summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-05-21 11:59:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-05-21 18:14:10 +0200
commitbc456ccf9f81bd36216c199ab42fa2fe77c5e17c (patch)
treefbb277c7e5d5a236093b3234647ba726708b39c0 /sc/qa/unit
parent441d8ed9be0e7f831b455a69b8688dcb79a8bc00 (diff)
loplugin:ostr in sc/qa
Change-Id: If731102d69667eaaa088cf804a8c7563b24ded5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167893 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/PivotTableFormatsImportExport.cxx30
-rw-r--r--sc/qa/unit/SparklineImportExportTest.cxx60
-rw-r--r--sc/qa/unit/ThemeImportExportTest.cxx102
-rw-r--r--sc/qa/unit/anchor.cxx18
-rw-r--r--sc/qa/unit/chart2dataprovider.cxx18
-rw-r--r--sc/qa/unit/cond_format_merge.cxx6
-rw-r--r--sc/qa/unit/copy_paste_test.cxx48
-rw-r--r--sc/qa/unit/datacache.cxx39
-rw-r--r--sc/qa/unit/dataproviders_test.cxx58
-rw-r--r--sc/qa/unit/filters-test.cxx20
-rw-r--r--sc/qa/unit/functions_addin.cxx4
-rw-r--r--sc/qa/unit/functions_array.cxx8
-rw-r--r--sc/qa/unit/functions_database.cxx4
-rw-r--r--sc/qa/unit/functions_datetime.cxx4
-rw-r--r--sc/qa/unit/functions_financial.cxx4
-rw-r--r--sc/qa/unit/functions_information.cxx4
-rw-r--r--sc/qa/unit/functions_logical.cxx4
-rw-r--r--sc/qa/unit/functions_mathematical.cxx4
-rw-r--r--sc/qa/unit/functions_old.cxx4
-rw-r--r--sc/qa/unit/functions_spreadsheet.cxx4
-rw-r--r--sc/qa/unit/functions_statistical.cxx4
-rw-r--r--sc/qa/unit/functions_text.cxx4
-rw-r--r--sc/qa/unit/helper/qahelper.cxx20
-rw-r--r--sc/qa/unit/helper/scfiltertestbase.cxx4
-rw-r--r--sc/qa/unit/helper/shared_test_impl.hxx2
-rw-r--r--sc/qa/unit/jumbosheets-test.cxx56
-rw-r--r--sc/qa/unit/opencl-test-1.cxx2
-rw-r--r--sc/qa/unit/opencl-test-2.cxx2
-rw-r--r--sc/qa/unit/parallelism.cxx2
-rw-r--r--sc/qa/unit/pivottable_filters_test.cxx583
-rw-r--r--sc/qa/unit/screenshots/screenshots.cxx6
-rw-r--r--sc/qa/unit/scshapetest.cxx150
-rw-r--r--sc/qa/unit/subsequent_export_test.cxx725
-rw-r--r--sc/qa/unit/subsequent_export_test2.cxx585
-rw-r--r--sc/qa/unit/subsequent_export_test3.cxx297
-rw-r--r--sc/qa/unit/subsequent_export_test4.cxx571
-rw-r--r--sc/qa/unit/subsequent_filters_test.cxx202
-rw-r--r--sc/qa/unit/subsequent_filters_test2.cxx267
-rw-r--r--sc/qa/unit/subsequent_filters_test3.cxx84
-rw-r--r--sc/qa/unit/subsequent_filters_test4.cxx228
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx276
-rw-r--r--sc/qa/unit/tiledrendering2/tiledrendering2.cxx14
-rw-r--r--sc/qa/unit/ucalc.cxx1024
-rw-r--r--sc/qa/unit/ucalc_DocumentThemes.cxx4
-rw-r--r--sc/qa/unit/ucalc_condformat.cxx170
-rw-r--r--sc/qa/unit/ucalc_copypaste.cxx4944
-rw-r--r--sc/qa/unit/ucalc_datatransformation.cxx208
-rw-r--r--sc/qa/unit/ucalc_formula.cxx1500
-rw-r--r--sc/qa/unit/ucalc_formula2.cxx1034
-rw-r--r--sc/qa/unit/ucalc_parallelism.cxx62
-rw-r--r--sc/qa/unit/ucalc_pivottable.cxx160
-rw-r--r--sc/qa/unit/ucalc_range.cxx6
-rw-r--r--sc/qa/unit/ucalc_sharedformula.cxx426
-rw-r--r--sc/qa/unit/ucalc_solver.cxx92
-rw-r--r--sc/qa/unit/ucalc_sort.cxx266
-rw-r--r--sc/qa/unit/ucalc_sparkline.cxx28
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx1013
-rw-r--r--sc/qa/unit/uicalc/uicalc2.cxx776
58 files changed, 8119 insertions, 8121 deletions
diff --git a/sc/qa/unit/PivotTableFormatsImportExport.cxx b/sc/qa/unit/PivotTableFormatsImportExport.cxx
index 33d0adc8f6f5..3c3b9414d29e 100644
--- a/sc/qa/unit/PivotTableFormatsImportExport.cxx
+++ b/sc/qa/unit/PivotTableFormatsImportExport.cxx
@@ -30,7 +30,7 @@ public:
};
ScPivotTableFormatsImportExport::ScPivotTableFormatsImportExport()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
@@ -94,7 +94,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
{
createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_1_DataFieldInRow_RowLabelColor.xlsx");
assertDataFieldInRow_RowLabelColor(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertDataFieldInRow_RowLabelColor(*getScDoc());
}
@@ -116,7 +116,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
createScDoc(
"xlsx/pivot-table/PivotTableCellFormatsTest_2_DataFieldInRow_ColumnLabelColor.xlsx");
assertDataFieldInRow_ColumnLabelColor(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertDataFieldInRow_ColumnLabelColor(*getScDoc());
}
@@ -139,7 +139,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
createScDoc(
"xlsx/pivot-table/PivotTableCellFormatsTest_3_DataFieldInColumn_ColumnLabelColor.xlsx");
assertDataFieldInColumn_ColumnLabelColor(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertDataFieldInColumn_ColumnLabelColor(*getScDoc());
}
@@ -160,7 +160,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
{
createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_4_DataFieldInColumn_DataColor.xlsx");
assertDataFieldInColumn_DataColor(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertDataFieldInColumn_DataColor(*getScDoc());
}
@@ -187,7 +187,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
createScDoc("xlsx/pivot-table//"
"PivotTableCellFormatsTest_5_DataFieldInColumnAndTwoRowFields_DataColor.xlsx");
assertDataFieldInColumnAndTwoRowFields_DataColor(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertDataFieldInColumnAndTwoRowFields_DataColor(*getScDoc());
}
@@ -203,7 +203,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
createScDoc(
"xlsx/pivot-table//PivotTableCellFormatsTest_6_SingleDataFieldInColumn_DataColor.xlsx");
assertSingleDataFieldInColumn_DataColor(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertSingleDataFieldInColumn_DataColor(*getScDoc());
}
@@ -223,7 +223,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
createScDoc(
"xlsx/pivot-table//PivotTableCellFormatsTest_7_TwoRowTwoColumnFields_DataColor.xlsx");
assertTwoRowTwoColumnFields_DataColor(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertTwoRowTwoColumnFields_DataColor(*getScDoc());
}
@@ -245,7 +245,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
{
createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_8_DataFieldInRow_DataColor.xlsx");
assertDataFieldInRow_DataColor(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertDataFieldInRow_DataColor(*getScDoc());
}
@@ -261,7 +261,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
{
createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_9_MultipleSelections.xlsx");
assertMultipleSelections(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertMultipleSelections(*getScDoc());
}
@@ -309,7 +309,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
{
createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_11_WholeDataColumnSelected.xlsx");
assertWholeDataColumnSelected(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertWholeDataColumnSelected(*getScDoc());
}
@@ -335,7 +335,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
{
createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_12_WholeLabelColumnSelected.xlsx");
assertWholeLabelColumnSelected(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertWholeLabelColumnSelected(*getScDoc());
}
@@ -357,7 +357,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
{
createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_13_SelectionInLabelAndData.xlsx");
assertSelectionInLabelAndData(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertSelectionInLabelAndData(*getScDoc());
}
@@ -384,7 +384,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
createScDoc("xlsx/pivot-table/"
"PivotTableCellFormatsTest_14_TwoRowsDataFieldInColumn_LabelColor.xlsx");
assertTwoRowsDataFieldInColumn_LabelColor(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertTwoRowsDataFieldInColumn_LabelColor(*getScDoc());
}
@@ -412,7 +412,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport,
createScDoc("xlsx/pivot-table/"
"PivotTableCellFormatsTest_15_TwoDataFieldColumns_WholeDataColumnSelected.xlsx");
assertTwoDataFieldColumns_WholeDataColumnSelected(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
assertTwoDataFieldColumns_WholeDataColumnSelected(*getScDoc());
}
diff --git a/sc/qa/unit/SparklineImportExportTest.cxx b/sc/qa/unit/SparklineImportExportTest.cxx
index 91575002771b..df82c28c2b4e 100644
--- a/sc/qa/unit/SparklineImportExportTest.cxx
+++ b/sc/qa/unit/SparklineImportExportTest.cxx
@@ -21,7 +21,7 @@ class SparklineImportExportTest : public UnoApiXmlTest
{
public:
SparklineImportExportTest()
- : UnoApiXmlTest("sc/qa/unit/data")
+ : UnoApiXmlTest(u"sc/qa/unit/data"_ustr)
{
}
@@ -152,7 +152,7 @@ void SparklineImportExportTest::testSparklinesRoundtripXLSX()
checkSparklines(*pModelObj->GetDocument());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
@@ -165,8 +165,8 @@ void SparklineImportExportTest::testSparklinesExportODS()
loadFromFile(u"xlsx/Sparklines.xlsx");
// Save as ODS and check content.xml with XPath
- save("calc8");
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
// We have 3 sparkline groups = 3 tables that contain sparklines
assertXPath(pXmlDoc, "//table:table/calcext:sparkline-groups"_ostr, 3);
@@ -184,30 +184,30 @@ void SparklineImportExportTest::testSparklinesExportODS()
// Check table[1] - sparkline-group[1]
OString aSparklineGroupPath
= "//table:table[1]/calcext:sparkline-groups/calcext:sparkline-group[1]"_ostr;
- assertXPath(pXmlDoc, aSparklineGroupPath, "type"_ostr, "line");
- assertXPath(pXmlDoc, aSparklineGroupPath, "line-width"_ostr, "1pt");
- assertXPath(pXmlDoc, aSparklineGroupPath, "display-empty-cells-as"_ostr, "gap");
- assertXPath(pXmlDoc, aSparklineGroupPath, "markers"_ostr, "true");
- assertXPath(pXmlDoc, aSparklineGroupPath, "high"_ostr, "true");
- assertXPath(pXmlDoc, aSparklineGroupPath, "low"_ostr, "true");
- assertXPath(pXmlDoc, aSparklineGroupPath, "first"_ostr, "true");
- assertXPath(pXmlDoc, aSparklineGroupPath, "last"_ostr, "true");
- assertXPath(pXmlDoc, aSparklineGroupPath, "negative"_ostr, "true");
- assertXPath(pXmlDoc, aSparklineGroupPath, "display-x-axis"_ostr, "true");
- assertXPath(pXmlDoc, aSparklineGroupPath, "min-axis-type"_ostr, "individual");
- assertXPath(pXmlDoc, aSparklineGroupPath, "max-axis-type"_ostr, "individual");
- assertXPath(pXmlDoc, aSparklineGroupPath, "color-series"_ostr, "#376092");
- assertXPath(pXmlDoc, aSparklineGroupPath, "color-negative"_ostr, "#00b050");
- assertXPath(pXmlDoc, aSparklineGroupPath, "color-axis"_ostr, "#000000");
- assertXPath(pXmlDoc, aSparklineGroupPath, "color-markers"_ostr, "#000000");
- assertXPath(pXmlDoc, aSparklineGroupPath, "color-first"_ostr, "#7030a0");
- assertXPath(pXmlDoc, aSparklineGroupPath, "color-last"_ostr, "#ff0000");
- assertXPath(pXmlDoc, aSparklineGroupPath, "color-high"_ostr, "#92d050");
- assertXPath(pXmlDoc, aSparklineGroupPath, "color-low"_ostr, "#00b0f0");
+ assertXPath(pXmlDoc, aSparklineGroupPath, "type"_ostr, u"line"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "line-width"_ostr, u"1pt"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "display-empty-cells-as"_ostr, u"gap"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "markers"_ostr, u"true"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "high"_ostr, u"true"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "low"_ostr, u"true"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "first"_ostr, u"true"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "last"_ostr, u"true"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "negative"_ostr, u"true"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "display-x-axis"_ostr, u"true"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "min-axis-type"_ostr, u"individual"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "max-axis-type"_ostr, u"individual"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "color-series"_ostr, u"#376092"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "color-negative"_ostr, u"#00b050"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "color-axis"_ostr, u"#000000"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "color-markers"_ostr, u"#000000"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "color-first"_ostr, u"#7030a0"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "color-last"_ostr, u"#ff0000"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "color-high"_ostr, u"#92d050"_ustr);
+ assertXPath(pXmlDoc, aSparklineGroupPath, "color-low"_ostr, u"#00b0f0"_ustr);
assertXPath(pXmlDoc, aSparklineGroupPath + "/calcext:sparklines/calcext:sparkline", 1);
assertXPath(pXmlDoc, aSparklineGroupPath + "/calcext:sparklines/calcext:sparkline[1]",
- "cell-address"_ostr, "Sheet1.A2");
+ "cell-address"_ostr, u"Sheet1.A2"_ustr);
}
void SparklineImportExportTest::testSparklinesRoundtripODS()
@@ -219,7 +219,7 @@ void SparklineImportExportTest::testSparklinesRoundtripODS()
checkSparklines(*pModelObj->GetDocument());
// Trigger export and import of sparklines
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
@@ -234,8 +234,8 @@ void SparklineImportExportTest::testNoSparklinesInDocumentXLSX()
// Load the document containing NO sparklines
loadFromFile(u"xlsx/empty.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/x:worksheet"_ostr, 1);
@@ -282,7 +282,7 @@ void SparklineImportExportTest::testSparklinesRoundtripThemeColorsODS()
CPPUNIT_ASSERT(pModelObj);
checkSparklineThemeColors(*pModelObj->GetDocument());
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
@@ -292,7 +292,7 @@ void SparklineImportExportTest::testSparklinesRoundtripThemeColorsODS()
void SparklineImportExportTest::testSparklinesRoundtripThemeColorsOOXML()
{
loadFromFile(u"fods/Sparklines.fods");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
diff --git a/sc/qa/unit/ThemeImportExportTest.cxx b/sc/qa/unit/ThemeImportExportTest.cxx
index 2531a60c2825..8fa07b36d9d7 100644
--- a/sc/qa/unit/ThemeImportExportTest.cxx
+++ b/sc/qa/unit/ThemeImportExportTest.cxx
@@ -27,14 +27,14 @@ class ThemeImportExportTest : public ScModelTestBase
{
public:
ThemeImportExportTest()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
};
CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testThemeExportAndImport)
{
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr);
{
uno::Reference<beans::XPropertySet> xPropertySet(mxComponent, uno::UNO_QUERY_THROW);
@@ -54,29 +54,29 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testThemeExportAndImport)
pColorSet->add(model::ThemeColorType::FollowedHyperlink, 0xcccccc);
pTheme->setColorSet(pColorSet);
- xPropertySet->setPropertyValue("Theme", uno::Any(model::theme::createXTheme(pTheme)));
+ xPropertySet->setPropertyValue(u"Theme"_ustr, uno::Any(model::theme::createXTheme(pTheme)));
}
// Check the "Theme" property
{
uno::Reference<beans::XPropertySet> xPropertySet(mxComponent, uno::UNO_QUERY_THROW);
- uno::Reference<util::XTheme> xTheme(xPropertySet->getPropertyValue("Theme"),
+ uno::Reference<util::XTheme> xTheme(xPropertySet->getPropertyValue(u"Theme"_ustr),
uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT(xTheme.is());
auto* pUnoTheme = dynamic_cast<UnoTheme*>(xTheme.get());
CPPUNIT_ASSERT(pUnoTheme);
auto pTheme = pUnoTheme->getTheme();
- CPPUNIT_ASSERT_EQUAL(OUString("MyTheme"), pTheme->GetName());
- CPPUNIT_ASSERT_EQUAL(OUString("MyColorSet"), pTheme->getColorSet()->getName());
- CPPUNIT_ASSERT_EQUAL(OUString("Office"), pTheme->getFontScheme().getName());
- CPPUNIT_ASSERT_EQUAL(OUString(""), pTheme->getFormatScheme().getName());
+ CPPUNIT_ASSERT_EQUAL(u"MyTheme"_ustr, pTheme->GetName());
+ CPPUNIT_ASSERT_EQUAL(u"MyColorSet"_ustr, pTheme->getColorSet()->getName());
+ CPPUNIT_ASSERT_EQUAL(u"Office"_ustr, pTheme->getFontScheme().getName());
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pTheme->getFormatScheme().getName());
}
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
{
- xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
+ xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr);
static constexpr OString sThemePath = "//office:styles/loext:theme"_ostr;
assertXPath(pXmlDoc, sThemePath, 1);
assertXPath(pXmlDoc, sThemePath + "[@loext:name='MyTheme']");
@@ -85,28 +85,28 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testThemeExportAndImport)
assertXPath(pXmlDoc, sThemeColorsPath + "[@loext:name='MyColorSet']");
const OString sThemeColorPath = sThemeColorsPath + "/loext:color";
assertXPath(pXmlDoc, sThemeColorPath, 12);
- assertXPath(pXmlDoc, sThemeColorPath + "[3]", "name"_ostr, "dark2");
- assertXPath(pXmlDoc, sThemeColorPath + "[3]", "color"_ostr, "#333333");
- assertXPath(pXmlDoc, sThemeColorPath + "[9]", "name"_ostr, "accent5");
- assertXPath(pXmlDoc, sThemeColorPath + "[9]", "color"_ostr, "#999999");
- assertXPath(pXmlDoc, sThemeColorPath + "[12]", "name"_ostr, "followed-hyperlink");
- assertXPath(pXmlDoc, sThemeColorPath + "[12]", "color"_ostr, "#cccccc");
+ assertXPath(pXmlDoc, sThemeColorPath + "[3]", "name"_ostr, u"dark2"_ustr);
+ assertXPath(pXmlDoc, sThemeColorPath + "[3]", "color"_ostr, u"#333333"_ustr);
+ assertXPath(pXmlDoc, sThemeColorPath + "[9]", "name"_ostr, u"accent5"_ustr);
+ assertXPath(pXmlDoc, sThemeColorPath + "[9]", "color"_ostr, u"#999999"_ustr);
+ assertXPath(pXmlDoc, sThemeColorPath + "[12]", "name"_ostr, u"followed-hyperlink"_ustr);
+ assertXPath(pXmlDoc, sThemeColorPath + "[12]", "color"_ostr, u"#cccccc"_ustr);
}
// Check the theme after import/export cycle
{
uno::Reference<beans::XPropertySet> xPropertySet(mxComponent, uno::UNO_QUERY_THROW);
- uno::Reference<util::XTheme> xTheme(xPropertySet->getPropertyValue("Theme"),
+ uno::Reference<util::XTheme> xTheme(xPropertySet->getPropertyValue(u"Theme"_ustr),
uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT(xTheme.is());
auto* pUnoTheme = dynamic_cast<UnoTheme*>(xTheme.get());
CPPUNIT_ASSERT(pUnoTheme);
auto pTheme = pUnoTheme->getTheme();
- CPPUNIT_ASSERT_EQUAL(OUString("MyTheme"), pTheme->GetName());
- CPPUNIT_ASSERT_EQUAL(OUString("MyColorSet"), pTheme->getColorSet()->getName());
- CPPUNIT_ASSERT_EQUAL(OUString("Office"), pTheme->getFontScheme().getName());
- CPPUNIT_ASSERT_EQUAL(OUString(""), pTheme->getFormatScheme().getName());
+ CPPUNIT_ASSERT_EQUAL(u"MyTheme"_ustr, pTheme->GetName());
+ CPPUNIT_ASSERT_EQUAL(u"MyColorSet"_ustr, pTheme->getColorSet()->getName());
+ CPPUNIT_ASSERT_EQUAL(u"Office"_ustr, pTheme->getFontScheme().getName());
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pTheme->getFormatScheme().getName());
}
}
@@ -114,46 +114,46 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testThemeExportOOXML)
{
loadFromFile(u"xlsx/CalcThemeTest.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
{
- xmlDocUniquePtr pXmlDoc = parseExport("xl/theme/theme1.xml");
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/theme/theme1.xml"_ustr);
OString aClrScheme = "/a:theme/a:themeElements/a:clrScheme"_ostr;
- assertXPath(pXmlDoc, aClrScheme, "name"_ostr, "Office");
- assertXPath(pXmlDoc, aClrScheme + "/a:dk1/a:srgbClr", "val"_ostr, "000000");
- assertXPath(pXmlDoc, aClrScheme + "/a:lt1/a:srgbClr", "val"_ostr, "ffffff");
- assertXPath(pXmlDoc, aClrScheme + "/a:dk2/a:srgbClr", "val"_ostr, "44546a");
- assertXPath(pXmlDoc, aClrScheme + "/a:lt2/a:srgbClr", "val"_ostr, "e7e6e6");
- assertXPath(pXmlDoc, aClrScheme + "/a:accent1/a:srgbClr", "val"_ostr, "4472c4");
- assertXPath(pXmlDoc, aClrScheme + "/a:accent2/a:srgbClr", "val"_ostr, "ed7d31");
- assertXPath(pXmlDoc, aClrScheme + "/a:accent3/a:srgbClr", "val"_ostr, "a5a5a5");
- assertXPath(pXmlDoc, aClrScheme + "/a:accent4/a:srgbClr", "val"_ostr, "ffc000");
- assertXPath(pXmlDoc, aClrScheme + "/a:accent5/a:srgbClr", "val"_ostr, "5b9bd5");
- assertXPath(pXmlDoc, aClrScheme + "/a:accent6/a:srgbClr", "val"_ostr, "70ad47");
- assertXPath(pXmlDoc, aClrScheme + "/a:hlink/a:srgbClr", "val"_ostr, "0563c1");
- assertXPath(pXmlDoc, aClrScheme + "/a:folHlink/a:srgbClr", "val"_ostr, "954f72");
+ assertXPath(pXmlDoc, aClrScheme, "name"_ostr, u"Office"_ustr);
+ assertXPath(pXmlDoc, aClrScheme + "/a:dk1/a:srgbClr", "val"_ostr, u"000000"_ustr);
+ assertXPath(pXmlDoc, aClrScheme + "/a:lt1/a:srgbClr", "val"_ostr, u"ffffff"_ustr);
+ assertXPath(pXmlDoc, aClrScheme + "/a:dk2/a:srgbClr", "val"_ostr, u"44546a"_ustr);
+ assertXPath(pXmlDoc, aClrScheme + "/a:lt2/a:srgbClr", "val"_ostr, u"e7e6e6"_ustr);
+ assertXPath(pXmlDoc, aClrScheme + "/a:accent1/a:srgbClr", "val"_ostr, u"4472c4"_ustr);
+ assertXPath(pXmlDoc, aClrScheme + "/a:accent2/a:srgbClr", "val"_ostr, u"ed7d31"_ustr);
+ assertXPath(pXmlDoc, aClrScheme + "/a:accent3/a:srgbClr", "val"_ostr, u"a5a5a5"_ustr);
+ assertXPath(pXmlDoc, aClrScheme + "/a:accent4/a:srgbClr", "val"_ostr, u"ffc000"_ustr);
+ assertXPath(pXmlDoc, aClrScheme + "/a:accent5/a:srgbClr", "val"_ostr, u"5b9bd5"_ustr);
+ assertXPath(pXmlDoc, aClrScheme + "/a:accent6/a:srgbClr", "val"_ostr, u"70ad47"_ustr);
+ assertXPath(pXmlDoc, aClrScheme + "/a:hlink/a:srgbClr", "val"_ostr, u"0563c1"_ustr);
+ assertXPath(pXmlDoc, aClrScheme + "/a:folHlink/a:srgbClr", "val"_ostr, u"954f72"_ustr);
}
{
- xmlDocUniquePtr pXmlDoc = parseExport("xl/styles.xml");
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/styles.xml"_ustr);
assertXPath(pXmlDoc, "/x:styleSheet"_ostr, 1);
// Fonts
OString aFont = "/x:styleSheet/x:fonts/x:font"_ostr;
assertXPath(pXmlDoc, aFont, 6);
- assertXPath(pXmlDoc, aFont + "[5]/x:color", "theme"_ostr, "7");
- assertXPath(pXmlDoc, aFont + "[6]/x:color", "rgb"_ostr, "FF9C5700");
+ assertXPath(pXmlDoc, aFont + "[5]/x:color", "theme"_ostr, u"7"_ustr);
+ assertXPath(pXmlDoc, aFont + "[6]/x:color", "rgb"_ostr, u"FF9C5700"_ustr);
// Fills
OString aFill = "/x:styleSheet/x:fills/x:fill"_ostr;
assertXPath(pXmlDoc, aFill, 4);
- assertXPath(pXmlDoc, aFill + "[1]/x:patternFill", "patternType"_ostr, "none");
- assertXPath(pXmlDoc, aFill + "[2]/x:patternFill", "patternType"_ostr, "gray125");
- assertXPath(pXmlDoc, aFill + "[3]/x:patternFill", "patternType"_ostr, "solid");
- assertXPath(pXmlDoc, aFill + "[3]/x:patternFill/x:fgColor", "rgb"_ostr, "FFFFEB9C");
- assertXPath(pXmlDoc, aFill + "[4]/x:patternFill", "patternType"_ostr, "solid");
- assertXPath(pXmlDoc, aFill + "[4]/x:patternFill/x:fgColor", "theme"_ostr, "4");
+ assertXPath(pXmlDoc, aFill + "[1]/x:patternFill", "patternType"_ostr, u"none"_ustr);
+ assertXPath(pXmlDoc, aFill + "[2]/x:patternFill", "patternType"_ostr, u"gray125"_ustr);
+ assertXPath(pXmlDoc, aFill + "[3]/x:patternFill", "patternType"_ostr, u"solid"_ustr);
+ assertXPath(pXmlDoc, aFill + "[3]/x:patternFill/x:fgColor", "rgb"_ostr, u"FFFFEB9C"_ustr);
+ assertXPath(pXmlDoc, aFill + "[4]/x:patternFill", "patternType"_ostr, u"solid"_ustr);
+ assertXPath(pXmlDoc, aFill + "[4]/x:patternFill/x:fgColor", "theme"_ostr, u"4"_ustr);
}
}
@@ -220,7 +220,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellBackgroundThemeColorOOXML)
{
loadFromFile(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx");
checkCellBackgroundThemeColor(getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
checkCellBackgroundThemeColor(getScDoc());
}
@@ -229,7 +229,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellBackgroundThemeColorODF)
// Open the OOXML source
loadFromFile(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx");
// Save as ODF and load again - checks import / export cycle
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Check the values and show that the document is unchanged and all the data preserved
checkCellBackgroundThemeColor(getScDoc());
}
@@ -291,7 +291,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellTextThemeColor)
{
loadFromFile(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx");
checkCellTextThemeColor(getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
checkCellTextThemeColor(getScDoc());
}
@@ -300,7 +300,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellTextThemeColorODF)
// Open the OOXML source
loadFromFile(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx");
// Save as ODF and load again - checks import / export cycle
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Check the values and show that the document is unchanged and all the data preserved
checkCellTextThemeColor(getScDoc());
}
@@ -420,7 +420,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellBorderThemeColor)
{
loadFromFile(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx");
checkCellBorderThemeColor(getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
checkCellBorderThemeColor(getScDoc());
}
@@ -429,7 +429,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellBorderThemeColorODF)
// Open the OOXML source
loadFromFile(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx");
// Save as ODF and load again - checks import / export cycle
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Check the values and show that the document is unchanged and all the data preserved
checkCellBorderThemeColor(getScDoc());
}
diff --git a/sc/qa/unit/anchor.cxx b/sc/qa/unit/anchor.cxx
index 18daecd23aa1..0dfffdd8ba4b 100644
--- a/sc/qa/unit/anchor.cxx
+++ b/sc/qa/unit/anchor.cxx
@@ -59,7 +59,7 @@ public:
};
ScAnchorTest::ScAnchorTest()
- : UnoApiTest("sc/qa/unit/data/ods")
+ : UnoApiTest(u"sc/qa/unit/data/ods"_ustr)
{
}
@@ -159,7 +159,7 @@ void ScAnchorTest::testUndoAnchor()
void ScAnchorTest::testTdf76183()
{
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr);
SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(mxComponent);
ScDocShell* pDocSh = dynamic_cast<ScDocShell*>(pFoundShell);
ScDocument& rDoc = pDocSh->GetDocument();
@@ -181,7 +181,7 @@ void ScAnchorTest::testTdf76183()
uno::Reference<container::XIndexAccess> xIA(xDoc->getSheets(), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XSpreadsheet> xSheet(xIA->getByIndex(0), uno::UNO_QUERY_THROW);
uno::Reference<text::XText> xText(xSheet->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
- xText->setString("first\nsecond\nthird");
+ xText->setString(u"first\nsecond\nthird"_ustr);
// The resize of first row must have moved the object down after its anchor cell
CPPUNIT_ASSERT(aOrigRect.Top() < rNewRect.Top());
@@ -253,13 +253,13 @@ void ScAnchorTest::testCopyColumnWithImages()
{
// 1. Copy source range
ScRange aSrcRange;
- aSrcRange.Parse("A1:A11", *pDoc, pDoc->GetAddressConvention());
+ aSrcRange.Parse(u"A1:A11"_ustr, *pDoc, pDoc->GetAddressConvention());
pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
pViewShell->GetViewData().GetView()->CopyToClip(&aClipDoc, false, false, true, false);
// 2. Paste to target range
ScRange aDstRange;
- aDstRange.Parse("D1:D11", *pDoc, pDoc->GetAddressConvention());
+ aDstRange.Parse(u"D1:D11"_ustr, *pDoc, pDoc->GetAddressConvention());
pViewShell->GetViewData().GetMarkData().SetMarkArea(aDstRange);
pViewShell->GetViewData().GetView()->PasteFromClip(InsertDeleteFlags::ALL, &aClipDoc);
@@ -276,13 +276,13 @@ void ScAnchorTest::testCopyColumnWithImages()
{
// 1. Copy source cells
ScRange aSrcRange;
- aSrcRange.Parse("A3:B3", *pDoc, pDoc->GetAddressConvention());
+ aSrcRange.Parse(u"A3:B3"_ustr, *pDoc, pDoc->GetAddressConvention());
pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
pViewShell->GetViewData().GetView()->CopyToClip(&aClipDoc, false, false, true, false);
// 2. Paste to target cells
ScRange aDstRange;
- aDstRange.Parse("G3:H3", *pDoc, pDoc->GetAddressConvention());
+ aDstRange.Parse(u"G3:H3"_ustr, *pDoc, pDoc->GetAddressConvention());
pViewShell->GetViewData().GetMarkData().SetMarkArea(aDstRange);
pViewShell->GetViewData().GetView()->PasteFromClip(InsertDeleteFlags::ALL, &aClipDoc);
@@ -318,7 +318,7 @@ void ScAnchorTest::testCutWithImages()
{
// Cut source range
ScRange aSrcRange;
- aSrcRange.Parse("A1:A11", *pDoc, pDoc->GetAddressConvention());
+ aSrcRange.Parse(u"A1:A11"_ustr, *pDoc, pDoc->GetAddressConvention());
pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
pViewShell->GetViewData().GetView()->CutToClip();
@@ -336,7 +336,7 @@ void ScAnchorTest::testCutWithImages()
{
// Cut source cells
ScRange aSrcRange;
- aSrcRange.Parse("A3:B3", *pDoc, pDoc->GetAddressConvention());
+ aSrcRange.Parse(u"A3:B3"_ustr, *pDoc, pDoc->GetAddressConvention());
pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
pViewShell->GetViewData().GetView()->CutToClip();
diff --git a/sc/qa/unit/chart2dataprovider.cxx b/sc/qa/unit/chart2dataprovider.cxx
index 5b10ee7f8af2..162b493478b7 100644
--- a/sc/qa/unit/chart2dataprovider.cxx
+++ b/sc/qa/unit/chart2dataprovider.cxx
@@ -41,10 +41,10 @@ static void lcl_createAndCheckDataProvider(ScDocument& rDoc, const OUString& cel
CPPUNIT_ASSERT(xDataProvider.is());
uno::Sequence<beans::PropertyValue> aArgs{
- comphelper::makePropertyValue("CellRangeRepresentation", cellRange),
- comphelper::makePropertyValue("HasCategories", hasCategories),
- comphelper::makePropertyValue("FirstCellAsLabel", firstCellAsLabel),
- comphelper::makePropertyValue("DataRowSource", chart::ChartDataRowSource_COLUMNS)
+ comphelper::makePropertyValue(u"CellRangeRepresentation"_ustr, cellRange),
+ comphelper::makePropertyValue(u"HasCategories"_ustr, hasCategories),
+ comphelper::makePropertyValue(u"FirstCellAsLabel"_ustr, firstCellAsLabel),
+ comphelper::makePropertyValue(u"DataRowSource"_ustr, chart::ChartDataRowSource_COLUMNS)
};
uno::Reference<chart2::data::XDataSource> xDataSource = xDataProvider->createDataSource(aArgs);
@@ -73,16 +73,16 @@ void ScChart2DataProviderTest::testHeaderExpansion()
ScDocument* pDoc = getScDoc();
- lcl_createAndCheckDataProvider(*pDoc, "$Sheet1.$A$1:$D$4", false, false, 4, 4);
- lcl_createAndCheckDataProvider(*pDoc, "$Sheet1.$A$1:$D$4", true, true, 4, 3);
+ lcl_createAndCheckDataProvider(*pDoc, u"$Sheet1.$A$1:$D$4"_ustr, false, false, 4, 4);
+ lcl_createAndCheckDataProvider(*pDoc, u"$Sheet1.$A$1:$D$4"_ustr, true, true, 4, 3);
- lcl_createAndCheckDataProvider(*pDoc, "$Sheet1.$A$17:$D$20", true, true, 3, 2);
+ lcl_createAndCheckDataProvider(*pDoc, u"$Sheet1.$A$17:$D$20"_ustr, true, true, 3, 2);
- lcl_createAndCheckDataProvider(*pDoc, "$Sheet1.$A$25:$D$28", true, true, 4, 2);
+ lcl_createAndCheckDataProvider(*pDoc, u"$Sheet1.$A$25:$D$28"_ustr, true, true, 4, 2);
}
ScChart2DataProviderTest::ScChart2DataProviderTest()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
diff --git a/sc/qa/unit/cond_format_merge.cxx b/sc/qa/unit/cond_format_merge.cxx
index ed6a938bb472..ce150d30df48 100644
--- a/sc/qa/unit/cond_format_merge.cxx
+++ b/sc/qa/unit/cond_format_merge.cxx
@@ -35,7 +35,7 @@ public:
};
ScCondFormatMergeTest::ScCondFormatMergeTest()
- : UnoApiTest("sc/qa/extras/testdocuments/")
+ : UnoApiTest(u"sc/qa/extras/testdocuments/"_ustr)
{
}
@@ -49,7 +49,7 @@ void ScCondFormatMergeTest::testCondFormatMerge()
uno::Reference<sheet::XSpreadsheet> xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xProps(xSheet, uno::UNO_QUERY_THROW);
- uno::Any aAny = xProps->getPropertyValue("ConditionalFormats");
+ uno::Any aAny = xProps->getPropertyValue(u"ConditionalFormats"_ustr);
uno::Reference<sheet::XConditionalFormats> xCondFormats;
CPPUNIT_ASSERT(aAny >>= xCondFormats);
@@ -71,7 +71,7 @@ void ScCondFormatMergeTest::testCondFormatMerge()
uno::Reference<beans::XPropertySet> xPropSet(xCondFormat, uno::UNO_QUERY_THROW);
- aAny = xPropSet->getPropertyValue("Range");
+ aAny = xPropSet->getPropertyValue(u"Range"_ustr);
uno::Reference<sheet::XSheetCellRanges> xCellRanges;
CPPUNIT_ASSERT(aAny >>= xCellRanges);
CPPUNIT_ASSERT(xCellRanges.is());
diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx
index c64e194de54e..5270e28c7c9b 100644
--- a/sc/qa/unit/copy_paste_test.cxx
+++ b/sc/qa/unit/copy_paste_test.cxx
@@ -82,7 +82,7 @@ void ScCopyPasteTest::testCopyPasteXLS()
// 2. Highlight B2:C5
ScRange aSrcRange;
- ScRefFlags nRes = aSrcRange.Parse("B2:C5", *pDoc, pDoc->GetAddressConvention());
+ ScRefFlags nRes = aSrcRange.Parse(u"B2:C5"_ustr, *pDoc, pDoc->GetAddressConvention());
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
ScMarkData aMark(pDoc->GetSheetLimits());
@@ -99,7 +99,7 @@ void ScCopyPasteTest::testCopyPasteXLS()
mxComponent.clear();
// Open a new document
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr);
// Get the document controller
pViewShell = ScDocShell::GetViewData()->GetViewShell();
@@ -143,7 +143,7 @@ void lcl_copy( const OUString& rSrcRange, const OUString& rDstRange, ScDocument&
void ScCopyPasteTest::testTdf84411()
{
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
@@ -157,11 +157,11 @@ void ScCopyPasteTest::testTdf84411()
for (unsigned int c = 0; c <= 14; ++c)
pDoc->SetValue( ScAddress(c,r,0), (r+1)*(c+1) );
- pDoc->SetString(ScAddress(15,10000,0), "=AVERAGE(A10001:O10001)");
- pDoc->SetString(ScAddress(16,10000,0), "=MIN(A10001:O10001)");
- pDoc->SetString(ScAddress(17,10000,0), "=MAX(A10001:O10001)");
+ pDoc->SetString(ScAddress(15,10000,0), u"=AVERAGE(A10001:O10001)"_ustr);
+ pDoc->SetString(ScAddress(16,10000,0), u"=MIN(A10001:O10001)"_ustr);
+ pDoc->SetString(ScAddress(17,10000,0), u"=MAX(A10001:O10001)"_ustr);
- lcl_copy("P10001:R10001", "P10002:R12500", *pDoc, pViewShell);
+ lcl_copy(u"P10001:R10001"_ustr, u"P10002:R12500"_ustr, *pDoc, pViewShell);
// 3. Disable OpenCL
@@ -172,11 +172,11 @@ void ScCopyPasteTest::testTdf84411()
// 4. Copy and Paste
- lcl_copy("A1:O2500", "A10001:O12500", *pDoc, pViewShell);
+ lcl_copy(u"A1:O2500"_ustr, u"A10001:O12500"_ustr, *pDoc, pViewShell);
- lcl_copy("A2501:O5000", "A12501:O15000", *pDoc, pViewShell);
+ lcl_copy(u"A2501:O5000"_ustr, u"A12501:O15000"_ustr, *pDoc, pViewShell);
- lcl_copy("P10001:R10001", "P12501:R15000", *pDoc, pViewShell);
+ lcl_copy(u"P10001:R10001"_ustr, u"P12501:R15000"_ustr, *pDoc, pViewShell);
// 5. Close the document (Ctrl-W)
@@ -185,7 +185,7 @@ void ScCopyPasteTest::testTdf84411()
void ScCopyPasteTest::testTdf124565()
{
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
@@ -194,7 +194,7 @@ void ScCopyPasteTest::testTdf124565()
ScTabViewShell* pViewShell = ScDocShell::GetViewData()->GetViewShell();
// Set content and height of first row
- pDoc->SetString(ScAddress(0, 0, 0), "Test");
+ pDoc->SetString(ScAddress(0, 0, 0), u"Test"_ustr);
pDoc->SetRowHeight(0, 0, 500);
pDoc->SetManualHeight(0, 0, 0, true);
@@ -214,7 +214,7 @@ void ScCopyPasteTest::testTdf124565()
pViewShell->GetViewData().GetView()->PasteFromClip(InsertDeleteFlags::ALL, &aClipDoc);
// Copy-pasted?
- CPPUNIT_ASSERT_EQUAL_MESSAGE("String was not pasted!", OUString("Test"), pDoc->GetString(nCol, nRow, nTab));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("String was not pasted!", u"Test"_ustr, pDoc->GetString(nCol, nRow, nTab));
// And height same as in source?
CPPUNIT_ASSERT_EQUAL_MESSAGE("Row#2 height is invalid!", sal_uInt16(500), pDoc->GetRowHeight(nRow, nTab));
@@ -224,7 +224,7 @@ void ScCopyPasteTest::testTdf124565()
void ScCopyPasteTest::testTdf126421()
{
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
@@ -252,7 +252,7 @@ void ScCopyPasteTest::testTdf126421()
void ScCopyPasteTest::testTdf107394()
{
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
@@ -271,8 +271,8 @@ void ScCopyPasteTest::testTdf107394()
aStream.Seek(0);
CPPUNIT_ASSERT(aObj.ImportStream(aStream, OUString(), SotClipboardFormatId::HTML));
- CPPUNIT_ASSERT_EQUAL(OUString("First"), pDoc->GetString(ScAddress(0,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Very long sentence."), pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"First"_ustr, pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Very long sentence."_ustr, pDoc->GetString(ScAddress(0,1,0)));
nFirstRowHeight = pDoc->GetRowHeight(0, 0);
nSecondRowHeight = pDoc->GetRowHeight(1, 0);
@@ -381,7 +381,7 @@ void ScCopyPasteTest::testTdf40993_fillMergedCells()
ScTabViewShell* pViewShell = ScDocShell::GetViewData()->GetViewShell();
// check content of the merged cell H11:I11
- CPPUNIT_ASSERT_EQUAL(OUString("1.5"), pDoc->GetString(ScAddress(7, 10, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"1.5"_ustr, pDoc->GetString(ScAddress(7, 10, 0)));
// fill operation on the merged cell should clone ATTR_MERGE and ATTR_MERGE_FLAG
// (as long as ATTR_MERGE_FLAG has only ScMF::Hor or ScMF::Ver)
@@ -624,8 +624,8 @@ void ScCopyPasteTest::tdf137653_137654_autofillUserlist()
// delete every userlist to make sure there won't be any string that is in 2 different userlist
ScGlobal::GetUserList().clear();
- addToUserList({ "January,February,March,April,May,June,July,August,September,October,November,December" });
- const ScUserListData* pListData = ScGlobal::GetUserList().GetData("January");
+ addToUserList({ u"January,February,March,April,May,June,July,August,September,October,November,December"_ustr });
+ const ScUserListData* pListData = ScGlobal::GetUserList().GetData(u"January"_ustr);
sal_uInt16 nIdx1 = 0, nIdx2 = 0;
bool bHasIdx1, bHasIdx2;
bool bMatchCase = false;
@@ -734,8 +734,8 @@ void ScCopyPasteTest::tdf137625_autofillMergedUserlist()
// delete every userlist to make sure there won't be any string that is in 2 different userlist
ScGlobal::GetUserList().clear();
- addToUserList({ "January,February,March,April,May,June,July,August,September,October,November,December" });
- const ScUserListData* pListData = ScGlobal::GetUserList().GetData("January");
+ addToUserList({ u"January,February,March,April,May,June,July,August,September,October,November,December"_ustr });
+ const ScUserListData* pListData = ScGlobal::GetUserList().GetData(u"January"_ustr);
sal_uInt16 nIdx1 = 0, nIdx2 = 0;
bool bHasIdx1, bHasIdx2;
bool bMatchCase = false;
@@ -795,7 +795,7 @@ void ScCopyPasteTest::tdf137624_autofillMergedMixed()
// add 1aa,2bb,3cc,4dd,5ee,6ff to userlist, to test that autofill won't confuse it with 1aa,3aa
// delete every userlist to make sure there won't be any string that is in 2 different userlist
ScGlobal::GetUserList().clear();
- addToUserList({ "1aa,2bb,3cc,4dd,5ee,6ff" });
+ addToUserList({ u"1aa,2bb,3cc,4dd,5ee,6ff"_ustr });
// fillauto mixed (string + number), these areas contain only merged cells
pViewShell->FillAuto(FILL_TO_RIGHT, 7, 5, 12, 7, 6); //H6:M8
@@ -836,7 +836,7 @@ void ScCopyPasteTest::tdf137624_autofillMergedMixed()
}
ScCopyPasteTest::ScCopyPasteTest()
- : UnoApiTest("/sc/qa/unit/data/")
+ : UnoApiTest(u"/sc/qa/unit/data/"_ustr)
{
}
diff --git a/sc/qa/unit/datacache.cxx b/sc/qa/unit/datacache.cxx
index 95cf67ae5efb..dca616d434c2 100644
--- a/sc/qa/unit/datacache.cxx
+++ b/sc/qa/unit/datacache.cxx
@@ -43,7 +43,7 @@ public:
void ScCacheTest::testCacheSimple()
{
ScDocument aDoc;
- aDoc.InsertTab(0, "test");
+ aDoc.InsertTab(0, u"test"_ustr);
for (SCROW nRow = 0; nRow < 10; ++nRow)
aDoc.SetValue(0, nRow, 0, nRow);
@@ -55,7 +55,7 @@ void ScCacheTest::testCacheSimple()
aStrm.Seek(0);
ScDocument aNewDoc;
- aNewDoc.InsertTab(0, "test");
+ aNewDoc.InsertTab(0, u"test"_ustr);
aNewDoc.RestoreTabFromCache(0, aStrm);
for (SCROW nRow = 0; nRow < 10; ++nRow)
@@ -65,11 +65,11 @@ void ScCacheTest::testCacheSimple()
void ScCacheTest::testCacheString()
{
ScDocument aDoc;
- aDoc.InsertTab(0, "test");
+ aDoc.InsertTab(0, u"test"_ustr);
- aDoc.SetString(0, 0, 0, "TestString");
- aDoc.SetString(0, 1, 0, "asjdaonfdssda");
- aDoc.SetString(0, 2, 0, "da");
+ aDoc.SetString(0, 0, 0, u"TestString"_ustr);
+ aDoc.SetString(0, 1, 0, u"asjdaonfdssda"_ustr);
+ aDoc.SetString(0, 2, 0, u"da"_ustr);
SvMemoryStream aStrm;
aDoc.StoreTabToCache(0, aStrm);
@@ -77,25 +77,25 @@ void ScCacheTest::testCacheString()
aStrm.Seek(0);
ScDocument aNewDoc;
- aNewDoc.InsertTab(0, "test");
+ aNewDoc.InsertTab(0, u"test"_ustr);
aNewDoc.RestoreTabFromCache(0, aStrm);
- CPPUNIT_ASSERT_EQUAL(OUString("TestString"), aNewDoc.GetString(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("asjdaonfdssda"), aNewDoc.GetString(0, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("da"), aNewDoc.GetString(0, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"TestString"_ustr, aNewDoc.GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"asjdaonfdssda"_ustr, aNewDoc.GetString(0, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"da"_ustr, aNewDoc.GetString(0, 2, 0));
}
void ScCacheTest::testCacheFormula()
{
ScDocument aDoc;
- aDoc.InsertTab(0, "test");
+ aDoc.InsertTab(0, u"test"_ustr);
- aDoc.SetString(0, 0, 0, "=B1");
- aDoc.SetString(0, 1, 0, "=B2");
- aDoc.SetString(0, 2, 0, "=B3");
- aDoc.SetString(0, 3, 0, "=B4");
- aDoc.SetString(0, 4, 0, "=B5");
- aDoc.SetString(0, 5, 0, "=B1");
+ aDoc.SetString(0, 0, 0, u"=B1"_ustr);
+ aDoc.SetString(0, 1, 0, u"=B2"_ustr);
+ aDoc.SetString(0, 2, 0, u"=B3"_ustr);
+ aDoc.SetString(0, 3, 0, u"=B4"_ustr);
+ aDoc.SetString(0, 4, 0, u"=B5"_ustr);
+ aDoc.SetString(0, 5, 0, u"=B1"_ustr);
SvMemoryStream aStrm;
aDoc.StoreTabToCache(0, aStrm);
@@ -103,10 +103,11 @@ void ScCacheTest::testCacheFormula()
aStrm.Seek(0);
ScDocument aNewDoc;
- aNewDoc.InsertTab(0, "test");
+ aNewDoc.InsertTab(0, u"test"_ustr);
aNewDoc.RestoreTabFromCache(0, aStrm);
- std::vector<OUString> aFormulas = { "=B1", "=B2", "=B3", "=B4", "=B5", "=B1" };
+ std::vector<OUString> aFormulas
+ = { u"=B1"_ustr, u"=B2"_ustr, u"=B3"_ustr, u"=B4"_ustr, u"=B5"_ustr, u"=B1"_ustr };
for (SCROW nRow = 0; nRow <= 5; ++nRow)
{
OUString aFormula = aNewDoc.GetFormula(0, nRow, 0);
diff --git a/sc/qa/unit/dataproviders_test.cxx b/sc/qa/unit/dataproviders_test.cxx
index 7de2e4597262..01c118d4a73a 100644
--- a/sc/qa/unit/dataproviders_test.cxx
+++ b/sc/qa/unit/dataproviders_test.cxx
@@ -44,14 +44,14 @@ void ScDataProvidersTest::testCSVImport()
{
createScDoc();
- ScDBData* pDBData = new ScDBData("testDB", 0, 0, 0, 10, 10);
+ ScDBData* pDBData = new ScDBData(u"testDB"_ustr, 0, 0, 0, 10, 10);
ScDocument* pDoc = getScDoc();
bool bInserted
= pDoc->GetDBCollection()->getNamedDBs().insert(std::unique_ptr<ScDBData>(pDBData));
CPPUNIT_ASSERT(bInserted);
OUString aFileURL = createFileURL(u"csv/test1.csv");
- sc::ExternalDataSource aDataSource(aFileURL, "org.libreoffice.calc.csv", pDoc);
+ sc::ExternalDataSource aDataSource(aFileURL, u"org.libreoffice.calc.csv"_ustr, pDoc);
aDataSource.setDBData(pDBData->GetName());
pDoc->GetExternalDataMapper().insertDataSource(aDataSource);
@@ -65,23 +65,23 @@ void ScDataProvidersTest::testCSVImport()
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(1, 0, 0));
CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(2, 0, 0));
CPPUNIT_ASSERT_EQUAL(4.0, pDoc->GetValue(3, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("test1"), pDoc->GetString(0, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("test2"), pDoc->GetString(1, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("test3"), pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"test1"_ustr, pDoc->GetString(0, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"test2"_ustr, pDoc->GetString(1, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"test3"_ustr, pDoc->GetString(2, 1, 0));
}
void ScDataProvidersTest::testDataLargerThanDB()
{
createScDoc();
- ScDBData* pDBData = new ScDBData("testDB", 0, 0, 0, 1, 1);
+ ScDBData* pDBData = new ScDBData(u"testDB"_ustr, 0, 0, 0, 1, 1);
ScDocument* pDoc = getScDoc();
bool bInserted
= pDoc->GetDBCollection()->getNamedDBs().insert(std::unique_ptr<ScDBData>(pDBData));
CPPUNIT_ASSERT(bInserted);
OUString aFileURL = createFileURL(u"csv/test1.csv");
- sc::ExternalDataSource aDataSource(aFileURL, "org.libreoffice.calc.csv", pDoc);
+ sc::ExternalDataSource aDataSource(aFileURL, u"org.libreoffice.calc.csv"_ustr, pDoc);
aDataSource.setDBData(pDBData->GetName());
pDoc->GetExternalDataMapper().insertDataSource(aDataSource);
@@ -95,8 +95,8 @@ void ScDataProvidersTest::testDataLargerThanDB()
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(1, 0, 0));
CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(2, 0, 0));
CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(3, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("test1"), pDoc->GetString(0, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("test2"), pDoc->GetString(1, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"test1"_ustr, pDoc->GetString(0, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"test2"_ustr, pDoc->GetString(1, 1, 0));
CPPUNIT_ASSERT_EQUAL(OUString(), pDoc->GetString(2, 1, 0));
}
@@ -104,15 +104,15 @@ void ScDataProvidersTest::testHTMLImport()
{
createScDoc();
- ScDBData* pDBData = new ScDBData("testDB", 0, 0, 0, 10, 10);
+ ScDBData* pDBData = new ScDBData(u"testDB"_ustr, 0, 0, 0, 10, 10);
ScDocument* pDoc = getScDoc();
bool bInserted
= pDoc->GetDBCollection()->getNamedDBs().insert(std::unique_ptr<ScDBData>(pDBData));
CPPUNIT_ASSERT(bInserted);
OUString aFileURL = createFileURL(u"html/test1.html");
- sc::ExternalDataSource aDataSource(aFileURL, "org.libreoffice.calc.html", pDoc);
- aDataSource.setID("//table");
+ sc::ExternalDataSource aDataSource(aFileURL, u"org.libreoffice.calc.html"_ustr, pDoc);
+ aDataSource.setID(u"//table"_ustr);
aDataSource.setDBData(pDBData->GetName());
pDoc->GetExternalDataMapper().insertDataSource(aDataSource);
@@ -122,17 +122,19 @@ void ScDataProvidersTest::testHTMLImport()
rDataSources[0].refresh(pDoc, true);
Scheduler::ProcessEventsToIdle();
- std::vector<OUString> aCarManufacturers = { "Audi", "GM", "Nissan", "Ferrari", "Peugeot" };
- std::vector<OUString> aCities = { "Berlin", "San Francisco", "Tokyo", "Rome", "Paris" };
+ std::vector<OUString> aCarManufacturers
+ = { u"Audi"_ustr, u"GM"_ustr, u"Nissan"_ustr, u"Ferrari"_ustr, u"Peugeot"_ustr };
+ std::vector<OUString> aCities
+ = { u"Berlin"_ustr, u"San Francisco"_ustr, u"Tokyo"_ustr, u"Rome"_ustr, u"Paris"_ustr };
std::vector<double> aFirstCol = { 1, 10, -100, -0.11111, 1 };
std::vector<double> aSecondCol = {
2, 2.1, 40179, 2, 2,
}; // 40179 is equal to 2010-1-1
- CPPUNIT_ASSERT_EQUAL(OUString("Col1"), pDoc->GetString(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Col2"), pDoc->GetString(1, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Col3"), pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Col4"), pDoc->GetString(3, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Col1"_ustr, pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Col2"_ustr, pDoc->GetString(1, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Col3"_ustr, pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Col4"_ustr, pDoc->GetString(3, 0, 0));
for (SCROW nRow = 0; nRow <= 4; ++nRow)
{
@@ -147,7 +149,7 @@ void ScDataProvidersTest::testXMLImport()
{
createScDoc();
- ScDBData* pDBData = new ScDBData("testDB", 0, 0, 0, 10, 10);
+ ScDBData* pDBData = new ScDBData(u"testDB"_ustr, 0, 0, 0, 10, 10);
ScDocument* pDoc = getScDoc();
bool bInserted
= pDoc->GetDBCollection()->getNamedDBs().insert(std::unique_ptr<ScDBData>(pDBData));
@@ -163,8 +165,8 @@ void ScDataProvidersTest::testXMLImport()
aParam.maRangeLinks.push_back(aRangeLink);
OUString aFileURL = createFileURL(u"xml/test1.xml");
- sc::ExternalDataSource aDataSource(aFileURL, "org.libreoffice.calc.xml", pDoc);
- aDataSource.setDBData("testDB");
+ sc::ExternalDataSource aDataSource(aFileURL, u"org.libreoffice.calc.xml"_ustr, pDoc);
+ aDataSource.setDBData(u"testDB"_ustr);
aDataSource.setXMLImportParam(aParam);
pDoc->GetExternalDataMapper().insertDataSource(aDataSource);
@@ -174,16 +176,16 @@ void ScDataProvidersTest::testXMLImport()
rDataSources[0].refresh(pDoc, true);
Scheduler::ProcessEventsToIdle();
- CPPUNIT_ASSERT_EQUAL(OUString("title"), pDoc->GetString(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("author"), pDoc->GetString(1, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"title"_ustr, pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"author"_ustr, pDoc->GetString(1, 0, 0));
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(0, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("test1"), pDoc->GetString(1, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"test1"_ustr, pDoc->GetString(1, 1, 0));
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(0, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("test2"), pDoc->GetString(1, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"test2"_ustr, pDoc->GetString(1, 2, 0));
CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(0, 3, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("test3"), pDoc->GetString(1, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"test3"_ustr, pDoc->GetString(1, 3, 0));
CPPUNIT_ASSERT_EQUAL(4.0, pDoc->GetValue(0, 4, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("test4"), pDoc->GetString(1, 4, 0));
+ CPPUNIT_ASSERT_EQUAL(u"test4"_ustr, pDoc->GetString(1, 4, 0));
}
/*
@@ -214,7 +216,7 @@ void ScDataProvidersTest::testBaseImport()
*/
ScDataProvidersTest::ScDataProvidersTest()
- : ScModelTestBase("sc/qa/unit/data/dataprovider")
+ : ScModelTestBase(u"sc/qa/unit/data/dataprovider"_ustr)
{
}
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 4c8661822c4a..d3eace0430c5 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -61,7 +61,7 @@ void ScFiltersTest::createFileURL(
// GetNewAbsURL instead of insertName for them:
INetURLObject url(m_directories.getSrcRootURL());
url.setFinalSlash();
- url.GetNewAbsURL("sc/qa/unit/data", &url);
+ url.GetNewAbsURL(u"sc/qa/unit/data"_ustr, &url);
url.insertName(aFileExtension, true);
url.GetNewAbsURL(OUString::Concat(aFileBase) + aFileExtension, &url);
rFilePath = url.GetMainURL(INetURLObject::DecodeMechanism::NONE);
@@ -84,28 +84,28 @@ bool ScFiltersTest::load(const OUString &rFilter, const OUString &rURL,
void ScFiltersTest::testCVEs()
{
#ifndef DISABLE_CVE_TESTS
- testDir("Quattro Pro 6.0",
+ testDir(u"Quattro Pro 6.0"_ustr,
m_directories.getURLFromSrc(u"/sc/qa/unit/data/qpro/"));
//warning, the current "sylk filter" in sc (docsh.cxx) automatically
//chains on failure on trying as csv, rtf, etc. so "success" may
//not indicate that it imported as .slk.
- testDir("SYLK",
+ testDir(u"SYLK"_ustr,
m_directories.getURLFromSrc(u"/sc/qa/unit/data/slk/"));
- testDir("MS Excel 97",
+ testDir(u"MS Excel 97"_ustr,
m_directories.getURLFromSrc(u"/sc/qa/unit/data/xls/"));
- testDir("Calc Office Open XML",
+ testDir(u"Calc Office Open XML"_ustr,
m_directories.getURLFromSrc(u"/sc/qa/unit/data/xlsx/"), OUString(), XLSX_FORMAT_TYPE);
- testDir("Calc Office Open XML",
+ testDir(u"Calc Office Open XML"_ustr,
m_directories.getURLFromSrc(u"/sc/qa/unit/data/xlsm/"), OUString(), XLSX_FORMAT_TYPE);
- testDir("dBase",
+ testDir(u"dBase"_ustr,
m_directories.getURLFromSrc(u"/sc/qa/unit/data/dbf/"));
- testDir("Lotus",
+ testDir(u"Lotus"_ustr,
m_directories.getURLFromSrc(u"/sc/qa/unit/data/wks/"));
#endif
@@ -135,7 +135,7 @@ void ScFiltersTest::testTdf90299()
aReferencingFileURL = aTmpDirectory1URL + "/tdf90299.xls";
aReferencedFileURL = aTmpDirectory1URL + "/dummy.xls";
- ScDocShellRef xShell = loadDoc(aReferencingFileURL, "MS Excel 97", OUString(), OUString(),
+ ScDocShellRef xShell = loadDoc(aReferencingFileURL, u"MS Excel 97"_ustr, OUString(), OUString(),
XLS_FORMAT_TYPE, SotClipboardFormatId::STARCALC_8);
ScDocument& rDoc = xShell->GetDocument();
@@ -161,7 +161,7 @@ void ScFiltersTest::testTdf90299()
aReferencingFileURL = aTmpDirectory2URL + "/tdf90299.xls";
aReferencedFileURL = aTmpDirectory2URL + "/dummy.xls";
- xShell = loadDoc(aReferencingFileURL, "MS Excel 97", OUString(), OUString(),
+ xShell = loadDoc(aReferencingFileURL, u"MS Excel 97"_ustr, OUString(), OUString(),
XLS_FORMAT_TYPE, SotClipboardFormatId::STARCALC_8);
ScDocument& rDoc2 = xShell->GetDocument();
CPPUNIT_ASSERT_EQUAL(OUString("='" + aReferencedFileURL + "'#$Sheet1.A1"), rDoc2.GetFormula(0, 0, 0));
diff --git a/sc/qa/unit/functions_addin.cxx b/sc/qa/unit/functions_addin.cxx
index 4c9189de235d..2c3cf0a43d93 100644
--- a/sc/qa/unit/functions_addin.cxx
+++ b/sc/qa/unit/functions_addin.cxx
@@ -16,8 +16,8 @@ public:
void AddinFunctionsTest::testAddinFormulasFODS()
{
OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/addin/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
}
diff --git a/sc/qa/unit/functions_array.cxx b/sc/qa/unit/functions_array.cxx
index 2053c44dfad7..ef0da39f5f6a 100644
--- a/sc/qa/unit/functions_array.cxx
+++ b/sc/qa/unit/functions_array.cxx
@@ -18,8 +18,8 @@ public:
void ArrayFunctionsTest::testArrayFormulasFODS()
{
OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/array/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
}
@@ -32,8 +32,8 @@ void ArrayFunctionsTest::testDubiousArrayFormulasFODS()
#if defined X86_64
OUString aDirectoryURL
= m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/array/dubious/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
#endif
}
diff --git a/sc/qa/unit/functions_database.cxx b/sc/qa/unit/functions_database.cxx
index 7bed3b5c956a..2510029f0ecf 100644
--- a/sc/qa/unit/functions_database.cxx
+++ b/sc/qa/unit/functions_database.cxx
@@ -16,8 +16,8 @@ public:
void DatabaseFunctionsTest::testDatabaseFormulasFODS()
{
OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/database/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
}
diff --git a/sc/qa/unit/functions_datetime.cxx b/sc/qa/unit/functions_datetime.cxx
index ba7f7ce2c56f..9e51c76c5cdb 100644
--- a/sc/qa/unit/functions_datetime.cxx
+++ b/sc/qa/unit/functions_datetime.cxx
@@ -16,8 +16,8 @@ public:
void DateTimeFunctionsTest::testDateTimeFormulasFODS()
{
OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/date_time/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
}
diff --git a/sc/qa/unit/functions_financial.cxx b/sc/qa/unit/functions_financial.cxx
index b83b4cd667e6..337ac25bf58a 100644
--- a/sc/qa/unit/functions_financial.cxx
+++ b/sc/qa/unit/functions_financial.cxx
@@ -16,8 +16,8 @@ public:
void FinancialFunctionsTest::testFinancialFormulasFODS()
{
OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/financial/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
}
diff --git a/sc/qa/unit/functions_information.cxx b/sc/qa/unit/functions_information.cxx
index 9d6de422ec5b..487f358ebd5d 100644
--- a/sc/qa/unit/functions_information.cxx
+++ b/sc/qa/unit/functions_information.cxx
@@ -16,8 +16,8 @@ public:
void InformationFunctionsTest::testInformationFormulasFODS()
{
OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/information/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
}
diff --git a/sc/qa/unit/functions_logical.cxx b/sc/qa/unit/functions_logical.cxx
index c501867a0e2c..f211909f37d7 100644
--- a/sc/qa/unit/functions_logical.cxx
+++ b/sc/qa/unit/functions_logical.cxx
@@ -16,8 +16,8 @@ public:
void LogicalFunctionsTest::testLogicalFormulasFODS()
{
OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/logical/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
}
diff --git a/sc/qa/unit/functions_mathematical.cxx b/sc/qa/unit/functions_mathematical.cxx
index 9eb940df892c..cefc3d052e8e 100644
--- a/sc/qa/unit/functions_mathematical.cxx
+++ b/sc/qa/unit/functions_mathematical.cxx
@@ -16,8 +16,8 @@ public:
void MathematicalFunctionsTest::testMathematicalFormulasFODS()
{
OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/mathematical/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
}
diff --git a/sc/qa/unit/functions_old.cxx b/sc/qa/unit/functions_old.cxx
index 0a3663f988d9..ada44afcd1a0 100644
--- a/sc/qa/unit/functions_old.cxx
+++ b/sc/qa/unit/functions_old.cxx
@@ -21,8 +21,8 @@ FunctionsTestOld::FunctionsTestOld():
void FunctionsTestOld::testFormulasFODS()
{
OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
}
diff --git a/sc/qa/unit/functions_spreadsheet.cxx b/sc/qa/unit/functions_spreadsheet.cxx
index 865134fc31c1..8457be24ba1a 100644
--- a/sc/qa/unit/functions_spreadsheet.cxx
+++ b/sc/qa/unit/functions_spreadsheet.cxx
@@ -16,8 +16,8 @@ public:
void SpreadsheetFunctionsTest::testSpreadsheetFormulasFODS()
{
OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/spreadsheet/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
}
diff --git a/sc/qa/unit/functions_statistical.cxx b/sc/qa/unit/functions_statistical.cxx
index 8f74aad999fb..605be9ca7534 100644
--- a/sc/qa/unit/functions_statistical.cxx
+++ b/sc/qa/unit/functions_statistical.cxx
@@ -16,8 +16,8 @@ public:
void StatisticalFunctionsTest::testStatisticalFormulasFODS()
{
OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/statistical/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
}
diff --git a/sc/qa/unit/functions_text.cxx b/sc/qa/unit/functions_text.cxx
index a9bfb8fefbab..367474ce36a2 100644
--- a/sc/qa/unit/functions_text.cxx
+++ b/sc/qa/unit/functions_text.cxx
@@ -16,8 +16,8 @@ public:
void TextFunctionsTest::testTextFormulasFODS()
{
OUString aDirectoryURL = m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/text/fods/");
- recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", aDirectoryURL,
- "com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+ recursiveScan(test::pass, u"OpenDocument Spreadsheet Flat XML"_ustr, aDirectoryURL,
+ u"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true"_ustr,
FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
}
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 4dc09a65de6e..4cc773fadd0b 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -219,7 +219,7 @@ void ScModelTestBase::testFormats(ScDocument* pDoc,std::u16string_view sFormat)
CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(4153), pDoc->GetColWidth(6,1) ); //2.8839in
//test case for i53253 where a cell has text with different styles and space between the text.
OUString aTestStr = pDoc->GetString(3,0,1);
- OUString aKnownGoodStr("text14 space");
+ OUString aKnownGoodStr(u"text14 space"_ustr);
CPPUNIT_ASSERT_EQUAL( aKnownGoodStr, aTestStr );
//test case for cell text with line breaks.
aTestStr = pDoc->GetString(3,5,1);
@@ -251,7 +251,7 @@ void ScModelTestBase::testFormats(ScDocument* pDoc,std::u16string_view sFormat)
pPattern = pDoc->GetPattern(1,1,3);
ScStyleSheet* pStyleSheet = const_cast<ScStyleSheet*>(pPattern->GetStyleSheet());
// check parent style name
- OUString sExpected("Excel Built-in Date");
+ OUString sExpected(u"Excel Built-in Date"_ustr);
OUString sResult = pStyleSheet->GetName();
CPPUNIT_ASSERT_EQUAL_MESSAGE("parent style for Sheet4.B2 is 'Excel Built-in Date'", sExpected, sResult);
// check align of style
@@ -287,7 +287,7 @@ void ScModelTestBase::goToCell(const OUString& rCell)
{
uno::Sequence<beans::PropertyValue> aArgs
= comphelper::InitPropertySequence({ { "ToPoint", uno::Any(rCell) } });
- dispatchCommand(mxComponent, ".uno:GoToCell", aArgs);
+ dispatchCommand(mxComponent, u".uno:GoToCell"_ustr, aArgs);
}
void ScModelTestBase::typeString(const std::u16string_view& rStr)
@@ -330,15 +330,15 @@ void ScModelTestBase::insertNewSheet(ScDocument& rDoc)
sal_Int32 nTabs = static_cast<sal_Int32>(rDoc.GetTableCount());
uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence(
- { { "Name", uno::Any(OUString("NewTab")) }, { "Index", uno::Any(nTabs + 1) } }));
- dispatchCommand(mxComponent, ".uno:Insert", aArgs);
+ { { "Name", uno::Any(u"NewTab"_ustr) }, { "Index", uno::Any(nTabs + 1) } }));
+ dispatchCommand(mxComponent, u".uno:Insert"_ustr, aArgs);
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(nTabs + 1), rDoc.GetTableCount());
}
void ScModelTestBase::executeAutoSum()
{
- dispatchCommand(mxComponent, ".uno:AutoSum", {});
+ dispatchCommand(mxComponent, u".uno:AutoSum"_ustr, {});
// Use RETURN key to exit autosum edit view
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
@@ -572,12 +572,12 @@ void ScUcalcTestBase::tearDown()
void ScModelTestBase::createScDoc(const char* pName, const char* pPassword, bool bCheckWarningError)
{
if (!pName)
- load("private:factory/scalc");
+ load(u"private:factory/scalc"_ustr);
else
loadFromFile(OUString::createFromAscii(pName), pPassword);
uno::Reference<lang::XServiceInfo> xServiceInfo(mxComponent, uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.sheet.SpreadsheetDocument"));
+ CPPUNIT_ASSERT(xServiceInfo->supportsService(u"com.sun.star.sheet.SpreadsheetDocument"_ustr));
if (bCheckWarningError)
CPPUNIT_ASSERT(!getScDocShell()->GetMedium()->GetWarningError());
@@ -683,7 +683,7 @@ void ScModelTestBase::initTestEnv(std::u16string_view fileName)
// Open the document with OpenCL disabled
mxComponent = mxDesktop->loadComponentFromURL(
- createFileURL(fileName), "_default", 0, comphelper::containerToSequence(args));
+ createFileURL(fileName), u"_default"_ustr, 0, comphelper::containerToSequence(args));
enableOpenCL();
CPPUNIT_ASSERT(ScCalcConfig::isOpenCLEnabled());
@@ -693,7 +693,7 @@ void ScModelTestBase::initTestEnv(std::u16string_view fileName)
// Open the document with OpenCL enabled
mxComponent2 = mxDesktop->loadComponentFromURL(
- maTempFile.GetURL(), "_default", 0, comphelper::containerToSequence(args));
+ maTempFile.GetURL(), u"_default"_ustr, 0, comphelper::containerToSequence(args));
// Check there are 2 documents
uno::Reference<frame::XFrames> xFrames = mxDesktop->getFrames();
diff --git a/sc/qa/unit/helper/scfiltertestbase.cxx b/sc/qa/unit/helper/scfiltertestbase.cxx
index 0e8f4525ef11..270ed973e5f6 100644
--- a/sc/qa/unit/helper/scfiltertestbase.cxx
+++ b/sc/qa/unit/helper/scfiltertestbase.cxx
@@ -53,8 +53,8 @@ void ScFilterTestBase::setUp()
// This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
// which is a private symbol to us, gets called
- m_xCalcComponent
- = getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
+ m_xCalcComponent = getMultiServiceFactory()->createInstance(
+ u"com.sun.star.comp.Calc.SpreadsheetDocument"_ustr);
CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
}
diff --git a/sc/qa/unit/helper/shared_test_impl.hxx b/sc/qa/unit/helper/shared_test_impl.hxx
index 4d792cd378b2..7ecb4925a66f 100644
--- a/sc/qa/unit/helper/shared_test_impl.hxx
+++ b/sc/qa/unit/helper/shared_test_impl.hxx
@@ -289,7 +289,7 @@ void testCeilingFloor_Impl( ScDocument& rDoc )
static constexpr OUString pORef = u"Sheet1.K1"_ustr;
ScAddress aPos;
aPos.Parse(pORef, rDoc);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=AND(K3:K81)"), rDoc.GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=AND(K3:K81)"_ustr, rDoc.GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
CPPUNIT_ASSERT_MESSAGE( OUString( pORef + " result is error.").toUtf8().getStr(),
isFormulaWithoutError( rDoc, aPos));
CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(aPos));
diff --git a/sc/qa/unit/jumbosheets-test.cxx b/sc/qa/unit/jumbosheets-test.cxx
index ae213c801393..20159c35c6e6 100644
--- a/sc/qa/unit/jumbosheets-test.cxx
+++ b/sc/qa/unit/jumbosheets-test.cxx
@@ -90,7 +90,7 @@ void ScJumboSheetsTest::testRoundtripColumn2000(std::u16string_view name, const
// Check the value at BXX1 (2000th column).
CPPUNIT_ASSERT_EQUAL(-5.0, pDoc->GetValue(1999, 0, 0));
// Check the formula referencing the value.
- CPPUNIT_ASSERT_EQUAL(OUString("=BXX1"), pDoc->GetFormula(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=BXX1"_ustr, pDoc->GetFormula(0, 0, 0));
// Recalc and check value in the reference.
pDoc->CalcAll();
CPPUNIT_ASSERT_EQUAL(-5.0, pDoc->GetValue(0, 0, 0));
@@ -104,7 +104,7 @@ void ScJumboSheetsTest::testRoundtripColumn2000(std::u16string_view name, const
ScDocument* pDoc = pModelObj->GetDocument();
// Check again.
CPPUNIT_ASSERT_EQUAL(-5.0, pDoc->GetValue(1999, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("=BXX1"), pDoc->GetFormula(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=BXX1"_ustr, pDoc->GetFormula(0, 0, 0));
pDoc->CalcAll();
CPPUNIT_ASSERT_EQUAL(-5.0, pDoc->GetValue(0, 0, 0));
}
@@ -118,49 +118,49 @@ void ScJumboSheetsTest::testRoundtripColumnRangeOds()
CPPUNIT_ASSERT(pModelObj);
ScDocument* pDoc = pModelObj->GetDocument();
// Check the formula referencing the whole-row range.
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(2:2)"), pDoc->GetFormula(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(2:2)"_ustr, pDoc->GetFormula(0, 0, 0));
// Check the formula referencing the whole-column range.
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C:C)"), pDoc->GetFormula(1, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C:C)"_ustr, pDoc->GetFormula(1, 0, 0));
}
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
{
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
ScDocument* pDoc = pModelObj->GetDocument();
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(2:2)"), pDoc->GetFormula(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C:C)"), pDoc->GetFormula(1, 0, 0));
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(2:2)"_ustr, pDoc->GetFormula(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C:C)"_ustr, pDoc->GetFormula(1, 0, 0));
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table/"
"table:table-row[1]/table:table-cell[1]"_ostr,
- "formula"_ostr, "of:=SUM([.2:.2])");
+ "formula"_ostr, u"of:=SUM([.2:.2])"_ustr);
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table/"
"table:table-row[1]/table:table-cell[2]"_ostr,
- "formula"_ostr, "of:=SUM([.C:.C])");
+ "formula"_ostr, u"of:=SUM([.C:.C])"_ustr);
}
}
void ScJumboSheetsTest::testRoundtripColumnRangeXlsx()
{
loadFromFile(u"ods/sum-whole-column-row.ods");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
{
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
ScDocument* pDoc = pModelObj->GetDocument();
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(2:2)"), pDoc->GetFormula(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C:C)"), pDoc->GetFormula(1, 0, 0));
- xmlDocUniquePtr pXmlDoc = parseExport("xl/worksheets/sheet1.xml");
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(2:2)"_ustr, pDoc->GetFormula(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C:C)"_ustr, pDoc->GetFormula(1, 0, 0));
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPathContent(pXmlDoc, "/x:worksheet/x:sheetData/x:row[1]/x:c[1]/x:f"_ostr,
- "SUM(2:2)");
+ u"SUM(2:2)"_ustr);
assertXPathContent(pXmlDoc, "/x:worksheet/x:sheetData/x:row[1]/x:c[2]/x:f"_ostr,
- "SUM(C:C)");
+ u"SUM(C:C)"_ustr);
}
}
@@ -267,11 +267,11 @@ void ScJumboSheetsTest::testTdf134553()
ScTabViewShell* pViewShell = ScDocShell::GetViewData()->GetViewShell();
pViewShell->SelectObject(u"Diagram 1");
- dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, u".uno:Cut"_ustr, {});
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pPage->GetObjCount());
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
pOleObj = pPage->GetObj(0);
CPPUNIT_ASSERT(pOleObj);
@@ -298,34 +298,34 @@ void ScJumboSheetsTest::testTdf134392()
void ScJumboSheetsTest::testTdf147509()
{
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
ScDocument* pDoc = pModelObj->GetDocument();
- pDoc->SetString(0, 0, 0, "A");
- pDoc->SetString(1, 0, 0, "B");
+ pDoc->SetString(0, 0, 0, u"A"_ustr);
+ pDoc->SetString(1, 0, 0, u"B"_ustr);
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), ScDocShell::GetViewData()->GetCurX());
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ScDocShell::GetViewData()->GetCurY());
- dispatchCommand(mxComponent, ".uno:SelectColumn", {});
+ dispatchCommand(mxComponent, u".uno:SelectColumn"_ustr, {});
- dispatchCommand(mxComponent, ".uno:InsertColumnsAfter", {});
+ dispatchCommand(mxComponent, u".uno:InsertColumnsAfter"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("A"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
// Without the fix in place, this test would have failed with
// - Expected:
// - Actual : B
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(1, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("B"), pDoc->GetString(ScAddress(2, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"B"_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
}
void ScJumboSheetsTest::testTdf133033()
{
- mxComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
@@ -350,7 +350,7 @@ void ScJumboSheetsTest::testTdf109061()
}
ScJumboSheetsTest::ScJumboSheetsTest()
- : UnoApiXmlTest("/sc/qa/unit/data/")
+ : UnoApiXmlTest(u"/sc/qa/unit/data/"_ustr)
{
}
diff --git a/sc/qa/unit/opencl-test-1.cxx b/sc/qa/unit/opencl-test-1.cxx
index 0c450d521120..27ae9682ffee 100644
--- a/sc/qa/unit/opencl-test-1.cxx
+++ b/sc/qa/unit/opencl-test-1.cxx
@@ -2095,7 +2095,7 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testStatisticalFormulaGammaDist)
}
ScOpenCLTest1::ScOpenCLTest1()
- : ScModelTestBase( "sc/qa/unit/data" )
+ : ScModelTestBase( u"sc/qa/unit/data"_ustr )
{
}
diff --git a/sc/qa/unit/opencl-test-2.cxx b/sc/qa/unit/opencl-test-2.cxx
index 7cd34f15245c..876c75d165da 100644
--- a/sc/qa/unit/opencl-test-2.cxx
+++ b/sc/qa/unit/opencl-test-2.cxx
@@ -1866,7 +1866,7 @@ CPPUNIT_TEST_FIXTURE(ScOpenCLTest2, testTdf149940_VLookup)
}
ScOpenCLTest2::ScOpenCLTest2()
- : ScModelTestBase( "sc/qa/unit/data" )
+ : ScModelTestBase( u"sc/qa/unit/data"_ustr )
{
}
diff --git a/sc/qa/unit/parallelism.cxx b/sc/qa/unit/parallelism.cxx
index 0ced71c44228..205f8bca32a8 100644
--- a/sc/qa/unit/parallelism.cxx
+++ b/sc/qa/unit/parallelism.cxx
@@ -25,7 +25,7 @@ class ScParallelismTest : public ScModelTestBase
{
public:
ScParallelismTest()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
diff --git a/sc/qa/unit/pivottable_filters_test.cxx b/sc/qa/unit/pivottable_filters_test.cxx
index 983aa176db70..17391890e4f6 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -42,7 +42,7 @@ public:
};
ScPivotTableFiltersTest::ScPivotTableFiltersTest()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
@@ -91,8 +91,8 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableBasicODS)
CPPUNIT_ASSERT_EQUAL_MESSAGE(("There should be exactly 3 row fields (2 normal dimensions and 1"
" layout dimension)."),
std::vector<ScDPSaveDimension const*>::size_type(3), aDims.size());
- CPPUNIT_ASSERT_MESSAGE("Dimension expected, but not found.", hasDimension(aDims, "Row1"));
- CPPUNIT_ASSERT_MESSAGE("Dimension expected, but not found.", hasDimension(aDims, "Row2"));
+ CPPUNIT_ASSERT_MESSAGE("Dimension expected, but not found.", hasDimension(aDims, u"Row1"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("Dimension expected, but not found.", hasDimension(aDims, u"Row2"_ustr));
const ScDPSaveDimension* pDataLayout = pSaveData->GetExistingDataLayoutDimension();
CPPUNIT_ASSERT_MESSAGE("There should be a data layout field as a row field.", pDataLayout);
CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be a data layout field as a row field.",
@@ -103,15 +103,17 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableBasicODS)
pSaveData->GetAllDimensionsByOrientation(sheet::DataPilotFieldOrientation_COLUMN, aDims);
CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly 2 column fields.",
std::vector<ScDPSaveDimension const*>::size_type(2), aDims.size());
- CPPUNIT_ASSERT_MESSAGE("Dimension expected, but not found.", hasDimension(aDims, "Col1"));
- CPPUNIT_ASSERT_MESSAGE("Dimension expected, but not found.", hasDimension(aDims, "Col2"));
+ CPPUNIT_ASSERT_MESSAGE("Dimension expected, but not found.", hasDimension(aDims, u"Col1"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("Dimension expected, but not found.", hasDimension(aDims, u"Col2"_ustr));
// Page fields
pSaveData->GetAllDimensionsByOrientation(sheet::DataPilotFieldOrientation_PAGE, aDims);
CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly 2 page fields.",
std::vector<ScDPSaveDimension const*>::size_type(2), aDims.size());
- CPPUNIT_ASSERT_MESSAGE("Dimension expected, but not found.", hasDimension(aDims, "Page1"));
- CPPUNIT_ASSERT_MESSAGE("Dimension expected, but not found.", hasDimension(aDims, "Page2"));
+ CPPUNIT_ASSERT_MESSAGE("Dimension expected, but not found.",
+ hasDimension(aDims, u"Page1"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("Dimension expected, but not found.",
+ hasDimension(aDims, u"Page2"_ustr));
// Check the data field.
pSaveData->GetAllDimensionsByOrientation(sheet::DataPilotFieldOrientation_DATA, aDims);
@@ -138,7 +140,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableNamedRangeSourceODS)
// Make sure this pivot table is based on a named range source.
const ScSheetSourceDesc* pDesc = pDP->GetSheetDesc();
CPPUNIT_ASSERT(pDesc);
- CPPUNIT_ASSERT_EQUAL(OUString("MyRange"), pDesc->GetRangeName());
+ CPPUNIT_ASSERT_EQUAL(u"MyRange"_ustr, pDesc->GetRangeName());
css::sheet::DataPilotFieldOrientation nOrient;
tools::Long nDim = pDP->GetHeaderDim(ScAddress(0, 1, 1), nOrient);
@@ -327,22 +329,22 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableSharedGroupXLSX)
// Check whether right group names are imported for both tables
// First table
- CPPUNIT_ASSERT_EQUAL(OUString("a2"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Csoport1"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Csoport2"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Csoport3"), pDoc->GetString(ScAddress(0, 4, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("16"), pDoc->GetString(ScAddress(0, 5, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("17"), pDoc->GetString(ScAddress(0, 6, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("18"), pDoc->GetString(ScAddress(0, 7, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"a2"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Csoport1"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Csoport2"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Csoport3"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"16"_ustr, pDoc->GetString(ScAddress(0, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"17"_ustr, pDoc->GetString(ScAddress(0, 6, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"18"_ustr, pDoc->GetString(ScAddress(0, 7, 0)));
// Second table
- CPPUNIT_ASSERT_EQUAL(OUString("a2"), pDoc->GetString(ScAddress(0, 11, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Csoport1"), pDoc->GetString(ScAddress(0, 12, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Csoport2"), pDoc->GetString(ScAddress(0, 13, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Csoport3"), pDoc->GetString(ScAddress(0, 14, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("16"), pDoc->GetString(ScAddress(0, 15, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("17"), pDoc->GetString(ScAddress(0, 16, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("18"), pDoc->GetString(ScAddress(0, 17, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"a2"_ustr, pDoc->GetString(ScAddress(0, 11, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Csoport1"_ustr, pDoc->GetString(ScAddress(0, 12, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Csoport2"_ustr, pDoc->GetString(ScAddress(0, 13, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Csoport3"_ustr, pDoc->GetString(ScAddress(0, 14, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"16"_ustr, pDoc->GetString(ScAddress(0, 15, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"17"_ustr, pDoc->GetString(ScAddress(0, 16, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"18"_ustr, pDoc->GetString(ScAddress(0, 17, 0)));
// There should be exactly 2 pivot tables and 1 cache.
ScDPCollection* pDPs = pDoc->GetDPCollection();
@@ -362,20 +364,20 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableSharedDateGroupXLSX)
auto testThis = [](ScDocument& rDoc) {
// Check whether right date labels are imported for both tables
// First table
- CPPUNIT_ASSERT_EQUAL(OUString("a"), rDoc.GetString(ScAddress(0, 3, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("1965"), rDoc.GetString(ScAddress(0, 4, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("1989"), rDoc.GetString(ScAddress(0, 5, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("2000"), rDoc.GetString(ScAddress(0, 6, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("2004"), rDoc.GetString(ScAddress(0, 7, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, rDoc.GetString(ScAddress(0, 3, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"1965"_ustr, rDoc.GetString(ScAddress(0, 4, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"1989"_ustr, rDoc.GetString(ScAddress(0, 5, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"2000"_ustr, rDoc.GetString(ScAddress(0, 6, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"2004"_ustr, rDoc.GetString(ScAddress(0, 7, 1)));
// TODO: check why this fails with 2005
// CPPUNIT_ASSERT_EQUAL(OUString("2007"), rDoc.GetString(ScAddress(0,8,1)));
// Second table
- CPPUNIT_ASSERT_EQUAL(OUString("a"), rDoc.GetString(ScAddress(5, 3, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("1965"), rDoc.GetString(ScAddress(5, 4, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("1989"), rDoc.GetString(ScAddress(5, 5, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("2000"), rDoc.GetString(ScAddress(5, 6, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("2004"), rDoc.GetString(ScAddress(5, 7, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, rDoc.GetString(ScAddress(5, 3, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"1965"_ustr, rDoc.GetString(ScAddress(5, 4, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"1989"_ustr, rDoc.GetString(ScAddress(5, 5, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"2000"_ustr, rDoc.GetString(ScAddress(5, 6, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"2004"_ustr, rDoc.GetString(ScAddress(5, 7, 1)));
// TODO: check why this fails with 2005
// CPPUNIT_ASSERT_EQUAL(OUString("2007"), rDoc.GetString(ScAddress(5,8,1)));
@@ -393,7 +395,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableSharedDateGroupXLSX)
createScDoc("xlsx/pivot-table/shared-dategroup.xlsx");
testThis(*getScDoc());
// Now test round-trip of group fields
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
testThis(*getScDoc());
}
@@ -403,19 +405,19 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableSharedNestedDateGrou
// Check whether right date groups are imported for both tables
// First table
// Years, Quarters, 'a' have compact layout so the only header contains a multi-field filter.
- CPPUNIT_ASSERT_EQUAL(OUString("1965"), rDoc.GetString(ScAddress(0, 4, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("1989"), rDoc.GetString(ScAddress(0, 11, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("2000"), rDoc.GetString(ScAddress(0, 18, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("2004"), rDoc.GetString(ScAddress(0, 21, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"1965"_ustr, rDoc.GetString(ScAddress(0, 4, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"1989"_ustr, rDoc.GetString(ScAddress(0, 11, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"2000"_ustr, rDoc.GetString(ScAddress(0, 18, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"2004"_ustr, rDoc.GetString(ScAddress(0, 21, 1)));
// TODO: check why this fails with the empty string
//CPPUNIT_ASSERT_EQUAL(OUString("2007"), rDoc.GetString(ScAddress(0,32,1)));
// Second table
// Years, Quarters, 'a' have compact layout so the only row header contains a multi-field filter.
- CPPUNIT_ASSERT_EQUAL(OUString("1965"), rDoc.GetString(ScAddress(6, 4, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("1989"), rDoc.GetString(ScAddress(6, 11, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("2000"), rDoc.GetString(ScAddress(6, 18, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("2004"), rDoc.GetString(ScAddress(6, 21, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"1965"_ustr, rDoc.GetString(ScAddress(6, 4, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"1989"_ustr, rDoc.GetString(ScAddress(6, 11, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"2000"_ustr, rDoc.GetString(ScAddress(6, 18, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"2004"_ustr, rDoc.GetString(ScAddress(6, 21, 1)));
// TODO: check why this fails with the empty string
//CPPUNIT_ASSERT_EQUAL(OUString("2007"), rDoc.GetString(ScAddress(6,31,1)));
@@ -436,7 +438,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableSharedNestedDateGrou
createScDoc("xlsx/pivot-table/shared-nested-dategroup.xlsx");
testThis(*getScDoc());
// Now test round-trip of group fields
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
testThis(*getScDoc());
}
@@ -447,20 +449,20 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableSharedNumGroupXLSX)
// Check whether right number groups are imported for both tables
// First table
- CPPUNIT_ASSERT_EQUAL(OUString("f"), pDoc->GetString(ScAddress(0, 3, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("32674-47673"), pDoc->GetString(ScAddress(0, 4, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("47674-62673"), pDoc->GetString(ScAddress(0, 5, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("62674-77673"), pDoc->GetString(ScAddress(0, 6, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("77674-92673"), pDoc->GetString(ScAddress(0, 7, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("92674-107673"), pDoc->GetString(ScAddress(0, 8, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"f"_ustr, pDoc->GetString(ScAddress(0, 3, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"32674-47673"_ustr, pDoc->GetString(ScAddress(0, 4, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"47674-62673"_ustr, pDoc->GetString(ScAddress(0, 5, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"62674-77673"_ustr, pDoc->GetString(ScAddress(0, 6, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"77674-92673"_ustr, pDoc->GetString(ScAddress(0, 7, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"92674-107673"_ustr, pDoc->GetString(ScAddress(0, 8, 1)));
// Second table
- CPPUNIT_ASSERT_EQUAL(OUString("f"), pDoc->GetString(ScAddress(5, 3, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("32674-47673"), pDoc->GetString(ScAddress(5, 4, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("47674-62673"), pDoc->GetString(ScAddress(5, 5, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("62674-77673"), pDoc->GetString(ScAddress(5, 6, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("77674-92673"), pDoc->GetString(ScAddress(5, 7, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("92674-107673"), pDoc->GetString(ScAddress(5, 8, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"f"_ustr, pDoc->GetString(ScAddress(5, 3, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"32674-47673"_ustr, pDoc->GetString(ScAddress(5, 4, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"47674-62673"_ustr, pDoc->GetString(ScAddress(5, 5, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"62674-77673"_ustr, pDoc->GetString(ScAddress(5, 6, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"77674-92673"_ustr, pDoc->GetString(ScAddress(5, 7, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"92674-107673"_ustr, pDoc->GetString(ScAddress(5, 8, 1)));
// There should be exactly 2 pivot tables and 1 cache.
ScDPCollection* pDPs = pDoc->GetDPCollection();
@@ -572,32 +574,33 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableExportXLSX)
createScDoc("xlsx/tdf89139_pivot_table.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable = parseExport("xl/pivotTables/pivotTable1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[3]/x:items"_ostr,
- "count"_ostr, "4");
+ "count"_ostr, u"4"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[3]/x:items/x:item"_ostr,
4);
assertXPath(pTable,
"/x:pivotTableDefinition/x:pivotFields/x:pivotField[3]/x:items/x:item[3]"_ostr,
- "h"_ostr, "1");
+ "h"_ostr, u"1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableExportXLSXSingleDataField)
{
createScDoc("ods/tdf123421_1datafield.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable = parseExport("xl/pivotTables/pivotTable1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
- assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "ref"_ostr, "A3:B6");
- assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstHeaderRow"_ostr, "1");
- assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstDataRow"_ostr, "1");
- assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstDataCol"_ostr, "1");
- assertXPath(pTable, "/x:pivotTableDefinition/x:dataFields"_ostr, "count"_ostr, "1");
+ assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "ref"_ostr, u"A3:B6"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstHeaderRow"_ostr,
+ u"1"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstDataRow"_ostr, u"1"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstDataCol"_ostr, u"1"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition/x:dataFields"_ostr, "count"_ostr, u"1"_ustr);
// There should not be any colFields tag, before the fix there used to be a singleton with
// <field x="-2"/> as child node.
@@ -608,23 +611,24 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableExportXLSXMultipleDa
{
createScDoc("ods/tdf123421_2datafields.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable = parseExport("xl/pivotTables/pivotTable1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
- assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "ref"_ostr, "A1:C6");
- assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstHeaderRow"_ostr, "1");
- assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstDataRow"_ostr, "2");
- assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstDataCol"_ostr, "1");
+ assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "ref"_ostr, u"A1:C6"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstHeaderRow"_ostr,
+ u"1"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstDataRow"_ostr, u"2"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstDataCol"_ostr, u"1"_ustr);
- assertXPath(pTable, "/x:pivotTableDefinition/x:dataFields"_ostr, "count"_ostr, "2");
+ assertXPath(pTable, "/x:pivotTableDefinition/x:dataFields"_ostr, "count"_ostr, u"2"_ustr);
// There should be a single colFields tag with sole child node
// <field x="-2"/>.
assertXPath(pTable, "/x:pivotTableDefinition/x:colFields"_ostr, 1);
- assertXPath(pTable, "/x:pivotTableDefinition/x:colFields"_ostr, "count"_ostr, "1");
+ assertXPath(pTable, "/x:pivotTableDefinition/x:colFields"_ostr, "count"_ostr, u"1"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:colFields/x:field"_ostr, 1);
- assertXPath(pTable, "/x:pivotTableDefinition/x:colFields/x:field"_ostr, "x"_ostr, "-2");
+ assertXPath(pTable, "/x:pivotTableDefinition/x:colFields/x:field"_ostr, "x"_ostr, u"-2"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
@@ -638,18 +642,18 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
createScDoc("xlsx/pivot-table/with-strings-integers-and-dates.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pCacheDef = parseExport("xl/pivotCache/pivotCacheDefinition1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pCacheDef = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr);
CPPUNIT_ASSERT(pCacheDef);
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField"_ostr, 6);
// Four strings and one empty field
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]"_ostr,
- "name"_ostr, "mixed strings and empty");
+ "name"_ostr, u"mixed strings and empty"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:sharedItems"_ostr,
- "containsBlank"_ostr, "1");
+ "containsBlank"_ostr, u"1"_ustr);
assertXPathNoAttribute(
pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:sharedItems"_ostr,
"containsMixedTypes"_ostr);
@@ -685,14 +689,14 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
"maxValue"_ostr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:sharedItems"_ostr,
- "count"_ostr, "5");
+ "count"_ostr, u"5"_ustr);
// Two integers and one empty field
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]"_ostr,
- "name"_ostr, "mixed empty fields and integers");
+ "name"_ostr, u"mixed empty fields and integers"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
- "containsBlank"_ostr, "1");
+ "containsBlank"_ostr, u"1"_ustr);
assertXPathNoAttribute(
pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
"containsMixedTypes"_ostr);
@@ -707,7 +711,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
"containsDate"_ostr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
- "containsString"_ostr, "0");
+ "containsString"_ostr, u"0"_ustr);
assertXPathNoAttribute(
pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
"minDate"_ostr);
@@ -716,24 +720,24 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
"maxDate"_ostr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
- "containsNumber"_ostr, "1");
+ "containsNumber"_ostr, u"1"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
- "containsInteger"_ostr, "1");
+ "containsInteger"_ostr, u"1"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
- "minValue"_ostr, "111");
+ "minValue"_ostr, u"111"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
- "maxValue"_ostr, "222");
+ "maxValue"_ostr, u"222"_ustr);
// We list items on round-trip, Excel not, but Excel accepts that; We need list all items, because we are using it as reference in pivotCacheRecords1.xml
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
- "count"_ostr, "3");
+ "count"_ostr, u"3"_ustr);
// Five integers
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[3]"_ostr,
- "name"_ostr, "all fields are integers");
+ "name"_ostr, u"all fields are integers"_ustr);
assertXPathNoAttribute(
pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[3]/x:sharedItems"_ostr,
"containsBlank"_ostr);
@@ -742,7 +746,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
"containsMixedTypes"_ostr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[3]/x:sharedItems"_ostr,
- "containsSemiMixedTypes"_ostr, "0");
+ "containsSemiMixedTypes"_ostr, u"0"_ustr);
assertXPathNoAttribute(
pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[3]/x:sharedItems"_ostr,
"containsNonDate"_ostr);
@@ -751,7 +755,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
"containsDate"_ostr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[3]/x:sharedItems"_ostr,
- "containsString"_ostr, "0");
+ "containsString"_ostr, u"0"_ustr);
assertXPathNoAttribute(
pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[3]/x:sharedItems"_ostr,
"minDate"_ostr);
@@ -760,30 +764,30 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
"maxDate"_ostr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[3]/x:sharedItems"_ostr,
- "containsNumber"_ostr, "1");
+ "containsNumber"_ostr, u"1"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[3]/x:sharedItems"_ostr,
- "containsInteger"_ostr, "1");
+ "containsInteger"_ostr, u"1"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[3]/x:sharedItems"_ostr,
- "minValue"_ostr, "1111");
+ "minValue"_ostr, u"1111"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[3]/x:sharedItems"_ostr,
- "maxValue"_ostr, "5555");
+ "maxValue"_ostr, u"5555"_ustr);
// We list items on round-trip, Excel not, but Excel accepts that; We need list all items, because we are using it as reference in pivotCacheRecords1.xml
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[3]/x:sharedItems"_ostr,
- "count"_ostr, "5");
+ "count"_ostr, u"5"_ustr);
// Three integers and one string
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[4]"_ostr,
- "name"_ostr, "mixed strings and integers");
+ "name"_ostr, u"mixed strings and integers"_ustr);
assertXPathNoAttribute(
pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[4]/x:sharedItems"_ostr,
"containsBlank"_ostr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[4]/x:sharedItems"_ostr,
- "containsMixedTypes"_ostr, "1");
+ "containsMixedTypes"_ostr, u"1"_ustr);
assertXPathNoAttribute(
pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[4]/x:sharedItems"_ostr,
"containsSemiMixedTypes"_ostr);
@@ -804,24 +808,24 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
"maxDate"_ostr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[4]/x:sharedItems"_ostr,
- "containsNumber"_ostr, "1");
+ "containsNumber"_ostr, u"1"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[4]/x:sharedItems"_ostr,
- "containsInteger"_ostr, "1");
+ "containsInteger"_ostr, u"1"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[4]/x:sharedItems"_ostr,
- "minValue"_ostr, "1234");
+ "minValue"_ostr, u"1234"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[4]/x:sharedItems"_ostr,
- "maxValue"_ostr, "5678");
+ "maxValue"_ostr, u"5678"_ustr);
// We list items on round-trip, Excel not, but Excel accepts that; We need list all items, because we are using it as reference in pivotCacheRecords1.xml
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[4]/x:sharedItems"_ostr,
- "count"_ostr, "4");
+ "count"_ostr, u"4"_ustr);
// Four dates without blanks
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[5]"_ostr,
- "name"_ostr, "date and time with duplicated entries");
+ "name"_ostr, u"date and time with duplicated entries"_ustr);
assertXPathNoAttribute(
pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[5]/x:sharedItems"_ostr,
"containsBlank"_ostr);
@@ -830,22 +834,22 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
"containsMixedTypes"_ostr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[5]/x:sharedItems"_ostr,
- "containsSemiMixedTypes"_ostr, "0");
+ "containsSemiMixedTypes"_ostr, u"0"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[5]/x:sharedItems"_ostr,
- "containsNonDate"_ostr, "0");
+ "containsNonDate"_ostr, u"0"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[5]/x:sharedItems"_ostr,
- "containsDate"_ostr, "1");
+ "containsDate"_ostr, u"1"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[5]/x:sharedItems"_ostr,
- "containsString"_ostr, "0");
+ "containsString"_ostr, u"0"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[5]/x:sharedItems"_ostr,
- "minDate"_ostr, "1899-12-31T00:00:00");
+ "minDate"_ostr, u"1899-12-31T00:00:00"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[5]/x:sharedItems"_ostr,
- "maxDate"_ostr, "2009-07-06T10:53:02");
+ "maxDate"_ostr, u"2009-07-06T10:53:02"_ustr);
assertXPathNoAttribute(
pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[5]/x:sharedItems"_ostr,
"containsNumber"_ostr);
@@ -861,14 +865,14 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
// We list items on round-trip, Excel not, but Excel accepts that; We need list all items, because we are using it as reference in pivotCacheRecords1.xml
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[5]/x:sharedItems"_ostr,
- "count"_ostr, "4");
+ "count"_ostr, u"4"_ustr);
// Only blanks
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[6]"_ostr,
- "name"_ostr, "blank");
+ "name"_ostr, u"blank"_ustr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[6]/x:sharedItems"_ostr,
- "containsBlank"_ostr, "1");
+ "containsBlank"_ostr, u"1"_ustr);
assertXPathNoAttribute(
pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[6]/x:sharedItems"_ostr,
"containsMixedTypes"_ostr);
@@ -881,7 +885,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
"containsDate"_ostr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[6]/x:sharedItems"_ostr,
- "containsString"_ostr, "0");
+ "containsString"_ostr, u"0"_ustr);
assertXPathNoAttribute(
pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[6]/x:sharedItems"_ostr,
"minDate"_ostr);
@@ -902,7 +906,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX)
"maxValue"_ostr);
assertXPath(pCacheDef,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[6]/x:sharedItems"_ostr,
- "count"_ostr, "1");
+ "count"_ostr, u"1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableXLSX)
@@ -1032,7 +1036,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableXLSX)
bool bCheck = aTest.check(*pDoc);
CPPUNIT_ASSERT_MESSAGE("Initial check failed.", bCheck);
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
// Reload check.
@@ -1151,7 +1155,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableTwoDataFieldsXLSX)
bool bCheck = aTest.check(*pDoc);
CPPUNIT_ASSERT_MESSAGE("Initial check failed.", bCheck);
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
// Reload check.
@@ -1164,7 +1168,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableMedianODS)
createScDoc("ods/pivot-table-median.ods");
// Export the document and import again for a check
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Check sheet
ScDocument* pDoc = getScDoc();
@@ -1227,7 +1231,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowHeaderXLS)
}
// Check also after a reload
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDoc = getScDoc();
// There should be exactly 2 pivot tables
@@ -1267,7 +1271,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDoubleFieldFilter)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pDPs->GetCount());
// Reload and check filtering of row dimensions
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pDPs->GetCount());
@@ -1365,7 +1369,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableStringFieldFilter)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
// Reload and check filtering of row dimensions
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -1379,11 +1383,11 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableStringFieldFilter)
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(2), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("United Kingdom");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"United Kingdom"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("United States");
+ pMember = pSaveDim->GetExistingMemberByName(u"United States"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
@@ -1397,7 +1401,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDateFieldFilter)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
// Reload and check filtering of row dimensions
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -1484,7 +1488,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableBoolFieldFilter)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
// Reload and check filtering of row dimensions
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -1498,11 +1502,11 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableBoolFieldFilter)
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(2), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("0");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"0"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("1");
+ pMember = pSaveDim->GetExistingMemberByName(u"1"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
@@ -1516,7 +1520,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowColPageFieldFilte
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
// Reload and check filtering of row dimensions
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -1533,15 +1537,15 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowColPageFieldFilte
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(3), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("1");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"1"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("2");
+ pMember = pSaveDim->GetExistingMemberByName(u"2"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("3");
+ pMember = pSaveDim->GetExistingMemberByName(u"3"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
@@ -1555,15 +1559,15 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowColPageFieldFilte
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(3), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("2");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"2"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("3");
+ pMember = pSaveDim->GetExistingMemberByName(u"3"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("4");
+ pMember = pSaveDim->GetExistingMemberByName(u"4"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
@@ -1577,15 +1581,15 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowColPageFieldFilte
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(3), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("5");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"5"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("6");
+ pMember = pSaveDim->GetExistingMemberByName(u"6"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("7");
+ pMember = pSaveDim->GetExistingMemberByName(u"7"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
@@ -1599,15 +1603,15 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowColPageFieldFilte
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(3), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("8");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"8"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("9");
+ pMember = pSaveDim->GetExistingMemberByName(u"9"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("10");
+ pMember = pSaveDim->GetExistingMemberByName(u"10"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
@@ -1622,7 +1626,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableEmptyItem)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
// Reload and check filtering of row dimensions
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -1636,15 +1640,15 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableEmptyItem)
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(3), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("Fruit");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"Fruit"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("Vegetables");
+ pMember = pSaveDim->GetExistingMemberByName(u"Vegetables"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("");
+ pMember = pSaveDim->GetExistingMemberByName(u""_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
@@ -1658,7 +1662,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTablePageFieldFilter)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
// Reload and check filtering of row dimensions
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -1673,15 +1677,15 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTablePageFieldFilter)
CPPUNIT_ASSERT(pSaveDim);
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(3), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("Banana");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"Banana"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("Carrots");
+ pMember = pSaveDim->GetExistingMemberByName(u"Carrots"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("");
+ pMember = pSaveDim->GetExistingMemberByName(u""_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
@@ -1694,15 +1698,15 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTablePageFieldFilter)
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(3), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("Vegetables");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"Vegetables"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("Fruit");
+ pMember = pSaveDim->GetExistingMemberByName(u"Fruit"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("");
+ pMember = pSaveDim->GetExistingMemberByName(u""_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
@@ -1715,15 +1719,15 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTablePageFieldFilter)
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(3), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("1");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"1"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("2");
+ pMember = pSaveDim->GetExistingMemberByName(u"2"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("3");
+ pMember = pSaveDim->GetExistingMemberByName(u"3"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
@@ -1736,15 +1740,15 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTablePageFieldFilter)
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(3), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("United States");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"United States"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("United Kingdom");
+ pMember = pSaveDim->GetExistingMemberByName(u"United Kingdom"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("");
+ pMember = pSaveDim->GetExistingMemberByName(u""_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
@@ -1757,18 +1761,21 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableFirstHeaderRowXLSX)
// The documentation is not clear about what firstHeaderRow actually means, but MS Excel works on this way
createScDoc("xlsx/pivot_table_first_header_row.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable = parseExport("xl/pivotTables/pivotTable1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
- assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstHeaderRow"_ostr, "1");
+ assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstHeaderRow"_ostr,
+ u"1"_ustr);
- pTable = parseExport("xl/pivotTables/pivotTable2.xml");
+ pTable = parseExport(u"xl/pivotTables/pivotTable2.xml"_ustr);
CPPUNIT_ASSERT(pTable);
- assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstHeaderRow"_ostr, "1");
+ assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstHeaderRow"_ostr,
+ u"1"_ustr);
- pTable = parseExport("xl/pivotTables/pivotTable3.xml");
+ pTable = parseExport(u"xl/pivotTables/pivotTable3.xml"_ustr);
CPPUNIT_ASSERT(pTable);
- assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstHeaderRow"_ostr, "1");
+ assertXPath(pTable, "/x:pivotTableDefinition/x:location"_ostr, "firstHeaderRow"_ostr,
+ u"1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDoubleFieldFilterXLSX)
@@ -1779,7 +1786,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDoubleFieldFilterXLS
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pDPs->GetCount());
// Reload and check filtering of row dimensions
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pDPs->GetCount());
@@ -1877,7 +1884,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableStringFieldFilterXLS
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
// Reload and check filtering of row dimensions
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -1891,11 +1898,11 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableStringFieldFilterXLS
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(2), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("United Kingdom");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"United Kingdom"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("United States");
+ pMember = pSaveDim->GetExistingMemberByName(u"United States"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
@@ -1909,7 +1916,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDateFieldFilterXLSX)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
// Reload and check filtering of row dimensions
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -1979,10 +1986,10 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableBoolFieldFilterXLSX)
ScDocument* pDoc = getScDoc();
ScDPCollection* pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
- CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), pDoc->GetString(ScAddress(0, 1, 0))); //A2
+ CPPUNIT_ASSERT_EQUAL(u"TRUE"_ustr, pDoc->GetString(ScAddress(0, 1, 0))); //A2
// Reload and check filtering of row dimensions
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -1996,11 +2003,11 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableBoolFieldFilterXLSX)
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(2), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("FALSE");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"FALSE"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("TRUE");
+ pMember = pSaveDim->GetExistingMemberByName(u"TRUE"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
@@ -2014,7 +2021,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowColPageFieldFilte
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
// Reload and check filtering of row dimensions
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -2031,15 +2038,15 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowColPageFieldFilte
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(3), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("1");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"1"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("2");
+ pMember = pSaveDim->GetExistingMemberByName(u"2"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("3");
+ pMember = pSaveDim->GetExistingMemberByName(u"3"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
@@ -2053,15 +2060,15 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowColPageFieldFilte
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(3), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("2");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"2"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("3");
+ pMember = pSaveDim->GetExistingMemberByName(u"3"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("4");
+ pMember = pSaveDim->GetExistingMemberByName(u"4"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
@@ -2075,15 +2082,15 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowColPageFieldFilte
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(3), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("5");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"5"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("6");
+ pMember = pSaveDim->GetExistingMemberByName(u"6"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
- pMember = pSaveDim->GetExistingMemberByName("7");
+ pMember = pSaveDim->GetExistingMemberByName(u"7"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(pMember->GetIsVisible());
@@ -2118,7 +2125,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableErrorItemFilterXLSX)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
// Reload and check whether filtering is preserved
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -2131,7 +2138,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableErrorItemFilterXLSX)
CPPUNIT_ASSERT(pSaveDim);
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(4), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("#DIV/0!");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"#DIV/0!"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
@@ -2152,7 +2159,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableErrorItemFilterXLSB)
CPPUNIT_ASSERT(pSaveDim);
const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
CPPUNIT_ASSERT_EQUAL(size_t(4), rMembers.size());
- ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("#DIV/0!");
+ ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName(u"#DIV/0!"_ustr);
CPPUNIT_ASSERT(pMember);
CPPUNIT_ASSERT(pMember->HasIsVisible());
CPPUNIT_ASSERT(!pMember->GetIsVisible());
@@ -2166,7 +2173,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableErrorItem2FilterXLSX
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
// Reload and check whether filtering is preserved
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -2186,74 +2193,74 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableOutlineModeXLSX)
{
createScDoc("xlsx/pivottable_outline_mode.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable = parseExport("xl/pivotTables/pivotTable1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
// Next to the outline flags, compact flags also should be set (true is the default)
- assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "outline"_ostr, "1");
- assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "outlineData"_ostr, "1");
- assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "compact"_ostr, "0");
- assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "compactData"_ostr, "0");
+ assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "outline"_ostr, u"1"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "outlineData"_ostr, u"1"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "compact"_ostr, u"0"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "compactData"_ostr, u"0"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]"_ostr,
- "compact"_ostr, "0");
+ "compact"_ostr, u"0"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDuplicatedMemberFilterXLSX)
{
createScDoc("xlsx/pivottable_duplicated_member_filter.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable = parseExport("xl/pivotTables/pivotTable1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
// Check whether page field has the right number of items
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[5]"_ostr, "axis"_ostr,
- "axisPage");
+ u"axisPage"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[5]/x:items"_ostr,
- "count"_ostr, "21");
+ "count"_ostr, u"21"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableTabularModeXLSX)
{
createScDoc("xlsx/pivottable_tabular_mode.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable = parseExport("xl/pivotTables/pivotTable1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
// In tabular mode both outline and compact flag should be false
- assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "outline"_ostr, "0");
- assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "outlineData"_ostr, "0");
- assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "compact"_ostr, "0");
- assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "compactData"_ostr, "0");
+ assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "outline"_ostr, u"0"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "outlineData"_ostr, u"0"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "compact"_ostr, u"0"_ustr);
+ assertXPath(pTable, "/x:pivotTableDefinition"_ostr, "compactData"_ostr, u"0"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]"_ostr,
- "compact"_ostr, "0");
+ "compact"_ostr, u"0"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]"_ostr,
- "outline"_ostr, "0");
+ "outline"_ostr, u"0"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDuplicateFields)
{
createScDoc("ods/caseinsensitive-duplicate-fields.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pCacheDef = parseExport("xl/pivotCache/pivotCacheDefinition1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pCacheDef = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr);
CPPUNIT_ASSERT(pCacheDef);
- assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields"_ostr, "count"_ostr, "6");
+ assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields"_ostr, "count"_ostr, u"6"_ustr);
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]"_ostr,
- "name"_ostr, "ID");
+ "name"_ostr, u"ID"_ustr);
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]"_ostr,
- "name"_ostr, "Name");
+ "name"_ostr, u"Name"_ustr);
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[3]"_ostr,
- "name"_ostr, "Score");
+ "name"_ostr, u"Score"_ustr);
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[4]"_ostr,
- "name"_ostr, "Method");
+ "name"_ostr, u"Method"_ustr);
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[5]"_ostr,
- "name"_ostr, "method2");
+ "name"_ostr, u"method2"_ustr);
assertXPath(pCacheDef, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[6]"_ostr,
- "name"_ostr, "Method3");
+ "name"_ostr, u"Method3"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf112106)
@@ -2264,7 +2271,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf112106)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
// Reload and check data layout dim
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDoc = getScDoc();
pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount());
@@ -2287,13 +2294,13 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf123923)
createScDoc("ods/pivot-table-err-in-cache.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable = parseExport("xl/pivotCache/pivotCacheDefinition1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
assertXPath(pTable,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:sharedItems/x:e"_ostr,
- "v"_ostr, "#REF!");
+ "v"_ostr, u"#REF!"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf123939)
@@ -2302,8 +2309,8 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf123939)
createScDoc("ods/pivot-table-str-and-err-in-data.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable = parseExport("xl/pivotCache/pivotCacheDefinition1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
assertXPathNoAttribute(
@@ -2312,47 +2319,47 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf123939)
// But we must emit containsMixedTypes="1" for a mix of errors and non-string types!
- pTable = parseExport("xl/pivotCache/pivotCacheDefinition2.xml");
+ pTable = parseExport(u"xl/pivotCache/pivotCacheDefinition2.xml"_ustr);
CPPUNIT_ASSERT(pTable);
assertXPath(pTable, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:sharedItems"_ostr,
- "containsMixedTypes"_ostr, "1");
+ "containsMixedTypes"_ostr, u"1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124651)
{
createScDoc("ods/tdf124651_simplePivotTable.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/pivotTables/pivotTable1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
// We have to export name attribute, even though it's optional according to ECMA-376 standard,
// because Excel (at least 2016) seems to require it.
// tdf#124881: this shouldn't be an empty string
assertXPath(pDoc, "/x:pivotTableDefinition/x:dataFields/x:dataField"_ostr, "name"_ostr,
- "Sum - num");
+ u"Sum - num"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124736)
{
createScDoc("xlsx/pivot-table/shared-dategroup.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pTable = parseExport("xl/pivotCache/pivotCacheDefinition1.xml");
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
assertXPath(
pTable,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:fieldGroup/x:groupItems"_ostr,
- "count"_ostr, "45");
+ "count"_ostr, u"45"_ustr);
// Group items must start with "<05/16/1958", then years sorted ascending, then ">06/11/2009"
// They used to have years in the beginning, then "<05/16/1958", then ">06/11/2009".
// The "<" and ">" date strings are locale-dependent, so test depends on en_US locale
assertXPath(
pTable,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:fieldGroup/x:groupItems/x:s[1]"_ostr,
- "v"_ostr, "<05/16/1958");
+ "v"_ostr, u"<05/16/1958"_ustr);
for (int i = 2; i <= 44; ++i)
assertXPath(
pTable,
@@ -2362,14 +2369,14 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124736)
assertXPath(
pTable,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:fieldGroup/x:groupItems/x:s[45]"_ostr,
- "v"_ostr, ">06/11/2009");
+ "v"_ostr, u">06/11/2009"_ustr);
// Now check that table references these in correct order (document-dependent, so this is how
// it should be in this specific testdoc which shows "<" and ">" values in the end)
- pTable = parseExport("xl/pivotTables/pivotTable1.xml");
+ pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]/x:items"_ostr,
- "count"_ostr, "46");
+ "count"_ostr, u"46"_ustr);
const int vals[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 0, 44 };
@@ -2382,28 +2389,28 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124736)
}
assertXPath(pTable,
"/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]/x:items/x:item[46]"_ostr,
- "t"_ostr, "default");
+ "t"_ostr, u"default"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124772NumFmt)
{
createScDoc("ods/pivot-table-num-fmt.ods");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pTable = parseExport("xl/pivotTables/pivotTable1.xml");
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
// This asserts that numFmtId attribute is present
const OUString sXclNumFmt = getXPath(
pTable, "/x:pivotTableDefinition/x:dataFields/x:dataField"_ostr, "numFmtId"_ostr);
- pTable = parseExport("xl/styles.xml");
+ pTable = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pTable);
// Check that we refer to correct format
assertXPath(pTable, "/x:styleSheet/x:numFmts/x:numFmt[@numFmtId='" + sXclNumFmt.toUtf8() + "']",
- "formatCode"_ostr, "\\$#,##0");
+ "formatCode"_ostr, u"\\$#,##0"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124810)
@@ -2412,23 +2419,23 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124810)
// First, test that we roundtrip existing pivot table style information from XLSX.
createScDoc("xlsx/pivot_dark1.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable = parseExport("xl/pivotTables/pivotTable1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
// All attributes must have been roundtripped correctly (testdoc uses some non-default values)
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo"_ostr, "name"_ostr,
- "PivotStyleDark1");
+ u"PivotStyleDark1"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo"_ostr,
- "showRowHeaders"_ostr, "1");
+ "showRowHeaders"_ostr, u"1"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo"_ostr,
- "showColHeaders"_ostr, "1");
+ "showColHeaders"_ostr, u"1"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo"_ostr,
- "showRowStripes"_ostr, "1");
+ "showRowStripes"_ostr, u"1"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo"_ostr,
- "showColStripes"_ostr, "0");
+ "showColStripes"_ostr, u"0"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo"_ostr,
- "showLastColumn"_ostr, "0");
+ "showLastColumn"_ostr, u"0"_ustr);
}
{
@@ -2437,23 +2444,23 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124810)
// exporting better pivot table style information.
createScDoc("ods/tdf124651_simplePivotTable.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable = parseExport("xl/pivotTables/pivotTable1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
// The default style for pivot tables in Excel 2007 through 2016 is PivotStyleLight16
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo"_ostr, "name"_ostr,
- "PivotStyleLight16");
+ u"PivotStyleLight16"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo"_ostr,
- "showRowHeaders"_ostr, "1");
+ "showRowHeaders"_ostr, u"1"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo"_ostr,
- "showColHeaders"_ostr, "1");
+ "showColHeaders"_ostr, u"1"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo"_ostr,
- "showRowStripes"_ostr, "0");
+ "showRowStripes"_ostr, u"0"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo"_ostr,
- "showColStripes"_ostr, "0");
+ "showColStripes"_ostr, u"0"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo"_ostr,
- "showLastColumn"_ostr, "1");
+ "showLastColumn"_ostr, u"1"_ustr);
}
}
@@ -2461,34 +2468,34 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124883)
{
createScDoc("xlsx/pivot-table/two-data-fields.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable = parseExport("xl/pivotTables/pivotTable1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pTable);
// The field names must be kept just as they appear in original XLSX
assertXPath(pTable, "/x:pivotTableDefinition/x:dataFields/x:dataField[1]"_ostr, "name"_ostr,
- "Sum of Value");
+ u"Sum of Value"_ustr);
assertXPath(pTable, "/x:pivotTableDefinition/x:dataFields/x:dataField[2]"_ostr, "name"_ostr,
- "Count of Value2");
+ u"Count of Value2"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf125046)
{
createScDoc("xlsx/pivottable_long_text.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/pivotCache/pivotCacheDefinition1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
- "longText"_ostr, "1");
+ "longText"_ostr, u"1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf125055)
{
createScDoc("xlsx/pivottable_1s_difference.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/pivotCache/pivotCacheDefinition1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
// 1-second precision should not result in duplicated entries for values different by ~1 s.
@@ -2499,24 +2506,24 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf125055)
OUString sISODateTime
= getXPath(pDoc, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
"minDate"_ostr);
- CPPUNIT_ASSERT_EQUAL(OUString("T09:11:02"), sISODateTime.copy(10));
+ CPPUNIT_ASSERT_EQUAL(u"T09:11:02"_ustr, sISODateTime.copy(10));
sISODateTime
= getXPath(pDoc, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
"maxDate"_ostr);
- CPPUNIT_ASSERT_EQUAL(OUString("T09:11:03"), sISODateTime.copy(10));
+ CPPUNIT_ASSERT_EQUAL(u"T09:11:03"_ustr, sISODateTime.copy(10));
assertXPath(pDoc, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
- "count"_ostr, "3");
+ "count"_ostr, u"3"_ustr);
assertXPathChildren(pDoc,
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems"_ostr,
3); // 2 different values + empty
sISODateTime = getXPath(
pDoc, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems/x:d[1]"_ostr,
"v"_ostr);
- CPPUNIT_ASSERT_EQUAL(OUString("T09:11:02"), sISODateTime.copy(10));
+ CPPUNIT_ASSERT_EQUAL(u"T09:11:02"_ustr, sISODateTime.copy(10));
sISODateTime = getXPath(
pDoc, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems/x:d[2]"_ostr,
"v"_ostr);
- CPPUNIT_ASSERT_EQUAL(OUString("T09:11:03"), sISODateTime.copy(10));
+ CPPUNIT_ASSERT_EQUAL(u"T09:11:03"_ustr, sISODateTime.copy(10));
// Trailing empty
CPPUNIT_ASSERT_EQUAL(
2,
@@ -2528,14 +2535,14 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf125086)
{
createScDoc("ods/pivottable_fieldInRowsAndData.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/pivotTables/pivotTable1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[2]"_ostr, "axis"_ostr,
- "axisRow");
+ u"axisRow"_ustr);
// "dataField" attribute was not written for this "axisRow" field
assertXPath(pDoc, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[2]"_ostr,
- "dataField"_ostr, "1");
+ "dataField"_ostr, u"1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf73845)
@@ -2588,7 +2595,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableCompactLayoutXLSX)
CPPUNIT_ASSERT_MESSAGE("The show expand/collapse buttons option must be true",
pSaveData->GetExpandCollapse());
- CPPUNIT_ASSERT_EQUAL(OUString("Row Labels"), rDoc.GetString(ScAddress(10, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Row Labels"_ustr, rDoc.GetString(ScAddress(10, 1, 0)));
// Check some row fields
struct RowFieldLabel
@@ -2600,17 +2607,17 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableCompactLayoutXLSX)
constexpr int nCases = 6;
const RowFieldLabel aCases[nCases] = {
- { "aaa", ScAddress(10, 2, 0), true },
+ { u"aaa"_ustr, ScAddress(10, 2, 0), true },
- { "bbb", ScAddress(10, 3, 0), true },
+ { u"bbb"_ustr, ScAddress(10, 3, 0), true },
- { "ccc", ScAddress(10, 4, 0), true },
+ { u"ccc"_ustr, ScAddress(10, 4, 0), true },
- { "aax", ScAddress(10, 10, 0), true },
+ { u"aax"_ustr, ScAddress(10, 10, 0), true },
- { "bbx", ScAddress(10, 14, 0), true },
+ { u"bbx"_ustr, ScAddress(10, 14, 0), true },
- { "ccc", ScAddress(10, 15, 0), true },
+ { u"ccc"_ustr, ScAddress(10, 15, 0), true },
};
for (int nCaseNum = 0; nCaseNum < nCases; ++nCaseNum)
@@ -2630,17 +2637,17 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableCompactLayoutXLSX)
}
// check col fields
- CPPUNIT_ASSERT_EQUAL(OUString("ddd"), rDoc.GetString(ScAddress(11, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("ddx"), rDoc.GetString(ScAddress(12, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"ddd"_ustr, rDoc.GetString(ScAddress(11, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"ddx"_ustr, rDoc.GetString(ScAddress(12, 1, 0)));
};
createScDoc("xlsx/pivot-table/pivotcompact.xlsx");
testThis(*getScDoc());
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
testThis(*getScDoc());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
testThis(*getScDoc());
}
@@ -2679,14 +2686,14 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest,
CPPUNIT_ASSERT(pSaveDimK);
// Check the headers
- CPPUNIT_ASSERT_EQUAL(OUString("K"), rDocument.GetString(ScAddress(0, 2, 0))); // A3
- CPPUNIT_ASSERT_EQUAL(OUString("Sum of A"), rDocument.GetString(ScAddress(1, 2, 0))); //B3
+ CPPUNIT_ASSERT_EQUAL(u"K"_ustr, rDocument.GetString(ScAddress(0, 2, 0))); // A3
+ CPPUNIT_ASSERT_EQUAL(u"Sum of A"_ustr, rDocument.GetString(ScAddress(1, 2, 0))); //B3
// Check the values
- CPPUNIT_ASSERT_EQUAL(OUString("1"), rDocument.GetString(ScAddress(0, 3, 0))); //A4
- CPPUNIT_ASSERT_EQUAL(OUString("2"), rDocument.GetString(ScAddress(0, 4, 0))); //A5
- CPPUNIT_ASSERT_EQUAL(OUString("5"), rDocument.GetString(ScAddress(1, 3, 0))); //B4
- CPPUNIT_ASSERT_EQUAL(OUString("5"), rDocument.GetString(ScAddress(1, 4, 0))); //B5
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, rDocument.GetString(ScAddress(0, 3, 0))); //A4
+ CPPUNIT_ASSERT_EQUAL(u"2"_ustr, rDocument.GetString(ScAddress(0, 4, 0))); //A5
+ CPPUNIT_ASSERT_EQUAL(u"5"_ustr, rDocument.GetString(ScAddress(1, 3, 0))); //B4
+ CPPUNIT_ASSERT_EQUAL(u"5"_ustr, rDocument.GetString(ScAddress(1, 4, 0))); //B5
};
// test document with sheet data and pivot table in sync
diff --git a/sc/qa/unit/screenshots/screenshots.cxx b/sc/qa/unit/screenshots/screenshots.cxx
index 006556904f88..0b0edfbd7343 100644
--- a/sc/qa/unit/screenshots/screenshots.cxx
+++ b/sc/qa/unit/screenshots/screenshots.cxx
@@ -74,7 +74,7 @@ ScScreenshotTest::ScScreenshotTest()
mxDocSh(),
mpViewShell(nullptr),
mpFact(nullptr),
- mCsv("some, strings, here, separated, by, commas"),
+ mCsv(u"some, strings, here, separated, by, commas"_ustr),
mpStream(),
mpItemSet()
{
@@ -85,7 +85,7 @@ void ScScreenshotTest::initialize()
if (mxComponent.is())
mxComponent->dispose();
// use new, empty doc to avoid file locking
- mxComponent = loadFromDesktop("private:factory/scalc", "com.sun.star.sheet.SpreadsheetDocument");
+ mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr, u"com.sun.star.sheet.SpreadsheetDocument"_ustr);
mpFoundShell = SfxObjectShell::GetShellFromComponent(mxComponent);
CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", mpFoundShell);
@@ -195,7 +195,7 @@ VclPtr<VclAbstractDialog> ScScreenshotTest::createDialogByID(sal_uInt32 nID)
{
pReturnDialog = mpFact->CreateScStringInputDlg(mpViewShell->GetFrameWeld(),
ScResId(SCSTR_APDTABLE), ScResId(SCSTR_NAME),
- aDefaultSheetName, "modules/scalc/ui/inputstringdialog/InputStringDialog", "" );
+ aDefaultSheetName, u"modules/scalc/ui/inputstringdialog/InputStringDialog"_ustr, u""_ustr );
break;
}
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index d434084519f3..294c5590843f 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -36,7 +36,7 @@ class ScShapeTest : public ScModelTestBase
{
public:
ScShapeTest()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
};
@@ -95,7 +95,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf144242_OpenBezier_noSwapWH)
tools::Rectangle aExpectRect(pObj->GetSnapRect());
// Save, reload and compare
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
pObj = lcl_getSdrObjectWithAssert(*pDoc, 0);
tools::Rectangle aSnapRect(pObj->GetSnapRect());
@@ -128,7 +128,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf144242_Line_noSwapWH)
tools::Rectangle aExpectRect(pObj->GetSnapRect());
// Save, reload and compare
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
pObj = lcl_getSdrObjectWithAssert(*pDoc, 0);
tools::Rectangle aSnapRect(pObj->GetSnapRect());
@@ -149,10 +149,10 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf143619_validation_circle_pos)
// Error was, that deleting row and col before E6 does not move circle to D5, but to B3.
// Delete first row and first column.
- goToCell("$A$1");
- dispatchCommand(mxComponent, ".uno:DeleteRows", {});
- goToCell("$A$1");
- dispatchCommand(mxComponent, ".uno:DeleteColumns", {});
+ goToCell(u"$A$1"_ustr);
+ dispatchCommand(mxComponent, u".uno:DeleteRows"_ustr, {});
+ goToCell(u"$A$1"_ustr);
+ dispatchCommand(mxComponent, u".uno:DeleteColumns"_ustr, {});
// Without fix in place the position was (2007, 833)
Point aPos = pObj->GetSnapRect().TopLeft();
@@ -218,9 +218,9 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf134355_DragCreateCustomShape)
// drag-create custom shape
uno::Sequence<beans::PropertyValue> aPropertyValues = {
- comphelper::makePropertyValue("SymbolShapes", OUString("smiley")),
+ comphelper::makePropertyValue(u"SymbolShapes"_ustr, u"smiley"_ustr),
};
- dispatchCommand(mxComponent, ".uno:SymbolShapes", aPropertyValues);
+ dispatchCommand(mxComponent, u".uno:SymbolShapes"_ustr, aPropertyValues);
// above includes creation of FuConstCustomShape and call of its Activate() method
FuConstCustomShape* pFuConstCS = static_cast<FuConstCustomShape*>(pTabView->GetDrawFuncPtr());
CPPUNIT_ASSERT(pFuConstCS);
@@ -326,7 +326,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137082_RTL_cell_anchored)
CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectB, pObj->GetSnapRect(), 1);
// Save and reload.
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Get document
pDoc = getScDoc();
@@ -375,7 +375,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137081_RTL_page_anchored)
CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aTopLeft, pObjCS->GetLogicRect().TopLeft(), 1);
// Save and reload.
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Get document
pDoc = getScDoc();
@@ -420,7 +420,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf139583_Rotate180deg)
pObj.clear();
// Save and reload.
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Get document and object
pDoc = getScDoc();
@@ -447,7 +447,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137033_FlipHori_Resize)
ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *pDoc, 0 /*SCTAB*/, true /*bResizeWithCell*/);
// Save and reload.
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Get document and shape
pDoc = getScDoc();
@@ -493,7 +493,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137033_RotShear_ResizeHide)
CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectRect, aSnapRect, 1);
// Save and reload.
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Get document and shape
pDoc = getScDoc();
@@ -527,7 +527,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137033_RotShear_Hide)
pDoc->SetDrawPageSize(0); // trigger recalcpos, otherwise shapes are not changed
// Save and reload.
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Get document and shape
pDoc = getScDoc();
@@ -567,15 +567,15 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137576_LogicRectInDefaultMeasureline)
pTabViewShell->SetDrawShell(false);
// Hide column A.
- goToCell("$A$1");
- dispatchCommand(mxComponent, ".uno:HideColumn", {});
+ goToCell(u"$A$1"_ustr);
+ dispatchCommand(mxComponent, u".uno:HideColumn"_ustr, {});
// Get current position. I will not use absolute values for comparison, because document is loaded
// in full screen mode of unknown size and default object is placed in center of window.
Point aOldPos = pObj->GetRelativePos();
// Save and reload, get ScDocShell
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Get document and object
pDoc = getScDoc();
@@ -647,7 +647,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testMeasurelineHideColSave)
CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aEndPoint, pObj->GetPoint(1), 1);
// save and reload
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Get document and shape
pDoc = getScDoc();
@@ -674,7 +674,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testHideColsShow)
tools::Rectangle aSnapRectOrig(pObj->GetSnapRect());
// Hide cols C and D.
- goToCell("$C$1:$D$1");
+ goToCell(u"$C$1:$D$1"_ustr);
ScTabViewShell* pViewShell = getViewShell();
pViewShell->GetViewData().GetDispatcher().Execute(FID_COL_HIDE);
@@ -683,7 +683,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testHideColsShow)
CPPUNIT_ASSERT_MESSAGE("Hide: Object should be invisible", !pObj->IsVisible());
// Show cols C and D
- goToCell("$C$1:$D$1");
+ goToCell(u"$C$1:$D$1"_ustr);
pViewShell->GetViewData().GetDispatcher().Execute(FID_COL_SHOW);
// Check object is visible and has old size
@@ -717,7 +717,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testFormSizeWithHiddenCol)
+ OUString::number(pData->maStart.Row()) + " end col "
+ OUString::number(pData->maEnd.Col()) + " row "
+ OUString::number(pData->maEnd.Row()));
- CPPUNIT_ASSERT_EQUAL(OUString("start col 1 row 4 end col 3 row 4"), sActual);
+ CPPUNIT_ASSERT_EQUAL(u"start col 1 row 4 end col 3 row 4"_ustr, sActual);
}
CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf138138_MoveCellWithRotatedShape)
@@ -736,7 +736,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf138138_MoveCellWithRotatedShape)
CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectedRect, aSnapRect, 1);
// Insert two columns after column B
- goToCell("$A$1:$B$1");
+ goToCell(u"$A$1:$B$1"_ustr);
ScTabViewShell* pViewShell = getViewShell();
pViewShell->GetViewData().GetDispatcher().Execute(FID_INS_COLUMNS_AFTER);
@@ -745,7 +745,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf138138_MoveCellWithRotatedShape)
CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectedRect, aSnapRect, 1);
// Save and reload
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Get document and shape
pDoc = getScDoc();
@@ -797,7 +797,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf117948_CollapseBeforeShape)
CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectedRect1, aSnapRect1Collapse, 1);
// Save and reload
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Get document and objects
pDoc = getScDoc();
@@ -829,7 +829,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137355_UndoHideRows)
// Hide rows 3 to 6 in UI. [Note: Simple pDoc->SetRowHidden(2,5,0,true) does not work, because it
// does not produce the needed undo items.]
- goToCell("$A$3:$A$6");
+ goToCell(u"$A$3:$A$6"_ustr);
ScTabViewShell* pViewShell = getViewShell();
pViewShell->GetViewData().GetDispatcher().Execute(FID_ROW_HIDE);
@@ -857,7 +857,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf152081_UndoHideColsWithNotes)
CPPUNIT_ASSERT_MESSAGE("Load: Note object should be visible", pObj->IsVisible());
// Hide B column
- goToCell("$B$2:$B$2");
+ goToCell(u"$B$2:$B$2"_ustr);
ScTabViewShell* pViewShell = getViewShell();
pViewShell->GetViewData().GetDispatcher().Execute(FID_COL_HIDE);
@@ -895,7 +895,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf115655_HideDetail)
CPPUNIT_ASSERT_MESSAGE("Collapse: Image should not be visible", !pObj->IsVisible());
// Save and reload
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Get document and image
pDoc = getScDoc();
@@ -968,7 +968,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testCustomShapeCellAnchoredRotatedShape)
+ OUString::number(pData->maStart.Row()) + " end col "
+ OUString::number(pData->maEnd.Col()) + " row "
+ OUString::number(pData->maEnd.Row()));
- CPPUNIT_ASSERT_EQUAL(OUString("start col 1 row 1 end col 2 row 8"), sActual);
+ CPPUNIT_ASSERT_EQUAL(u"start col 1 row 1 end col 2 row 8"_ustr, sActual);
}
CPPUNIT_TEST_FIXTURE(ScShapeTest, testLargeAnchorOffset)
@@ -985,7 +985,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testLargeAnchorOffset)
// Just to check that it imports correctly
CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(9504, 9089), aOldPos, 1);
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
pObj = lcl_getSdrObjectWithAssert(*pDoc, 0);
@@ -1009,12 +1009,12 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf139083_copy_without_resize)
ScDocument* pDoc = getScDoc();
// Copy cells B2:B3. They have row height 2cm and column width 3cm.
- goToCell("$B$2:$B$3");
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ goToCell(u"$B$2:$B$3"_ustr);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// Paste to D5. There are row height 0.5cm and column width 1cm.
- goToCell("$D$5");
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ goToCell(u"$D$5"_ustr);
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
// Make sure original and pasted shape have the same size.
// Size of original shape is 2001x3002, without fix size of pasted shape was 668x750.
@@ -1035,10 +1035,10 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf155093_double_names)
ScDocument* pDoc = getScDoc();
// Copy and paste
- goToCell("$B$6:$C$14");
- dispatchCommand(mxComponent, ".uno:Copy", {});
- goToCell("$D$16");
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ goToCell(u"$B$6:$C$14"_ustr);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+ goToCell(u"$D$16"_ustr);
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
// Make sure original and pasted shape have different names.
SdrObject* pObjOrig = lcl_getSdrObjectWithAssert(*pDoc, 0); // original shape
@@ -1056,10 +1056,10 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf155095_shape_collapsed_group)
ScDocument* pDoc = getScDoc();
// Copy and paste
- goToCell("$B$5:$C$19");
- dispatchCommand(mxComponent, ".uno:Copy", {});
- goToCell("$B$22");
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ goToCell(u"$B$5:$C$19"_ustr);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+ goToCell(u"$B$22"_ustr);
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
// Make sure the shape has the correct size and spans C26:C33
SdrObject* pObj = lcl_getSdrObjectWithAssert(*pDoc, 1); // pasted shape
@@ -1089,17 +1089,17 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf155094_paste_transposed)
ScDocument* pDoc = getScDoc();
// Copy and paste
- goToCell("$C$3:$E$5");
- dispatchCommand(mxComponent, ".uno:Copy", {});
- goToCell("$K$6");
+ goToCell(u"$C$3:$E$5"_ustr);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+ goToCell(u"$K$6"_ustr);
uno::Sequence<beans::PropertyValue> aPropertyValues
- = { comphelper::makePropertyValue("Flags", OUString("A")),
- comphelper::makePropertyValue("FormulaCommand", sal_uInt16(0)),
- comphelper::makePropertyValue("SkipEmptyCells", false),
- comphelper::makePropertyValue("Transpose", true),
- comphelper::makePropertyValue("AsLink", false),
- comphelper::makePropertyValue("MoveMode", sal_uInt16(4)) };
- dispatchCommand(mxComponent, ".uno:InsertContents", aPropertyValues);
+ = { comphelper::makePropertyValue(u"Flags"_ustr, u"A"_ustr),
+ comphelper::makePropertyValue(u"FormulaCommand"_ustr, sal_uInt16(0)),
+ comphelper::makePropertyValue(u"SkipEmptyCells"_ustr, false),
+ comphelper::makePropertyValue(u"Transpose"_ustr, true),
+ comphelper::makePropertyValue(u"AsLink"_ustr, false),
+ comphelper::makePropertyValue(u"MoveMode"_ustr, sal_uInt16(4)) };
+ dispatchCommand(mxComponent, u".uno:InsertContents"_ustr, aPropertyValues);
// Without fix there had been only 5 object.
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
@@ -1131,10 +1131,10 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf155091_paste_duplicates)
ScDocument* pDoc = getScDoc();
// Copy and paste
- goToCell("$B$5:$C$19");
- dispatchCommand(mxComponent, ".uno:Copy", {});
- goToCell("$B$23");
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ goToCell(u"$B$5:$C$19"_ustr);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+ goToCell(u"$B$23"_ustr);
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
// Make sure there is no third object but only original and pasted one.
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
@@ -1153,10 +1153,10 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf125938_anchor_after_copy_paste)
ScDocument* pDoc = getScDoc();
// Copy and paste
- goToCell("$Sheet1.$A$3:$C$3");
- dispatchCommand(mxComponent, ".uno:Copy", {});
- goToCell("$Sheet2.$D$9");
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ goToCell(u"$Sheet1.$A$3:$C$3"_ustr);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+ goToCell(u"$Sheet2.$D$9"_ustr);
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
// Get pasted shape
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
@@ -1191,7 +1191,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf154821_shape_in_group)
pViewShell->GetViewData().SetCurY(1);
pViewShell->GetViewData().GetDispatcher().Execute(SID_OUTLINE_HIDE);
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Expand the lower group
pViewShell = getViewShell();
@@ -1218,15 +1218,15 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf160003_copy_page_anchored)
createScDoc("ods/tdf160003_page_anchored_object.ods");
// copy range with chart
- goToCell("$Sheet2.$A$1:$L$24");
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ goToCell(u"$Sheet2.$A$1:$L$24"_ustr);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// close document and create new one
createScDoc();
// paste clipboard
- goToCell("$Sheet1.$A$1");
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ goToCell(u"$Sheet1.$A$1"_ustr);
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
// Make sure the chart object exists.
ScDocument* pDoc = getScDoc();
@@ -1264,7 +1264,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf160369_groupshape)
tools::Rectangle aOrigRect = pObj->GetSnapRect();
// Save document but do not reload. Saving alone had already caused the error.
- save("calc8");
+ save(u"calc8"_ustr);
// Get geometry of the group again
ScDrawObjData* pAfterObjData = ScDrawLayer::GetObjData(pObj);
@@ -1287,7 +1287,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf160369_groupshape)
pDoc->SetColHidden(3, 3, 0, true);
pDoc->SetDrawPageSize(0);
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// Verify geometry is same as before save
pDoc = getScDoc();
@@ -1311,15 +1311,15 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf160329_sortWithHiddenRows)
// Sort the rows
uno::Sequence<beans::PropertyValue> aArgs1
- = { comphelper::makePropertyValue("DbName", u"myRange"_ustr) };
- dispatchCommand(mxComponent, ".uno:SelectDB", aArgs1);
+ = { comphelper::makePropertyValue(u"DbName"_ustr, u"myRange"_ustr) };
+ dispatchCommand(mxComponent, u".uno:SelectDB"_ustr, aArgs1);
uno::Sequence<beans::PropertyValue> aArgs2
- = { comphelper::makePropertyValue("ByRows", true),
- comphelper::makePropertyValue("HasHeader", true),
- comphelper::makePropertyValue("Col1", sal_Int32(1)),
- comphelper::makePropertyValue("Ascending1", false),
- comphelper::makePropertyValue("IncludeImages", true) };
- dispatchCommand(mxComponent, ".uno:DataSort", aArgs2);
+ = { comphelper::makePropertyValue(u"ByRows"_ustr, true),
+ comphelper::makePropertyValue(u"HasHeader"_ustr, true),
+ comphelper::makePropertyValue(u"Col1"_ustr, sal_Int32(1)),
+ comphelper::makePropertyValue(u"Ascending1"_ustr, false),
+ comphelper::makePropertyValue(u"IncludeImages"_ustr, true) };
+ dispatchCommand(mxComponent, u".uno:DataSort"_ustr, aArgs2);
// Make sure objects are on correct position
SdrObject* pObj = lcl_getSdrObjectbyName(*pDoc, std::u16string_view(u"ImageD"));
diff --git a/sc/qa/unit/subsequent_export_test.cxx b/sc/qa/unit/subsequent_export_test.cxx
index bf64e19821ca..67e7cd013119 100644
--- a/sc/qa/unit/subsequent_export_test.cxx
+++ b/sc/qa/unit/subsequent_export_test.cxx
@@ -50,7 +50,7 @@ protected:
public:
ScExportTest()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
};
@@ -63,7 +63,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testExport)
pDoc->SetValue(0, 0, 0, 1.0);
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
double aVal = pDoc->GetValue(0, 0, 0);
@@ -80,7 +80,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testDefaultFontHeight)
pPool->SetUserDefaultItem(SvxFontHeightItem(400, 100, ATTR_CJK_FONT_HEIGHT));
pPool->SetUserDefaultItem(SvxFontHeightItem(400, 100, ATTR_CTL_FONT_HEIGHT));
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
pPool = pDoc->GetPool();
@@ -96,13 +96,13 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf139167)
{
createScDoc("xlsx/tdf139167.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:styleSheet/x:cellStyles"_ostr, "count"_ostr, "6");
+ assertXPath(pDoc, "/x:styleSheet/x:cellStyles"_ostr, "count"_ostr, u"6"_ustr);
assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:fill/x:patternFill/x:bgColor"_ostr, "rgb"_ostr,
- "FFFFFF00");
+ u"FFFFFF00"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testFontColorWithMultipleAttributesDefined)
@@ -114,102 +114,102 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testFontColorWithMultipleAttributesDefined)
createScDoc("xlsx/tdf113271.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:styleSheet/x:fonts"_ostr, "count"_ostr, "6");
+ assertXPath(pDoc, "/x:styleSheet/x:fonts"_ostr, "count"_ostr, u"6"_ustr);
// Expect "theme" attribute to be set correctly
- assertXPath(pDoc, "/x:styleSheet/x:fonts/x:font[1]/x:color"_ostr, "theme"_ostr, "1");
+ assertXPath(pDoc, "/x:styleSheet/x:fonts/x:font[1]/x:color"_ostr, "theme"_ostr, u"1"_ustr);
// We don't export "rgb" attribute
assertXPathNoAttribute(pDoc, "/x:styleSheet/x:fonts/x:font[1]/x:color"_ostr, "rgb"_ostr);
// Just making sure the checked font is the correct one
- assertXPath(pDoc, "/x:styleSheet/x:fonts/x:font[1]/x:name"_ostr, "val"_ostr, "Calibri");
+ assertXPath(pDoc, "/x:styleSheet/x:fonts/x:font[1]/x:name"_ostr, "val"_ostr, u"Calibri"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf139394)
{
createScDoc("xlsx/tdf139394.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPathContent(
pDoc,
"/x:worksheet/x:extLst/x:ext/x14:conditionalFormattings/x14:conditionalFormatting[1]/"
"x14:cfRule/xm:f"_ostr,
- "LEFT(A1,LEN(\"+\"))=\"+\"");
+ u"LEFT(A1,LEN(\"+\"))=\"+\""_ustr);
assertXPathContent(
pDoc,
"/x:worksheet/x:extLst/x:ext/x14:conditionalFormattings/x14:conditionalFormatting[2]/"
"x14:cfRule/xm:f"_ostr,
- "RIGHT(A2,LEN(\"-\"))=\"-\"");
+ u"RIGHT(A2,LEN(\"-\"))=\"-\""_ustr);
assertXPathContent(
pDoc,
"/x:worksheet/x:extLst/x:ext/x14:conditionalFormattings/x14:conditionalFormatting[3]/"
"x14:cfRule/xm:f"_ostr,
- "LEFT(A3,LEN($B$3))=$B$3");
+ u"LEFT(A3,LEN($B$3))=$B$3"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testExtCondFormatXLSX)
{
createScDoc("xlsx/tdf139021.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(
pDoc,
"/x:worksheet/x:extLst/x:ext/x14:conditionalFormattings/x14:conditionalFormatting[1]/"
"x14:cfRule"_ostr,
- "type"_ostr, "containsText");
+ "type"_ostr, u"containsText"_ustr);
assertXPathContent(
pDoc,
"/x:worksheet/x:extLst/x:ext/x14:conditionalFormattings/x14:conditionalFormatting[1]/"
"x14:cfRule/xm:f[1]"_ostr,
- "NOT(ISERROR(SEARCH($B$1,A1)))");
+ u"NOT(ISERROR(SEARCH($B$1,A1)))"_ustr);
assertXPathContent(
pDoc,
"/x:worksheet/x:extLst/x:ext/x14:conditionalFormattings/x14:conditionalFormatting[1]/"
"x14:cfRule/xm:f[2]"_ostr,
- "$B$1");
+ u"$B$1"_ustr);
assertXPath(
pDoc,
"/x:worksheet/x:extLst/x:ext/x14:conditionalFormattings/x14:conditionalFormatting[2]/"
"x14:cfRule"_ostr,
- "type"_ostr, "notContainsText");
+ "type"_ostr, u"notContainsText"_ustr);
assertXPathContent(
pDoc,
"/x:worksheet/x:extLst/x:ext/x14:conditionalFormattings/x14:conditionalFormatting[2]/"
"x14:cfRule/xm:f[1]"_ostr,
- "ISERROR(SEARCH($B$2,A2))");
+ u"ISERROR(SEARCH($B$2,A2))"_ustr);
assertXPathContent(
pDoc,
"/x:worksheet/x:extLst/x:ext/x14:conditionalFormattings/x14:conditionalFormatting[2]/"
"x14:cfRule/xm:f[2]"_ostr,
- "$B$2");
+ u"$B$2"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf90104)
{
createScDoc("xlsx/tdf90104.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPathContent(pDoc,
"/x:worksheet/x:dataValidations/x:dataValidation/mc:AlternateContent"
"/mc:Choice/x12ac:list"_ostr,
- "1,\"2,3\",4,\"5,6\"");
+ u"1,\"2,3\",4,\"5,6\""_ustr);
assertXPathContent(pDoc,
"/x:worksheet/x:dataValidations/x:dataValidation/mc:AlternateContent"
"/mc:Fallback/x:formula1"_ostr,
- "\"1,2,3,4,5,6\"");
+ u"\"1,2,3,4,5,6\""_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf111876)
@@ -218,8 +218,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf111876)
createScDoc("xlsx/tdf111876.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/_rels/sheet1.xml.rels");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/_rels/sheet1.xml.rels"_ustr);
CPPUNIT_ASSERT(pDoc);
OUString sTarget = getXPath(pDoc, "/rels:Relationships/rels:Relationship"_ostr, "Target"_ostr);
@@ -229,7 +229,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf111876)
CPPUNIT_TEST_FIXTURE(ScExportTest, testPasswordExport)
{
- std::vector<OUString> aFilterNames{ "calc8", "MS Excel 97", "Calc Office Open XML" };
+ std::vector<OUString> aFilterNames{ u"calc8"_ustr, u"MS Excel 97"_ustr,
+ u"Calc Office Open XML"_ustr };
for (size_t i = 0; i < aFilterNames.size(); ++i)
{
@@ -257,7 +258,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf134332)
ASSERT_DOUBLES_EQUAL(238.0, pDoc->GetValue(ScAddress(0, 10144, 0)));
- saveAndReload("calc8", /*pPassword*/ "test");
+ saveAndReload(u"calc8"_ustr, /*pPassword*/ "test");
// Without the fixes in place, it would have failed here
pDoc = getScDoc();
@@ -270,7 +271,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testConditionalFormatExportODS)
{
createScDoc("ods/new_cond_format_test_export.ods");
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
OUString aCSVPath = createFilePath(u"contentCSV/new_cond_format_test_export.csv");
testCondFile(aCSVPath, &*pDoc, 0);
@@ -279,7 +280,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testConditionalFormatExportODS)
CPPUNIT_TEST_FIXTURE(ScExportTest, testCondFormatExportCellIs)
{
createScDoc("xlsx/condFormat_cellis.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetCondFormList(0)->size());
@@ -295,7 +296,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCondFormatExportCellIs)
CPPUNIT_ASSERT_EQUAL(ScConditionMode::Equal, pCondition->GetOperation());
OUString aStr = pCondition->GetExpression(ScAddress(0, 0, 0), 0);
- CPPUNIT_ASSERT_EQUAL(OUString("$Sheet2.$A$2"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"$Sheet2.$A$2"_ustr, aStr);
pEntry = pFormat->GetEntry(1);
CPPUNIT_ASSERT(pEntry);
@@ -305,14 +306,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCondFormatExportCellIs)
CPPUNIT_ASSERT_EQUAL(ScConditionMode::Equal, pCondition->GetOperation());
aStr = pCondition->GetExpression(ScAddress(0, 0, 0), 0);
- CPPUNIT_ASSERT_EQUAL(OUString("$Sheet2.$A$1"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"$Sheet2.$A$1"_ustr, aStr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testConditionalFormatExportXLSX)
{
createScDoc("xlsx/new_cond_format_test_export.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
{
OUString aCSVPath = createFilePath(u"contentCSV/new_cond_format_test_export.csv");
@@ -328,7 +329,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf99856_dataValidationTest)
{
createScDoc("ods/tdf99856_dataValidationTest.ods");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
const ScValidationData* pData = pDoc->GetValidationEntry(2);
@@ -338,7 +339,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf99856_dataValidationTest)
std::vector<ScTypedStrData> aList;
pData->FillSelectionList(aList, ScAddress(0, 1, 1));
CPPUNIT_ASSERT_EQUAL(size_t(18), aList.size());
- CPPUNIT_ASSERT_EQUAL(OUString("18 Missis"), aList[17].GetString());
+ CPPUNIT_ASSERT_EQUAL(u"18 Missis"_ustr, aList[17].GetString());
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testProtectionKeyODS_UTF16LErtlSHA1)
@@ -355,8 +356,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testProtectionKeyODS_UTF16LErtlSHA1)
// we can't assume that the user entered the password; check that we
// round-trip the password as-is
- save("calc8");
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
assertXPath(
pXmlDoc,
"//office:spreadsheet[@table:structure-protected='true' and "
@@ -383,8 +384,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testProtectionKeyODS_UTF8SHA1)
// we can't assume that the user entered the password; check that we
// round-trip the password as-is
- save("calc8");
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
assertXPath(
pXmlDoc,
"//office:spreadsheet[@table:structure-protected='true' and "
@@ -411,8 +412,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testProtectionKeyODS_UTF8SHA256ODF12)
// we can't assume that the user entered the password; check that we
// round-trip the password as-is
- save("calc8");
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
assertXPath(
pXmlDoc,
"//office:spreadsheet[@table:structure-protected='true' and "
@@ -439,8 +440,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testProtectionKeyODS_UTF8SHA256W3C)
// we can't assume that the user entered the password; check that we
// round-trip the password as-is
- save("calc8");
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
assertXPath(
pXmlDoc,
"//office:spreadsheet[@table:structure-protected='true' and "
@@ -467,8 +468,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testProtectionKeyODS_XL_SHA1)
// we can't assume that the user entered the password; check that we
// round-trip the password as-is
- save("calc8");
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
assertXPath(
pXmlDoc,
"//office:spreadsheet[@table:structure-protected='true' and "
@@ -489,7 +490,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testColorScaleExportODS)
{
createScDoc("ods/colorscale.ods");
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
@@ -501,7 +502,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testColorScaleExportXLSX)
{
createScDoc("xlsx/colorscale.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
@@ -513,7 +514,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testDataBarExportODS)
{
createScDoc("ods/databar.ods");
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
@@ -524,7 +525,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testFormatExportODS)
{
createScDoc("ods/formats.ods");
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
@@ -536,31 +537,31 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCommentExportXLSX)
//tdf#104729 FILESAVE OpenOffice do not save author of the comment during export to .xlsx
createScDoc("ods/comment.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pComments = parseExport("xl/comments1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pComments = parseExport(u"xl/comments1.xml"_ustr);
CPPUNIT_ASSERT(pComments);
- assertXPathContent(pComments, "/x:comments/x:authors/x:author[1]"_ostr, "BAKO");
+ assertXPathContent(pComments, "/x:comments/x:authors/x:author[1]"_ostr, u"BAKO"_ustr);
assertXPath(pComments, "/x:comments/x:authors/x:author"_ostr, 1);
assertXPathContent(pComments, "/x:comments/x:commentList/x:comment/x:text/x:r/x:t"_ostr,
- "Komentarz");
+ u"Komentarz"_ustr);
- xmlDocUniquePtr pVmlDrawing = parseExport("xl/drawings/vmlDrawing1.vml");
+ xmlDocUniquePtr pVmlDrawing = parseExport(u"xl/drawings/vmlDrawing1.vml"_ustr);
CPPUNIT_ASSERT(pVmlDrawing);
//assertXPath(pVmlDrawing, "/xml/v:shapetype", "coordsize", "21600,21600");
- assertXPath(pVmlDrawing, "/xml/v:shapetype"_ostr, "spt"_ostr, "202");
- assertXPath(pVmlDrawing, "/xml/v:shapetype/v:stroke"_ostr, "joinstyle"_ostr, "miter");
+ assertXPath(pVmlDrawing, "/xml/v:shapetype"_ostr, "spt"_ostr, u"202"_ustr);
+ assertXPath(pVmlDrawing, "/xml/v:shapetype/v:stroke"_ostr, "joinstyle"_ostr, u"miter"_ustr);
const OUString sShapeTypeId = "#" + getXPath(pVmlDrawing, "/xml/v:shapetype"_ostr, "id"_ostr);
assertXPath(pVmlDrawing, "/xml/v:shape"_ostr, "type"_ostr, sShapeTypeId);
- assertXPath(pVmlDrawing, "/xml/v:shape/v:shadow"_ostr, "color"_ostr, "black");
- assertXPath(pVmlDrawing, "/xml/v:shape/v:shadow"_ostr, "obscured"_ostr, "t");
+ assertXPath(pVmlDrawing, "/xml/v:shape/v:shadow"_ostr, "color"_ostr, u"black"_ustr);
+ assertXPath(pVmlDrawing, "/xml/v:shape/v:shadow"_ostr, "obscured"_ostr, u"t"_ustr);
//tdf#117274 fix MSO interoperability with the secret VML shape type id
- assertXPath(pVmlDrawing, "/xml/v:shapetype"_ostr, "id"_ostr, "_x0000_t202");
- assertXPath(pVmlDrawing, "/xml/v:shape"_ostr, "type"_ostr, "#_x0000_t202");
+ assertXPath(pVmlDrawing, "/xml/v:shapetype"_ostr, "id"_ostr, u"_x0000_t202"_ustr);
+ assertXPath(pVmlDrawing, "/xml/v:shape"_ostr, "type"_ostr, u"#_x0000_t202"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testCommentExportXLSX_2_XLSX)
@@ -577,14 +578,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCommentExportXLSX_2_XLSX)
pNote->ShowCaption(aPosC9, true);
- save("Calc Office Open XML");
- xmlDocUniquePtr pComments = parseExport("xl/comments1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pComments = parseExport(u"xl/comments1.xml"_ustr);
CPPUNIT_ASSERT(pComments);
assertXPathContent(pComments, "/x:comments/x:commentList/x:comment/x:text/x:r/x:t"_ostr,
- "visible comment");
+ u"visible comment"_ustr);
- xmlDocUniquePtr pVmlDrawing = parseExport("xl/drawings/vmlDrawing1.vml");
+ xmlDocUniquePtr pVmlDrawing = parseExport(u"xl/drawings/vmlDrawing1.vml"_ustr);
CPPUNIT_ASSERT(pVmlDrawing);
assertXPath(pVmlDrawing, "/xml/v:shape/x:ClientData/x:Visible"_ostr, 0);
@@ -596,8 +597,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCustomColumnWidthExportXLSX)
//tdf#100946 FILESAVE Excel on macOS ignored column widths in XLSX last saved by LO
createScDoc("ods/custom_column_width.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// tdf#124741: check that we export default width, otherwise the skipped columns would have
@@ -609,57 +610,59 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCustomColumnWidthExportXLSX)
// First column, has everything default (width in Calc: 1280), skipped
// Second column, has custom width (width in Calc: 1225)
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "outlineLevel"_ostr, "0");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "customWidth"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "min"_ostr, "2");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "max"_ostr, "2");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "outlineLevel"_ostr, u"0"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "customWidth"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "min"_ostr, u"2"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "max"_ostr, u"2"_ustr);
// Third column, has everything default (width in Calc: 1280), skipped
// Fourth column has custom width. Columns from 4 to 7 are hidden
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "outlineLevel"_ostr, "0");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "customWidth"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "min"_ostr, "4");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "max"_ostr, "4");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "outlineLevel"_ostr, u"0"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "customWidth"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "min"_ostr, u"4"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "max"_ostr, u"4"_ustr);
// 5th column has custom width. Columns from 4 to 7 are hidden
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "outlineLevel"_ostr, "0");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "customWidth"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "min"_ostr, "5");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "max"_ostr, "5");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "outlineLevel"_ostr, u"0"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "customWidth"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "min"_ostr, u"5"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "max"_ostr, u"5"_ustr);
// 6th and 7th columns have default width and they are hidden
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "outlineLevel"_ostr, "0");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "customWidth"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "min"_ostr, "6");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "max"_ostr, "7");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "outlineLevel"_ostr, u"0"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "customWidth"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "min"_ostr, u"6"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "max"_ostr, u"7"_ustr);
// 8th column has everything default - skipped
// 9th column has custom width
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "outlineLevel"_ostr, "0");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "customWidth"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "min"_ostr, "9");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "max"_ostr, "9");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "outlineLevel"_ostr, u"0"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "customWidth"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "min"_ostr, u"9"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "max"_ostr, u"9"_ustr);
// We expected that exactly 5 unique Nodes will be produced
assertXPath(pSheet, "/x:worksheet/x:cols/x:col"_ostr, 5);
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "outlineLevel"_ostr, "0");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "customFormat"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "customHeight"_ostr, "false");
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "outlineLevel"_ostr, u"0"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "customFormat"_ostr,
+ u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "customHeight"_ostr,
+ u"false"_ustr);
}
#endif
@@ -668,8 +671,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testXfDefaultValuesXLSX)
//tdf#70565 FORMATTING: User Defined Custom Formatting is not applied during importing XLSX documents
createScDoc("xlsx/xf_default_values.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// cellStyleXfs don't need xfId, so we need to make sure it is not saved
@@ -677,10 +680,10 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testXfDefaultValuesXLSX)
// Because numFmtId fontId fillId borderId xfId are not existing during import
// it should be created during export, with values set to "0"
- assertXPath(pSheet, "/x:styleSheet/x:cellXfs/x:xf[1]"_ostr, "xfId"_ostr, "0");
- assertXPath(pSheet, "/x:styleSheet/x:cellXfs/x:xf[2]"_ostr, "xfId"_ostr, "0");
- assertXPath(pSheet, "/x:styleSheet/x:cellXfs/x:xf[3]"_ostr, "xfId"_ostr, "0");
- assertXPath(pSheet, "/x:styleSheet/x:cellXfs/x:xf[4]"_ostr, "xfId"_ostr, "0");
+ assertXPath(pSheet, "/x:styleSheet/x:cellXfs/x:xf[1]"_ostr, "xfId"_ostr, u"0"_ustr);
+ assertXPath(pSheet, "/x:styleSheet/x:cellXfs/x:xf[2]"_ostr, "xfId"_ostr, u"0"_ustr);
+ assertXPath(pSheet, "/x:styleSheet/x:cellXfs/x:xf[3]"_ostr, "xfId"_ostr, u"0"_ustr);
+ assertXPath(pSheet, "/x:styleSheet/x:cellXfs/x:xf[4]"_ostr, "xfId"_ostr, u"0"_ustr);
// We expected that exactly 15 cellXfs:xf Nodes will be produced
assertXPath(pSheet, "/x:styleSheet/x:cellXfs/x:xf"_ostr, 14);
@@ -728,14 +731,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testODF13)
// FIXME: Error: unexpected attribute "loext:scale-to-X"
skipValidation();
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
// check XML
- xmlDocUniquePtr pContentXml = parseExport("content.xml");
+ xmlDocUniquePtr pContentXml = parseExport(u"content.xml"_ustr);
assertXPath(pContentXml, "/office:document-content/office:automatic-styles/style:style/"
"style:table-properties[@table:tab-color='#ff3838']"_ostr);
- xmlDocUniquePtr pStylesXml = parseExport("styles.xml");
+ xmlDocUniquePtr pStylesXml = parseExport(u"styles.xml"_ustr);
assertXPath(pStylesXml, "/office:document-styles/office:automatic-styles/style:page-layout/"
"style:page-layout-properties[@style:scale-to-X='2']"_ostr);
assertXPath(pStylesXml, "/office:document-styles/office:automatic-styles/style:page-layout/"
@@ -751,14 +754,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testODF13)
officecfg::Office::Common::Save::ODF::DefaultVersion::set(9, pBatch);
pBatch->commit();
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
// check XML
- xmlDocUniquePtr pContentXml = parseExport("content.xml");
+ xmlDocUniquePtr pContentXml = parseExport(u"content.xml"_ustr);
assertXPath(pContentXml, "/office:document-content/office:automatic-styles/style:style/"
"style:table-properties[@tableooo:tab-color='#ff3838']"_ostr);
- xmlDocUniquePtr pStylesXml = parseExport("styles.xml");
+ xmlDocUniquePtr pStylesXml = parseExport(u"styles.xml"_ustr);
assertXPath(pStylesXml, "/office:document-styles/office:automatic-styles/style:page-layout/"
"style:page-layout-properties[@loext:scale-to-X='2']"_ostr);
assertXPath(pStylesXml, "/office:document-styles/office:automatic-styles/style:page-layout/"
@@ -774,15 +777,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testODF13)
officecfg::Office::Common::Save::ODF::DefaultVersion::set(4, pBatch);
pBatch->commit();
- save("calc8");
+ save(u"calc8"_ustr);
// check XML
- xmlDocUniquePtr pContentXml = parseExport("content.xml");
+ xmlDocUniquePtr pContentXml = parseExport(u"content.xml"_ustr);
assertXPathNoAttribute(
pContentXml,
"/office:document-content/office:automatic-styles/style:style/style:table-properties"_ostr,
"tab-color"_ostr);
- xmlDocUniquePtr pStylesXml = parseExport("styles.xml");
+ xmlDocUniquePtr pStylesXml = parseExport(u"styles.xml"_ustr);
assertXPathNoAttribute(pStylesXml,
"/office:document-styles/office:automatic-styles/"
"style:page-layout[1]/style:page-layout-properties"_ostr,
@@ -802,29 +805,29 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testColumnWidthResaveXLSX)
// Test if after resave .xlsx file, columns width is identical with previous one
createScDoc("xlsx/different-column-width-excel2010.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// In original Excel document the width is "24"
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "width"_ostr, "24");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "customWidth"_ostr, "true");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "width"_ostr, u"24"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "customWidth"_ostr, u"true"_ustr);
// In original Excel document the width is "12"
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "width"_ostr, "12");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "customWidth"_ostr, "true");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "width"_ostr, u"12"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "customWidth"_ostr, u"true"_ustr);
// In original Excel document the width is "6"
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "width"_ostr, "6");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "customWidth"_ostr, "true");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "width"_ostr, u"6"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "customWidth"_ostr, u"true"_ustr);
// In original Excel document the width is "1"
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "width"_ostr, "1");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "customWidth"_ostr, "true");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "width"_ostr, u"1"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "customWidth"_ostr, u"true"_ustr);
// In original Excel document the width is "250"
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "width"_ostr, "250");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "customWidth"_ostr, "true");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "width"_ostr, u"250"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "customWidth"_ostr, u"true"_ustr);
assertXPath(pSheet, "/x:worksheet/x:cols/x:col"_ostr, 5);
}
@@ -868,7 +871,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testColumnWidthExportFromODStoXLSX)
// Export to .xlsx and compare column width with the .ods
// We expect that column width from .ods will be exactly the same as imported from .xlsx
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
@@ -901,141 +904,141 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testOutlineExportXLSX)
//tdf#51524 FILESAVE .xlsx and.xls looses width information for hidden/collapsed grouped columns
createScDoc("ods/outline.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// Maximum Outline Row is 4 for this document
- assertXPath(pSheet, "/x:worksheet/x:sheetFormatPr"_ostr, "outlineLevelRow"_ostr, "4");
+ assertXPath(pSheet, "/x:worksheet/x:sheetFormatPr"_ostr, "outlineLevelRow"_ostr, u"4"_ustr);
// Maximum Outline Column is 4 for this document
- assertXPath(pSheet, "/x:worksheet/x:sheetFormatPr"_ostr, "outlineLevelCol"_ostr, "4");
+ assertXPath(pSheet, "/x:worksheet/x:sheetFormatPr"_ostr, "outlineLevelCol"_ostr, u"4"_ustr);
// First XML node, creates two columns (from min=1 to max=2)
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "outlineLevel"_ostr, "1");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "min"_ostr, "1");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "max"_ostr, "2");
-
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "outlineLevel"_ostr, "2");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "min"_ostr, "3");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "max"_ostr, "3");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "outlineLevel"_ostr, u"1"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "min"_ostr, u"1"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]"_ostr, "max"_ostr, u"2"_ustr);
+
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "outlineLevel"_ostr, u"2"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "min"_ostr, u"3"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]"_ostr, "max"_ostr, u"3"_ustr);
// Column 4 has custom width and it is hidden. We need to make sure that it is created
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "outlineLevel"_ostr, "2");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "min"_ostr, "4");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "max"_ostr, "4");
-
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "outlineLevel"_ostr, "3");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "min"_ostr, "5");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "max"_ostr, "6");
-
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "outlineLevel"_ostr, "4");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "min"_ostr, "7");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "max"_ostr, "7");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "outlineLevel"_ostr, u"2"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "min"_ostr, u"4"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[3]"_ostr, "max"_ostr, u"4"_ustr);
+
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "outlineLevel"_ostr, u"3"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "min"_ostr, u"5"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[4]"_ostr, "max"_ostr, u"6"_ustr);
+
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "outlineLevel"_ostr, u"4"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "min"_ostr, u"7"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[5]"_ostr, "max"_ostr, u"7"_ustr);
// Column 8 has custom width and it is hidden. We need to make sure that it is created
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[6]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[6]"_ostr, "outlineLevel"_ostr, "4");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[6]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[6]"_ostr, "min"_ostr, "8");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[6]"_ostr, "max"_ostr, "8");
-
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[7]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[7]"_ostr, "outlineLevel"_ostr, "4");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[7]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[7]"_ostr, "min"_ostr, "9");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[7]"_ostr, "max"_ostr, "19");
-
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[8]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[8]"_ostr, "outlineLevel"_ostr, "3");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[8]"_ostr, "collapsed"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[8]"_ostr, "min"_ostr, "20");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[8]"_ostr, "max"_ostr, "20");
-
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[9]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[9]"_ostr, "outlineLevel"_ostr, "3");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[9]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[9]"_ostr, "min"_ostr, "21");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[9]"_ostr, "max"_ostr, "21");
-
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[10]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[10]"_ostr, "outlineLevel"_ostr, "2");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[10]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[10]"_ostr, "min"_ostr, "22");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[10]"_ostr, "max"_ostr, "23");
-
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[11]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[11]"_ostr, "outlineLevel"_ostr, "1");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[11]"_ostr, "collapsed"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[11]"_ostr, "min"_ostr, "24");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[11]"_ostr, "max"_ostr, "24");
-
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[12]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[12]"_ostr, "outlineLevel"_ostr, "1");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[12]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[12]"_ostr, "min"_ostr, "25");
- assertXPath(pSheet, "/x:worksheet/x:cols/x:col[12]"_ostr, "max"_ostr, "26");
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[6]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[6]"_ostr, "outlineLevel"_ostr, u"4"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[6]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[6]"_ostr, "min"_ostr, u"8"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[6]"_ostr, "max"_ostr, u"8"_ustr);
+
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[7]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[7]"_ostr, "outlineLevel"_ostr, u"4"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[7]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[7]"_ostr, "min"_ostr, u"9"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[7]"_ostr, "max"_ostr, u"19"_ustr);
+
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[8]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[8]"_ostr, "outlineLevel"_ostr, u"3"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[8]"_ostr, "collapsed"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[8]"_ostr, "min"_ostr, u"20"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[8]"_ostr, "max"_ostr, u"20"_ustr);
+
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[9]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[9]"_ostr, "outlineLevel"_ostr, u"3"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[9]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[9]"_ostr, "min"_ostr, u"21"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[9]"_ostr, "max"_ostr, u"21"_ustr);
+
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[10]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[10]"_ostr, "outlineLevel"_ostr, u"2"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[10]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[10]"_ostr, "min"_ostr, u"22"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[10]"_ostr, "max"_ostr, u"23"_ustr);
+
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[11]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[11]"_ostr, "outlineLevel"_ostr, u"1"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[11]"_ostr, "collapsed"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[11]"_ostr, "min"_ostr, u"24"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[11]"_ostr, "max"_ostr, u"24"_ustr);
+
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[12]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[12]"_ostr, "outlineLevel"_ostr, u"1"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[12]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[12]"_ostr, "min"_ostr, u"25"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:cols/x:col[12]"_ostr, "max"_ostr, u"26"_ustr);
// We expected that exactly 12 unique Nodes will be produced
assertXPath(pSheet, "/x:worksheet/x:cols/x:col"_ostr, 12);
// First row is empty and default so it is not written into XML file
// so we need to save 29 rows, as it provides information about outLineLevel
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "r"_ostr, "2");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "outlineLevel"_ostr, "1");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]"_ostr, "r"_ostr, "3");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]"_ostr, "outlineLevel"_ostr, "2");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]"_ostr, "r"_ostr, "4");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]"_ostr, "outlineLevel"_ostr, "2");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]"_ostr, "r"_ostr, "5");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]"_ostr, "outlineLevel"_ostr, "3");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]"_ostr, "r"_ostr, "6");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]"_ostr, "outlineLevel"_ostr, "3");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]"_ostr, "r"_ostr, "7");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]"_ostr, "outlineLevel"_ostr, "4");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]"_ostr, "r"_ostr, "8");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]"_ostr, "outlineLevel"_ostr, "4");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]"_ostr, "r"_ostr, "9");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]"_ostr, "outlineLevel"_ostr, "4");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]"_ostr, "collapsed"_ostr, "false");
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "r"_ostr, u"2"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "outlineLevel"_ostr, u"1"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]"_ostr, "r"_ostr, u"3"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]"_ostr, "outlineLevel"_ostr, u"2"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]"_ostr, "r"_ostr, u"4"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]"_ostr, "outlineLevel"_ostr, u"2"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]"_ostr, "r"_ostr, u"5"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]"_ostr, "outlineLevel"_ostr, u"3"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]"_ostr, "r"_ostr, u"6"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]"_ostr, "outlineLevel"_ostr, u"3"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]"_ostr, "r"_ostr, u"7"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]"_ostr, "outlineLevel"_ostr, u"4"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]"_ostr, "r"_ostr, u"8"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]"_ostr, "outlineLevel"_ostr, u"4"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]"_ostr, "r"_ostr, u"9"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]"_ostr, "outlineLevel"_ostr, u"4"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]"_ostr, "collapsed"_ostr, u"false"_ustr);
// Next rows are the same as the previous one but it needs to be preserved,
// as they contain information about outlineLevel
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[20]"_ostr, "r"_ostr, "21");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[20]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[20]"_ostr, "outlineLevel"_ostr, "4");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[20]"_ostr, "collapsed"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]"_ostr, "r"_ostr, "22");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]"_ostr, "outlineLevel"_ostr, "3");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]"_ostr, "collapsed"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]"_ostr, "r"_ostr, "23");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]"_ostr, "hidden"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]"_ostr, "outlineLevel"_ostr, "3");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]"_ostr, "collapsed"_ostr, "false");
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[20]"_ostr, "r"_ostr, u"21"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[20]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[20]"_ostr, "outlineLevel"_ostr, u"4"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[20]"_ostr, "collapsed"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]"_ostr, "r"_ostr, u"22"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]"_ostr, "outlineLevel"_ostr, u"3"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]"_ostr, "collapsed"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]"_ostr, "r"_ostr, u"23"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]"_ostr, "hidden"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]"_ostr, "outlineLevel"_ostr, u"3"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]"_ostr, "collapsed"_ostr, u"false"_ustr);
// We expected that exactly 29 Row Nodes will be produced
assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row"_ostr, 29);
@@ -1045,10 +1048,10 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testAllRowsHiddenXLSX)
{
createScDoc("xlsx/tdf105840_allRowsHidden.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
- assertXPath(pSheet, "/x:worksheet/x:sheetFormatPr"_ostr, "zeroHeight"_ostr, "true");
+ assertXPath(pSheet, "/x:worksheet/x:sheetFormatPr"_ostr, "zeroHeight"_ostr, u"true"_ustr);
assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row"_ostr, 0);
}
@@ -1057,15 +1060,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testHiddenEmptyRowsXLSX)
//tdf#98106 FILESAVE: Hidden and empty rows became visible when export to .XLSX
createScDoc("ods/hidden-empty-rows.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
- assertXPath(pSheet, "/x:worksheet/x:sheetFormatPr"_ostr, "zeroHeight"_ostr, "false");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]"_ostr, "hidden"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]"_ostr, "hidden"_ostr, "false");
+ assertXPath(pSheet, "/x:worksheet/x:sheetFormatPr"_ostr, "zeroHeight"_ostr, u"false"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]"_ostr, "hidden"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]"_ostr, "hidden"_ostr, u"false"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testHiddenEmptyColsODS)
@@ -1073,12 +1076,12 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testHiddenEmptyColsODS)
//tdf#98106 FILESAVE: Hidden and empty rows became visible when export to .XLSX
createScDoc("ods/tdf128895_emptyHiddenCols.ods");
- save("calc8");
- xmlDocUniquePtr pSheet = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"content.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
assertXPath(pSheet, "//table:table/table:table-column[2]"_ostr);
assertXPath(pSheet, "//table:table/table:table-column[2]"_ostr, "number-columns-repeated"_ostr,
- "1017");
+ u"1017"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testLandscapeOrientationXLSX)
@@ -1086,20 +1089,20 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testLandscapeOrientationXLSX)
//tdf#48767 - Landscape page orientation is not loaded from .xlsx format with MS Excel, after export with Libre Office
createScDoc("ods/hidden-empty-rows.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// the usePrinterDefaults cannot be saved to allow opening sheets in Landscape mode via MS Excel
assertXPathNoAttribute(pSheet, "/x:worksheet/x:pageSetup"_ostr, "usePrinterDefaults"_ostr);
- assertXPath(pSheet, "/x:worksheet/x:pageSetup"_ostr, "orientation"_ostr, "landscape");
+ assertXPath(pSheet, "/x:worksheet/x:pageSetup"_ostr, "orientation"_ostr, u"landscape"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testDataBarExportXLSX)
{
createScDoc("xlsx/databar.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
@@ -1132,16 +1135,17 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testMiscRowHeightExport)
// additionally there is effectively a default row height ( 5.29 mm ). So we test the
// unset rows at the end of the document to ensure the effective xlsx default height
// is set there too.
- { u"xlsx/miscrowheights.xlsx", "Calc Office Open XML", SAL_N_ELEMENTS(DfltRowData),
+ { u"xlsx/miscrowheights.xlsx", u"Calc Office Open XML"_ustr, SAL_N_ELEMENTS(DfltRowData),
DfltRowData },
// Checks that some distributed ( non-empty ) heights remain set after export (to xls)
- { u"xlsx/miscrowheights.xlsx", "MS Excel 97", SAL_N_ELEMENTS(DfltRowData), DfltRowData },
+ { u"xlsx/miscrowheights.xlsx", u"MS Excel 97"_ustr, SAL_N_ELEMENTS(DfltRowData),
+ DfltRowData },
// Checks that repreated rows ( of various heights ) remain set after export ( to xlsx )
- { u"ods/miscemptyrepeatedrowheights.ods", "Calc Office Open XML",
+ { u"ods/miscemptyrepeatedrowheights.ods", u"Calc Office Open XML"_ustr,
SAL_N_ELEMENTS(EmptyRepeatRowData), EmptyRepeatRowData },
// Checks that repreated rows ( of various heights ) remain set after export ( to xls )
- { u"ods/miscemptyrepeatedrowheights.ods", "MS Excel 97", SAL_N_ELEMENTS(EmptyRepeatRowData),
- EmptyRepeatRowData },
+ { u"ods/miscemptyrepeatedrowheights.ods", u"MS Excel 97"_ustr,
+ SAL_N_ELEMENTS(EmptyRepeatRowData), EmptyRepeatRowData },
};
miscRowHeightsTest(aTestValues, SAL_N_ELEMENTS(aTestValues));
}
@@ -1214,7 +1218,7 @@ void setFont(ScFieldEditEngine& rEE, sal_Int32 nPara, sal_Int32 nStart, sal_Int3
aSel.nEndPos = nEnd;
SfxItemSet aItemSet = rEE.GetEmptyItemSet();
- SvxFontItem aItem(FAMILY_MODERN, rFontName, "", PITCH_VARIABLE, RTL_TEXTENCODING_UTF8,
+ SvxFontItem aItem(FAMILY_MODERN, rFontName, u""_ustr, PITCH_VARIABLE, RTL_TEXTENCODING_UTF8,
EE_CHAR_FONTINFO);
aItemSet.Put(aItem);
rEE.QuickSetAttribs(aItemSet, aSel);
@@ -1247,7 +1251,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testNamedRangeBugfdo62729)
pDoc->DeleteTab(0);
//should be still a single named range
CPPUNIT_ASSERT_EQUAL(size_t(1), pNames->size());
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
@@ -1261,27 +1265,27 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testBuiltinRangesXLSX)
{
createScDoc("xlsx/built-in_ranges.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/workbook.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/workbook.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
//assert the existing OOXML built-in names are still there
assertXPathContent(pDoc,
"/x:workbook/x:definedNames/"
"x:definedName[@name='_xlnm._FilterDatabase'][@localSheetId='0']"_ostr,
- "'Sheet1 Test'!$A$1:$A$5");
+ u"'Sheet1 Test'!$A$1:$A$5"_ustr);
assertXPathContent(pDoc,
"/x:workbook/x:definedNames/"
"x:definedName[@name='_xlnm._FilterDatabase'][@localSheetId='1']"_ostr,
- "'Sheet2 Test'!$K$10:$K$14");
+ u"'Sheet2 Test'!$K$10:$K$14"_ustr);
assertXPathContent(
pDoc,
"/x:workbook/x:definedNames/x:definedName[@name='_xlnm.Print_Area'][@localSheetId='0']"_ostr,
- "'Sheet1 Test'!$A$1:$A$5");
+ u"'Sheet1 Test'!$A$1:$A$5"_ustr);
assertXPathContent(
pDoc,
"/x:workbook/x:definedNames/x:definedName[@name='_xlnm.Print_Area'][@localSheetId='1']"_ostr,
- "'Sheet2 Test'!$K$10:$M$18");
+ u"'Sheet2 Test'!$K$10:$M$18"_ustr);
//...and that no extra ones are added (see tdf#112571)
assertXPath(pDoc,
@@ -1529,7 +1533,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS)
if (pAttr->mnParagraph != 0 || pAttr->mnStart != 0 || pAttr->mnEnd != 5)
return false;
- if (pAttr->maAttributes.size() != 1 || !isFont(*pAttr, "Courier"))
+ if (pAttr->maAttributes.size() != 1 || !isFont(*pAttr, u"Courier"_ustr))
return false;
// Last section should have "Luxi Mono" applied.
@@ -1537,7 +1541,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS)
if (pAttr->mnParagraph != 0 || pAttr->mnStart != 10 || pAttr->mnEnd != 15)
return false;
- if (pAttr->maAttributes.size() != 1 || !isFont(*pAttr, "Luxi Mono"))
+ if (pAttr->maAttributes.size() != 1 || !isFont(*pAttr, u"Luxi Mono"_ustr))
return false;
return true;
@@ -1653,7 +1657,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS)
// Insert an edit text cell.
ScFieldEditEngine* pEE = &pDoc->GetEditEngine();
- pEE->SetTextCurrentDefaults("Bold and Italic");
+ pEE->SetTextCurrentDefaults(u"Bold and Italic"_ustr);
// Set the 'Bold' part bold.
setAttribute(*pEE, 0, 0, 4, EE_CHAR_WEIGHT);
// Set the 'Italic' part italic.
@@ -1668,7 +1672,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS)
}
// Now, save and reload this document.
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
{
ScDocument* pDoc = getScDoc();
CPPUNIT_ASSERT_MESSAGE("Reloaded document should at least have one sheet.",
@@ -1681,14 +1685,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS)
// Insert a multi-line content to B4.
pEE->Clear();
- pEE->SetTextCurrentDefaults("One\nTwo\nThree");
+ pEE->SetTextCurrentDefaults(u"One\nTwo\nThree"_ustr);
pDoc->SetEditText(ScAddress(1, 3, 0), pEE->CreateTextObject());
pEditText = pDoc->GetEditText(ScAddress(1, 3, 0));
CPPUNIT_ASSERT_MESSAGE("Incorrect B4 value.", aCheckFunc.checkB4(pEditText));
}
// Reload the doc again, and check the content of B2 and B4.
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
{
ScDocument* pDoc = getScDoc();
ScFieldEditEngine* pEE = &pDoc->GetEditEngine();
@@ -1700,14 +1704,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS)
// Insert a multi-line content to B5, but this time, set some empty paragraphs.
pEE->Clear();
- pEE->SetTextCurrentDefaults("\nTwo\nThree\n\nFive\n");
+ pEE->SetTextCurrentDefaults(u"\nTwo\nThree\n\nFive\n"_ustr);
pDoc->SetEditText(ScAddress(1, 4, 0), pEE->CreateTextObject());
pEditText = pDoc->GetEditText(ScAddress(1, 4, 0));
CPPUNIT_ASSERT_MESSAGE("Incorrect B5 value.", aCheckFunc.checkB5(pEditText));
// Insert a text with strikethrough in B6.
pEE->Clear();
- pEE->SetTextCurrentDefaults("Strike Me");
+ pEE->SetTextCurrentDefaults(u"Strike Me"_ustr);
// Set the 'Strike' part strikethrough.
setAttribute(*pEE, 0, 0, 6, EE_CHAR_STRIKEOUT);
pDoc->SetEditText(ScAddress(1, 5, 0), pEE->CreateTextObject());
@@ -1716,16 +1720,16 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS)
// Insert a text with different font segments in B7.
pEE->Clear();
- pEE->SetTextCurrentDefaults("Font1 and Font2");
- setFont(*pEE, 0, 0, 5, "Courier");
- setFont(*pEE, 0, 10, 15, "Luxi Mono");
+ pEE->SetTextCurrentDefaults(u"Font1 and Font2"_ustr);
+ setFont(*pEE, 0, 0, 5, u"Courier"_ustr);
+ setFont(*pEE, 0, 10, 15, u"Luxi Mono"_ustr);
pDoc->SetEditText(ScAddress(1, 6, 0), pEE->CreateTextObject());
pEditText = pDoc->GetEditText(ScAddress(1, 6, 0));
CPPUNIT_ASSERT_MESSAGE("Incorrect B7 value.", aCheckFunc.checkB7(pEditText));
// Insert a text with overline and underline in B8.
pEE->Clear();
- pEE->SetTextCurrentDefaults("Over and Under");
+ pEE->SetTextCurrentDefaults(u"Over and Under"_ustr);
setAttribute(*pEE, 0, 0, 4, EE_CHAR_OVERLINE);
setAttribute(*pEE, 0, 9, 14, EE_CHAR_UNDERLINE);
pDoc->SetEditText(ScAddress(1, 7, 0), pEE->CreateTextObject());
@@ -1733,7 +1737,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS)
CPPUNIT_ASSERT_MESSAGE("Incorrect B8 value.", aCheckFunc.checkB8(pEditText));
pEE->Clear();
- pEE->SetTextCurrentDefaults("Sub and Super");
+ pEE->SetTextCurrentDefaults(u"Sub and Super"_ustr);
setEscapement(*pEE, 0, 0, 3, 32, 64);
setEscapement(*pEE, 0, 8, 13, -32, 66);
pDoc->SetEditText(ScAddress(1, 8, 0), pEE->CreateTextObject());
@@ -1745,7 +1749,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS)
// Set font color of B10 to blue.
pDoc->ApplyPattern(1, 9, 0, aCellFontColor);
pEE->Clear();
- pEE->SetTextCurrentDefaults("BLUE AUTO");
+ pEE->SetTextCurrentDefaults(u"BLUE AUTO"_ustr);
// Set the color of the string "AUTO" to automatic color.
setAttribute(*pEE, 0, 5, 9, EE_CHAR_COLOR, COL_AUTO);
pDoc->SetEditText(ScAddress(1, 9, 0), pEE->CreateTextObject());
@@ -1754,7 +1758,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS)
}
// Reload the doc again, and check the content of B2, B4, B6 and B7.
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
pEditText = pDoc->GetEditText(ScAddress(1, 1, 0));
@@ -1784,21 +1788,21 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextCellFormatXLSX)
{
createScDoc("xls/cellformat.xls");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// make sure the only cell in this doc is assigned some formatting record
OUString aCellFormat = getXPath(pSheet, "/x:worksheet/x:sheetData/x:row/x:c"_ostr, "s"_ostr);
CPPUNIT_ASSERT_MESSAGE("Cell format is missing", !aCellFormat.isEmpty());
- xmlDocUniquePtr pStyles = parseExport("xl/styles.xml");
+ xmlDocUniquePtr pStyles = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pStyles);
OString nFormatIdx = OString::number(aCellFormat.toInt32() + 1);
const OString aXPath1("/x:styleSheet/x:cellXfs/x:xf[" + nFormatIdx + "]/x:alignment");
// formatting record is set to wrap text
- assertXPath(pStyles, aXPath1, "wrapText"_ostr, "true");
+ assertXPath(pStyles, aXPath1, "wrapText"_ostr, u"true"_ustr);
// see what font it references
const OString aXPath2("/x:styleSheet/x:cellXfs/x:xf[" + nFormatIdx + "]");
@@ -1807,34 +1811,34 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextCellFormatXLSX)
// that font should be bold
const OString aXPath3("/x:styleSheet/x:fonts/x:font[" + nFontIdx + "]/x:b");
- assertXPath(pStyles, aXPath3, "val"_ostr, "true");
+ assertXPath(pStyles, aXPath3, "val"_ostr, u"true"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testWrapText)
{
createScDoc("xlsx/wrap-text.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pStyles = parseExport("xl/styles.xml");
+ xmlDocUniquePtr pStyles = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pStyles);
- assertXPath(pStyles, "/x:styleSheet/x:cellXfs"_ostr, "count"_ostr, "7");
+ assertXPath(pStyles, "/x:styleSheet/x:cellXfs"_ostr, "count"_ostr, u"7"_ustr);
assertXPath(pStyles, "/x:styleSheet/x:cellXfs/x:xf[1]/x:alignment"_ostr, "wrapText"_ostr,
- "false");
+ u"false"_ustr);
assertXPath(pStyles, "/x:styleSheet/x:cellXfs/x:xf[2]/x:alignment"_ostr, "wrapText"_ostr,
- "false");
+ u"false"_ustr);
assertXPath(pStyles, "/x:styleSheet/x:cellXfs/x:xf[3]/x:alignment"_ostr, "wrapText"_ostr,
- "false");
+ u"false"_ustr);
assertXPath(pStyles, "/x:styleSheet/x:cellXfs/x:xf[4]/x:alignment"_ostr, "wrapText"_ostr,
- "false");
+ u"false"_ustr);
assertXPath(pStyles, "/x:styleSheet/x:cellXfs/x:xf[5]/x:alignment"_ostr, "wrapText"_ostr,
- "true");
+ u"true"_ustr);
assertXPath(pStyles, "/x:styleSheet/x:cellXfs/x:xf[6]/x:alignment"_ostr, "wrapText"_ostr,
- "true");
+ u"true"_ustr);
assertXPath(pStyles, "/x:styleSheet/x:cellXfs/x:xf[7]/x:alignment"_ostr, "wrapText"_ostr,
- "true");
+ u"true"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testFormulaRefSheetNameODS)
@@ -1844,18 +1848,18 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testFormulaRefSheetNameODS)
ScDocument* pDoc = getScDoc();
sc::AutoCalcSwitch aACSwitch(*pDoc, true); // turn on auto calc.
- pDoc->SetString(ScAddress(1, 1, 0), "='90''s Data'.B2");
+ pDoc->SetString(ScAddress(1, 1, 0), u"='90''s Data'.B2"_ustr);
CPPUNIT_ASSERT_EQUAL(1.1, pDoc->GetValue(ScAddress(1, 1, 0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("='90''s Data'.B2"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"='90''s Data'.B2"_ustr,
pDoc->GetFormula(1, 1, 0));
}
// Now, save and reload this document.
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
pDoc->CalcAll();
CPPUNIT_ASSERT_EQUAL(1.1, pDoc->GetValue(ScAddress(1, 1, 0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("='90''s Data'.B2"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"='90''s Data'.B2"_ustr,
pDoc->GetFormula(1, 1, 0));
}
@@ -1874,24 +1878,24 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCellValuesExportODS)
// set a formula
pDoc->SetValue(ScAddress(2, 0, 0), 3.0); // C1
pDoc->SetValue(ScAddress(3, 0, 0), 3); // D1
- pDoc->SetString(ScAddress(4, 0, 0), "=10*C1/4"); // E1
+ pDoc->SetString(ScAddress(4, 0, 0), u"=10*C1/4"_ustr); // E1
pDoc->SetValue(ScAddress(5, 0, 0), 3.0); // F1
- pDoc->SetString(ScAddress(7, 0, 0), "=SUM(C1:F1)"); //H1
+ pDoc->SetString(ScAddress(7, 0, 0), u"=SUM(C1:F1)"_ustr); //H1
// set a string
- pDoc->SetString(ScAddress(0, 2, 0), "a simple line"); //A3
+ pDoc->SetString(ScAddress(0, 2, 0), u"a simple line"_ustr); //A3
// set a digit string
- pDoc->SetString(ScAddress(0, 4, 0), "'12"); //A5
+ pDoc->SetString(ScAddress(0, 4, 0), u"'12"_ustr); //A5
// set a contiguous value
pDoc->SetValue(ScAddress(0, 5, 0), 12.0); //A6
// set a contiguous string
- pDoc->SetString(ScAddress(0, 6, 0), "a string"); //A7
+ pDoc->SetString(ScAddress(0, 6, 0), u"a string"_ustr); //A7
// set a contiguous formula
- pDoc->SetString(ScAddress(0, 7, 0), "=$A$6"); //A8
+ pDoc->SetString(ScAddress(0, 7, 0), u"=$A$6"_ustr); //A8
}
// save and reload
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
CPPUNIT_ASSERT_MESSAGE("Reloaded document should at least have one sheet.",
pDoc->GetTableCount() > 0);
@@ -1904,9 +1908,9 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCellValuesExportODS)
CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(5, 0, 0));
// check formula
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula =10*C1/4", OUString("=10*C1/4"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula =10*C1/4", u"=10*C1/4"_ustr,
pDoc->GetFormula(4, 0, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula =SUM(C1:F1)", OUString("=SUM(C1:F1)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula =SUM(C1:F1)", u"=SUM(C1:F1)"_ustr,
pDoc->GetFormula(7, 0, 0));
CPPUNIT_ASSERT_EQUAL(16.5, pDoc->GetValue(7, 0, 0));
@@ -1925,9 +1929,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCellValuesExportODS)
//check contiguous values
CPPUNIT_ASSERT_EQUAL(12.0, pDoc->GetValue(0, 5, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("a string"), pDoc->GetString(0, 6, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula =$A$6", OUString("=$A$6"),
- pDoc->GetFormula(0, 7, 0));
+ CPPUNIT_ASSERT_EQUAL(u"a string"_ustr, pDoc->GetString(0, 6, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula =$A$6", u"=$A$6"_ustr, pDoc->GetFormula(0, 7, 0));
CPPUNIT_ASSERT_EQUAL(pDoc->GetValue(0, 5, 0), pDoc->GetValue(0, 7, 0));
}
@@ -1942,12 +1945,12 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCellNoteExportODS)
aPos.IncRow(); // Move to A2.
ScPostIt* pNote = pDoc->GetOrCreateNote(aPos);
- pNote->SetText(aPos, "Note One");
- pNote->SetAuthor("Author One");
+ pNote->SetText(aPos, u"Note One"_ustr);
+ pNote->SetAuthor(u"Author One"_ustr);
CPPUNIT_ASSERT_MESSAGE("There should be a note at A2.", pDoc->HasNote(aPos));
}
// save and reload
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
aPos.SetRow(0); // Move back to A1.
@@ -1979,7 +1982,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCellNoteExportXLS)
CPPUNIT_ASSERT(pDoc->HasNote(ScAddress(0, 2, 2)));
}
// save and reload as XLS.
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
{
ScDocument* pDoc = getScDoc();
CPPUNIT_ASSERT_EQUAL_MESSAGE("This document should have 3 sheets.", SCTAB(3),
@@ -2029,7 +2032,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testInlineArrayXLS)
{
createScDoc("xls/inline-array.xls");
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
ScDocument* pDoc = getScDoc();
@@ -2047,29 +2050,29 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testEmbeddedChartODS)
{
createScDoc("xls/embedded-chart.xls");
- save("calc8");
+ save(u"calc8"_ustr);
- xmlDocUniquePtr pDoc = parseExport("content.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"content.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc,
"/office:document-content/office:body/office:spreadsheet/table:table[2]/"
"table:table-row[7]/table:table-cell[2]/draw:frame/draw:object"_ostr,
"notify-on-update-of-ranges"_ostr,
- "Chart1.B3:Chart1.B5 Chart1.C2:Chart1.C2 Chart1.C3:Chart1.C5");
+ u"Chart1.B3:Chart1.B5 Chart1.C2:Chart1.C2 Chart1.C3:Chart1.C5"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testEmbeddedChartXLS)
{
createScDoc("xls/embedded-chart.xls");
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
ScDocument* pDoc = getScDoc();
// Make sure the 2nd sheet is named 'Chart1'.
OUString aName;
pDoc->GetName(1, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Chart1"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Chart1"_ustr, aName);
const SdrOle2Obj* pOleObj = getSingleChartObject(*pDoc, 1);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve a chart object from the 2nd sheet.", pOleObj);
@@ -2086,7 +2089,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCellAnchoredGroupXLS)
{
createScDoc("xls/cell-anchored-group.xls");
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// the document contains a group anchored on the first cell, make sure it's there in the right place
ScDocument* pDoc = getScDoc();
@@ -2109,25 +2112,25 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testFormulaReferenceXLS)
{
createScDoc("xls/formula-reference.xls");
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D2", OUString("=$A$2+$B$2+$C$2"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D2", u"=$A$2+$B$2+$C$2"_ustr,
pDoc->GetFormula(3, 1, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D3", OUString("=A3+B3+C3"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D3", u"=A3+B3+C3"_ustr,
pDoc->GetFormula(3, 2, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D6", OUString("=SUM($A$6:$C$6)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D6", u"=SUM($A$6:$C$6)"_ustr,
pDoc->GetFormula(3, 5, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D7", OUString("=SUM(A7:C7)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D7", u"=SUM(A7:C7)"_ustr,
pDoc->GetFormula(3, 6, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D10", OUString("=$Two.$A$2+$Two.$B$2+$Two.$C$2"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D10", u"=$Two.$A$2+$Two.$B$2+$Two.$C$2"_ustr,
pDoc->GetFormula(3, 9, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D11", OUString("=$Two.A3+$Two.B3+$Two.C3"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D11", u"=$Two.A3+$Two.B3+$Two.C3"_ustr,
pDoc->GetFormula(3, 10, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D14", OUString("=MIN($Two.$A$2:$C$2)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D14", u"=MIN($Two.$A$2:$C$2)"_ustr,
pDoc->GetFormula(3, 13, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D15", OUString("=MAX($Two.A3:C3)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D15", u"=MAX($Two.A3:C3)"_ustr,
pDoc->GetFormula(3, 14, 0));
}
@@ -2135,7 +2138,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testSheetProtectionXLSX)
{
createScDoc("xlsx/ProtecteSheet1234Pass.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
const ScTableProtection* pTabProtect = pDoc->GetTabProtection(0);
@@ -2156,7 +2159,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testSheetProtectionXLSB)
{
createScDoc("xlsb/tdf108017_calcProtection.xlsb");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
const ScTableProtection* pTabProtect = pDoc->GetTabProtection(0);
@@ -2176,12 +2179,12 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testConditionalFormatNumberInTextRule)
ScRange aCondFormatRange(aAddress);
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry
- = new ScCondFormatEntry(ScConditionMode::BeginsWith, "15", "", *pDocument, aAddress, "");
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::BeginsWith, u"15"_ustr,
+ u""_ustr, *pDocument, aAddress, u""_ustr);
pFormat->AddEntry(pEntry);
pDocument->AddCondFormat(std::move(pFormat), 0);
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDocument = getScDoc();
ScConditionalFormat* pCondFormat = pDocument->GetCondFormat(0, 0, 0);
@@ -2193,7 +2196,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testConditionalFormatNumberInTextRule)
const ScConditionEntry* pConditionEntry
= static_cast<const ScConditionEntry*>(pCondFormatEntry);
CPPUNIT_ASSERT_EQUAL(ScConditionMode::BeginsWith, pConditionEntry->GetOperation());
- CPPUNIT_ASSERT_EQUAL(OUString("\"15\""), pConditionEntry->GetExpression(aAddress, 0));
+ CPPUNIT_ASSERT_EQUAL(u"\"15\""_ustr, pConditionEntry->GetExpression(aAddress, 0));
}
namespace
@@ -2275,36 +2278,36 @@ void ScExportTest::testExcelCellBorders(const OUString& sFormatType)
CPPUNIT_TEST_FIXTURE(ScExportTest, testCellBordersXLS)
{
createScDoc("xls/cell-borders.xls");
- testExcelCellBorders("MS Excel 97");
+ testExcelCellBorders(u"MS Excel 97"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testCellBordersXLSX)
{
createScDoc("xlsx/cell-borders.xlsx");
- testExcelCellBorders("Calc Office Open XML");
+ testExcelCellBorders(u"Calc Office Open XML"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf155368)
{
createScDoc("ods/tdf155368.ods");
- dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
- dispatchCommand(mxComponent, ".uno:WrapText", {});
+ dispatchCommand(mxComponent, u".uno:WrapText"_ustr, {});
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pStyles = parseExport("xl/styles.xml");
+ xmlDocUniquePtr pStyles = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pStyles);
assertXPath(pStyles, "/x:styleSheet/x:cellXfs/x:xf[1]/x:alignment"_ostr, "wrapText"_ostr,
- "false");
+ u"false"_ustr);
// Without the fix in place, this test would have failed with
// - Expected: false
// - Actual : true
assertXPath(pStyles, "/x:styleSheet/x:cellXfs/x:xf[2]/x:alignment"_ostr, "wrapText"_ostr,
- "false");
+ u"false"_ustr);
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx
index 1f9ba48df12a..3be3576b27eb 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -36,16 +36,16 @@ public:
};
ScExportTest2::ScExportTest2()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testGroupShape)
{
createScDoc("xlsx/groupShape.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/drawing1.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor/xdr:grpSp/xdr:grpSpPr"_ostr);
}
@@ -54,22 +54,22 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testMatrixMultiplicationXLSX)
{
createScDoc("xlsx/matrix-multiplication.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
OUString CellFormulaRange
= getXPath(pDoc, "/x:worksheet/x:sheetData/x:row[4]/x:c/x:f"_ostr, "ref"_ostr);
// make sure that the CellFormulaRange is G5:G6.
- CPPUNIT_ASSERT_EQUAL(OUString("G5:G6"), CellFormulaRange);
+ CPPUNIT_ASSERT_EQUAL(u"G5:G6"_ustr, CellFormulaRange);
OUString CellFormulaType
= getXPath(pDoc, "/x:worksheet/x:sheetData/x:row[4]/x:c/x:f"_ostr, "t"_ostr);
// make sure that the CellFormulaType is array.
- CPPUNIT_ASSERT_EQUAL(OUString("array"), CellFormulaType);
+ CPPUNIT_ASSERT_EQUAL(u"array"_ustr, CellFormulaType);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testRefStringXLSX)
@@ -77,7 +77,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testRefStringXLSX)
createScDoc("xlsx/ref_string.xlsx");
//make sure ref syntax gets saved for MSO-produced docs
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
ScCalcConfig aCalcConfig = pDoc->GetCalcConfig();
@@ -89,7 +89,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testRefStringConfigXLSX)
// this doc is configured with CalcA1 ref syntax
createScDoc("xlsx/empty.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
ScCalcConfig aConfig = pDoc->GetCalcConfig();
@@ -111,7 +111,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testRefStringConfigXLSX)
aConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_XL_R1C1;
pDoc->SetCalcConfig(aConfig);
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
// ... and make sure it got saved
pDoc = getScDoc();
@@ -134,7 +134,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testRefStringUnspecified)
// change formula syntax (i.e. not string ref syntax) to ExcelA1
pDoc->SetGrammar(formula::FormulaGrammar::GRAM_NATIVE_XL_A1);
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// with string ref syntax at its default value, we should've saved ExcelA1
pDoc = getScDoc();
@@ -148,63 +148,65 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testHeaderImageODS)
{
// Graphic as header background was lost on export.
createScDoc("ods/header-image.ods");
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(mxComponent,
uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xStyleFamilies
= xStyleFamiliesSupplier->getStyleFamilies();
- uno::Reference<container::XNameAccess> xPageStyles(xStyleFamilies->getByName("PageStyles"),
- uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName("Default"), uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xPageStyles(
+ xStyleFamilies->getByName(u"PageStyles"_ustr), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName(u"Default"_ustr),
+ uno::UNO_QUERY);
uno::Reference<graphic::XGraphic> xGraphic;
- xStyle->getPropertyValue("HeaderBackGraphic") >>= xGraphic;
+ xStyle->getPropertyValue(u"HeaderBackGraphic"_ustr) >>= xGraphic;
CPPUNIT_ASSERT(xGraphic.is());
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testHeaderFooterContentODS)
{
createScDoc("ods/header-footer-content.ods");
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(mxComponent,
uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xStyleFamilies
= xStyleFamiliesSupplier->getStyleFamilies();
- uno::Reference<container::XNameAccess> xPageStyles(xStyleFamilies->getByName("PageStyles"),
- uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName("Default"), uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xPageStyles(
+ xStyleFamilies->getByName(u"PageStyles"_ustr), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName(u"Default"_ustr),
+ uno::UNO_QUERY);
uno::Reference<css::sheet::XHeaderFooterContent> xContent;
- xStyle->getPropertyValue("RightPageHeaderContent") >>= xContent;
+ xStyle->getPropertyValue(u"RightPageHeaderContent"_ustr) >>= xContent;
CPPUNIT_ASSERT(xContent.is());
- CPPUNIT_ASSERT_EQUAL(OUString("header"), xContent->getCenterText()->getString());
+ CPPUNIT_ASSERT_EQUAL(u"header"_ustr, xContent->getCenterText()->getString());
- xStyle->getPropertyValue("FirstPageHeaderContent") >>= xContent;
+ xStyle->getPropertyValue(u"FirstPageHeaderContent"_ustr) >>= xContent;
CPPUNIT_ASSERT(xContent.is());
- CPPUNIT_ASSERT_EQUAL(OUString("first page header"), xContent->getCenterText()->getString());
+ CPPUNIT_ASSERT_EQUAL(u"first page header"_ustr, xContent->getCenterText()->getString());
- xStyle->getPropertyValue("RightPageFooterContent") >>= xContent;
+ xStyle->getPropertyValue(u"RightPageFooterContent"_ustr) >>= xContent;
CPPUNIT_ASSERT(xContent.is());
- CPPUNIT_ASSERT_EQUAL(OUString("footer"), xContent->getCenterText()->getString());
+ CPPUNIT_ASSERT_EQUAL(u"footer"_ustr, xContent->getCenterText()->getString());
- xStyle->getPropertyValue("FirstPageFooterContent") >>= xContent;
+ xStyle->getPropertyValue(u"FirstPageFooterContent"_ustr) >>= xContent;
// First page footer content used to be lost upon export.
CPPUNIT_ASSERT(xContent.is());
- CPPUNIT_ASSERT_EQUAL(OUString("first page footer"), xContent->getCenterText()->getString());
+ CPPUNIT_ASSERT_EQUAL(u"first page footer"_ustr, xContent->getCenterText()->getString());
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTextDirectionXLSX)
{
createScDoc("xlsx/writingMode.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/x:styleSheet/x:cellXfs/x:xf[2]/x:alignment"_ostr, "readingOrder"_ostr,
- "1"); //LTR
+ u"1"_ustr); //LTR
assertXPath(pDoc, "/x:styleSheet/x:cellXfs/x:xf[3]/x:alignment"_ostr, "readingOrder"_ostr,
- "2"); //RTL
+ u"2"_ustr); //RTL
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf121260)
@@ -215,8 +217,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf121260)
// change formula syntax (i.e. not string ref syntax) to ExcelA1
FormulaGrammarSwitch aFGSwitch(pDoc, formula::FormulaGrammar::GRAM_NATIVE_XL_A1);
- save("Calc Office Open XML");
- xmlDocUniquePtr pChart1 = parseExport("xl/charts/chart1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pChart1 = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pChart1);
// Without the fix in place, this test would have failed with
@@ -224,45 +226,47 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf121260)
// - Actual : sheet1 $A$1:$A$2
assertXPathContent(
pChart1, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:val/c:numRef/c:f"_ostr,
- "Sheet1!$A$1:$A$2");
+ u"Sheet1!$A$1:$A$2"_ustr);
assertXPathContent(
pChart1, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:val/c:numRef/c:f"_ostr,
- "Sheet1!$B$1:$B$2");
+ u"Sheet1!$B$1:$B$2"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf120168)
{
createScDoc("xlsx/tdf120168.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
// Without the fix in place, this test would have failed with
// - Expected: left
// - Actual : general
assertXPath(pDoc, "/x:styleSheet/x:cellXfs/x:xf[2]/x:alignment"_ostr, "horizontal"_ostr,
- "left");
+ u"left"_ustr);
assertXPath(pDoc, "/x:styleSheet/x:cellXfs/x:xf[3]/x:alignment"_ostr, "horizontal"_ostr,
- "right");
+ u"right"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf117266)
{
createScDoc("xlsm/tdf117266_macroButton.xlsm");
- save("Calc MS Excel 2007 VBA XML");
- xmlDocUniquePtr pVmlDrawing = parseExport("xl/drawings/vmlDrawing1.vml");
+ save(u"Calc MS Excel 2007 VBA XML"_ustr);
+ xmlDocUniquePtr pVmlDrawing = parseExport(u"xl/drawings/vmlDrawing1.vml"_ustr);
OUString sName = getXPath(pVmlDrawing, "/xml/v:shape"_ostr, "id"_ostr);
- CPPUNIT_ASSERT_EQUAL(OUString("Button 1001"), sName);
+ CPPUNIT_ASSERT_EQUAL(u"Button 1001"_ustr, sName);
OUString sSpid = getXPath(pVmlDrawing, "/xml/v:shape"_ostr, "spid"_ostr);
CPPUNIT_ASSERT(sSpid.startsWith("_x0000_s"));
- assertXPathContent(pVmlDrawing, "/xml/v:shape/v:textbox/div/font"_ostr, "Button 1 \"y\" z");
+ assertXPathContent(pVmlDrawing, "/xml/v:shape/v:textbox/div/font"_ostr,
+ u"Button 1 \"y\" z"_ustr);
// Why the xx:, I have no idea..., but it certainly doesn't work with just x:.
- assertXPathContent(pVmlDrawing, "/xml/v:shape//xx:FmlaMacro"_ostr, "Module1.Button1_Click");
+ assertXPathContent(pVmlDrawing, "/xml/v:shape//xx:FmlaMacro"_ostr,
+ u"Module1.Button1_Click"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf66668)
@@ -270,8 +274,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf66668)
// Would hang on exporting without the fix in place
createScDoc("xlsx/tdf66668.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
}
@@ -279,49 +283,50 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf130108)
{
createScDoc("ods/tdf130108.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:b"_ostr, "val"_ostr, "1");
- assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:i"_ostr, "val"_ostr, "0");
- assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:color"_ostr, "rgb"_ostr, "FFFFFFFF");
- assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:sz"_ostr, "val"_ostr, "10");
+ assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:b"_ostr, "val"_ostr, u"1"_ustr);
+ assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:i"_ostr, "val"_ostr, u"0"_ustr);
+ assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:color"_ostr, "rgb"_ostr,
+ u"FFFFFFFF"_ustr);
+ assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:sz"_ostr, "val"_ostr, u"10"_ustr);
assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:fill/x:patternFill/x:bgColor"_ostr, "rgb"_ostr,
- "FFCC0000");
+ u"FFCC0000"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf76949)
{
createScDoc("ods/tdf76949.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
assertXPathContent(pSheet, "/x:worksheet/x:sheetData/x:row/x:c/x:f"_ostr,
- "_xlfn.CHISQ.DIST(1,1,1)");
+ u"_xlfn.CHISQ.DIST(1,1,1)"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf107586)
{
createScDoc("xlsx/tdf107586.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// Without the fix in place, this test would have failed with
// XPath '/x:worksheet/x:sheetPr/x:tabColor' number of nodes is incorrect
- assertXPath(pSheet, "/x:worksheet/x:sheetPr/x:tabColor"_ostr, "rgb"_ostr, "FF9BBB59");
+ assertXPath(pSheet, "/x:worksheet/x:sheetPr/x:tabColor"_ostr, "rgb"_ostr, u"FF9BBB59"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf55417)
{
createScDoc("xlsx/tdf55417.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/x:styleSheet/x:cellXfs/x:xf[1]/x:alignment"_ostr, 1);
assertXPath(pDoc, "/x:styleSheet/x:cellXfs/x:xf[2]/x:alignment"_ostr, 1);
@@ -331,23 +336,24 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf129985)
{
createScDoc("xlsx/tdf129985.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[2]"_ostr, "formatCode"_ostr, "m/d/yyyy");
+ assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[2]"_ostr, "formatCode"_ostr,
+ u"m/d/yyyy"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf73063)
{
createScDoc("xlsx/tdf73063.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[2]"_ostr, "formatCode"_ostr,
- "[$-1C1A]dddd\", \"d\". \"mmmm\\ yyyy;@");
+ u"[$-1C1A]dddd\", \"d\". \"mmmm\\ yyyy;@"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf95640_ods_to_xlsx)
@@ -355,32 +361,33 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf95640_ods_to_xlsx)
// Roundtripping sort options with user defined list to XLSX
createScDoc("ods/tdf95640.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
- assertXPath(pDoc, "//x:worksheet/x:autoFilter"_ostr, "ref"_ostr, "A1:B4");
+ assertXPath(pDoc, "//x:worksheet/x:autoFilter"_ostr, "ref"_ostr, u"A1:B4"_ustr);
assertXPath(pDoc, "//x:worksheet/x:autoFilter/x:sortState/x:sortCondition"_ostr, "ref"_ostr,
- "A2:A4");
+ u"A2:A4"_ustr);
assertXPath(pDoc, "//x:worksheet/x:autoFilter/x:sortState/x:sortCondition"_ostr,
- "customList"_ostr, "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec");
+ "customList"_ostr, u"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf95640_ods_to_xlsx_with_standard_list)
{
// Roundtripping sort options with user defined list to XLSX
createScDoc("ods/tdf95640_standard_list.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
- assertXPath(pDoc, "//x:worksheet/x:autoFilter"_ostr, "ref"_ostr, "A1:B4");
+ assertXPath(pDoc, "//x:worksheet/x:autoFilter"_ostr, "ref"_ostr, u"A1:B4"_ustr);
assertXPath(pDoc, "//x:worksheet/x:autoFilter/x:sortState/x:sortCondition"_ostr, "ref"_ostr,
- "A2:A4");
+ u"A2:A4"_ustr);
assertXPath(pDoc, "//x:worksheet/x:autoFilter/x:sortState/x:sortCondition"_ostr,
- "customList"_ostr, "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday");
+ "customList"_ostr,
+ u"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf95640_xlsx_to_xlsx)
@@ -391,16 +398,16 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf95640_xlsx_to_xlsx)
// low, medium, high
createScDoc("xlsx/tdf95640.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
- assertXPath(pDoc, "//x:worksheet/x:autoFilter"_ostr, "ref"_ostr, "A1:B4");
+ assertXPath(pDoc, "//x:worksheet/x:autoFilter"_ostr, "ref"_ostr, u"A1:B4"_ustr);
assertXPath(pDoc, "//x:worksheet/x:autoFilter/x:sortState/x:sortCondition"_ostr, "ref"_ostr,
- "A2:A4");
+ u"A2:A4"_ustr);
assertXPath(pDoc, "//x:worksheet/x:autoFilter/x:sortState/x:sortCondition"_ostr,
- "customList"_ostr, "Low,Medium,High");
+ "customList"_ostr, u"Low,Medium,High"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testDateAutofilterXLSX)
@@ -408,63 +415,63 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testDateAutofilterXLSX)
// XLSX Roundtripping autofilter with date list
createScDoc("xlsx/dateAutofilter.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "//x:autoFilter"_ostr, "ref"_ostr, "A1:B4");
+ assertXPath(pDoc, "//x:autoFilter"_ostr, "ref"_ostr, u"A1:B4"_ustr);
assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[1]"_ostr, "day"_ostr,
- "02");
+ u"02"_ustr);
assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[1]"_ostr,
- "month"_ostr, "03");
+ "month"_ostr, u"03"_ustr);
assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[1]"_ostr,
- "year"_ostr, "2017");
+ "year"_ostr, u"2017"_ustr);
assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[1]"_ostr,
- "dateTimeGrouping"_ostr, "day");
+ "dateTimeGrouping"_ostr, u"day"_ustr);
assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[2]"_ostr, "day"_ostr,
- "01");
+ u"01"_ustr);
assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[2]"_ostr,
- "month"_ostr, "10");
+ "month"_ostr, u"10"_ustr);
assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[2]"_ostr,
- "year"_ostr, "2014");
+ "year"_ostr, u"2014"_ustr);
assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[2]"_ostr,
- "dateTimeGrouping"_ostr, "day");
+ "dateTimeGrouping"_ostr, u"day"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testDateAutofilterODS)
{
createScDoc("ods/tdf142231.ods");
- save("calc8");
- xmlDocUniquePtr pDoc = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"content.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "//table:filter/table:filter-and/table:filter-condition[1]"_ostr,
- "value"_ostr, "Calc");
+ "value"_ostr, u"Calc"_ustr);
assertXPath(pDoc, "//table:filter/table:filter-and/table:filter-condition[2]"_ostr,
- "value"_ostr, "2021-05-04");
+ "value"_ostr, u"2021-05-04"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterColorsODF)
{
createScDoc("ods/autofilter-colors.ods");
- save("calc8");
- xmlDocUniquePtr pDoc = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"content.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc,
"//table:database-ranges/table:database-range[1]/table:filter/table:filter-and/"
"table:filter-condition[1]"_ostr,
- "value"_ostr, "#e8f2a1");
+ "value"_ostr, u"#e8f2a1"_ustr);
assertXPath(pDoc,
"//table:database-ranges/table:database-range[1]/table:filter/table:filter-and/"
"table:filter-condition[1][@loext:data-type='background-color']"_ostr);
assertXPath(pDoc,
"//table:database-ranges/table:database-range[1]/table:filter/table:filter-and/"
"table:filter-condition[2]"_ostr,
- "value"_ostr, "#3465a4");
+ "value"_ostr, u"#3465a4"_ustr);
assertXPath(pDoc,
"//table:database-ranges/table:database-range[1]/table:filter/"
"table:filter-and/table:filter-condition[2][@loext:data-type='text-color']"_ostr);
@@ -476,22 +483,22 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterColorsODF)
assertXPath(pDoc,
"//table:database-ranges/table:database-range[2]/table:filter/table:filter-and/"
"table:filter-condition[1]"_ostr,
- "value"_ostr, "transparent");
+ "value"_ostr, u"transparent"_ustr);
assertXPath(pDoc,
"//table:database-ranges/table:database-range[3]/table:filter/"
"table:filter-and/table:filter-condition[1][@loext:data-type='text-color']"_ostr);
assertXPath(pDoc,
"//table:database-ranges/table:database-range[3]/table:filter/table:filter-and/"
"table:filter-condition[1]"_ostr,
- "value"_ostr, "window-font-color");
+ "value"_ostr, u"window-font-color"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterColorsOOXML)
{
{
createScDoc("xlsx/autofilter-colors.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable1 = parseExport("xl/tables/table1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable1 = parseExport(u"xl/tables/table1.xml"_ustr);
CPPUNIT_ASSERT(pTable1);
sal_Int32 nDxfId
= getXPath(pTable1, "/x:table/x:autoFilter/x:filterColumn/x:colorFilter"_ostr,
@@ -499,17 +506,17 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterColorsOOXML)
.toInt32()
+ 1;
- xmlDocUniquePtr pStyles = parseExport("xl/styles.xml");
+ xmlDocUniquePtr pStyles = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pStyles);
OString sDxfXPath("/x:styleSheet/x:dxfs/x:dxf[" + OString::number(nDxfId)
+ "]/x:fill/x:patternFill/x:fgColor");
- assertXPath(pStyles, sDxfXPath, "rgb"_ostr, "FFFFD7D7");
+ assertXPath(pStyles, sDxfXPath, "rgb"_ostr, u"FFFFD7D7"_ustr);
}
{
createScDoc("xlsx/autofilter-colors-fg.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pTable1 = parseExport("xl/tables/table1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pTable1 = parseExport(u"xl/tables/table1.xml"_ustr);
CPPUNIT_ASSERT(pTable1);
sal_Int32 nDxfId
= getXPath(pTable1, "/x:table/x:autoFilter/x:filterColumn/x:colorFilter"_ostr,
@@ -517,11 +524,11 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterColorsOOXML)
.toInt32()
+ 1;
- xmlDocUniquePtr pStyles = parseExport("xl/styles.xml");
+ xmlDocUniquePtr pStyles = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pStyles);
OString sDxfXPath("/x:styleSheet/x:dxfs/x:dxf[" + OString::number(nDxfId)
+ "]/x:fill/x:patternFill/x:fgColor");
- assertXPath(pStyles, sDxfXPath, "rgb"_ostr, "FF3465A4");
+ assertXPath(pStyles, sDxfXPath, "rgb"_ostr, u"FF3465A4"_ustr);
}
}
@@ -529,63 +536,63 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterTop10XLSX)
{
createScDoc("xlsx/tdf143068_top10filter.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "//x:autoFilter/x:filterColumn"_ostr, "colId"_ostr, "0");
- assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:top10"_ostr, "val"_ostr, "4");
+ assertXPath(pDoc, "//x:autoFilter/x:filterColumn"_ostr, "colId"_ostr, u"0"_ustr);
+ assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:top10"_ostr, "val"_ostr, u"4"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf88657ODS)
{
createScDoc("ods/tdf88657.ods");
- save("calc8");
- xmlDocUniquePtr pDoc = parseExport("styles.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"styles.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "//number:fraction"_ostr, "min-denominator-digits"_ostr, "3");
+ assertXPath(pDoc, "//number:fraction"_ostr, "min-denominator-digits"_ostr, u"3"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf41722)
{
createScDoc("xlsx/tdf41722.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "//x:conditionalFormatting/x:cfRule[1]"_ostr, "operator"_ostr,
- "containsText");
+ u"containsText"_ustr);
assertXPath(pDoc, "//x:conditionalFormatting/x:cfRule[2]"_ostr, "operator"_ostr,
- "containsText");
+ u"containsText"_ustr);
assertXPath(pDoc, "//x:conditionalFormatting/x:cfRule[3]"_ostr, "operator"_ostr,
- "containsText");
+ u"containsText"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf113621)
{
createScDoc("xlsx/tdf113621.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "//x:conditionalFormatting"_ostr, "sqref"_ostr, "A1:A1048576");
+ assertXPath(pDoc, "//x:conditionalFormatting"_ostr, "sqref"_ostr, u"A1:A1048576"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testEscapeCharInNumberFormatXLSX)
{
createScDoc("xlsx/tdf81939.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[2]"_ostr, "formatCode"_ostr,
- "00\\ 00\\ 00\\ 00\\ 00");
+ u"00\\ 00\\ 00\\ 00\\ 00"_ustr);
assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[3]"_ostr, "formatCode"_ostr,
- "00\\.00\\.00\\.000\\.0"); // tdf#81939
+ u"00\\.00\\.00\\.000\\.0"_ustr); // tdf#81939
// "_-* #,##0\ _€_-;\-* #,##0\ _€_-;_-* "- "_€_-;_-@_-" // tdf#81222
OUString rFormatStrExpected(u"_-* #,##0\\ _€_-;\\-* #,##0\\ _€_-;_-* \"- \"_€_-;_-@_-"_ustr);
assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[4]"_ostr, "formatCode"_ostr,
@@ -596,27 +603,27 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testEscapeCharInNumberFormatXLSX)
rFormatStrExpected);
// remove escape char in fraction
assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[6]"_ostr, "formatCode"_ostr,
- "# ?/?;[RED]\\-# #/#####");
+ u"# ?/?;[RED]\\-# #/#####"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testNatNumInNumberFormatXLSX)
{
createScDoc("ods/tdf79398_NatNum5.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[3]"_ostr, "formatCode"_ostr,
- "[DBNum2][$-804]General;[RED][DBNum2][$-804]General");
+ u"[DBNum2][$-804]General;[RED][DBNum2][$-804]General"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testExponentWithoutSignFormatXLSX)
{
createScDoc("ods/tdf102370_ExponentWithoutSign.ods");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
sal_uInt32 nNumberFormat = pDoc->GetNumberFormat(0, 0, 0);
@@ -624,38 +631,40 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testExponentWithoutSignFormatXLSX)
const OUString& rFormatStr = pNumberFormat->GetFormatstring();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Number format lost exponent without sign during Excel export",
- OUString("0.00E0"), rFormatStr);
+ u"0.00E0"_ustr, rFormatStr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testExtendedLCIDXLSX)
{
createScDoc("ods/tdf36038_ExtendedLCID.ods");
- saveAndReload("Calc Office Open XML");
- xmlDocUniquePtr pDocXml = parseExport("xl/styles.xml");
+ saveAndReload(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDocXml = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pDocXml);
// Check export
assertXPath(pDocXml, "/x:styleSheet/x:numFmts/x:numFmt[2]"_ostr, "formatCode"_ostr,
- "[$-107041E]dd\\-mm\\-yyyy");
+ u"[$-107041E]dd\\-mm\\-yyyy"_ustr);
assertXPath(pDocXml, "/x:styleSheet/x:numFmts/x:numFmt[3]"_ostr, "formatCode"_ostr,
- "[$-D07041E]dd\\-mm\\-yyyy");
+ u"[$-D07041E]dd\\-mm\\-yyyy"_ustr);
assertXPath(pDocXml, "/x:styleSheet/x:numFmts/x:numFmt[4]"_ostr, "formatCode"_ostr,
- "[$-1030411]dd\\-mm\\-ee");
+ u"[$-1030411]dd\\-mm\\-ee"_ustr);
assertXPath(pDocXml, "/x:styleSheet/x:numFmts/x:numFmt[5]"_ostr, "formatCode"_ostr,
- "[$-1B030411]dd\\-mm\\-ee");
+ u"[$-1B030411]dd\\-mm\\-ee"_ustr);
assertXPath(pDocXml, "/x:styleSheet/x:numFmts/x:numFmt[6]"_ostr, "formatCode"_ostr,
- "[$-108040D]dd\\-mm\\-yyyy");
+ u"[$-108040D]dd\\-mm\\-yyyy"_ustr);
assertXPath(pDocXml, "/x:styleSheet/x:numFmts/x:numFmt[7]"_ostr, "formatCode"_ostr,
- "[$-108040D]dd\\-mm\\-yyyy");
+ u"[$-108040D]dd\\-mm\\-yyyy"_ustr);
assertXPath(pDocXml, "/x:styleSheet/x:numFmts/x:numFmt[8]"_ostr, "formatCode"_ostr,
- "[$-1060401]dd\\-mm\\-yyyy");
+ u"[$-1060401]dd\\-mm\\-yyyy"_ustr);
// Check import
ScDocument* pDoc = getScDoc();
SvNumberFormatter* pNumFormatter = pDoc->GetFormatTable();
- const OUString aLang[5] = { "[$-41E]", "[$-411]", "[$-40D]", "[$-401]", "[$-500]" };
- const OUString aCalendar[5] = { "[~buddhist]DD-MM-YYYY", "DD-MM-EE", "[~jewish]DD-MM-YYYY",
- "[~hijri]DD-MM-YYYY", "[~dangi]YYYY/MM/DD" };
+ const OUString aLang[5]
+ = { u"[$-41E]"_ustr, u"[$-411]"_ustr, u"[$-40D]"_ustr, u"[$-401]"_ustr, u"[$-500]"_ustr };
+ const OUString aCalendar[5]
+ = { u"[~buddhist]DD-MM-YYYY"_ustr, u"DD-MM-EE"_ustr, u"[~jewish]DD-MM-YYYY"_ustr,
+ u"[~hijri]DD-MM-YYYY"_ustr, u"[~dangi]YYYY/MM/DD"_ustr };
// Note: ja-JP Gengou calendar is an implicit secondary (non-gregorian)
// calendar, the explicit [~gengou] calendar modifier does not need to be
// present, the E and EE keywords are used instead of YY and YYYY.
@@ -667,7 +676,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testExtendedLCIDXLSX)
const SvNumberformat* pNumberFormat = pNumFormatter->GetEntry(nNumberFormat);
const OUString& rFormatStr = pNumberFormat->GetFormatstring();
const OUString aExpectedFormatStr
- = aLang[nRow - 1] + ((nCol == 2 && nRow != 3) ? OUString("[NatNum1]") : OUString())
+ = aLang[nRow - 1] + ((nCol == 2 && nRow != 3) ? u"[NatNum1]"_ustr : OUString())
+ aCalendar[nRow - 1];
CPPUNIT_ASSERT_EQUAL_MESSAGE("Number format lost extended LCID during Excel export",
@@ -685,7 +694,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testHiddenRepeatedRowsODS)
pDoc->SetRowHidden(0, 20, 0, true);
}
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
SCROW nFirstRow = 0;
SCROW nLastRow = 0;
@@ -710,22 +719,23 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testHyperlinkTargetFrameODS)
const SvxURLField* pURLData = static_cast<const SvxURLField*>(pData);
OUString aTargetFrame = pURLData->GetTargetFrame();
- CPPUNIT_ASSERT_EQUAL(OUString("_blank"), aTargetFrame);
+ CPPUNIT_ASSERT_EQUAL(u"_blank"_ustr, aTargetFrame);
- save("calc8");
- xmlDocUniquePtr pDocXml = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pDocXml = parseExport(u"content.xml"_ustr);
CPPUNIT_ASSERT(pDocXml);
OUString aTargetFrameExport
= getXPath(pDocXml,
"/office:document-content/office:body/office:spreadsheet/table:table/"
"table:table-row[2]/table:table-cell[2]/text:p/text:a"_ostr,
"target-frame-name"_ostr);
- CPPUNIT_ASSERT_EQUAL(OUString("_blank"), aTargetFrameExport);
+ CPPUNIT_ASSERT_EQUAL(u"_blank"_ustr, aTargetFrameExport);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testOpenDocumentAsReadOnly)
{
- uno::Sequence<beans::PropertyValue> aParams = { comphelper::makePropertyValue("Silent", true) };
+ uno::Sequence<beans::PropertyValue> aParams
+ = { comphelper::makePropertyValue(u"Silent"_ustr, true) };
loadWithParams(createFileURL(u"xlsx/open-as-read-only.xlsx"), aParams);
ScDocShell* pDocSh = getScDocShell();
@@ -742,8 +752,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testKeepSettingsOfBlankRows)
{
createScDoc("xlsx/tdf41425.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// saved blank row with not default setting in A2
@@ -754,8 +764,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf133595)
{
createScDoc("xlsx/tdf133595.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// without the fix in place, mc:AlternateContent would have been added to sheet1
@@ -766,88 +776,88 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf134769)
{
createScDoc("xlsx/tdf134769.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// without the fix in place, the legacyDrawing would have been exported after the checkbox
// and Excel would have claimed the document is corrupted
// Use their ids to check the order
- assertXPath(pSheet, "/x:worksheet/x:drawing"_ostr, "id"_ostr, "rId2");
- assertXPath(pSheet, "/x:worksheet/x:legacyDrawing"_ostr, "id"_ostr, "rId3");
+ assertXPath(pSheet, "/x:worksheet/x:drawing"_ostr, "id"_ostr, u"rId2"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:legacyDrawing"_ostr, "id"_ostr, u"rId3"_ustr);
assertXPath(pSheet,
"/x:worksheet/mc:AlternateContent/mc:Choice/x:controls/mc:AlternateContent/"
"mc:Choice/x:control"_ostr,
- "id"_ostr, "rId4");
+ "id"_ostr, u"rId4"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf106181)
{
createScDoc("ods/tdf106181.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
assertXPath(pSheet,
"/x:worksheet/mc:AlternateContent/mc:Choice/x:controls/mc:AlternateContent/"
"mc:Choice/x:control"_ostr,
- "name"_ostr, "Check Box");
+ "name"_ostr, u"Check Box"_ustr);
assertXPath(pSheet,
"/x:worksheet/mc:AlternateContent/mc:Choice/x:controls/mc:AlternateContent/"
"mc:Choice/x:control/x:controlPr"_ostr,
- "altText"_ostr, "Check Box 1");
+ "altText"_ostr, u"Check Box 1"_ustr);
- xmlDocUniquePtr pDrawing = parseExport("xl/drawings/drawing1.xml");
+ xmlDocUniquePtr pDrawing = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDrawing);
assertXPath(
pDrawing,
"/xdr:wsDr/mc:AlternateContent/mc:Choice/xdr:twoCellAnchor/xdr:sp/xdr:nvSpPr/xdr:cNvPr"_ostr,
- "name"_ostr, "Check Box 1");
+ "name"_ostr, u"Check Box 1"_ustr);
assertXPath(
pDrawing,
"/xdr:wsDr/mc:AlternateContent/mc:Choice/xdr:twoCellAnchor/xdr:sp/xdr:nvSpPr/xdr:cNvPr"_ostr,
- "descr"_ostr, "Check Box");
+ "descr"_ostr, u"Check Box"_ustr);
assertXPath(
pDrawing,
"/xdr:wsDr/mc:AlternateContent/mc:Choice/xdr:twoCellAnchor/xdr:sp/xdr:nvSpPr/xdr:cNvPr"_ostr,
- "hidden"_ostr, "0");
+ "hidden"_ostr, u"0"_ustr);
- xmlDocUniquePtr pVmlDrawing = parseExport("xl/drawings/vmlDrawing1.vml");
+ xmlDocUniquePtr pVmlDrawing = parseExport(u"xl/drawings/vmlDrawing1.vml"_ustr);
CPPUNIT_ASSERT(pVmlDrawing);
- assertXPathContent(pVmlDrawing, "//xx:ClientData/xx:FmlaLink"_ostr, "$D$9");
+ assertXPathContent(pVmlDrawing, "//xx:ClientData/xx:FmlaLink"_ostr, u"$D$9"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf145057)
{
createScDoc("xlsx/tdf145057.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/tables/table1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/tables/table1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "//x:colorFilter"_ostr, "dxfId"_ostr, "1");
+ assertXPath(pDoc, "//x:colorFilter"_ostr, "dxfId"_ostr, u"1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf105272)
{
createScDoc("xlsx/tdf105272.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
//without the fix in place,it would fail
//Expected: Table1[[#This Row],[Total]]/Table1[[#This Row],['# Athletes]]
//Actual : table1[[#this row],[total]]/table1[[#this row],['# athletes]]
CPPUNIT_ASSERT_EQUAL_MESSAGE(
- "Wrong formula", OUString("=Table1[[#This Row],[Total]]/Table1[[#This Row],['# Athletes]]"),
+ "Wrong formula", u"=Table1[[#This Row],[Total]]/Table1[[#This Row],['# Athletes]]"_ustr,
pDoc->GetFormula(7, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf118990)
{
createScDoc("xlsx/tdf118990.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
// TODO: also test A1, which contains a UNC reference to \\localhost\share\lookupsource.xlsx,
@@ -857,19 +867,19 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf118990)
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Wrong Windows share (using host IP) URL in A2",
- OUString("=VLOOKUP(B1,'file://192.168.1.1/share/lookupsource.xlsx'#$Sheet1.A1:B5,2)"),
+ u"=VLOOKUP(B1,'file://192.168.1.1/share/lookupsource.xlsx'#$Sheet1.A1:B5,2)"_ustr,
pDoc->GetFormula(0, 1, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Wrong Windows share (using hostname) URL in A3",
- OUString("=VLOOKUP(B1,'file://NETWORKHOST/share/lookupsource.xlsx'#$Sheet1.A1:B5,2)"),
+ u"=VLOOKUP(B1,'file://NETWORKHOST/share/lookupsource.xlsx'#$Sheet1.A1:B5,2)"_ustr,
pDoc->GetFormula(0, 2, 0));
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf121612)
{
createScDoc("ods/tdf121612.ods");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
@@ -886,12 +896,12 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf112936)
{
createScDoc("xlsx/tdf112936.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/pivotCache/pivotCacheDefinition1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "//x:pivotCacheDefinition"_ostr, "recordCount"_ostr, "4");
- assertXPath(pDoc, "//x:pivotCacheDefinition"_ostr, "createdVersion"_ostr, "3");
+ assertXPath(pDoc, "//x:pivotCacheDefinition"_ostr, "recordCount"_ostr, u"4"_ustr);
+ assertXPath(pDoc, "//x:pivotCacheDefinition"_ostr, "createdVersion"_ostr, u"3"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testXltxExport)
@@ -900,12 +910,13 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testXltxExport)
createScDoc();
// Export as template and check content type
- save("Calc MS Excel 2007 XML Template");
- xmlDocUniquePtr pDoc = parseExport("[Content_Types].xml");
+ save(u"Calc MS Excel 2007 XML Template"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"[Content_Types].xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/ContentType:Types/ContentType:Override[@PartName='/xl/workbook.xml']"_ostr,
- "ContentType"_ostr,
- "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml");
+ assertXPath(
+ pDoc, "/ContentType:Types/ContentType:Override[@PartName='/xl/workbook.xml']"_ostr,
+ "ContentType"_ostr,
+ u"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testPivotCacheAfterExportXLSX)
@@ -913,7 +924,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testPivotCacheAfterExportXLSX)
createScDoc("ods/numgroup_example.ods");
// export only
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
CPPUNIT_ASSERT(pDoc->HasPivotTable());
@@ -938,58 +949,58 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf114969XLSX)
{
createScDoc("ods/sheet_name_with_dots.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink[1]"_ostr, "location"_ostr,
- "'1.1.1.1'!C1");
+ u"'1.1.1.1'!C1"_ustr);
assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink[2]"_ostr, "location"_ostr,
- "'1.1.1.1'!C2");
+ u"'1.1.1.1'!C2"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf115192XLSX)
{
createScDoc("xlsx/test_115192.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/_rels/drawing1.xml.rels");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/_rels/drawing1.xml.rels"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "TargetMode"_ostr,
- "External");
+ u"External"_ustr);
assertXPathNoAttribute(pDoc, "/rels:Relationships/rels:Relationship[@Id='rId2']"_ostr,
"TargetMode"_ostr);
assertXPath(pDoc, "/rels:Relationships/rels:Relationship[@Id='rId3']"_ostr, "TargetMode"_ostr,
- "External");
+ u"External"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf142764)
{
createScDoc("ods/tdf142764.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
- assertXPath(pSheet, "/x:worksheet/x:headerFooter"_ostr, "differentOddEven"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:headerFooter"_ostr, "differentFirst"_ostr, "true");
+ assertXPath(pSheet, "/x:worksheet/x:headerFooter"_ostr, "differentOddEven"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:headerFooter"_ostr, "differentFirst"_ostr, u"true"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf91634XLSX)
{
createScDoc("xlsx/image_hyperlink.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/drawing1.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor/xdr:pic/xdr:nvPicPr/xdr:cNvPr/a:hlinkClick"_ostr,
1);
- xmlDocUniquePtr pXmlRels = parseExport("xl/drawings/_rels/drawing1.xml.rels");
+ xmlDocUniquePtr pXmlRels = parseExport(u"xl/drawings/_rels/drawing1.xml.rels"_ustr);
CPPUNIT_ASSERT(pXmlRels);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "Target"_ostr,
- "https://www.google.com/");
+ u"https://www.google.com/"_ustr);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr,
- "TargetMode"_ostr, "External");
+ "TargetMode"_ostr, u"External"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testValidationCopyPaste)
@@ -1014,21 +1025,21 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testValidationCopyPaste)
pDoc->CopyFromClip(aDstRange, aMark2, InsertDeleteFlags::ALL, nullptr, &aClipDoc);
// save as XLSX
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
// check validation
- xmlDocUniquePtr pDocXml = parseExport("xl/worksheets/sheet1.xml");
+ xmlDocUniquePtr pDocXml = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDocXml);
assertXPathContent(pDocXml, "/x:worksheet/x:dataValidations/x:dataValidation/x:formula1"_ostr,
- "#REF!");
+ u"#REF!"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf115159)
{
createScDoc("xlsx/tdf115159.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/workbook.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/workbook.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
//assert the existing OOXML built-in name is not duplicated
@@ -1040,7 +1051,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf112567)
// Set the system locale to Hungarian (a language with different range separator)
SvtSysLocaleOptions aOptions;
OUString sLocaleConfigString = aOptions.GetLanguageTag().getBcp47();
- aOptions.SetLocaleConfigString("hu-HU");
+ aOptions.SetLocaleConfigString(u"hu-HU"_ustr);
aOptions.Commit();
comphelper::ScopeGuard g([&aOptions, &sLocaleConfigString] {
aOptions.SetLocaleConfigString(sLocaleConfigString);
@@ -1049,8 +1060,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf112567)
createScDoc("xlsx/tdf112567.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/workbook.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/workbook.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
//assert the existing OOXML built-in name is not duplicated
@@ -1066,12 +1077,12 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf75702)
ScDocument* pDoc = getScDoc();
CPPUNIT_ASSERT_EQUAL_MESSAGE("load a1", sA1, pDoc->GetString(0, 0, 0));
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
CPPUNIT_ASSERT_EQUAL_MESSAGE("reload a1", sA1, pDoc->GetString(0, 0, 0));
- save("calc8");
- xmlDocUniquePtr pContent = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pContent = parseExport(u"content.xml"_ustr);
assertXPath(pContent, "//table:table-row[1]/table:table-cell/text:p"_ostr, 2);
}
@@ -1087,7 +1098,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf103829)
CPPUNIT_ASSERT_EQUAL_MESSAGE("load a1", sA1, pDoc->GetString(0, 0, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("load a2", sA2, pDoc->GetString(0, 1, 0));
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
CPPUNIT_ASSERT_EQUAL_MESSAGE("reload a1", sA1, pDoc->GetString(0, 0, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("reload a2", sA2, pDoc->GetString(0, 1, 0));
@@ -1098,7 +1109,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf122191)
// Set the system locale to Hungarian
SvtSysLocaleOptions aOptions;
OUString sLocaleConfigString = aOptions.GetLanguageTag().getBcp47();
- aOptions.SetLocaleConfigString("hu-HU");
+ aOptions.SetLocaleConfigString(u"hu-HU"_ustr);
aOptions.Commit();
comphelper::ScopeGuard g([&aOptions, &sLocaleConfigString] {
aOptions.SetLocaleConfigString(sLocaleConfigString);
@@ -1108,45 +1119,53 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf122191)
createScDoc("xlsx/tdf122191.xlsx");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("IGAZ"), pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"IGAZ"_ustr, pDoc->GetString(0, 0, 0));
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
// Without the fix in place, this test would have failed with
// - Expected: IGAZ
// - Actual : BOOL00AN
- CPPUNIT_ASSERT_EQUAL(OUString("IGAZ"), pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"IGAZ"_ustr, pDoc->GetString(0, 0, 0));
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf142881)
{
createScDoc("xlsx/tdf142881.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDrawing1 = parseExport("xl/drawings/drawing1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDrawing1 = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDrawing1);
// Verify that the shapes are rotated and positioned in the expected way
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:from/xdr:col"_ostr, "11");
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:from/xdr:row"_ostr, "0");
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:to/xdr:col"_ostr, "12");
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:to/xdr:row"_ostr, "19");
-
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:from/xdr:col"_ostr, "2");
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:from/xdr:row"_ostr, "8");
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:to/xdr:col"_ostr, "7");
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:to/xdr:row"_ostr, "10");
-
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:from/xdr:col"_ostr, "10");
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:from/xdr:row"_ostr, "9");
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:to/xdr:col"_ostr, "11");
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:to/xdr:row"_ostr, "26");
-
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:from/xdr:col"_ostr, "2");
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:from/xdr:row"_ostr, "17");
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:to/xdr:col"_ostr, "8");
- assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:to/xdr:row"_ostr, "19");
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:from/xdr:col"_ostr,
+ u"11"_ustr);
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:from/xdr:row"_ostr,
+ u"0"_ustr);
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:to/xdr:col"_ostr, u"12"_ustr);
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:to/xdr:row"_ostr, u"19"_ustr);
+
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:from/xdr:col"_ostr,
+ u"2"_ustr);
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:from/xdr:row"_ostr,
+ u"8"_ustr);
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:to/xdr:col"_ostr, u"7"_ustr);
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:to/xdr:row"_ostr, u"10"_ustr);
+
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:from/xdr:col"_ostr,
+ u"10"_ustr);
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:from/xdr:row"_ostr,
+ u"9"_ustr);
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:to/xdr:col"_ostr, u"11"_ustr);
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:to/xdr:row"_ostr, u"26"_ustr);
+
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:from/xdr:col"_ostr,
+ u"2"_ustr);
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:from/xdr:row"_ostr,
+ u"17"_ustr);
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:to/xdr:col"_ostr, u"8"_ustr);
+ assertXPathContent(pDrawing1, "/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:to/xdr:row"_ostr, u"19"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf112567b)
@@ -1154,7 +1173,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf112567b)
// Set the system locale to Hungarian (a language with different range separator)
SvtSysLocaleOptions aOptions;
OUString sLocaleConfigString = aOptions.GetLanguageTag().getBcp47();
- aOptions.SetLocaleConfigString("hu-HU");
+ aOptions.SetLocaleConfigString(u"hu-HU"_ustr);
aOptions.Commit();
comphelper::ScopeGuard g([&aOptions, &sLocaleConfigString] {
aOptions.SetLocaleConfigString(sLocaleConfigString);
@@ -1163,8 +1182,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf112567b)
createScDoc("ods/tdf112567.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/workbook.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/workbook.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
//assert the existing OOXML built-in name is not duplicated
@@ -1172,15 +1191,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf112567b)
//and it contains "," instead of ";"
assertXPathContent(pDoc, "/x:workbook/x:definedNames/x:definedName[1]"_ostr,
- "Sheet1!$A:$A,Sheet1!$1:$1");
+ u"Sheet1!$A:$A,Sheet1!$1:$1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf123645XLSX)
{
createScDoc("xlsx/chart_hyperlink.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/drawing1.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc,
"/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:graphicFrame/xdr:nvGraphicFramePr/xdr:cNvPr/"
@@ -1195,88 +1214,88 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf123645XLSX)
"a:hlinkClick"_ostr,
1);
- xmlDocUniquePtr pXmlRels = parseExport("xl/drawings/_rels/drawing1.xml.rels");
+ xmlDocUniquePtr pXmlRels = parseExport(u"xl/drawings/_rels/drawing1.xml.rels"_ustr);
CPPUNIT_ASSERT(pXmlRels);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr,
- "TargetMode"_ostr, "External");
+ "TargetMode"_ostr, u"External"_ustr);
assertXPathNoAttribute(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId3']"_ostr,
"TargetMode"_ostr);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId5']"_ostr,
- "TargetMode"_ostr, "External");
+ "TargetMode"_ostr, u"External"_ustr);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "Target"_ostr,
- "file:///C:/TEMP/test.xlsx");
+ u"file:///C:/TEMP/test.xlsx"_ustr);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId3']"_ostr, "Target"_ostr,
- "#Sheet2!A1");
+ u"#Sheet2!A1"_ustr);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId5']"_ostr, "Target"_ostr,
- "https://bugs.documentfoundation.org/show_bug.cgi?id=123645");
+ u"https://bugs.documentfoundation.org/show_bug.cgi?id=123645"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf125173XLSX)
{
createScDoc("ods/text_box_hyperlink.ods");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/drawing1.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor/xdr:sp/xdr:nvSpPr/xdr:cNvPr/a:hlinkClick"_ostr,
1);
- xmlDocUniquePtr pXmlRels = parseExport("xl/drawings/_rels/drawing1.xml.rels");
+ xmlDocUniquePtr pXmlRels = parseExport(u"xl/drawings/_rels/drawing1.xml.rels"_ustr);
CPPUNIT_ASSERT(pXmlRels);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "Target"_ostr,
- "http://www.google.com/");
+ u"http://www.google.com/"_ustr);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr,
- "TargetMode"_ostr, "External");
+ "TargetMode"_ostr, u"External"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf79972XLSX)
{
createScDoc("xlsx/tdf79972.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink"_ostr, "ref"_ostr, "A1");
+ assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink"_ostr, "ref"_ostr, u"A1"_ustr);
- xmlDocUniquePtr pXmlRels = parseExport("xl/worksheets/_rels/sheet1.xml.rels");
+ xmlDocUniquePtr pXmlRels = parseExport(u"xl/worksheets/_rels/sheet1.xml.rels"_ustr);
CPPUNIT_ASSERT(pXmlRels);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship"_ostr, "Target"_ostr,
- "https://bugs.documentfoundation.org/show_bug.cgi?id=79972");
+ u"https://bugs.documentfoundation.org/show_bug.cgi?id=79972"_ustr);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship"_ostr, "TargetMode"_ostr,
- "External");
+ u"External"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf126024XLSX)
{
createScDoc("xlsx/hyperlink_formula.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink"_ostr, "ref"_ostr, "A2");
+ assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink"_ostr, "ref"_ostr, u"A2"_ustr);
- xmlDocUniquePtr pXmlRels = parseExport("xl/worksheets/_rels/sheet1.xml.rels");
+ xmlDocUniquePtr pXmlRels = parseExport(u"xl/worksheets/_rels/sheet1.xml.rels"_ustr);
CPPUNIT_ASSERT(pXmlRels);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship"_ostr, "Target"_ostr,
- "https://bugs.documentfoundation.org/");
+ u"https://bugs.documentfoundation.org/"_ustr);
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship"_ostr, "TargetMode"_ostr,
- "External");
+ u"External"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testEnhancedProtectionRangeShorthand)
{
createScDoc("xlsx/enhancedProtectionRangeShorthand.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
// the shorthand version was not recognized as a valid range on import
- assertXPath(pDoc, "//x:protectedRanges/x:protectedRange[1]"_ostr, "sqref"_ostr, "C:C");
+ assertXPath(pDoc, "//x:protectedRanges/x:protectedRange[1]"_ostr, "sqref"_ostr, u"C:C"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf91332)
{
createScDoc("xlsx/tdf91332.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY_THROW);
uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0),
@@ -1288,7 +1307,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf91332)
// - Actual : rgba[ffffffff]
// i.e. fill color inherited from theme lost after export.
Color nColor;
- xShapeProps->getPropertyValue("FillColor") >>= nColor;
+ xShapeProps->getPropertyValue(u"FillColor"_ustr) >>= nColor;
CPPUNIT_ASSERT_EQUAL(Color(0x90cf47), nColor);
}
diff --git a/sc/qa/unit/subsequent_export_test3.cxx b/sc/qa/unit/subsequent_export_test3.cxx
index 8f8d5160d2eb..e537595b6cee 100644
--- a/sc/qa/unit/subsequent_export_test3.cxx
+++ b/sc/qa/unit/subsequent_export_test3.cxx
@@ -40,7 +40,7 @@ class ScExportTest3 : public ScModelTestBase
{
public:
ScExportTest3()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
@@ -221,7 +221,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testBordersExchangeXLSX)
createScDoc("ods/test_borders_export.ods");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
for (size_t nCol = 0; nCol < nMaxCol; ++nCol)
@@ -415,7 +415,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX)
}
// Insert a new record to make sure the user and date-time are correct.
- rDoc.SetString(ScAddress(1, 8, 0), "New String");
+ rDoc.SetString(ScAddress(1, 8, 0), u"New String"_ustr);
ScCellValue aEmpty;
pCT->AppendContent(ScAddress(1, 8, 0), aEmpty);
pAction = pCT->GetLast();
@@ -446,8 +446,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX)
} aTest;
SvtUserOptions& rUserOpt = SC_MOD()->GetUserOptions();
- rUserOpt.SetToken(UserOptToken::FirstName, "Export");
- rUserOpt.SetToken(UserOptToken::LastName, "Test");
+ rUserOpt.SetToken(UserOptToken::FirstName, u"Export"_ustr);
+ rUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr);
OUString aOwnerName = rUserOpt.GetFirstName() + " " + rUserOpt.GetLastName();
@@ -458,7 +458,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX)
bool bGood = aTest.check(*pDoc);
CPPUNIT_ASSERT_MESSAGE("Initial check failed (xls).", bGood);
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDoc = getScDoc();
bGood = aTest.check(*pDoc);
CPPUNIT_ASSERT_MESSAGE("Check after reload failed (xls).", bGood);
@@ -469,7 +469,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX)
ScChangeAction* pAction = pCT->GetAction(1);
CPPUNIT_ASSERT(pAction);
OUString aDesc = pAction->GetDescription(*pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("Cell B2 changed from '<empty>' to '1'"), aDesc);
+ CPPUNIT_ASSERT_EQUAL(u"Cell B2 changed from '<empty>' to '1'"_ustr, aDesc);
pDoc = getScDoc();
bGood = aTest.checkRevisionUserAndTime(*pDoc, aOwnerName);
@@ -482,7 +482,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX)
aTest.check(*pDoc);
CPPUNIT_ASSERT_MESSAGE("Initial check failed (xlsx).", bGood);
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
bGood = aTest.check(*pDoc);
CPPUNIT_ASSERT_MESSAGE("Check after reload failed (xlsx).", bGood);
@@ -546,7 +546,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetTabColorsXLSX)
CPPUNIT_ASSERT_MESSAGE("Failed on the initial content check.", bRes);
}
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
bool bRes = aTest.checkContent(*pDoc);
CPPUNIT_ASSERT_MESSAGE("Failed on the content check after reload.", bRes);
@@ -556,15 +556,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf133487)
{
createScDoc("fods/shapes_foreground_background.fods");
- save("calc8");
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// shape in background has lowest index
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
"table:table-row[1]/table:table-cell[1]/draw:custom-shape"_ostr,
- "z-index"_ostr, "0");
+ "z-index"_ostr, u"0"_ustr);
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
"table:table-row[1]/table:table-cell[1]/draw:custom-shape"
@@ -573,12 +573,12 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf133487)
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
"table:table-row[1]/table:table-cell[1]/draw:custom-shape"_ostr,
- "table-background"_ostr, "true");
+ "table-background"_ostr, u"true"_ustr);
// shape in foreground, previously index 1
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
"table:table-row[1]/table:table-cell[2]/draw:custom-shape"_ostr,
- "z-index"_ostr, "2");
+ "z-index"_ostr, u"2"_ustr);
// attribute is only written for value "true"
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
@@ -589,7 +589,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf133487)
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
"table:table-row[3]/table:table-cell[1]/draw:custom-shape"_ostr,
- "z-index"_ostr, "1");
+ "z-index"_ostr, u"1"_ustr);
// attribute is only written for value "true"
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
@@ -600,7 +600,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf133487)
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
"table:shapes/draw:custom-shape"_ostr,
- "z-index"_ostr, "3");
+ "z-index"_ostr, u"3"_ustr);
// attribute is only written for value "true"
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
@@ -611,7 +611,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf133487)
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
"table:shapes/draw:control"_ostr,
- "z-index"_ostr, "4");
+ "z-index"_ostr, u"4"_ustr);
// attribute is only written for value "true"
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table[1]/"
@@ -633,7 +633,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLS)
// Check the title row.
OUString aActual = rDoc.GetString(0, 1, 0);
- OUString aExpected = "Response";
+ OUString aExpected = u"Response"_ustr;
if (aActual != aExpected)
{
cerr << "Wrong content in A2: expected='" << aExpected << "', actual='" << aActual
@@ -702,7 +702,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLS)
CPPUNIT_ASSERT_MESSAGE("Content check on the original document failed.", bRes);
}
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
// Check the content of the reloaded. This should be identical.
ScDocument* pDoc = getScDoc();
@@ -795,7 +795,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLSX)
}
// Save and reload, and check the content again.
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
pDoc->CalcAll(); // Recalculate to flush all cached results.
@@ -863,7 +863,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaStringResultExportXLSX)
CPPUNIT_ASSERT_MESSAGE("Content check on the initial recalculated document failed.", bRes);
}
// Reload and check again.
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
bool bRes = aTest.checkContent(*pDoc);
@@ -883,12 +883,12 @@ void ScExportTest3::testFunctionsExcel2010(const OUString& sFormatType)
CPPUNIT_TEST_FIXTURE(ScExportTest3, testFunctionsExcel2010XLSX)
{
- testFunctionsExcel2010("Calc Office Open XML");
+ testFunctionsExcel2010(u"Calc Office Open XML"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testFunctionsExcel2010XLS)
{
- testFunctionsExcel2010("MS Excel 97");
+ testFunctionsExcel2010(u"MS Excel 97"_ustr);
}
void ScExportTest3::testCeilingFloor(const OUString& sFormatType)
@@ -904,7 +904,7 @@ void ScExportTest3::testCeilingFloor(const OUString& sFormatType)
CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorXLSX)
{
- testCeilingFloor("Calc Office Open XML");
+ testCeilingFloor(u"Calc Office Open XML"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorODSToXLSX)
@@ -912,35 +912,36 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorODSToXLSX)
// tdf#100011 - Cannot open sheet containing FLOOR/CEILING functions by MS Excel, after export to .xlsx
createScDoc("ods/ceiling-floor.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/workbook.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/workbook.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// there shouldn't be any defined names during export of FLOOR and CEILING functions to .xlsx
assertXPath(pSheet, "/x:workbook/x:definedNames"_ostr, 0);
}
-CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorXLS) { testCeilingFloor("MS Excel 97"); }
+CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorXLS) { testCeilingFloor(u"MS Excel 97"_ustr); }
-CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorODS) { testCeilingFloor("calc8"); }
+CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorODS) { testCeilingFloor(u"calc8"_ustr); }
CPPUNIT_TEST_FIXTURE(ScExportTest3, testCustomXml)
{
// Load document and export it to a temporary file
createScDoc("xlsx/customxml.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pXmlDoc = parseExport("customXml/item1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"customXml/item1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- xmlDocUniquePtr pRelsDoc = parseExport("customXml/_rels/item1.xml.rels");
+ xmlDocUniquePtr pRelsDoc = parseExport(u"customXml/_rels/item1.xml.rels"_ustr);
CPPUNIT_ASSERT(pRelsDoc);
// Check there is a relation to itemProps1.xml.
assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship"_ostr, 1);
assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "Target"_ostr,
- "itemProps1.xml");
+ u"itemProps1.xml"_ustr);
- std::unique_ptr<SvStream> pStream = parseExportStream(maTempFile.GetURL(), "ddp/ddpfile.xen");
+ std::unique_ptr<SvStream> pStream
+ = parseExportStream(maTempFile.GetURL(), u"ddp/ddpfile.xen"_ustr);
CPPUNIT_ASSERT(pStream);
}
@@ -959,8 +960,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testRelativePathsODS)
{
createScDoc("ods/fdo79305.ods");
- save("calc8");
- xmlDocUniquePtr pDoc = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"content.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
OUString aURL = getXPath(pDoc,
"/office:document-content/office:body/office:spreadsheet/table:table/"
@@ -1004,7 +1005,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetProtectionODS)
testSheetProtection_Impl(*pDoc);
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
@@ -1018,7 +1019,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testFunctionsExcel2010ODS)
CPPUNIT_TEST_FIXTURE(ScExportTest3, testSwappedOutImageExport)
{
- std::vector<OUString> aFilterNames{ "calc8", "MS Excel 97", "Calc Office Open XML" };
+ std::vector<OUString> aFilterNames{ u"calc8"_ustr, u"MS Excel 97"_ustr,
+ u"Calc Office Open XML"_ustr };
for (size_t i = 0; i < aFilterNames.size(); ++i)
{
@@ -1047,7 +1049,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSwappedOutImageExport)
// Check Graphic, Size
{
uno::Reference<graphic::XGraphic> xGraphic;
- XPropSet->getPropertyValue("Graphic") >>= xGraphic;
+ XPropSet->getPropertyValue(u"Graphic"_ustr) >>= xGraphic;
CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), xGraphic.is());
CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(),
xGraphic->getType() != graphic::GraphicType::EMPTY);
@@ -1065,7 +1067,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSwappedOutImageExport)
// Check Graphic, Size
{
uno::Reference<graphic::XGraphic> xGraphic;
- XPropSet->getPropertyValue("Graphic") >>= xGraphic;
+ XPropSet->getPropertyValue(u"Graphic"_ustr) >>= xGraphic;
CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), xGraphic.is());
CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(),
xGraphic->getType() != graphic::GraphicType::EMPTY);
@@ -1083,7 +1085,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSupBookVirtualPathXLS)
{
createScDoc("xls/external-ref.xls");
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
ScDocument* pDoc = getScDoc();
@@ -1092,15 +1094,16 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSupBookVirtualPathXLS)
aFormula = OUString::Concat(aFormula.subView(0, 9)) + aFormula.subView(12);
// strip drive letter, e.g. 'C:/'
#endif
- CPPUNIT_ASSERT_EQUAL_MESSAGE(
- "Wrong SupBook VirtualPath URL",
- OUString("='file:///home/timar/Documents/external.xls'#$Sheet1.A1"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong SupBook VirtualPath URL",
+ u"='file:///home/timar/Documents/external.xls'#$Sheet1.A1"_ustr,
+ aFormula);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testLinkedGraphicRT)
{
// Problem was with linked images
- std::vector<OUString> aFilterNames{ "calc8", "MS Excel 97", "Calc Office Open XML" };
+ std::vector<OUString> aFilterNames{ u"calc8"_ustr, u"MS Excel 97"_ustr,
+ u"Calc Office Open XML"_ustr };
for (size_t i = 0; i < aFilterNames.size(); ++i)
{
@@ -1138,7 +1141,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testLinkedGraphicRT)
CPPUNIT_TEST_FIXTURE(ScExportTest3, testImageWithSpecialID)
{
- std::vector<OUString> aFilterNames{ "calc8", "MS Excel 97", "Calc Office Open XML" };
+ std::vector<OUString> aFilterNames{ u"calc8"_ustr, u"MS Excel 97"_ustr,
+ u"Calc Office Open XML"_ustr };
for (size_t i = 0; i < aFilterNames.size(); ++i)
{
@@ -1166,7 +1170,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testImageWithSpecialID)
// Check Graphic, Size
{
uno::Reference<graphic::XGraphic> xGraphic;
- XPropSet->getPropertyValue("Graphic") >>= xGraphic;
+ XPropSet->getPropertyValue(u"Graphic"_ustr) >>= xGraphic;
CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), xGraphic.is());
CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(),
xGraphic->getType() != graphic::GraphicType::EMPTY);
@@ -1184,7 +1188,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testImageWithSpecialID)
// Check Graphic, Size
{
uno::Reference<graphic::XGraphic> xGraphic;
- XPropSet->getPropertyValue("Graphic") >>= xGraphic;
+ XPropSet->getPropertyValue(u"Graphic"_ustr) >>= xGraphic;
CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), xGraphic.is());
CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(),
xGraphic->getType() != graphic::GraphicType::EMPTY);
@@ -1200,19 +1204,19 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testImageWithSpecialID)
CPPUNIT_TEST_FIXTURE(ScExportTest3, testAbsNamedRangeHTML)
{
- setImportFilterName("calc_HTML_WebQuery");
+ setImportFilterName(u"calc_HTML_WebQuery"_ustr);
createScDoc("html/numberformat.html");
ScDocShell* pDocSh = getScDocShell();
pDocSh->DoHardRecalc();
//reset import filter
- setImportFilterName("calc8");
- saveAndReload("calc8");
+ setImportFilterName(u"calc8"_ustr);
+ saveAndReload(u"calc8"_ustr);
pDocSh = getScDocShell();
pDocSh->DoHardRecalc();
ScDocument* pDoc = getScDoc();
- ScRangeData* pRangeData = pDoc->GetRangeName()->findByUpperName(OUString("HTML_1"));
+ ScRangeData* pRangeData = pDoc->GetRangeName()->findByUpperName(u"HTML_1"_ustr);
ScSingleRefData* pRef = pRangeData->GetCode()->FirstToken()->GetSingleRef();
// see tdf#119141 for the reason why this isn't Sheet1.HTML_1
CPPUNIT_ASSERT_MESSAGE("HTML_1 is an absolute reference", !pRef->IsTabRel());
@@ -1223,25 +1227,25 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf80149)
createScDoc("csv/tdf80149.csv");
ScDocShell* pDocSh = getScDocShell();
pDocSh->DoHardRecalc();
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDocSh = getScDocShell();
pDocSh->DoHardRecalc();
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("row 1"), pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"row 1"_ustr, pDoc->GetString(0, 0, 0));
// Without the fix in place, this test would have failed with
// - Expected: Character 0x16 is here ->><<--
// - Actual :
- CPPUNIT_ASSERT_EQUAL(OUString("Character 0x16 is here ->><<--"), pDoc->GetString(1, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("File opens in libre office, but can't be saved as xlsx"),
+ CPPUNIT_ASSERT_EQUAL(u"Character 0x16 is here ->><<--"_ustr, pDoc->GetString(1, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"File opens in libre office, but can't be saved as xlsx"_ustr,
pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("row 2"), pDoc->GetString(0, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Subsequent rows get truncated"), pDoc->GetString(1, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("This cell goes missing"), pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("row 3"), pDoc->GetString(0, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Subsequent rows get truncated"), pDoc->GetString(1, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("This cell goes missing"), pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"row 2"_ustr, pDoc->GetString(0, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Subsequent rows get truncated"_ustr, pDoc->GetString(1, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"This cell goes missing"_ustr, pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"row 3"_ustr, pDoc->GetString(0, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Subsequent rows get truncated"_ustr, pDoc->GetString(1, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"This cell goes missing"_ustr, pDoc->GetString(2, 2, 0));
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetLocalRangeNameXLS)
@@ -1249,7 +1253,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetLocalRangeNameXLS)
createScDoc("xls/named-ranges-local.xls");
ScDocShell* pDocSh = getScDocShell();
pDocSh->DoHardRecalc();
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDocSh = getScDocShell();
pDocSh->DoHardRecalc();
@@ -1259,11 +1263,11 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetLocalRangeNameXLS)
CPPUNIT_ASSERT_EQUAL(size_t(2), pRangeName->size());
OUString aFormula = pDoc->GetFormula(3, 11, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(local_name2)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(local_name2)"_ustr, aFormula);
ASSERT_DOUBLES_EQUAL(14.0, pDoc->GetValue(3, 11, 0));
aFormula = pDoc->GetFormula(6, 4, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=local_name1"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=local_name1"_ustr, aFormula);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testRelativeNamedExpressionsXLS)
@@ -1271,7 +1275,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testRelativeNamedExpressionsXLS)
createScDoc("ods/tdf113991_relativeNamedRanges.ods");
ScDocShell* pDocSh = getScDocShell();
pDocSh->DoHardRecalc();
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDocSh = getScDocShell();
pDocSh->DoHardRecalc();
@@ -1279,31 +1283,30 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testRelativeNamedExpressionsXLS)
// Sheet1:G3
ScAddress aPos(6, 2, 0);
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("=single_cell_A3"),
+ CPPUNIT_ASSERT_EQUAL(u"=single_cell_A3"_ustr,
pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Sheet2:F6
aPos = ScAddress(5, 5, 1);
CPPUNIT_ASSERT_EQUAL(18.0, pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(test_conflict)"),
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(test_conflict)"_ustr,
pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Sheet2:H3
aPos = ScAddress(7, 2, 1);
CPPUNIT_ASSERT_EQUAL(10.0, pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("=single_global_A3"),
+ CPPUNIT_ASSERT_EQUAL(u"=single_global_A3"_ustr,
pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Sheet2:H6
aPos = ScAddress(7, 5, 1);
CPPUNIT_ASSERT_EQUAL(75.0, pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A6:F6)"),
- pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A6:F6)"_ustr, pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetTextBoxHyperlinkXLSX)
{
createScDoc("xlsx/textbox-hyperlink.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/drawing1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(
@@ -1316,24 +1319,24 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testFontSizeXLSX)
{
createScDoc("xlsx/fontSize.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/drawing1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
OUString fontSize = getXPath(
pDoc, "/xdr:wsDr/xdr:twoCellAnchor/xdr:sp[1]/xdr:txBody/a:p[1]/a:r[1]/a:rPr"_ostr,
"sz"_ostr);
// make sure that the font size is 18
- CPPUNIT_ASSERT_EQUAL(OUString("1800"), fontSize);
+ CPPUNIT_ASSERT_EQUAL(u"1800"_ustr, fontSize);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetCharacterKerningSpaceXLSX)
{
createScDoc("xlsx/textbox-CharKerningSpace.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/drawing1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
OUString CharKerningSpace = getXPath(
@@ -1342,15 +1345,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetCharacterKerningSpaceXLSX)
"spc"_ostr);
// make sure that the CharKerning is 2001 (2000 in original document).
- CPPUNIT_ASSERT_EQUAL(OUString("2001"), CharKerningSpace);
+ CPPUNIT_ASSERT_EQUAL(u"2001"_ustr, CharKerningSpace);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetCondensedCharacterSpaceXLSX)
{
createScDoc("xlsx/textbox-CondensedCharacterSpace.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/drawing1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
OUString CondensedCharSpace = getXPath(
@@ -1359,34 +1362,34 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetCondensedCharacterSpaceXLSX)
"spc"_ostr);
// make sure that the CondensedCharSpace is -1001 (-1000 in original document).
- CPPUNIT_ASSERT_EQUAL(OUString("-1001"), CondensedCharSpace);
+ CPPUNIT_ASSERT_EQUAL(u"-1001"_ustr, CondensedCharSpace);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testTextUnderlineColorXLSX)
{
createScDoc("xlsx/underlineColor.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/drawing1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
// Make sure the underline type is double line
assertXPath(pDoc,
"/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:sp[1]/xdr:txBody/a:p[1]/a:r[1]/a:rPr"_ostr,
- "u"_ostr, "dbl");
+ "u"_ostr, u"dbl"_ustr);
assertXPath(pDoc,
"/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:sp[1]/xdr:txBody/a:p[1]/a:r[1]/a:rPr"_ostr,
- "b"_ostr, "1");
+ "b"_ostr, u"1"_ustr);
// Make sure that the underline color is RED
assertXPath(pDoc,
"/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:sp[1]/xdr:txBody/a:p[1]/a:r[1]/a:rPr/a:uFill/"
"a:solidFill/a:srgbClr"_ostr,
- "val"_ostr, "ff0000");
+ "val"_ostr, u"ff0000"_ustr);
// Make sure the underline type is drawn with heavy line
assertXPath(pDoc,
"/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:sp[1]/xdr:txBody/a:p[1]/a:r[1]/a:rPr"_ostr,
- "u"_ostr, "heavy");
+ "u"_ostr, u"heavy"_ustr);
// tdf#104219 Make sure that uFill is not existing and uFillTx is set.
// It mean that color is automatic, should be the same color as the text.
assertXPath(
@@ -1402,33 +1405,33 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetRunParagraphPropertyXLSX)
{
createScDoc("xlsx/TextColor.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/sharedStrings.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/sharedStrings.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
OUString aColor = getXPath(pDoc, "/x:sst/x:si/x:r[1]/x:rPr[1]/x:color"_ostr, "rgb"_ostr);
- CPPUNIT_ASSERT_EQUAL(OUString("FFFF0000"), aColor);
+ CPPUNIT_ASSERT_EQUAL(u"FFFF0000"_ustr, aColor);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testPreserveTextWhitespaceXLSX)
{
createScDoc("xlsx/preserve-whitespace.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/sharedStrings.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/sharedStrings.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:sst/x:si/x:t"_ostr, "space"_ostr, "preserve");
+ assertXPath(pDoc, "/x:sst/x:si/x:t"_ostr, "space"_ostr, u"preserve"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testPreserveTextWhitespace2XLSX)
{
createScDoc("xlsx/preserve_space.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/sharedStrings.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/sharedStrings.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:sst/x:si[1]/x:t"_ostr, "space"_ostr, "preserve");
- assertXPath(pDoc, "/x:sst/x:si[2]/x:t"_ostr, "space"_ostr, "preserve");
+ assertXPath(pDoc, "/x:sst/x:si[1]/x:t"_ostr, "space"_ostr, u"preserve"_ustr);
+ assertXPath(pDoc, "/x:sst/x:si[2]/x:t"_ostr, "space"_ostr, u"preserve"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testHiddenShapeXLS)
@@ -1460,19 +1463,19 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testHiddenShapeXLSX)
CPPUNIT_ASSERT_MESSAGE("Drawing object should not be visible.", !pObj->IsVisible());
CPPUNIT_ASSERT_MESSAGE("Drawing object should not be printable.", !pObj->IsPrintable());
- save("Calc Office Open XML");
- xmlDocUniquePtr pDocXml = parseExport("xl/drawings/drawing1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDocXml = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDocXml);
assertXPath(pDocXml, "/xdr:wsDr/xdr:twoCellAnchor/xdr:sp[1]/xdr:nvSpPr/xdr:cNvPr"_ostr,
- "hidden"_ostr, "1");
+ "hidden"_ostr, u"1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testShapeAutofitXLSX)
{
createScDoc("xlsx/testShapeAutofit.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/drawing1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
// TextAutoGrowHeight --> "Fit height to text" / "Resize shape to fit text" --> true
@@ -1487,10 +1490,11 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testHyperlinkXLSX)
{
createScDoc("xlsx/hyperlink.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/_rels/drawing1.xml.rels");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/_rels/drawing1.xml.rels"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/rels:Relationships/rels:Relationship"_ostr, "Target"_ostr, "#Sheet2!A1");
+ assertXPath(pDoc, "/rels:Relationships/rels:Relationship"_ostr, "Target"_ostr,
+ u"#Sheet2!A1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testMoveCellAnchoredShapesODS)
@@ -1561,7 +1565,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testMoveCellAnchoredShapesODS)
aNDataEnd = pNData->maEnd;
// Save the document and load again to check anchor persist
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// There are two cell-anchored objects on the first sheet.
pDoc = getScDoc();
@@ -1626,7 +1630,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testMoveCellAnchoredShapesODS)
aNDataEnd = pNData->maEnd;
// Save the document and load again to check anchor persist
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// There are two cell-anchored objects on the first sheet.
pDoc = getScDoc();
@@ -1666,27 +1670,27 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testMoveCellAnchoredShapesODS)
CPPUNIT_TEST_FIXTURE(ScExportTest3, testConditionalFormatRangeListXLSX)
{
createScDoc("ods/conditionalformat_rangelist.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "//x:conditionalFormatting"_ostr, "sqref"_ostr, "F4 F10");
+ assertXPath(pDoc, "//x:conditionalFormatting"_ostr, "sqref"_ostr, u"F4 F10"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testConditionalFormatContainsTextXLSX)
{
createScDoc("ods/conditionalformat_containstext.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPathContent(pDoc, "//x:conditionalFormatting/x:cfRule/x:formula"_ostr,
- "NOT(ISERROR(SEARCH(\"test\",A1)))");
+ u"NOT(ISERROR(SEARCH(\"test\",A1)))"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testConditionalFormatPriorityCheckXLSX)
{
createScDoc("xlsx/conditional_fmt_checkpriority.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
constexpr bool bHighPriorityExtensionA1
= true; // Should A1's extension cfRule has higher priority than normal cfRule ?
@@ -1733,13 +1737,13 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testConditionalFormatPriorityCheckXLSX)
CPPUNIT_TEST_FIXTURE(ScExportTest3, testConditionalFormatOriginXLSX)
{
createScDoc("xlsx/conditional_fmt_origin.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
// tdf#124953 : The range-list is B3:C6 F1:G2, origin address in the formula should be B1, not B3.
OUString aFormula = getXPathContent(pDoc, "//x:conditionalFormatting/x:cfRule/x:formula"_ostr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong origin address in formula",
- OUString("NOT(ISERROR(SEARCH(\"BAC\",B1)))"), aFormula);
+ u"NOT(ISERROR(SEARCH(\"BAC\",B1)))"_ustr, aFormula);
}
// FILESAVE: XLSX export with long sheet names (length > 31 characters)
@@ -1749,13 +1753,13 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf79998)
createScDoc("ods/tdf79998.ods");
ScDocument* pDoc = getScDoc();
const std::vector<OUString> aTabNames1 = pDoc->GetAllTableNames();
- CPPUNIT_ASSERT_EQUAL(OUString("Utilities (FX Kurse, Kreditkarten etc)"), aTabNames1[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Utilities (FX Kurse, Kreditkarten etc)"_ustr, aTabNames1[1]);
// check: saved XLSX document has truncated tab name
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
const std::vector<OUString> aTabNames2 = pDoc->GetAllTableNames();
- CPPUNIT_ASSERT_EQUAL(OUString("Utilities (FX Kurse, Kreditkart"), aTabNames2[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Utilities (FX Kurse, Kreditkart"_ustr, aTabNames2[1]);
}
static void impl_testLegacyCellAnchoredRotatedShape(ScDocument& rDoc, const tools::Rectangle& aRect,
@@ -1805,7 +1809,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testLegacyCellAnchoredRotatedShape)
// test save and reload
// for some reason having this test in subsequent_export-test.cxx causes
// a core dump in editeng ( so moved to here )
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
impl_testLegacyCellAnchoredRotatedShape(*pDoc, aRect, aAnchor);
}
@@ -1830,7 +1834,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testLegacyCellAnchoredRotatedShape)
pDoc->SetDrawPageSize(0); // trigger recalcpos
impl_testLegacyCellAnchoredRotatedShape(*pDoc, aRect, aAnchor);
// test save and reload
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
impl_testLegacyCellAnchoredRotatedShape(*pDoc, aRect, aAnchor);
}
@@ -1852,7 +1856,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testLegacyCellAnchoredRotatedShape)
// test import
impl_testLegacyCellAnchoredRotatedShape(*pDoc, aRect, aAnchor);
// test save and reload
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
impl_testLegacyCellAnchoredRotatedShape(*pDoc, aRect, aAnchor);
}
@@ -1862,11 +1866,11 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf113646)
{
createScDoc("ods/tdf113646.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
- assertXPath(pSheet, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:sz"_ostr, "val"_ostr, "36");
+ assertXPath(pSheet, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:sz"_ostr, "val"_ostr, u"36"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testDateStandardfilterXLSX)
@@ -1874,35 +1878,38 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testDateStandardfilterXLSX)
// XLSX Roundtripping standard filter with date
createScDoc("ods/tdf142607.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "//x:autoFilter"_ostr, "ref"_ostr, "A1:B6");
+ assertXPath(pDoc, "//x:autoFilter"_ostr, "ref"_ostr, u"A1:B6"_ustr);
assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[1]"_ostr, "day"_ostr,
- "03");
+ u"03"_ustr);
assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[1]"_ostr,
- "month"_ostr, "12");
+ "month"_ostr, u"12"_ustr);
assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[1]"_ostr,
- "year"_ostr, "2011");
+ "year"_ostr, u"2011"_ustr);
assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[1]"_ostr,
- "dateTimeGrouping"_ostr, "day");
+ "dateTimeGrouping"_ostr, u"day"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testNumberFormatODS)
{
createScDoc("ods/testNumberFormats.ods");
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
sal_uInt32 nNumberFormat;
const sal_Int32 nCountFormats = 18;
const OUString aExpectedFormatStr[nCountFormats]
- = { "\"format=\"000000", "\"format=\"??????", "\"format=\"??0000",
- "\"format=\"000,000", "\"format=\"???,???", "\"format=\"??0,000",
- "\"format=\"000\" \"?/?", "\"format=\"???\" \"?/?", "\"format=\"?00\" \"?/?",
- "\"format=\"0,000\" \"?/?", "\"format=\"?,???\" \"?/?", "\"format=\"?,?00\" \"?/?",
- "\"format=\"0.000E+00", "\"format=\"?.###E+00", "\"format=\"?.0##E+00",
- "\"format=\"000E+00", "\"format=\"???E+00", "\"format=\"?00E+00" };
+ = { u"\"format=\"000000"_ustr, u"\"format=\"??????"_ustr,
+ u"\"format=\"??0000"_ustr, u"\"format=\"000,000"_ustr,
+ u"\"format=\"???,???"_ustr, u"\"format=\"??0,000"_ustr,
+ u"\"format=\"000\" \"?/?"_ustr, u"\"format=\"???\" \"?/?"_ustr,
+ u"\"format=\"?00\" \"?/?"_ustr, u"\"format=\"0,000\" \"?/?"_ustr,
+ u"\"format=\"?,???\" \"?/?"_ustr, u"\"format=\"?,?00\" \"?/?"_ustr,
+ u"\"format=\"0.000E+00"_ustr, u"\"format=\"?.###E+00"_ustr,
+ u"\"format=\"?.0##E+00"_ustr, u"\"format=\"000E+00"_ustr,
+ u"\"format=\"???E+00"_ustr, u"\"format=\"?00E+00"_ustr };
for (sal_Int32 i = 0; i < nCountFormats; i++)
{
nNumberFormat = pDoc->GetNumberFormat(i + 1, 2, 0);
@@ -1940,7 +1947,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf137576_Measureline)
CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(4800, 5200), aEnd, 1);
// Save and reload
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
// Get shape
@@ -1987,7 +1994,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf137044_CoverHiddenRows)
pDoc->SetRowHidden(4, 5, 0, true);
// Save and reload
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
// Get shape
@@ -2028,7 +2035,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf137020_FlipVertical)
CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectOrig, aSnapRectFlip, 1);
// Save and reload
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
// Get shape
diff --git a/sc/qa/unit/subsequent_export_test4.cxx b/sc/qa/unit/subsequent_export_test4.cxx
index 1f212499714b..041a7b0bb9cf 100644
--- a/sc/qa/unit/subsequent_export_test4.cxx
+++ b/sc/qa/unit/subsequent_export_test4.cxx
@@ -57,26 +57,27 @@ public:
};
ScExportTest4::ScExportTest4()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf126177XLSX)
{
createScDoc("xlsx/hyperlink_export.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink"_ostr, "location"_ostr, "Munka1!A5");
+ assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink"_ostr, "location"_ostr,
+ u"Munka1!A5"_ustr);
- xmlDocUniquePtr pXmlRels = parseExport("xl/worksheets/_rels/sheet1.xml.rels");
+ xmlDocUniquePtr pXmlRels = parseExport(u"xl/worksheets/_rels/sheet1.xml.rels"_ustr);
CPPUNIT_ASSERT(pXmlRels);
OUString aTarget
= getXPath(pXmlRels, "/rels:Relationships/rels:Relationship"_ostr, "Target"_ostr);
CPPUNIT_ASSERT(aTarget.endsWith("test.xlsx"));
assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship"_ostr, "TargetMode"_ostr,
- "External");
+ u"External"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentTextVAlignment)
@@ -84,12 +85,13 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentTextVAlignment)
// Testing comment text alignments.
createScDoc("ods/CommentTextVAlign.ods");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pVmlDrawing = parseExport("xl/drawings/vmlDrawing1.vml");
+ xmlDocUniquePtr pVmlDrawing = parseExport(u"xl/drawings/vmlDrawing1.vml"_ustr);
CPPUNIT_ASSERT(pVmlDrawing);
- assertXPathContent(pVmlDrawing, "/xml/v:shape/xx:ClientData/xx:TextVAlign"_ostr, "Center");
+ assertXPathContent(pVmlDrawing, "/xml/v:shape/xx:ClientData/xx:TextVAlign"_ostr,
+ u"Center"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentTextHAlignment)
@@ -97,12 +99,13 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentTextHAlignment)
// Testing comment text alignments.
createScDoc("ods/CommentTextHAlign.ods");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pVmlDrawing = parseExport("xl/drawings/vmlDrawing1.vml");
+ xmlDocUniquePtr pVmlDrawing = parseExport(u"xl/drawings/vmlDrawing1.vml"_ustr);
CPPUNIT_ASSERT(pVmlDrawing);
- assertXPathContent(pVmlDrawing, "/xml/v:shape/xx:ClientData/xx:TextHAlign"_ostr, "Center");
+ assertXPathContent(pVmlDrawing, "/xml/v:shape/xx:ClientData/xx:TextHAlign"_ostr,
+ u"Center"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testRotatedImageODS)
@@ -115,8 +118,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testRotatedImageODS)
createScDoc("ods/tdf103092_RotatedImage.ods");
- save("calc8");
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
const OUString sTransform = getXPath(pXmlDoc,
@@ -140,8 +143,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf120177)
// Error: unexpected attribute "form:input-required"
skipValidation();
- save("calc8");
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// Without the fix in place, this test would have failed with
@@ -149,11 +152,11 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf120177)
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table/office:forms/"
"form:form/form:radio[1]"_ostr,
- "value"_ostr, "1");
+ "value"_ostr, u"1"_ustr);
assertXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/table:table/office:forms/"
"form:form/form:radio[2]"_ostr,
- "value"_ostr, "2");
+ "value"_ostr, u"2"_ustr);
const OUString sGroupName1 = getXPath(pXmlDoc,
"/office:document-content/office:body/office:spreadsheet/"
"table:table/office:forms/form:form/form:radio[1]"_ostr,
@@ -169,19 +172,20 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf85553)
{
createScDoc("ods/tdf85553.ods");
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
ScDocument* pDoc = getScDoc();
// Without the fix in place, this test would have failed with
// - Expected: 4.5
// - Actual : #N/A
- CPPUNIT_ASSERT_EQUAL(OUString("4.5"), pDoc->GetString(ScAddress(2, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"4.5"_ustr, pDoc->GetString(ScAddress(2, 2, 0)));
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf151484)
{
- std::vector<OUString> aFilterNames{ "calc8", "MS Excel 97", "Calc Office Open XML" };
+ std::vector<OUString> aFilterNames{ u"calc8"_ustr, u"MS Excel 97"_ustr,
+ u"Calc Office Open XML"_ustr };
for (size_t i = 0; i < aFilterNames.size(); ++i)
{
@@ -216,7 +220,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf143979)
createScDoc();
{
ScDocument* pDoc = getScDoc();
- OUString aCode = "YYYY-MM\"\"MMM-DDNN";
+ OUString aCode = u"YYYY-MM\"\"MMM-DDNN"_ustr;
sal_Int32 nCheckPos;
SvNumFormatType nType;
sal_uInt32 nFormat;
@@ -226,24 +230,24 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf143979)
SfxItemSet& rSet = aNewAttrs.GetItemSet();
rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat));
pDoc->ApplyPattern(0, 0, 0, aNewAttrs);
- pDoc->SetString(ScAddress(0, 0, 0), "08/30/2021");
- CPPUNIT_ASSERT_EQUAL(OUString("2021-08Aug-30Mon"), pDoc->GetString(ScAddress(0, 0, 0)));
+ pDoc->SetString(ScAddress(0, 0, 0), u"08/30/2021"_ustr);
+ CPPUNIT_ASSERT_EQUAL(u"2021-08Aug-30Mon"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
}
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
// Without the fix in place, this test would have failed with
// - Expected: 2021-08Aug-30Mon
// - Actual : 2021-A-30Mon
- CPPUNIT_ASSERT_EQUAL(OUString("2021-08Aug-30Mon"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2021-08Aug-30Mon"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf128976)
{
createScDoc("xls/tdf128976.xls");
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
ScDocument* pDoc = getScDoc();
@@ -267,8 +271,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf120502)
const auto nOldWidth = pDoc->GetColWidth(nMaxCol, 0);
pDoc->SetColWidth(nMaxCol, 0, nOldWidth + 100);
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet1 = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet1 = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet1);
// This was 1025 when nMaxCol+1 was 1024
@@ -280,48 +284,48 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf131372)
{
createScDoc("ods/tdf131372.ods");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
- assertXPathContent(pSheet, "/x:worksheet/x:sheetData/x:row/x:c[1]/x:f"_ostr, "NA()");
- assertXPathContent(pSheet, "/x:worksheet/x:sheetData/x:row/x:c[2]/x:f"_ostr, "#N/A");
+ assertXPathContent(pSheet, "/x:worksheet/x:sheetData/x:row/x:c[1]/x:f"_ostr, u"NA()"_ustr);
+ assertXPathContent(pSheet, "/x:worksheet/x:sheetData/x:row/x:c[2]/x:f"_ostr, u"#N/A"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf81470)
{
createScDoc("xls/tdf81470.xls");
//without the fix in place, it would have crashed at export time
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
//also check revisions are exported
- xmlDocUniquePtr pHeaders = parseExport("xl/revisions/revisionHeaders.xml");
+ xmlDocUniquePtr pHeaders = parseExport(u"xl/revisions/revisionHeaders.xml"_ustr);
CPPUNIT_ASSERT(pHeaders);
assertXPath(pHeaders, "/x:headers/x:header[1]"_ostr, "dateTime"_ostr,
- "2014-07-11T13:46:00.000000000Z");
- assertXPath(pHeaders, "/x:headers/x:header[1]"_ostr, "userName"_ostr, "Kohei Yoshida");
+ u"2014-07-11T13:46:00.000000000Z"_ustr);
+ assertXPath(pHeaders, "/x:headers/x:header[1]"_ostr, "userName"_ostr, u"Kohei Yoshida"_ustr);
assertXPath(pHeaders, "/x:headers/x:header[2]"_ostr, "dateTime"_ostr,
- "2014-07-11T18:38:00.000000000Z");
- assertXPath(pHeaders, "/x:headers/x:header[2]"_ostr, "userName"_ostr, "Kohei Yoshida");
+ u"2014-07-11T18:38:00.000000000Z"_ustr);
+ assertXPath(pHeaders, "/x:headers/x:header[2]"_ostr, "userName"_ostr, u"Kohei Yoshida"_ustr);
assertXPath(pHeaders, "/x:headers/x:header[3]"_ostr, "dateTime"_ostr,
- "2014-07-11T18:43:00.000000000Z");
- assertXPath(pHeaders, "/x:headers/x:header[3]"_ostr, "userName"_ostr, "Kohei Yoshida");
+ u"2014-07-11T18:43:00.000000000Z"_ustr);
+ assertXPath(pHeaders, "/x:headers/x:header[3]"_ostr, "userName"_ostr, u"Kohei Yoshida"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf122331)
{
createScDoc("ods/tdf122331.ods");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
- assertXPath(pSheet, "/x:worksheet/x:sheetPr"_ostr, "filterMode"_ostr, "true");
- assertXPath(pSheet, "/x:worksheet/x:autoFilter"_ostr, "ref"_ostr, "A1:B761");
- assertXPath(pSheet, "/x:worksheet/x:autoFilter/x:filterColumn"_ostr, "colId"_ostr, "1");
+ assertXPath(pSheet, "/x:worksheet/x:sheetPr"_ostr, "filterMode"_ostr, u"true"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:autoFilter"_ostr, "ref"_ostr, u"A1:B761"_ustr);
+ assertXPath(pSheet, "/x:worksheet/x:autoFilter/x:filterColumn"_ostr, "colId"_ostr, u"1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf83779)
@@ -329,13 +333,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf83779)
// Roundtripping TRUE/FALSE constants (not functions) must convert them to functions
createScDoc("xlsx/tdf83779.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pVmlDrawing = parseExport("xl/worksheets/sheet1.xml");
+ xmlDocUniquePtr pVmlDrawing = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pVmlDrawing);
- assertXPathContent(pVmlDrawing, "/x:worksheet/x:sheetData/x:row[1]/x:c/x:f"_ostr, "FALSE()");
- assertXPathContent(pVmlDrawing, "/x:worksheet/x:sheetData/x:row[2]/x:c/x:f"_ostr, "TRUE()");
+ assertXPathContent(pVmlDrawing, "/x:worksheet/x:sheetData/x:row[1]/x:c/x:f"_ostr,
+ u"FALSE()"_ustr);
+ assertXPathContent(pVmlDrawing, "/x:worksheet/x:sheetData/x:row[2]/x:c/x:f"_ostr,
+ u"TRUE()"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf121715_FirstPageHeaderFooterXLSX)
@@ -343,15 +349,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf121715_FirstPageHeaderFooterXLSX)
// Check if first page header and footer are exported properly
createScDoc("xlsx/tdf121715.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:worksheet/x:headerFooter"_ostr, "differentFirst"_ostr, "true");
+ assertXPath(pDoc, "/x:worksheet/x:headerFooter"_ostr, "differentFirst"_ostr, u"true"_ustr);
assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:firstHeader"_ostr,
- "&CFirst Page Header");
+ u"&CFirst Page Header"_ustr);
assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:firstFooter"_ostr,
- "&CFirst Page Footer");
+ u"&CFirst Page Footer"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf121716_ExportEvenHeaderFooterXLSX)
@@ -362,28 +368,28 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf121716_ExportEvenHeaderFooterXLSX)
createScDoc("ods/tdf121716_EvenHeaderFooter.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:worksheet/x:headerFooter"_ostr, "differentOddEven"_ostr, "true");
+ assertXPath(pDoc, "/x:worksheet/x:headerFooter"_ostr, "differentOddEven"_ostr, u"true"_ustr);
assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:oddHeader"_ostr,
- "&Lodd/right&Cpage&Rheader");
+ u"&Lodd/right&Cpage&Rheader"_ustr);
assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:oddFooter"_ostr,
- "&Lboth&C&12page&Rfooter");
+ u"&Lboth&C&12page&Rfooter"_ustr);
assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:evenHeader"_ostr,
- "&Lpage&Cheader&Reven/left");
+ u"&Lpage&Cheader&Reven/left"_ustr);
assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:evenFooter"_ostr,
- "&Lboth&C&12page&Rfooter");
+ u"&Lboth&C&12page&Rfooter"_ustr);
- pDoc = parseExport("xl/worksheets/sheet2.xml");
+ pDoc = parseExport(u"xl/worksheets/sheet2.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:worksheet/x:headerFooter"_ostr, "differentOddEven"_ostr, "true");
- assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:oddHeader"_ostr, "&Coddh");
- assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:oddFooter"_ostr, "&Coddf");
- assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:evenHeader"_ostr, "&Cevenh");
- assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:evenFooter"_ostr, "&Levenf");
+ assertXPath(pDoc, "/x:worksheet/x:headerFooter"_ostr, "differentOddEven"_ostr, u"true"_ustr);
+ assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:oddHeader"_ostr, u"&Coddh"_ustr);
+ assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:oddFooter"_ostr, u"&Coddf"_ustr);
+ assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:evenHeader"_ostr, u"&Cevenh"_ustr);
+ assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:evenFooter"_ostr, u"&Levenf"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf134459_HeaderFooterColorXLSX)
@@ -391,14 +397,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf134459_HeaderFooterColorXLSX)
// Colors in header and footer should be exported, and imported properly
createScDoc("xlsx/tdf134459_HeaderFooterColor.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:oddHeader"_ostr,
- "&L&Kc06040l&C&K4c3789c&Rr");
+ u"&L&Kc06040l&C&K4c3789c&Rr"_ustr);
assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:oddFooter"_ostr,
- "&Ll&C&K64cf5fc&R&Kcd15aar");
+ u"&Ll&C&K64cf5fc&R&Kcd15aar"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf134817_HeaderFooterTextWith2SectionXLSX)
@@ -406,14 +412,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf134817_HeaderFooterTextWith2SectionXL
// Header/footer text with multiple selection should be exported, and imported properly
createScDoc("xlsx/tdf134817_HeaderFooterTextWith2Section.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:oddHeader"_ostr,
- "&L&\"Abadi,Regular\"&11aaa&\"Bembo,Regular\"&20bbb");
+ u"&L&\"Abadi,Regular\"&11aaa&\"Bembo,Regular\"&20bbb"_ustr);
assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:oddFooter"_ostr,
- "&R&\"Cambria,Regular\"&14camb&\"Dante,Regular\"&18dant");
+ u"&R&\"Cambria,Regular\"&14camb&\"Dante,Regular\"&18dant"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf121718_UseFirstPageNumberXLSX)
@@ -421,14 +427,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf121718_UseFirstPageNumberXLSX)
// If "First page number" is not checked then useFirstPageNumb, and firstPageNumber should not be exported.
createScDoc("ods/tdf121718_UseFirstPageNumber.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:worksheet/x:pageSetup"_ostr, "useFirstPageNumber"_ostr, "true");
- assertXPath(pDoc, "/x:worksheet/x:pageSetup"_ostr, "firstPageNumber"_ostr, "10");
+ assertXPath(pDoc, "/x:worksheet/x:pageSetup"_ostr, "useFirstPageNumber"_ostr, u"true"_ustr);
+ assertXPath(pDoc, "/x:worksheet/x:pageSetup"_ostr, "firstPageNumber"_ostr, u"10"_ustr);
- pDoc = parseExport("xl/worksheets/sheet2.xml");
+ pDoc = parseExport(u"xl/worksheets/sheet2.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPathNoAttribute(pDoc, "/x:worksheet/x:pageSetup"_ostr, "useFirstPageNumber"_ostr);
@@ -478,7 +484,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf154445_unused_pagestyles)
pDoc->SetPageStyle(0, ScResId(STR_STYLENAME_STANDARD));
// Save and reload the document to check if the unused page styles are still present
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
// Without the accompanying fix in place, the unused page styles don't exist anymore
@@ -495,9 +501,9 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf135828_Shape_Rect)
// forth conversion between emu and hmm.
createScDoc("xlsx/tdf135828_Shape_Rect.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDrawing = parseExport("xl/drawings/drawing1.xml");
+ xmlDocUniquePtr pDrawing = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDrawing);
double nXPosOfTopleft
@@ -582,24 +588,26 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf123353)
{
createScDoc("xlsx/tdf123353.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:worksheet/x:autoFilter/x:filterColumn/x:filters"_ostr, "blank"_ostr, "1");
+ assertXPath(pDoc, "/x:worksheet/x:autoFilter/x:filterColumn/x:filters"_ostr, "blank"_ostr,
+ u"1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf140098)
{
createScDoc("ods/tdf140098.ods");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:worksheet/x:autoFilter/x:filterColumn/x:filters"_ostr, "blank"_ostr, "1");
+ assertXPath(pDoc, "/x:worksheet/x:autoFilter/x:filterColumn/x:filters"_ostr, "blank"_ostr,
+ u"1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf133688_precedents)
@@ -607,8 +615,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf133688_precedents)
// tdf#133688 Check that we do not export detective shapes.
createScDoc("ods/tdf133688_dont_save_precedents_to_xlsx.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDrawing = parseExport("xl/drawings/drawing1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDrawing = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDrawing);
// We do not export any shapes.
@@ -621,15 +629,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf91251_missingOverflowRoundtrip)
// getting preserved after roundtrip
createScDoc("xlsx/tdf91251_missingOverflowRoundtrip.xlsx");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDrawing = parseExport("xl/drawings/drawing1.xml");
+ xmlDocUniquePtr pDrawing = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDrawing);
assertXPath(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:sp/xdr:txBody/a:bodyPr"_ostr,
- "horzOverflow"_ostr, "clip");
+ "horzOverflow"_ostr, u"clip"_ustr);
assertXPath(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:sp/xdr:txBody/a:bodyPr"_ostr,
- "horzOverflow"_ostr, "clip");
+ "horzOverflow"_ostr, u"clip"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf137000_handle_upright)
@@ -640,28 +648,28 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf137000_handle_upright)
// of workaround 'rot'.
createScDoc("xlsx/tdf137000_export_upright.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDrawing = parseExport("xl/drawings/drawing1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDrawing = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDrawing);
assertXPath(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:sp/xdr:txBody/a:bodyPr"_ostr,
- "upright"_ostr, "1");
+ "upright"_ostr, u"1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf126305_DataValidatyErrorAlert)
{
createScDoc("ods/tdf126305.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/x:worksheet/x:dataValidations/x:dataValidation[1]"_ostr, "errorStyle"_ostr,
- "stop");
+ u"stop"_ustr);
assertXPath(pDoc, "/x:worksheet/x:dataValidations/x:dataValidation[2]"_ostr, "errorStyle"_ostr,
- "warning");
+ u"warning"_ustr);
assertXPath(pDoc, "/x:worksheet/x:dataValidations/x:dataValidation[3]"_ostr, "errorStyle"_ostr,
- "information");
+ u"information"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf76047_externalLink)
@@ -724,7 +732,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf87973_externalLinkSkipUnuseds)
pDoc->SetFormula(ScAddress(3, 2, 0), aFormula, formula::FormulaGrammar::GRAM_NATIVE_UI);
// save and load back
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
// check if the new filename is present in the link (and not replaced by '[2]')
pDoc = getScDoc();
@@ -751,7 +759,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf51022_lostPrintRange)
pDoc->AddPrintRange(0, aRange2);
// save and load back
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
// check if the same print ranges are present
pDoc = getScDoc();
@@ -770,7 +778,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf148170_ExceedXlsPrintRange)
ScDocument* pDoc = getScDoc();
pDoc->AddPrintRange(0, aCalcPrintRange);
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
// Check if print range was shrunk to xls limitations
pDoc = getScDoc();
@@ -785,7 +793,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf138741_externalLinkSkipUnusedsCrash)
createScDoc("xlsx/tdf138741_externalLinkSkipUnusedsCrash.xlsx");
//without the fix in place, it would have crashed at export time
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf138824_linkToParentDirectory)
@@ -809,20 +817,20 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf138824_linkToParentDirectory)
aFormula = aFormula.replaceAt(nIdxOfFile, nIdxOfFilename - nIdxOfFile, aTempFilename);
pDoc->SetFormula(ScAddress(3, 1, 0), aFormula, formula::FormulaGrammar::GRAM_NATIVE_UI);
- save("Calc Office Open XML");
- xmlDocUniquePtr pDocXml = parseExport("xl/externalLinks/_rels/externalLink1.xml.rels");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDocXml = parseExport(u"xl/externalLinks/_rels/externalLink1.xml.rels"_ustr);
CPPUNIT_ASSERT(pDocXml);
// test also the Linux specific bug tdf#121472
assertXPath(pDocXml, "/rels:Relationships/rels:Relationship"_ostr, "Target"_ostr,
- "../tdf138824_externalSource.ods");
+ u"../tdf138824_externalSource.ods"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf129969)
{
createScDoc("ods/external_hyperlink.ods");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
ScAddress aPos(0, 0, 0);
const EditTextObject* pEditText = pDoc->GetEditText(aPos);
@@ -835,21 +843,21 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf147088)
{
createScDoc("fods/tdf147088.fods");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
// Without the fix in place, this test would have failed with
// - Expected: _xffff_
// - Actual :
- CPPUNIT_ASSERT_EQUAL(OUString("_xffff_"), pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"_xffff_"_ustr, pDoc->GetString(0, 0, 0));
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf84874)
{
createScDoc("ods/tdf84874.ods");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
@@ -875,11 +883,11 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf136721_paper_size)
{
createScDoc("xlsx/tdf136721_letter_sized_paper.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/x:worksheet/x:pageSetup"_ostr, "paperSize"_ostr, "70");
+ assertXPath(pDoc, "/x:worksheet/x:pageSetup"_ostr, "paperSize"_ostr, u"70"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf139258_rotated_image)
@@ -887,15 +895,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf139258_rotated_image)
// Check that the topleft position of the image is correct.
createScDoc("ods/tdf139258_rotated_image.ods");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
- xmlDocUniquePtr pDrawing = parseExport("xl/drawings/drawing1.xml");
+ xmlDocUniquePtr pDrawing = parseExport(u"xl/drawings/drawing1.xml"_ustr);
CPPUNIT_ASSERT(pDrawing);
- assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:from/xdr:col"_ostr, "1");
- assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:from/xdr:row"_ostr, "12");
- assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:to/xdr:col"_ostr, "6");
- assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:to/xdr:row"_ostr, "25");
+ assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:from/xdr:col"_ostr, u"1"_ustr);
+ assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:from/xdr:row"_ostr, u"12"_ustr);
+ assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:to/xdr:col"_ostr, u"6"_ustr);
+ assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:to/xdr:row"_ostr, u"25"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf144642_RowHeightRounding)
@@ -936,8 +944,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf151755_stylesLostOnXLSXExport)
createScDoc("xlsx/tdf151755_stylesLostOnXLSXExport.xlsx");
// Resave the xlsx file without any modification.
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// Check if all the 3 empty cells with styles are saved, and have the same style id.
@@ -954,20 +962,20 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf152581_bordercolorNotExportedToXLSX)
createScDoc("xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx");
// Resave the xlsx file without any modification.
- save("Calc Office Open XML");
- xmlDocUniquePtr pStyles = parseExport("xl/styles.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pStyles = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pStyles);
// Check if conditional format border color is exported
assertXPath(pStyles, "/x:styleSheet/x:dxfs/x:dxf/x:border/x:left/x:color"_ostr, "theme"_ostr,
- "5");
+ u"5"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf140431)
{
createScDoc("xlsx/129969-min.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocument* pDoc = getScDoc();
ScAddress aPos(0, 2, 0);
const EditTextObject* pEditText = pDoc->GetEditText(aPos);
@@ -984,14 +992,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCheckboxFormControlXlsxExport)
createScDoc("xlsx/checkbox-form-control.xlsx");
// When exporting to XLSX:
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
// Then make sure its VML markup is written and it has a correct position + size:
- xmlDocUniquePtr pDoc = parseExport("xl/drawings/vmlDrawing1.vml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/vmlDrawing1.vml"_ustr);
// Without the fix in place, this test would have failed as there was no such stream.
CPPUNIT_ASSERT(pDoc);
assertXPathContent(pDoc, "/xml/v:shape/xx:ClientData/xx:Anchor"_ostr,
- "1, 22, 3, 3, 3, 30, 6, 1");
+ u"1, 22, 3, 3, 3, 30, 6, 1"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testButtonFormControlXlsxExport)
@@ -1000,18 +1008,18 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testButtonFormControlXlsxExport)
createScDoc("xlsx/button-form-control.xlsx");
// When exporting to XLSX:
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
// Then make sure its control markup is written and it has a correct position + size:
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
// Without the fix in place, this test would have failed with:
// - XPath '//x:anchor/x:from/xdr:col' not found
// i.e. the control markup was missing, the button was lost on export.
- assertXPathContent(pDoc, "//x:anchor/x:from/xdr:col"_ostr, "1");
- assertXPathContent(pDoc, "//x:anchor/x:from/xdr:row"_ostr, "3");
- assertXPathContent(pDoc, "//x:anchor/x:to/xdr:col"_ostr, "3");
- assertXPathContent(pDoc, "//x:anchor/x:to/xdr:row"_ostr, "7");
+ assertXPathContent(pDoc, "//x:anchor/x:from/xdr:col"_ostr, u"1"_ustr);
+ assertXPathContent(pDoc, "//x:anchor/x:from/xdr:row"_ostr, u"3"_ustr);
+ assertXPathContent(pDoc, "//x:anchor/x:to/xdr:col"_ostr, u"3"_ustr);
+ assertXPathContent(pDoc, "//x:anchor/x:to/xdr:row"_ostr, u"7"_ustr);
// Also make sure that an empty macro attribute is not written.
// Without the fix in place, this test would have failed with:
@@ -1025,11 +1033,11 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf142929_filterLessThanXLSX)
// Document contains a standard filter with '<' condition.
createScDoc("xlsx/tdf142929.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "//x:customFilters/x:customFilter"_ostr, "val"_ostr, "2");
- assertXPath(pDoc, "//x:customFilters/x:customFilter"_ostr, "operator"_ostr, "lessThan");
+ assertXPath(pDoc, "//x:customFilters/x:customFilter"_ostr, "val"_ostr, u"2"_ustr);
+ assertXPath(pDoc, "//x:customFilters/x:customFilter"_ostr, "operator"_ostr, u"lessThan"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testInvalidNamedRange)
@@ -1041,17 +1049,17 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testInvalidNamedRange)
// Then make sure that named range is ignored, as "1" can't be resolved, and exporting it back
// to XLSX (without the xlPathMissing link) would corrupt the document:
uno::Reference<beans::XPropertySet> xDocProps(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XNameAccess> xNamedRanges(xDocProps->getPropertyValue("NamedRanges"),
- uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xNamedRanges(
+ xDocProps->getPropertyValue(u"NamedRanges"_ustr), uno::UNO_QUERY);
// Without the fix in place, this test would have failed, we didn't ignore the problematic named
// range on import.
- CPPUNIT_ASSERT(!xNamedRanges->hasByName("myname"));
+ CPPUNIT_ASSERT(!xNamedRanges->hasByName(u"myname"_ustr));
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testExternalDefinedNameXLSX)
{
createScDoc("xlsx/tdf144397.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScDocShell* pDocSh = getScDocShell();
pDocSh->ReloadAllLinks();
@@ -1063,68 +1071,68 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testExternalDefinedNameXLSX)
const ScFormulaCell* pFC = pDoc->GetFormulaCell(ScAddress(1, 1, 0));
sc::FormulaResultValue aRes = pFC->GetResult();
CPPUNIT_ASSERT_EQUAL(sc::FormulaResultValue::String, aRes.meType);
- CPPUNIT_ASSERT_EQUAL(OUString("January"), aRes.maString.getString());
+ CPPUNIT_ASSERT_EQUAL(u"January"_ustr, aRes.maString.getString());
}
// "March"
{
const ScFormulaCell* pFC = pDoc->GetFormulaCell(ScAddress(1, 3, 0));
sc::FormulaResultValue aRes = pFC->GetResult();
CPPUNIT_ASSERT_EQUAL(sc::FormulaResultValue::String, aRes.meType);
- CPPUNIT_ASSERT_EQUAL(OUString("March"), aRes.maString.getString());
+ CPPUNIT_ASSERT_EQUAL(u"March"_ustr, aRes.maString.getString());
}
// "Empty = #N/A"
{
const ScFormulaCell* pFC = pDoc->GetFormulaCell(ScAddress(1, 5, 0));
sc::FormulaResultValue aRes = pFC->GetResult();
CPPUNIT_ASSERT_EQUAL(sc::FormulaResultValue::Error, aRes.meType);
- CPPUNIT_ASSERT_EQUAL(OUString(""), aRes.maString.getString());
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, aRes.maString.getString());
}
// "June"
{
const ScFormulaCell* pFC = pDoc->GetFormulaCell(ScAddress(1, 6, 0));
sc::FormulaResultValue aRes = pFC->GetResult();
CPPUNIT_ASSERT_EQUAL(sc::FormulaResultValue::String, aRes.meType);
- CPPUNIT_ASSERT_EQUAL(OUString("June"), aRes.maString.getString());
+ CPPUNIT_ASSERT_EQUAL(u"June"_ustr, aRes.maString.getString());
}
- save("Calc Office Open XML");
- xmlDocUniquePtr pDocXml = parseExport("xl/externalLinks/externalLink1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDocXml = parseExport(u"xl/externalLinks/externalLink1.xml"_ustr);
CPPUNIT_ASSERT(pDocXml);
assertXPath(pDocXml, "/x:externalLink/x:externalBook/x:sheetNames/x:sheetName"_ostr, "val"_ostr,
- "Munka1");
+ u"Munka1"_ustr);
assertXPath(pDocXml, "/x:externalLink/x:externalBook/x:definedNames/x:definedName"_ostr,
- "name"_ostr, "MonthNames");
+ "name"_ostr, u"MonthNames"_ustr);
// TODO: no need for the [1] external document identifier
assertXPath(pDocXml, "/x:externalLink/x:externalBook/x:definedNames/x:definedName"_ostr,
- "refersTo"_ostr, "[1]Munka1!$A$2:$A$13");
+ "refersTo"_ostr, u"[1]Munka1!$A$2:$A$13"_ustr);
assertXPath(pDocXml, "/x:externalLink/x:externalBook/x:sheetDataSet/x:sheetData"_ostr,
- "sheetId"_ostr, "0");
+ "sheetId"_ostr, u"0"_ustr);
assertXPath(pDocXml, "/x:externalLink/x:externalBook/x:sheetDataSet/x:sheetData/x:row[2]"_ostr,
- "r"_ostr, "3");
+ "r"_ostr, u"3"_ustr);
assertXPathContent(
pDocXml,
"/x:externalLink/x:externalBook/x:sheetDataSet/x:sheetData/x:row[2]/x:cell/x:v"_ostr,
- "February");
+ u"February"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testHyperlinkLocationXLSX)
{
createScDoc("ods/tdf143220.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pDoc);
// tdf#143220 link to sheet not valid without cell reference
assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink[@ref='A1']"_ostr, "location"_ostr,
- "Sheet2!A1");
+ u"Sheet2!A1"_ustr);
// tdf#145079 link with defined name target didn't work because Calc added "A1" at the end
assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink[@ref='A2']"_ostr, "location"_ostr,
- "name");
+ u"name"_ustr);
assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink[@ref='A3']"_ostr, "location"_ostr,
- "db");
+ u"db"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf142264ManyChartsToXLSX)
@@ -1143,7 +1151,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf142264ManyChartsToXLSX)
pBatch->commit();
createScDoc("ods/many_charts.ods");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
css::uno::Reference<css::drawing::XDrawPagesSupplier> xSupplier(mxComponent,
css::uno::UNO_QUERY_THROW);
@@ -1165,8 +1173,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf142264ManyChartsToXLSX)
{
css::uno::Reference<css::beans::XPropertySet> xProps(xPage->getByIndex(i),
css::uno::UNO_QUERY_THROW);
- css::uno::Reference<css::chart2::XChartDocument> xChart(xProps->getPropertyValue("Model"),
- css::uno::UNO_QUERY_THROW);
+ css::uno::Reference<css::chart2::XChartDocument> xChart(
+ xProps->getPropertyValue(u"Model"_ustr), css::uno::UNO_QUERY_THROW);
const auto xDiagram = xChart->getFirstDiagram();
CPPUNIT_ASSERT(xDiagram);
@@ -1191,8 +1199,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf142264ManyChartsToXLSX)
{
css::uno::Reference<css::beans::XPropertySet> xProps(xPage->getByIndex(i),
css::uno::UNO_QUERY_THROW);
- css::uno::Reference<css::chart2::XChartDocument> xChart(xProps->getPropertyValue("Model"),
- css::uno::UNO_QUERY_THROW);
+ css::uno::Reference<css::chart2::XChartDocument> xChart(
+ xProps->getPropertyValue(u"Model"_ustr), css::uno::UNO_QUERY_THROW);
const auto xDiagram = xChart->getFirstDiagram();
CPPUNIT_ASSERT(xDiagram);
@@ -1225,15 +1233,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf143929MultiColumnToODS)
css::uno::Reference<css::drawing::XShape> xShape(xIndexAccess->getByIndex(0),
css::uno::UNO_QUERY_THROW);
css::uno::Reference<css::beans::XPropertySet> xProps(xShape, css::uno::UNO_QUERY_THROW);
- css::uno::Reference<css::text::XTextColumns> xCols(xProps->getPropertyValue("TextColumns"),
- css::uno::UNO_QUERY_THROW);
+ css::uno::Reference<css::text::XTextColumns> xCols(
+ xProps->getPropertyValue(u"TextColumns"_ustr), css::uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCols->getColumnCount());
css::uno::Reference<css::beans::XPropertySet> xColProps(xCols, css::uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(css::uno::Any(sal_Int32(1000)),
- xColProps->getPropertyValue("AutomaticDistance"));
+ xColProps->getPropertyValue(u"AutomaticDistance"_ustr));
}
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
{
css::uno::Reference<css::drawing::XDrawPagesSupplier> xSupplier(mxComponent,
css::uno::UNO_QUERY_THROW);
@@ -1248,15 +1256,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf143929MultiColumnToODS)
// Without the fix in place, this would have failed with:
// An uncaught exception of type com.sun.star.uno.RuntimeException
// - unsatisfied query for interface of type com.sun.star.text.XTextColumns!
- css::uno::Reference<css::text::XTextColumns> xCols(xProps->getPropertyValue("TextColumns"),
- css::uno::UNO_QUERY_THROW);
+ css::uno::Reference<css::text::XTextColumns> xCols(
+ xProps->getPropertyValue(u"TextColumns"_ustr), css::uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCols->getColumnCount());
css::uno::Reference<css::beans::XPropertySet> xColProps(xCols, css::uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(css::uno::Any(sal_Int32(1000)),
- xColProps->getPropertyValue("AutomaticDistance"));
+ xColProps->getPropertyValue(u"AutomaticDistance"_ustr));
}
- xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// Without the fix in place, this would have failed with:
// - Expected: 1
@@ -1267,7 +1275,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf143929MultiColumnToODS)
pXmlDoc,
"/office:document-content/office:automatic-styles/style:style[@style:family='graphic']/"
"style:graphic-properties/style:columns"_ostr,
- "column-count"_ostr, "2");
+ "column-count"_ostr, u"2"_ustr);
// Only test that "column-gap" attribute exists, not its value that depends on locale (cm, in)
getXPath(
pXmlDoc,
@@ -1280,8 +1288,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf142578)
{
createScDoc("ods/tdf142578.ods");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
// Get DxfId for color filter
@@ -1301,16 +1309,16 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf142578)
CPPUNIT_ASSERT_MESSAGE("dxfID's should be different!", nDxfIdColorFilter != nDxfIdCondFormat);
// Check colors used by these dxfs
- xmlDocUniquePtr pStyles = parseExport("xl/styles.xml");
+ xmlDocUniquePtr pStyles = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pStyles);
OString sDxfColorFilterXPath("/x:styleSheet/x:dxfs/x:dxf[" + OString::number(nDxfIdColorFilter)
+ "]/x:fill/x:patternFill/x:fgColor");
- assertXPath(pStyles, sDxfColorFilterXPath, "rgb"_ostr, "FF81D41A");
+ assertXPath(pStyles, sDxfColorFilterXPath, "rgb"_ostr, u"FF81D41A"_ustr);
OString sDxfCondFormatXPath("/x:styleSheet/x:dxfs/x:dxf[" + OString::number(nDxfIdCondFormat)
+ "]/x:fill/x:patternFill/x:bgColor");
- assertXPath(pStyles, sDxfCondFormatXPath, "rgb"_ostr, "FFFFCCCC");
+ assertXPath(pStyles, sDxfCondFormatXPath, "rgb"_ostr, u"FFFFCCCC"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf145059)
@@ -1318,10 +1326,10 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf145059)
createScDoc("ods/tdf145059.ods");
// Export to xlsx.
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
- xmlDocUniquePtr pStyle = parseExport("xl/styles.xml");
+ xmlDocUniquePtr pStyle = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pStyle);
sal_Int32 nColorFilterDxdId
@@ -1335,7 +1343,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf145059)
// Find color by this dxfid
OString sDxfIdPath = "/x:styleSheet/x:dxfs/x:dxf[" + OString::number(nColorFilterDxdId + 1)
+ "]/x:fill/x:patternFill/x:fgColor";
- assertXPath(pStyle, sDxfIdPath, "rgb"_ostr, "FF4472C4");
+ assertXPath(pStyle, sDxfIdPath, "rgb"_ostr, u"FF4472C4"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf130104_XLSXIndent)
@@ -1343,10 +1351,10 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf130104_XLSXIndent)
createScDoc("xlsx/tdf130104_indent.xlsx");
// Resave the xlsx file without any modification.
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
- xmlDocUniquePtr pStyle = parseExport("xl/styles.xml");
+ xmlDocUniquePtr pStyle = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pStyle);
// Check to see whether the indents remain the same as the original ones:
@@ -1358,75 +1366,75 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf130104_XLSXIndent)
OString sStyleA1XPath
= "/x:styleSheet/x:cellXfs/x:xf[" + OString::number(nCellA1StyleIndex) + "]/x:alignment";
// (if this assertion fails, you should first check whether there is no style index set for this cell)
- assertXPath(pStyle, sStyleA1XPath, "indent"_ostr, "0");
+ assertXPath(pStyle, sStyleA1XPath, "indent"_ostr, u"0"_ustr);
sal_Int32 nCellA3StyleIndex
= getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]/x:c[1]"_ostr, "s"_ostr).toInt32() + 1;
// The indent for cell A3 should be 1
OString sStyleA3XPath
= "/x:styleSheet/x:cellXfs/x:xf[" + OString::number(nCellA3StyleIndex) + "]/x:alignment";
- assertXPath(pStyle, sStyleA3XPath, "indent"_ostr, "1");
+ assertXPath(pStyle, sStyleA3XPath, "indent"_ostr, u"1"_ustr);
sal_Int32 nCellA6StyleIndex
= getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]/x:c[1]"_ostr, "s"_ostr).toInt32() + 1;
OString sStyleA6XPath
= "/x:styleSheet/x:cellXfs/x:xf[" + OString::number(nCellA6StyleIndex) + "]/x:alignment";
- assertXPath(pStyle, sStyleA6XPath, "indent"_ostr, "2");
+ assertXPath(pStyle, sStyleA6XPath, "indent"_ostr, u"2"_ustr);
sal_Int32 nCellA9StyleIndex
= getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[9]/x:c[1]"_ostr, "s"_ostr).toInt32() + 1;
OString sStyleA9XPath
= "/x:styleSheet/x:cellXfs/x:xf[" + OString::number(nCellA9StyleIndex) + "]/x:alignment";
- assertXPath(pStyle, sStyleA9XPath, "indent"_ostr, "3");
+ assertXPath(pStyle, sStyleA9XPath, "indent"_ostr, u"3"_ustr);
sal_Int32 nCellA12StyleIndex
= getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[12]/x:c[1]"_ostr, "s"_ostr).toInt32()
+ 1;
OString sStyleA12XPath
= "/x:styleSheet/x:cellXfs/x:xf[" + OString::number(nCellA12StyleIndex) + "]/x:alignment";
- assertXPath(pStyle, sStyleA12XPath, "indent"_ostr, "4");
+ assertXPath(pStyle, sStyleA12XPath, "indent"_ostr, u"4"_ustr);
sal_Int32 nCellA15StyleIndex
= getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[15]/x:c[1]"_ostr, "s"_ostr).toInt32()
+ 1;
OString sStyleA15XPath
= "/x:styleSheet/x:cellXfs/x:xf[" + OString::number(nCellA15StyleIndex) + "]/x:alignment";
- assertXPath(pStyle, sStyleA15XPath, "indent"_ostr, "5");
+ assertXPath(pStyle, sStyleA15XPath, "indent"_ostr, u"5"_ustr);
sal_Int32 nCellA18StyleIndex
= getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[18]/x:c[1]"_ostr, "s"_ostr).toInt32()
+ 1;
OString sStyleA18XPath
= "/x:styleSheet/x:cellXfs/x:xf[" + OString::number(nCellA18StyleIndex) + "]/x:alignment";
- assertXPath(pStyle, sStyleA18XPath, "indent"_ostr, "6");
+ assertXPath(pStyle, sStyleA18XPath, "indent"_ostr, u"6"_ustr);
sal_Int32 nCellA21StyleIndex
= getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]/x:c[1]"_ostr, "s"_ostr).toInt32()
+ 1;
OString sStyleA21XPath
= "/x:styleSheet/x:cellXfs/x:xf[" + OString::number(nCellA21StyleIndex) + "]/x:alignment";
- assertXPath(pStyle, sStyleA21XPath, "indent"_ostr, "7");
+ assertXPath(pStyle, sStyleA21XPath, "indent"_ostr, u"7"_ustr);
sal_Int32 nCellA24StyleIndex
= getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[24]/x:c[1]"_ostr, "s"_ostr).toInt32()
+ 1;
OString sStyleA24XPath
= "/x:styleSheet/x:cellXfs/x:xf[" + OString::number(nCellA24StyleIndex) + "]/x:alignment";
- assertXPath(pStyle, sStyleA24XPath, "indent"_ostr, "8");
+ assertXPath(pStyle, sStyleA24XPath, "indent"_ostr, u"8"_ustr);
sal_Int32 nCellA27StyleIndex
= getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[27]/x:c[1]"_ostr, "s"_ostr).toInt32()
+ 1;
OString sStyleA27XPath
= "/x:styleSheet/x:cellXfs/x:xf[" + OString::number(nCellA27StyleIndex) + "]/x:alignment";
- assertXPath(pStyle, sStyleA27XPath, "indent"_ostr, "9");
+ assertXPath(pStyle, sStyleA27XPath, "indent"_ostr, u"9"_ustr);
sal_Int32 nCellA30StyleIndex
= getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[30]/x:c[1]"_ostr, "s"_ostr).toInt32()
+ 1;
OString sStyleA30XPath
= "/x:styleSheet/x:cellXfs/x:xf[" + OString::number(nCellA30StyleIndex) + "]/x:alignment";
- assertXPath(pStyle, sStyleA30XPath, "indent"_ostr, "10");
+ assertXPath(pStyle, sStyleA30XPath, "indent"_ostr, u"10"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testWholeRowBold)
@@ -1442,14 +1450,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testWholeRowBold)
pDoc->ApplyPatternAreaTab(0, 1, pDoc->MaxCol(), 1, 0, boldAttr);
}
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScDocument* pDoc = getScDoc();
CPPUNIT_ASSERT_EQUAL(SCCOL(INITIALCOLCOUNT), pDoc->GetAllocatedColumnsCount(0));
vcl::Font aFont;
pDoc->GetPattern(pDoc->MaxCol(), 1, 0)->fillFontOnly(aFont);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight());
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
CPPUNIT_ASSERT_EQUAL(SCCOL(INITIALCOLCOUNT), pDoc->GetAllocatedColumnsCount(0));
pDoc->GetPattern(pDoc->MaxCol(), 1, 0)->fillFontOnly(aFont);
@@ -1460,13 +1468,13 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testXlsxRowsOrder)
{
createScDoc("xlsx/tdf58243.xlsx");
// Make sure code in SheetDataBuffer doesn't assert columns/rows sorting.
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf91286)
{
createScDoc("ods/tdf91286.ods");
- save("Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
Reference<packages::zip::XZipFileAccess2> xNameAccess
= packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory),
@@ -1487,8 +1495,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf91286)
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf148820)
{
createScDoc("xlsx/tdf148820.xlsx");
- save("Calc Office Open XML");
- xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
CPPUNIT_ASSERT(pSheet);
sal_Int32 nDxfIdCondFormatFirst
@@ -1500,17 +1508,17 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf148820)
.toInt32()
+ 1;
- xmlDocUniquePtr pStyles = parseExport("xl/styles.xml");
+ xmlDocUniquePtr pStyles = parseExport(u"xl/styles.xml"_ustr);
CPPUNIT_ASSERT(pStyles);
OString sDxfCondFormatXPath("/x:styleSheet/x:dxfs/x:dxf["
+ OString::number(nDxfIdCondFormatFirst)
+ "]/x:fill/x:patternFill/x:bgColor");
- assertXPath(pStyles, sDxfCondFormatXPath, "rgb"_ostr, "FF53B5A9");
+ assertXPath(pStyles, sDxfCondFormatXPath, "rgb"_ostr, u"FF53B5A9"_ustr);
sDxfCondFormatXPath
= OString("/x:styleSheet/x:dxfs/x:dxf[" + OString::number(nDxfIdCondFormatLast)
+ "]/x:fill/x:patternFill/x:bgColor");
- assertXPath(pStyles, sDxfCondFormatXPath, "rgb"_ostr, "FFA30000");
+ assertXPath(pStyles, sDxfCondFormatXPath, "rgb"_ostr, u"FFA30000"_ustr);
}
namespace
@@ -1544,26 +1552,26 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testBlankInExponent)
createScDoc("ods/tdf156449-Blank-In-Exponent.ods");
// save to ODS and reload
- saveAndReload("calc8");
- lcl_TestNumberFormat(*getScDoc(), "0.00E+?0");
- lcl_SetNumberFormat(*getScDoc(), "0.00E+??");
+ saveAndReload(u"calc8"_ustr);
+ lcl_TestNumberFormat(*getScDoc(), u"0.00E+?0"_ustr);
+ lcl_SetNumberFormat(*getScDoc(), u"0.00E+??"_ustr);
// at least one '0' in exponent
- saveAndReload("calc8");
- lcl_TestNumberFormat(*getScDoc(), "0.00E+?0");
+ saveAndReload(u"calc8"_ustr);
+ lcl_TestNumberFormat(*getScDoc(), u"0.00E+?0"_ustr);
// save to XLSX and reload
- saveAndReload("Calc Office Open XML");
- lcl_TestNumberFormat(*getScDoc(), "0.00E+?0");
+ saveAndReload(u"Calc Office Open XML"_ustr);
+ lcl_TestNumberFormat(*getScDoc(), u"0.00E+?0"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testSecondsWithoutTruncateAndDecimals)
{
createScDoc("xlsx/seconds-without-truncate-and-decimals.xlsx");
- lcl_TestNumberFormat(*getScDoc(), "[SS].00");
+ lcl_TestNumberFormat(*getScDoc(), u"[SS].00"_ustr);
// save to ODS and reload
- saveAndReload("calc8");
- lcl_TestNumberFormat(*getScDoc(), "[SS].00");
+ saveAndReload(u"calc8"_ustr);
+ lcl_TestNumberFormat(*getScDoc(), u"[SS].00"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testBlankWidthCharacter)
@@ -1571,22 +1579,22 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testBlankWidthCharacter)
createScDoc("ods/tdf152724-Blank-width-char.ods");
// save to ODS and reload
- saveAndReload("calc8");
- lcl_TestNumberFormat(*getScDoc(), "[>0]_-?0;[<0]-?0;_-?0;@");
+ saveAndReload(u"calc8"_ustr);
+ lcl_TestNumberFormat(*getScDoc(), u"[>0]_-?0;[<0]-?0;_-?0;@"_ustr);
// save to XLSX and reload
- saveAndReload("Calc Office Open XML");
- lcl_TestNumberFormat(*getScDoc(), "_-?0;-?0;_-?0;@");
+ saveAndReload(u"Calc Office Open XML"_ustr);
+ lcl_TestNumberFormat(*getScDoc(), u"_-?0;-?0;_-?0;@"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testEmbeddedTextInDecimal)
{
createScDoc("xlsx/embedded-text-in-decimal.xlsx");
- lcl_TestNumberFormat(*getScDoc(), "#,##0.000\" \"###\" \"###");
+ lcl_TestNumberFormat(*getScDoc(), u"#,##0.000\" \"###\" \"###"_ustr);
// save to ODS and reload
- saveAndReload("calc8");
- lcl_TestNumberFormat(*getScDoc(), "#,##0.000\" \"###\" \"###");
+ saveAndReload(u"calc8"_ustr);
+ lcl_TestNumberFormat(*getScDoc(), u"#,##0.000\" \"###\" \"###"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testLowercaseExponent)
@@ -1594,49 +1602,49 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testLowercaseExponent)
createScDoc("ods/tdf153993-Exponent-lower-case.ods");
// save to ODS and reload
- saveAndReload("calc8");
- lcl_TestNumberFormat(*getScDoc(), "0.000\" \"000\" \"e+\" \"0");
+ saveAndReload(u"calc8"_ustr);
+ lcl_TestNumberFormat(*getScDoc(), u"0.000\" \"000\" \"e+\" \"0"_ustr);
// save to XLSX and reload
// lower case not preserve in XLSX
- saveAndReload("Calc Office Open XML");
- lcl_TestNumberFormat(*getScDoc(), "0.000 000 E+ 0");
+ saveAndReload(u"Calc Office Open XML"_ustr);
+ lcl_TestNumberFormat(*getScDoc(), u"0.000 000 E+ 0"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTotalsRowFunction)
{
createScDoc("xlsx/totalsRowFunction.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
{
- xmlDocUniquePtr pDocXml = parseExport("xl/tables/table1.xml");
+ xmlDocUniquePtr pDocXml = parseExport(u"xl/tables/table1.xml"_ustr);
CPPUNIT_ASSERT(pDocXml);
assertXPath(pDocXml, "/x:table/x:tableColumns/x:tableColumn[5]"_ostr,
- "totalsRowFunction"_ostr, "sum");
+ "totalsRowFunction"_ostr, u"sum"_ustr);
}
ScDocument* pDoc = getScDoc();
pDoc->InsertCol(ScRange(3, 0, 0, 3, pDoc->MaxRow(), 0)); // Insert col 4
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
{
- xmlDocUniquePtr pDocXml = parseExport("xl/tables/table1.xml");
+ xmlDocUniquePtr pDocXml = parseExport(u"xl/tables/table1.xml"_ustr);
CPPUNIT_ASSERT(pDocXml);
assertXPathNoAttribute(pDocXml, "/x:table/x:tableColumns/x:tableColumn[5]"_ostr,
"totalsRowFunction"_ostr);
assertXPath(pDocXml, "/x:table/x:tableColumns/x:tableColumn[6]"_ostr,
- "totalsRowFunction"_ostr, "sum");
+ "totalsRowFunction"_ostr, u"sum"_ustr);
}
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testAutofilterHiddenButton)
{
createScDoc("xlsx/hiddenButton.xlsx");
- saveAndReload("Calc Office Open XML");
- xmlDocUniquePtr pDocXml = parseExport("xl/tables/table1.xml");
+ saveAndReload(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pDocXml = parseExport(u"xl/tables/table1.xml"_ustr);
CPPUNIT_ASSERT(pDocXml);
for (int i = 1; i <= 5; i++)
{
OString sPath
= OString::Concat("/x:table/x:autoFilter/x:filterColumn[") + OString::number(i) + "]";
- assertXPath(pDocXml, sPath, "hiddenButton"_ostr, "1");
+ assertXPath(pDocXml, sPath, "hiddenButton"_ostr, u"1"_ustr);
}
}
@@ -1649,38 +1657,41 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testShapeStyles)
uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(mxComponent,
uno::UNO_QUERY_THROW);
uno::Reference<container::XNameContainer> xGraphicStyles(
- xStyleFamiliesSupplier->getStyleFamilies()->getByName("GraphicStyles"),
+ xStyleFamiliesSupplier->getStyleFamilies()->getByName(u"GraphicStyles"_ustr),
uno::UNO_QUERY_THROW);
// create styles
uno::Reference<style::XStyle> xStyle(
- xMSF->createInstance("com.sun.star.style.GraphicStyle"), uno::UNO_QUERY_THROW);
- xGraphicStyles->insertByName("MyStyle1", Any(xStyle));
+ xMSF->createInstance(u"com.sun.star.style.GraphicStyle"_ustr), uno::UNO_QUERY_THROW);
+ xGraphicStyles->insertByName(u"MyStyle1"_ustr, Any(xStyle));
uno::Reference<beans::XPropertySet> xPropertySet(xStyle, uno::UNO_QUERY_THROW);
- xPropertySet->setPropertyValue("FillColor", Any(COL_RED));
- xPropertySet->setPropertyValue("FillTransparence", Any(sal_Int16(40)));
+ xPropertySet->setPropertyValue(u"FillColor"_ustr, Any(COL_RED));
+ xPropertySet->setPropertyValue(u"FillTransparence"_ustr, Any(sal_Int16(40)));
- xStyle.set(xMSF->createInstance("com.sun.star.style.GraphicStyle"), uno::UNO_QUERY_THROW);
- xGraphicStyles->insertByName("MyStyle2", Any(xStyle));
- xStyle->setParentStyle("MyStyle1");
+ xStyle.set(xMSF->createInstance(u"com.sun.star.style.GraphicStyle"_ustr),
+ uno::UNO_QUERY_THROW);
+ xGraphicStyles->insertByName(u"MyStyle2"_ustr, Any(xStyle));
+ xStyle->setParentStyle(u"MyStyle1"_ustr);
- xStyle.set(xMSF->createInstance("com.sun.star.style.GraphicStyle"), uno::UNO_QUERY_THROW);
- xGraphicStyles->insertByName("MyStyle3", Any(xStyle));
- xStyle->setParentStyle("MyStyle2");
+ xStyle.set(xMSF->createInstance(u"com.sun.star.style.GraphicStyle"_ustr),
+ uno::UNO_QUERY_THROW);
+ xGraphicStyles->insertByName(u"MyStyle3"_ustr, Any(xStyle));
+ xStyle->setParentStyle(u"MyStyle2"_ustr);
// create shape
uno::Reference<drawing::XShape> xShape(
- xMSF->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY_THROW);
+ xMSF->createInstance(u"com.sun.star.drawing.RectangleShape"_ustr),
+ uno::UNO_QUERY_THROW);
uno::Reference<drawing::XDrawPagesSupplier> xDPS(mxComponent, uno::UNO_QUERY_THROW);
uno::Reference<drawing::XShapes> xShapes(xDPS->getDrawPages()->getByIndex(0),
uno::UNO_QUERY_THROW);
xShapes->add(xShape);
uno::Reference<beans::XPropertySet>(xShape, uno::UNO_QUERY_THROW)
- ->setPropertyValue("Style", Any(xStyle));
+ ->setPropertyValue(u"Style"_ustr, Any(xStyle));
}
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
{
uno::Reference<drawing::XDrawPagesSupplier> xDPS(mxComponent, uno::UNO_QUERY_THROW);
@@ -1689,17 +1700,17 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testShapeStyles)
uno::Reference<beans::XPropertySet> xShape(xShapes->getByIndex(0), uno::UNO_QUERY_THROW);
// check style hierarchy
- uno::Reference<style::XStyle> xStyle(xShape->getPropertyValue("Style"),
+ uno::Reference<style::XStyle> xStyle(xShape->getPropertyValue(u"Style"_ustr),
uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT_EQUAL(OUString("MyStyle3"), xStyle->getName());
- CPPUNIT_ASSERT_EQUAL(OUString("MyStyle2"), xStyle->getParentStyle());
+ CPPUNIT_ASSERT_EQUAL(u"MyStyle3"_ustr, xStyle->getName());
+ CPPUNIT_ASSERT_EQUAL(u"MyStyle2"_ustr, xStyle->getParentStyle());
// check that styles have effect on shapes
Color nColor;
- xShape->getPropertyValue("FillColor") >>= nColor;
+ xShape->getPropertyValue(u"FillColor"_ustr) >>= nColor;
CPPUNIT_ASSERT_EQUAL(COL_RED, nColor);
CPPUNIT_ASSERT_EQUAL(sal_Int16(40),
- xShape->getPropertyValue("FillTransparence").get<sal_Int16>());
+ xShape->getPropertyValue(u"FillTransparence"_ustr).get<sal_Int16>());
}
}
@@ -1722,7 +1733,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentStyles)
CPPUNIT_ASSERT_LESSEQUAL(SfxItemState::DEFAULT,
pCaption->GetMergedItemSet().GetItemState(SDRATTR_SHADOW, false));
- auto pStyleSheet = &pDoc->GetStyleSheetPool()->Make("MyStyle1", SfxStyleFamily::Frame);
+ auto pStyleSheet
+ = &pDoc->GetStyleSheetPool()->Make(u"MyStyle1"_ustr, SfxStyleFamily::Frame);
auto& rSet = pStyleSheet->GetItemSet();
rSet.Put(SvxFontHeightItem(1129, 100, EE_CHAR_FONTHEIGHT));
@@ -1732,7 +1744,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentStyles)
pNote->ShowCaption(aPos, false);
}
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
{
ScDocument aDoc;
@@ -1747,10 +1759,10 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentStyles)
CPPUNIT_ASSERT(pCaption);
// Check that the style was imported, and survived copying
- CPPUNIT_ASSERT_EQUAL(OUString("MyStyle1"), pCaption->GetStyleSheet()->GetName());
+ CPPUNIT_ASSERT_EQUAL(u"MyStyle1"_ustr, pCaption->GetStyleSheet()->GetName());
}
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
{
ScDocument* pDoc = getScDoc();
@@ -1771,7 +1783,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentStyles)
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf119565)
{
createScDoc("xlsx/tdf119565.xlsx");
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY_THROW);
uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0),
@@ -1783,14 +1795,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf119565)
// - Actual : 0
// i.e. line width inherited from theme lost after export.
CPPUNIT_ASSERT_EQUAL(sal_Int32(35),
- xShapeProps->getPropertyValue("LineWidth").get<sal_Int32>());
+ xShapeProps->getPropertyValue(u"LineWidth"_ustr).get<sal_Int32>());
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 3
// - Actual : 4
// i.e. line joint inherited from theme lost after export.
- CPPUNIT_ASSERT_EQUAL(drawing::LineJoint_MITER,
- xShapeProps->getPropertyValue("LineJoint").get<drawing::LineJoint>());
+ CPPUNIT_ASSERT_EQUAL(
+ drawing::LineJoint_MITER,
+ xShapeProps->getPropertyValue(u"LineJoint"_ustr).get<drawing::LineJoint>());
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf152980)
@@ -1798,7 +1811,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf152980)
createScDoc("csv/tdf152980.csv");
ScDocShell* pDocSh = getScDocShell();
pDocSh->DoHardRecalc();
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDocSh = getScDocShell();
pDocSh->DoHardRecalc();
@@ -1806,18 +1819,18 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf152980)
// - Expected: The part between a and b does not change
// - Actual : Only the characters a and b remain
- CPPUNIT_ASSERT_EQUAL(OUString("a_x1_b"), pDoc->GetString(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("a_x01_b"), pDoc->GetString(0, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("a_x001_b"), pDoc->GetString(0, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"a_x1_b"_ustr, pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"a_x01_b"_ustr, pDoc->GetString(0, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"a_x001_b"_ustr, pDoc->GetString(0, 2, 0));
// The character code does not change in both cases
- CPPUNIT_ASSERT_EQUAL(OUString("a_x0001_b"), pDoc->GetString(0, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"a_x0001_b"_ustr, pDoc->GetString(0, 3, 0));
// The escape characters are handled correctly in both cases
- CPPUNIT_ASSERT_EQUAL(OUString("a_xfoo\nb"), pDoc->GetString(0, 4, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("a\tb"), pDoc->GetString(0, 5, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("a\nb"), pDoc->GetString(0, 6, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("a\n\nb"), pDoc->GetString(0, 7, 0));
+ CPPUNIT_ASSERT_EQUAL(u"a_xfoo\nb"_ustr, pDoc->GetString(0, 4, 0));
+ CPPUNIT_ASSERT_EQUAL(u"a\tb"_ustr, pDoc->GetString(0, 5, 0));
+ CPPUNIT_ASSERT_EQUAL(u"a\nb"_ustr, pDoc->GetString(0, 6, 0));
+ CPPUNIT_ASSERT_EQUAL(u"a\n\nb"_ustr, pDoc->GetString(0, 7, 0));
}
CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf100034)
@@ -1826,10 +1839,10 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf100034)
ScDocument* pDoc = getScDoc();
// Clear print ranges (Format - Print Ranges - Clear)
- dispatchCommand(mxComponent, ".uno:DeletePrintArea", {});
+ dispatchCommand(mxComponent, u".uno:DeletePrintArea"_ustr, {});
// Save and load back
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
// Check if the same print ranges are present
pDoc = getScDoc();
@@ -1843,7 +1856,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf157318)
ScDocument* pDoc = getScDoc();
// Save as XLSX and load back
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
// Check if there is one global named range
diff --git a/sc/qa/unit/subsequent_filters_test.cxx b/sc/qa/unit/subsequent_filters_test.cxx
index 04815e128790..f25c90e8157b 100644
--- a/sc/qa/unit/subsequent_filters_test.cxx
+++ b/sc/qa/unit/subsequent_filters_test.cxx
@@ -46,16 +46,16 @@ void testRangeNameImpl(const ScDocument& rDoc)
{
//check one range data per sheet and one global more detailed
//add some more checks here
- ScRangeData* pRangeData = rDoc.GetRangeName()->findByUpperName(OUString("GLOBAL1"));
+ ScRangeData* pRangeData = rDoc.GetRangeName()->findByUpperName(u"GLOBAL1"_ustr);
CPPUNIT_ASSERT_MESSAGE("range name Global1 not found", pRangeData);
double aValue = rDoc.GetValue(1, 0, 0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("range name Global1 should reference Sheet1.A1", 1.0, aValue);
- pRangeData = rDoc.GetRangeName(0)->findByUpperName(OUString("LOCAL1"));
+ pRangeData = rDoc.GetRangeName(0)->findByUpperName(u"LOCAL1"_ustr);
CPPUNIT_ASSERT_MESSAGE("range name Sheet1.Local1 not found", pRangeData);
aValue = rDoc.GetValue(1, 2, 0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("range name Sheet1.Local1 should reference Sheet1.A3", 3.0,
aValue);
- pRangeData = rDoc.GetRangeName(1)->findByUpperName(OUString("LOCAL2"));
+ pRangeData = rDoc.GetRangeName(1)->findByUpperName(u"LOCAL2"_ustr);
CPPUNIT_ASSERT_MESSAGE("range name Sheet2.Local2 not found", pRangeData);
aValue = rDoc.GetValue(1, 1, 1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("range name Sheet2.Local2 should reference Sheet2.A2", 7.0,
@@ -87,9 +87,9 @@ void testContentImpl(ScDocument& rDoc, bool bCheckMergedCells)
OUString aString = rDoc.GetString(1, 0, 0);
//check string import
- CPPUNIT_ASSERT_EQUAL_MESSAGE("string imported not correctly", OUString("String1"), aString);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("string imported not correctly", u"String1"_ustr, aString);
aString = rDoc.GetString(1, 1, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("string not imported correctly", OUString("String2"), aString);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("string not imported correctly", u"String2"_ustr, aString);
//check basic formula import
// in case of DIF it just contains values
@@ -115,7 +115,7 @@ void testContentImpl(ScDocument& rDoc, bool bCheckMergedCells)
ScAddress aAddress(7, 2, 0);
ScPostIt* pNote = rDoc.GetNote(aAddress);
CPPUNIT_ASSERT_MESSAGE("note not imported", pNote);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("note text not imported correctly", OUString("Test"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("note text not imported correctly", u"Test"_ustr,
pNote->GetText());
}
@@ -323,8 +323,8 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testTdf139934)
// Without the fix in place, this test would have failed with
// - Expected: 1/20/2021
// - Actual : 44216
- CPPUNIT_ASSERT_EQUAL(OUString("1/20/2021"), pDoc->GetString(0, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("11/25/2020"), pDoc->GetString(0, 61, 0));
+ CPPUNIT_ASSERT_EQUAL(u"1/20/2021"_ustr, pDoc->GetString(0, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"11/25/2020"_ustr, pDoc->GetString(0, 61, 0));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest, testTdf150452)
@@ -334,8 +334,8 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testTdf150452)
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("1-GDUSF"), pDoc->GetString(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("1-GE41L"), pDoc->GetString(0, 3998, 0));
+ CPPUNIT_ASSERT_EQUAL(u"1-GDUSF"_ustr, pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"1-GE41L"_ustr, pDoc->GetString(0, 3998, 0));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest, testTdf48731)
@@ -344,23 +344,23 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testTdf48731)
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("'"), pDoc->GetString(1, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("''"), pDoc->GetString(1, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("'''"), pDoc->GetString(1, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"'"_ustr, pDoc->GetString(1, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"''"_ustr, pDoc->GetString(1, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"'''"_ustr, pDoc->GetString(1, 3, 0));
// Without the fix in place, this test would have failed with
// - Expected: '3
// - Actual : 3
- CPPUNIT_ASSERT_EQUAL(OUString("'3"), pDoc->GetString(1, 4, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("'word"), pDoc->GetString(1, 5, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("'mword"), pDoc->GetString(1, 6, 0));
+ CPPUNIT_ASSERT_EQUAL(u"'3"_ustr, pDoc->GetString(1, 4, 0));
+ CPPUNIT_ASSERT_EQUAL(u"'word"_ustr, pDoc->GetString(1, 5, 0));
+ CPPUNIT_ASSERT_EQUAL(u"'mword"_ustr, pDoc->GetString(1, 6, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("'"), pDoc->GetString(1, 9, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("''"), pDoc->GetString(1, 10, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("'''"), pDoc->GetString(1, 11, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("'3"), pDoc->GetString(1, 12, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("'word"), pDoc->GetString(1, 13, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("'mword"), pDoc->GetString(1, 14, 0));
+ CPPUNIT_ASSERT_EQUAL(u"'"_ustr, pDoc->GetString(1, 9, 0));
+ CPPUNIT_ASSERT_EQUAL(u"''"_ustr, pDoc->GetString(1, 10, 0));
+ CPPUNIT_ASSERT_EQUAL(u"'''"_ustr, pDoc->GetString(1, 11, 0));
+ CPPUNIT_ASSERT_EQUAL(u"'3"_ustr, pDoc->GetString(1, 12, 0));
+ CPPUNIT_ASSERT_EQUAL(u"'word"_ustr, pDoc->GetString(1, 13, 0));
+ CPPUNIT_ASSERT_EQUAL(u"'mword"_ustr, pDoc->GetString(1, 14, 0));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest, testCondFormatFormulaIsXLSX)
@@ -515,11 +515,11 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testBasicCellContentODS)
ScDocument* pDoc = getScDoc();
OUString aStr = pDoc->GetString(1, 1, 0); // B2
- CPPUNIT_ASSERT_EQUAL(OUString("LibreOffice Calc"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"LibreOffice Calc"_ustr, aStr);
double fVal = pDoc->GetValue(1, 2, 0); // B3
CPPUNIT_ASSERT_EQUAL(12345.0, fVal);
aStr = pDoc->GetString(1, 3, 0); // B4
- CPPUNIT_ASSERT_EQUAL(OUString("A < B"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"A < B"_ustr, aStr);
// Numeric value of 0.
ScRefCellValue aCell;
@@ -551,19 +551,18 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testTdf143809)
ScDocument* pDoc = getScDoc();
OUString aFormula = pDoc->GetFormula(0, 0, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMPRODUCT(IFERROR(CEILING.MATH(DURATIONS,300),0))"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUMPRODUCT(IFERROR(CEILING.MATH(DURATIONS,300),0))"_ustr, aFormula);
// Without the fix in place, this test would have failed with
// - Expected: 53700
// - Actual : Err:502
- CPPUNIT_ASSERT_EQUAL(OUString("53700"), pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"53700"_ustr, pDoc->GetString(0, 0, 0));
aFormula = pDoc->GetFormula(0, 1, 0);
CPPUNIT_ASSERT_EQUAL(
- OUString(
- "=SUMPRODUCT(IFERROR(CEILING(SUMIFS(DURATIONS,IDS,IDS),300)/COUNTIFS(IDS,IDS),0))"),
+ u"=SUMPRODUCT(IFERROR(CEILING(SUMIFS(DURATIONS,IDS,IDS),300)/COUNTIFS(IDS,IDS),0))"_ustr,
aFormula);
- CPPUNIT_ASSERT_EQUAL(OUString("51900"), pDoc->GetString(0, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"51900"_ustr, pDoc->GetString(0, 1, 0));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest, testTdf76310)
@@ -578,7 +577,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testTdf76310)
// +
// 2
// - Actual : =1 + 2
- CPPUNIT_ASSERT_EQUAL(OUString("=1\n+\n2"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=1\n+\n2"_ustr, aFormula);
ASSERT_DOUBLES_EQUAL(3.0, pDoc->GetValue(0, 0, 0));
}
@@ -608,11 +607,11 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testRangeNameLocalXLS)
CPPUNIT_ASSERT_EQUAL(size_t(2), pRangeName->size());
OUString aFormula = pDoc->GetFormula(3, 11, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(local_name2)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(local_name2)"_ustr, aFormula);
ASSERT_DOUBLES_EQUAL(14.0, pDoc->GetValue(3, 11, 0));
aFormula = pDoc->GetFormula(6, 4, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=local_name1"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=local_name1"_ustr, aFormula);
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest, testRangeNameXLSX)
@@ -645,12 +644,12 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testHiddenRangeNameODS)
ScDocument* pDoc = getScDoc();
// This named range is set to "hidden"
- ScRangeData* pRangeData1 = pDoc->GetRangeName()->findByUpperName(OUString("NAMEDRANGE1"));
+ ScRangeData* pRangeData1 = pDoc->GetRangeName()->findByUpperName(u"NAMEDRANGE1"_ustr);
CPPUNIT_ASSERT(pRangeData1);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(sheet::NamedRangeFlag::HIDDEN),
pRangeData1->GetUnoType() & sheet::NamedRangeFlag::HIDDEN);
// This named range is visible
- ScRangeData* pRangeData2 = pDoc->GetRangeName()->findByUpperName(OUString("NAMEDRANGE2"));
+ ScRangeData* pRangeData2 = pDoc->GetRangeName()->findByUpperName(u"NAMEDRANGE2"_ustr);
CPPUNIT_ASSERT(pRangeData2);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0),
pRangeData2->GetUnoType() & sheet::NamedRangeFlag::HIDDEN);
@@ -661,13 +660,13 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testHiddenRangeNameODS)
pRangeData2->GetUnoType() & sheet::NamedRangeFlag::HIDDEN);
// Check if both named ranges are hidden after saving and reloading
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
- pRangeData1 = pDoc->GetRangeName()->findByUpperName(OUString("NAMEDRANGE1"));
+ pRangeData1 = pDoc->GetRangeName()->findByUpperName(u"NAMEDRANGE1"_ustr);
CPPUNIT_ASSERT(pRangeData1);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(sheet::NamedRangeFlag::HIDDEN),
pRangeData1->GetUnoType() & sheet::NamedRangeFlag::HIDDEN);
- pRangeData2 = pDoc->GetRangeName()->findByUpperName(OUString("NAMEDRANGE2"));
+ pRangeData2 = pDoc->GetRangeName()->findByUpperName(u"NAMEDRANGE2"_ustr);
CPPUNIT_ASSERT(pRangeData2);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(sheet::NamedRangeFlag::HIDDEN),
pRangeData2->GetUnoType() & sheet::NamedRangeFlag::HIDDEN);
@@ -679,24 +678,24 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testHiddenRangeNameXLSX)
ScDocument* pDoc = getScDoc();
// This named range is set to "hidden"
- ScRangeData* pRangeData1 = pDoc->GetRangeName()->findByUpperName(OUString("NAMEDRANGE1"));
+ ScRangeData* pRangeData1 = pDoc->GetRangeName()->findByUpperName(u"NAMEDRANGE1"_ustr);
CPPUNIT_ASSERT(pRangeData1);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(sheet::NamedRangeFlag::HIDDEN),
pRangeData1->GetUnoType() & sheet::NamedRangeFlag::HIDDEN);
// This named range is visible
- ScRangeData* pRangeData2 = pDoc->GetRangeName()->findByUpperName(OUString("NAMEDRANGE2"));
+ ScRangeData* pRangeData2 = pDoc->GetRangeName()->findByUpperName(u"NAMEDRANGE2"_ustr);
CPPUNIT_ASSERT(pRangeData2);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0),
pRangeData2->GetUnoType() & sheet::NamedRangeFlag::HIDDEN);
// Save as ODS and test if the named ranges are still with the correct hidden flag
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
- pRangeData1 = pDoc->GetRangeName()->findByUpperName(OUString("NAMEDRANGE1"));
+ pRangeData1 = pDoc->GetRangeName()->findByUpperName(u"NAMEDRANGE1"_ustr);
CPPUNIT_ASSERT(pRangeData1);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(sheet::NamedRangeFlag::HIDDEN),
pRangeData1->GetUnoType() & sheet::NamedRangeFlag::HIDDEN);
- pRangeData2 = pDoc->GetRangeName()->findByUpperName(OUString("NAMEDRANGE2"));
+ pRangeData2 = pDoc->GetRangeName()->findByUpperName(u"NAMEDRANGE2"_ustr);
CPPUNIT_ASSERT(pRangeData2);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0),
pRangeData2->GetUnoType() & sheet::NamedRangeFlag::HIDDEN);
@@ -709,39 +708,39 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testHiddenNamedExpression)
// Adds two hidden named expressions and two non-hidden named expressions
ScRangeName* pNamedRanges = pDoc->GetRangeName();
- ScRangeData* pRangeData1 = new ScRangeData(*pDoc, "NAME1", "100");
+ ScRangeData* pRangeData1 = new ScRangeData(*pDoc, u"NAME1"_ustr, u"100"_ustr);
pRangeData1->AddType(ScRangeData::Type::Hidden);
pNamedRanges->insert(pRangeData1);
- ScRangeData* pRangeData2 = new ScRangeData(*pDoc, "NAME2", "text1");
+ ScRangeData* pRangeData2 = new ScRangeData(*pDoc, u"NAME2"_ustr, u"text1"_ustr);
pRangeData2->AddType(ScRangeData::Type::Hidden);
pNamedRanges->insert(pRangeData2);
- ScRangeData* pRangeData3 = new ScRangeData(*pDoc, "NAME3", "200");
+ ScRangeData* pRangeData3 = new ScRangeData(*pDoc, u"NAME3"_ustr, u"200"_ustr);
pNamedRanges->insert(pRangeData3);
- ScRangeData* pRangeData4 = new ScRangeData(*pDoc, "NAME4", "text2");
+ ScRangeData* pRangeData4 = new ScRangeData(*pDoc, u"NAME4"_ustr, u"text2"_ustr);
pNamedRanges->insert(pRangeData4);
CPPUNIT_ASSERT_EQUAL(size_t(4), pNamedRanges->size());
// Save and reload to test whether the named expressions retain the hidden where applicable
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
pNamedRanges = pDoc->GetRangeName();
CPPUNIT_ASSERT_EQUAL(size_t(4), pNamedRanges->size());
- pRangeData1 = pNamedRanges->findByUpperName(OUString("NAME1"));
+ pRangeData1 = pNamedRanges->findByUpperName(u"NAME1"_ustr);
CPPUNIT_ASSERT(pRangeData1);
CPPUNIT_ASSERT_EQUAL(ScRangeData::Type::Hidden, pRangeData1->GetType());
- CPPUNIT_ASSERT_EQUAL(OUString("100"), pRangeData1->GetSymbol());
- pRangeData2 = pNamedRanges->findByUpperName(OUString("NAME2"));
+ CPPUNIT_ASSERT_EQUAL(u"100"_ustr, pRangeData1->GetSymbol());
+ pRangeData2 = pNamedRanges->findByUpperName(u"NAME2"_ustr);
CPPUNIT_ASSERT(pRangeData2);
CPPUNIT_ASSERT_EQUAL(ScRangeData::Type::Hidden, pRangeData2->GetType());
- CPPUNIT_ASSERT_EQUAL(OUString("text1"), pRangeData2->GetSymbol());
- pRangeData3 = pNamedRanges->findByUpperName(OUString("NAME3"));
+ CPPUNIT_ASSERT_EQUAL(u"text1"_ustr, pRangeData2->GetSymbol());
+ pRangeData3 = pNamedRanges->findByUpperName(u"NAME3"_ustr);
CPPUNIT_ASSERT(pRangeData3);
CPPUNIT_ASSERT_EQUAL(ScRangeData::Type::Name, pRangeData3->GetType());
- CPPUNIT_ASSERT_EQUAL(OUString("200"), pRangeData3->GetSymbol());
- pRangeData4 = pNamedRanges->findByUpperName(OUString("NAME4"));
+ CPPUNIT_ASSERT_EQUAL(u"200"_ustr, pRangeData3->GetSymbol());
+ pRangeData4 = pNamedRanges->findByUpperName(u"NAME4"_ustr);
CPPUNIT_ASSERT(pRangeData4);
CPPUNIT_ASSERT_EQUAL(ScRangeData::Type::Name, pRangeData4->GetType());
- CPPUNIT_ASSERT_EQUAL(OUString("text2"), pRangeData4->GetSymbol());
+ CPPUNIT_ASSERT_EQUAL(u"text2"_ustr, pRangeData4->GetSymbol());
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest, testHiddenNamedExpressionODS)
@@ -751,14 +750,14 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testHiddenNamedExpressionODS)
// The document has 2 named expressions; the first is hidden; the second is visible
ScRangeName* pNamedRanges = pDoc->GetRangeName();
- ScRangeData* pRangeData1 = pNamedRanges->findByUpperName(OUString("NAME1"));
+ ScRangeData* pRangeData1 = pNamedRanges->findByUpperName(u"NAME1"_ustr);
CPPUNIT_ASSERT(pRangeData1);
CPPUNIT_ASSERT_EQUAL(ScRangeData::Type::Hidden, pRangeData1->GetType());
- CPPUNIT_ASSERT_EQUAL(OUString("100"), pRangeData1->GetSymbol());
- ScRangeData* pRangeData2 = pNamedRanges->findByUpperName(OUString("NAME2"));
+ CPPUNIT_ASSERT_EQUAL(u"100"_ustr, pRangeData1->GetSymbol());
+ ScRangeData* pRangeData2 = pNamedRanges->findByUpperName(u"NAME2"_ustr);
CPPUNIT_ASSERT(pRangeData2);
CPPUNIT_ASSERT_EQUAL(ScRangeData::Type::Name, pRangeData2->GetType());
- CPPUNIT_ASSERT_EQUAL(OUString("200"), pRangeData2->GetSymbol());
+ CPPUNIT_ASSERT_EQUAL(u"200"_ustr, pRangeData2->GetSymbol());
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest, testHyperlinksXLSX)
@@ -766,9 +765,9 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testHyperlinksXLSX)
createScDoc("xlsx/hyperlinks.xlsx");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("10:ABC10"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("10:ABC11"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("10:ABC12"), pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"10:ABC10"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"10:ABC11"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"10:ABC12"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest, testHardRecalcODS)
@@ -907,14 +906,14 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testCachedFormulaResultsODS)
+ OUString::number(nRow) + ")";
pDoc->SetString(nCol, nRow + 2, 2, aFormula);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
- OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8).getStr(), OUString("TRUE"),
+ OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8).getStr(), u"TRUE"_ustr,
pDoc->GetString(nCol, nRow + 2, 2));
OUString aIsTextFormula = "=ISTEXT("
+ OUString::number(static_cast<char>('A' + nCol))
+ OUString::number(nRow) + ")";
pDoc->SetString(nCol, nRow + 4, 2, aIsTextFormula);
- CPPUNIT_ASSERT_EQUAL(OUString("FALSE"), pDoc->GetString(nCol, nRow + 4, 2));
+ CPPUNIT_ASSERT_EQUAL(u"FALSE"_ustr, pDoc->GetString(nCol, nRow + 4, 2));
}
}
}
@@ -945,7 +944,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testCachedMatrixFormulaResultsODS)
// fdo#59293 with cached value import error formulas require special
// treatment
- pDoc->SetString(2, 5, 2, "=ISERROR(A6)");
+ pDoc->SetString(2, 5, 2, u"=ISERROR(A6)"_ustr);
double nVal = pDoc->GetValue(2, 5, 2);
CPPUNIT_ASSERT_EQUAL(1.0, nVal);
}
@@ -1348,11 +1347,12 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testBugFixesODS)
{
// fdo#40426
- ScDBData* pDBData = pDoc->GetDBCollection()->getNamedDBs().findByUpperName("DBRANGE1");
+ ScDBData* pDBData
+ = pDoc->GetDBCollection()->getNamedDBs().findByUpperName(u"DBRANGE1"_ustr);
CPPUNIT_ASSERT(pDBData);
CPPUNIT_ASSERT(pDBData->HasHeader());
// no header
- pDBData = pDoc->GetDBCollection()->getNamedDBs().findByUpperName("DBRANGE2");
+ pDBData = pDoc->GetDBCollection()->getNamedDBs().findByUpperName(u"DBRANGE2"_ustr);
CPPUNIT_ASSERT(pDBData);
CPPUNIT_ASSERT(!pDBData->HasHeader());
}
@@ -1552,19 +1552,19 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testDataValidityODS)
ScAddress aValBaseAddr3(2, 2, 2); //sheet3
//sheet1's expected Data Validation Entry values
- ValDataTestParams aVDTParams1(SC_VALID_DECIMAL, ScConditionMode::Greater, "3.14", OUString(),
- *pDoc, aValBaseAddr1, "Too small",
- "The number you are trying to enter is not greater than 3.14! "
- "Are you sure you want to enter it anyway?",
+ ValDataTestParams aVDTParams1(SC_VALID_DECIMAL, ScConditionMode::Greater, u"3.14"_ustr,
+ OUString(), *pDoc, aValBaseAddr1, u"Too small"_ustr,
+ u"The number you are trying to enter is not greater than 3.14! "
+ "Are you sure you want to enter it anyway?"_ustr,
SC_VALERR_WARNING, 1);
//sheet2's expected Data Validation Entry values
- ValDataTestParams aVDTParams2(SC_VALID_WHOLE, ScConditionMode::Between, "1", "10", *pDoc,
- aValBaseAddr2, "Error sheet 2",
- "Must be a whole number between 1 and 10.", SC_VALERR_STOP, 2);
+ ValDataTestParams aVDTParams2(
+ SC_VALID_WHOLE, ScConditionMode::Between, u"1"_ustr, u"10"_ustr, *pDoc, aValBaseAddr2,
+ u"Error sheet 2"_ustr, u"Must be a whole number between 1 and 10."_ustr, SC_VALERR_STOP, 2);
//sheet3's expected Data Validation Entry values
- ValDataTestParams aVDTParams3(SC_VALID_CUSTOM, ScConditionMode::Direct, "ISTEXT(C3)",
- OUString(), *pDoc, aValBaseAddr3, "Error sheet 3",
- "Must not be a numerical value.", SC_VALERR_STOP, 3);
+ ValDataTestParams aVDTParams3(SC_VALID_CUSTOM, ScConditionMode::Direct, u"ISTEXT(C3)"_ustr,
+ OUString(), *pDoc, aValBaseAddr3, u"Error sheet 3"_ustr,
+ u"Must not be a numerical value."_ustr, SC_VALERR_STOP, 3);
//check each sheet's Data Validation Entries
checkValiditationEntries(aVDTParams1);
checkValiditationEntries(aVDTParams2);
@@ -1619,36 +1619,36 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testDataTableMortgageXLS)
// One-variable table
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=PMT(B3/12,B4,-B5)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=PMT(B3/12,B4,-B5)"_ustr,
pDoc->GetFormula(3, 1, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=MULTIPLE.OPERATIONS(D$2,$B$3,$C3)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=MULTIPLE.OPERATIONS(D$2,$B$3,$C3)"_ustr,
pDoc->GetFormula(3, 2, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=MULTIPLE.OPERATIONS(D$2,$B$3,$C4)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=MULTIPLE.OPERATIONS(D$2,$B$3,$C4)"_ustr,
pDoc->GetFormula(3, 3, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=MULTIPLE.OPERATIONS(D$2,$B$3,$C5)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=MULTIPLE.OPERATIONS(D$2,$B$3,$C5)"_ustr,
pDoc->GetFormula(3, 4, 0));
// Two-variable table
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=PMT(B9/12,B10,-B11)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=PMT(B9/12,B10,-B11)"_ustr,
pDoc->GetFormula(2, 7, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!",
- OUString("=MULTIPLE.OPERATIONS($C$8,$B$9,$C9,$B$10,D$8)"),
+ u"=MULTIPLE.OPERATIONS($C$8,$B$9,$C9,$B$10,D$8)"_ustr,
pDoc->GetFormula(3, 8, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!",
- OUString("=MULTIPLE.OPERATIONS($C$8,$B$9,$C10,$B$10,D$8)"),
+ u"=MULTIPLE.OPERATIONS($C$8,$B$9,$C10,$B$10,D$8)"_ustr,
pDoc->GetFormula(3, 9, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!",
- OUString("=MULTIPLE.OPERATIONS($C$8,$B$9,$C11,$B$10,D$8)"),
+ u"=MULTIPLE.OPERATIONS($C$8,$B$9,$C11,$B$10,D$8)"_ustr,
pDoc->GetFormula(3, 10, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!",
- OUString("=MULTIPLE.OPERATIONS($C$8,$B$9,$C9,$B$10,E$8)"),
+ u"=MULTIPLE.OPERATIONS($C$8,$B$9,$C9,$B$10,E$8)"_ustr,
pDoc->GetFormula(4, 8, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!",
- OUString("=MULTIPLE.OPERATIONS($C$8,$B$9,$C10,$B$10,E$8)"),
+ u"=MULTIPLE.OPERATIONS($C$8,$B$9,$C10,$B$10,E$8)"_ustr,
pDoc->GetFormula(4, 9, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!",
- OUString("=MULTIPLE.OPERATIONS($C$8,$B$9,$C11,$B$10,E$8)"),
+ u"=MULTIPLE.OPERATIONS($C$8,$B$9,$C11,$B$10,E$8)"_ustr,
pDoc->GetFormula(4, 10, 0));
}
@@ -1666,12 +1666,12 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testDataTableOneVarXLSX)
// B5:B11 should have multiple operations formula cells. Just check the
// top and bottom cells.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=MULTIPLE.OPERATIONS(B$4,$A$2,$A5)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=MULTIPLE.OPERATIONS(B$4,$A$2,$A5)"_ustr,
pDoc->GetFormula(1, 4, 0));
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(1, 4, 0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=MULTIPLE.OPERATIONS(B$4,$A$2,$A11)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=MULTIPLE.OPERATIONS(B$4,$A$2,$A11)"_ustr,
pDoc->GetFormula(1, 10, 0));
CPPUNIT_ASSERT_EQUAL(14.0, pDoc->GetValue(ScAddress(1, 10, 0)));
@@ -1679,12 +1679,12 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testDataTableOneVarXLSX)
// Likewise, E5:I5 should have multiple operations formula cells. Just
// check the left- and right-most cells.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=MULTIPLE.OPERATIONS($D5,$B$2,E$4)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=MULTIPLE.OPERATIONS($D5,$B$2,E$4)"_ustr,
pDoc->GetFormula(4, 4, 0));
CPPUNIT_ASSERT_EQUAL(10.0, pDoc->GetValue(ScAddress(4, 4, 0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=MULTIPLE.OPERATIONS($D5,$B$2,I$4)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=MULTIPLE.OPERATIONS($D5,$B$2,I$4)"_ustr,
pDoc->GetFormula(8, 4, 0));
CPPUNIT_ASSERT_EQUAL(50.0, pDoc->GetValue(ScAddress(8, 4, 0)));
@@ -1705,13 +1705,13 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testDataTableMultiTableXLSX)
// the top-left and bottom-right ones.
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!",
- OUString("=MULTIPLE.OPERATIONS($A$3,$E$1,$A4,$D$1,B$3)"),
+ u"=MULTIPLE.OPERATIONS($A$3,$E$1,$A4,$D$1,B$3)"_ustr,
pDoc->GetFormula(1, 3, 0));
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(ScAddress(1, 3, 0)));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!",
- OUString("=MULTIPLE.OPERATIONS($A$3,$E$1,$A15,$D$1,M$3)"),
+ u"=MULTIPLE.OPERATIONS($A$3,$E$1,$A15,$D$1,M$3)"_ustr,
pDoc->GetFormula(12, 14, 0));
CPPUNIT_ASSERT_EQUAL(144.0, pDoc->GetValue(ScAddress(12, 14, 0)));
@@ -1749,26 +1749,26 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testRowIndex1BasedXLSX)
// A1
OUString aStr = pDoc->GetString(ScAddress(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Action Plan.Name"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"Action Plan.Name"_ustr, aStr);
// B1
aStr = pDoc->GetString(ScAddress(1, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Action Plan.Description"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"Action Plan.Description"_ustr, aStr);
// A2
aStr = pDoc->GetString(ScAddress(0, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Jerry"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"Jerry"_ustr, aStr);
// B2 - multi-line text.
const EditTextObject* pText = pDoc->GetEditText(ScAddress(1, 1, 0));
CPPUNIT_ASSERT(pText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), pText->GetParagraphCount());
aStr = pText->GetText(0);
- CPPUNIT_ASSERT_EQUAL(OUString("This is a longer Text."), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"This is a longer Text."_ustr, aStr);
aStr = pText->GetText(1);
- CPPUNIT_ASSERT_EQUAL(OUString("Second line."), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"Second line."_ustr, aStr);
aStr = pText->GetText(2);
- CPPUNIT_ASSERT_EQUAL(OUString("Third line."), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"Third line."_ustr, aStr);
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest, testCondFormatCfvoScaleValueXLSX)
@@ -1793,7 +1793,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testCondFormatCfvoScaleValueXLSX)
}
ScFiltersTest::ScFiltersTest()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx
index 2a09166847e9..4968ef61ae59 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -58,7 +58,7 @@ public:
};
ScFiltersTest2::ScFiltersTest2()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
@@ -186,7 +186,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testCustomNumFormatHybridCellODS)
pDoc->SetValue(ScAddress(1, 15, 0), 1.0);
OUString aStr = pDoc->GetString(ScAddress(1, 17, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("1"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, aStr);
// Make sure the cell doesn't have an error value.
ScFormulaCell* pFC = pDoc->GetFormulaCell(ScAddress(1, 17, 0));
@@ -245,8 +245,8 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf153767)
// Without the fix in place, this test would have failed with
// - Expected: TRUE
// - Actual : 0
- CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), pDoc->GetString(ScAddress(7, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("FALSE"), pDoc->GetString(ScAddress(7, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"TRUE"_ustr, pDoc->GetString(ScAddress(7, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"FALSE"_ustr, pDoc->GetString(ScAddress(7, 2, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf124454)
@@ -255,11 +255,11 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf124454)
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(ScAddress(1, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(ScAddress(2, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
// Without the fix in place, double negation with text in array
// would have returned -1
- CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(ScAddress(3, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(ScAddress(3, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testPrintRangeODS)
@@ -392,7 +392,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testSharedFormulaHorizontalXLS)
// J2 has a string of "MW".
aPos.SetCol(9);
- CPPUNIT_ASSERT_EQUAL(OUString("MW"), pDoc->GetString(aPos));
+ CPPUNIT_ASSERT_EQUAL(u"MW"_ustr, pDoc->GetString(aPos));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testSharedFormulaWrappedRefsXLS)
@@ -489,10 +489,10 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testSharedFormulaXLS)
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(10), pFC->GetSharedLength());
OUString aFormula = pDoc->GetFormula(2, 1, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B9:D9)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B9:D9)"_ustr, aFormula);
aFormula = pDoc->GetFormula(2, 10, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B18:D18)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B18:D18)"_ustr, aFormula);
}
{
@@ -507,10 +507,10 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testSharedFormulaXLS)
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(10), pFC->GetSharedLength());
OUString aFormula = pDoc->GetFormula(4, 8, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(G9:EY9)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(G9:EY9)"_ustr, aFormula);
aFormula = pDoc->GetFormula(4, 17, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(G18:EY18)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(G18:EY18)"_ustr, aFormula);
}
{
@@ -525,10 +525,10 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testSharedFormulaXLS)
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(10), pFC->GetSharedLength());
OUString aFormula = pDoc->GetFormula(6, 15, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A16:A40000)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A16:A40000)"_ustr, aFormula);
aFormula = pDoc->GetFormula(6, 24, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A25:A40009)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A25:A40009)"_ustr, aFormula);
}
}
}
@@ -600,10 +600,10 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testExternalRefCacheXLSX)
ScDocument* pDoc = getScDoc();
// These string values are cached external cell values.
- CPPUNIT_ASSERT_EQUAL(OUString("Name"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Andy"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Bruce"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Charlie"), pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Name"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Andy"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Bruce"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Charlie"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testExternalRefCacheODS)
@@ -613,9 +613,9 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testExternalRefCacheODS)
ScDocument* pDoc = getScDoc();
// Cells B2:B4 have VLOOKUP with external references which should all show "text".
- CPPUNIT_ASSERT_EQUAL(OUString("text"), pDoc->GetString(ScAddress(1, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("text"), pDoc->GetString(ScAddress(1, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("text"), pDoc->GetString(ScAddress(1, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"text"_ustr, pDoc->GetString(ScAddress(1, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"text"_ustr, pDoc->GetString(ScAddress(1, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"text"_ustr, pDoc->GetString(ScAddress(1, 3, 0)));
// Both cells A6 and A7 should be registered with scExternalRefManager properly
CPPUNIT_ASSERT_EQUAL(
@@ -645,7 +645,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testCopyMergedNumberFormats)
OUString aStrD1 = pDoc->GetString(ScAddress(3, 0, 0));
ScDocument aCopyDoc;
- aCopyDoc.InsertTab(0, "CopyHere");
+ aCopyDoc.InsertTab(0, u"CopyHere"_ustr);
pDoc->CopyStaticToDocument(ScRange(1, 0, 0, 3, 0, 0), 0, aCopyDoc);
// Make sure the date formats are copied to the new document.
@@ -666,7 +666,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testVBAUserFunctionXLSM)
sc::CompileFormulaContext aCxt(*pDoc);
OUString aFormula = pFC->GetFormula(aCxt);
- CPPUNIT_ASSERT_EQUAL(OUString("=MYFUNC()"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=MYFUNC()"_ustr, aFormula);
// Check the formula state after the load.
FormulaError nErrCode = pFC->GetErrCode();
@@ -706,14 +706,14 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testErrorOnExternalReferences)
ScDocument* pDoc = getScDoc();
// Test tdf#89330
- pDoc->SetString(ScAddress(0, 0, 0), "='file:///Path/To/FileA.ods'#$Sheet1.A1A");
+ pDoc->SetString(ScAddress(0, 0, 0), u"='file:///Path/To/FileA.ods'#$Sheet1.A1A"_ustr);
ScFormulaCell* pFC = pDoc->GetFormulaCell(ScAddress(0, 0, 0));
CPPUNIT_ASSERT(pFC);
CPPUNIT_ASSERT_EQUAL(int(FormulaError::NoName), static_cast<int>(pFC->GetErrCode()));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Formula changed",
- OUString("='file:///Path/To/FileA.ods'#$Sheet1.A1A"),
+ u"='file:///Path/To/FileA.ods'#$Sheet1.A1A"_ustr,
pDoc->GetFormula(0, 0, 0));
}
@@ -729,7 +729,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf145054)
// Make sure named DB was copied
ScDBData* pDBData
- = pDoc->GetDBCollection()->getNamedDBs().findByName("__Anonymous_Sheet_DB__1");
+ = pDoc->GetDBCollection()->getNamedDBs().findByName(u"__Anonymous_Sheet_DB__1"_ustr);
CPPUNIT_ASSERT(pDBData);
}
@@ -739,10 +739,10 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf84762)
ScDocument* pDoc = getScDoc();
- pDoc->SetString(ScAddress(0, 0, 0), "=RAND()");
- pDoc->SetString(ScAddress(0, 1, 0), "=RAND()");
- pDoc->SetString(ScAddress(1, 0, 0), "=RAND()*A1");
- pDoc->SetString(ScAddress(1, 1, 0), "=RAND()*B1");
+ pDoc->SetString(ScAddress(0, 0, 0), u"=RAND()"_ustr);
+ pDoc->SetString(ScAddress(0, 1, 0), u"=RAND()"_ustr);
+ pDoc->SetString(ScAddress(1, 0, 0), u"=RAND()*A1"_ustr);
+ pDoc->SetString(ScAddress(1, 1, 0), u"=RAND()*B1"_ustr);
double nValA1, nValB1, nValA2, nValB2;
@@ -772,7 +772,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf44076)
ScDocument* pDoc = getScDoc();
- pDoc->SetString(ScAddress(0, 0, 0), "=(-8)^(1/3)");
+ pDoc->SetString(ScAddress(0, 0, 0), u"=(-8)^(1/3)"_ustr);
CPPUNIT_ASSERT_EQUAL(-2.0, pDoc->GetValue(ScAddress(0, 0, 0)));
}
@@ -786,7 +786,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testEditEngStrikeThroughXLSX)
const EditTextObject* pObj = pDoc->GetEditText(ScAddress(0, 0, 0));
CPPUNIT_ASSERT(pObj);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pObj->GetParagraphCount());
- CPPUNIT_ASSERT_EQUAL(OUString("this is strike through this not"), pObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"this is strike through this not"_ustr, pObj->GetText(0));
std::vector<EECharAttrib> aAttribs;
pObj->GetCharAttribs(0, aAttribs);
@@ -885,7 +885,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testColumnStyle2XLSX)
const SfxPoolItem& rItem = pAttr->GetItem(ATTR_FONT);
const SvxFontItem& rFont = static_cast<const SvxFontItem&>(rItem);
OUString aName = rFont.GetFamilyName();
- CPPUNIT_ASSERT_EQUAL(OUString("Linux Biolinum G"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Linux Biolinum G"_ustr, aName);
}
}
@@ -900,7 +900,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf110440XLSX)
xIA.set(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xShape(xIA->getByIndex(0), uno::UNO_QUERY_THROW);
bool bVisible = true;
- xShape->getPropertyValue("Visible") >>= bVisible;
+ xShape->getPropertyValue(u"Visible"_ustr) >>= bVisible;
// This failed: group shape's hidden property was lost on import.
CPPUNIT_ASSERT(!bVisible);
}
@@ -973,8 +973,8 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testRelFormulaValidationXLS)
ScDocument* pDoc = getScDoc();
- checkValidationFormula(ScAddress(3, 4, 0), *pDoc, "C5");
- checkValidationFormula(ScAddress(5, 8, 0), *pDoc, "D7");
+ checkValidationFormula(ScAddress(3, 4, 0), *pDoc, u"C5"_ustr);
+ checkValidationFormula(ScAddress(5, 8, 0), *pDoc, u"D7"_ustr);
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf136364)
@@ -987,13 +987,13 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf136364)
// - Expected: =SUM((B2:B3~C4:C5~D6:D7))
// - Actual : =SUM((B2:B3~C4:C5,D6:D7))
OUString aFormula = pDoc->GetFormula(4, 0, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM((B2:B3~C4:C5~D6:D7))"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM((B2:B3~C4:C5~D6:D7))"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(27.0, pDoc->GetValue(ScAddress(4, 0, 0)));
// - Expected: =SUM((B2~C4~D6))
// - Actual : =SUM((B2~C4,D6))
aFormula = pDoc->GetFormula(4, 1, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM((B2~C4~D6))"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM((B2~C4~D6))"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(12.0, pDoc->GetValue(ScAddress(4, 1, 0)));
}
@@ -1003,7 +1003,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf103734)
ScDocument* pDoc = getScDoc();
// Without the fix in place, MAX() would have returned -1.8E+308
- CPPUNIT_ASSERT_EQUAL(OUString("#N/A"), pDoc->GetString(ScAddress(2, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#N/A"_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf126116)
@@ -1011,9 +1011,9 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf126116)
createScDoc("fods/tdf126116.fods");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("02/02/21"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"02/02/21"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
- pDoc->SetString(ScAddress(0, 0, 0), "03/03");
+ pDoc->SetString(ScAddress(0, 0, 0), u"03/03"_ustr);
sal_uInt32 nNumberFormat = pDoc->GetNumberFormat(0, 0, 0);
const SvNumberformat* pNumberFormat = pDoc->GetFormatTable()->GetEntry(nNumberFormat);
@@ -1022,7 +1022,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf126116)
// Without the fix in place, this test would have failed with
// - Expected: MM/DD/YY
// - Actual : MM/DD/YYYY
- CPPUNIT_ASSERT_EQUAL(OUString("MM/DD/YY"), rFormatStr);
+ CPPUNIT_ASSERT_EQUAL(u"MM/DD/YY"_ustr, rFormatStr);
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf144209)
@@ -1030,7 +1030,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf144209)
createScDoc("ods/tdf144209.ods");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("AA 0"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"AA 0"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
ScDocShell* pDocSh = getScDocShell();
pDocSh->DoHardRecalc();
@@ -1038,7 +1038,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf144209)
// Without the fix in place, this test would have failed with
// - Expected: AA 33263342642.5385
// - Actual : AA 0
- CPPUNIT_ASSERT_EQUAL(OUString("AA 33263342642.5385"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"AA 33263342642.5385"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf98844)
@@ -1075,12 +1075,12 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf118561)
//Without the fix in place, it would have failed with
//- Expected: apple
//- Actual : Err:502
- CPPUNIT_ASSERT_EQUAL(OUString("apple"), pDoc->GetString(ScAddress(1, 1, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("apple"), pDoc->GetString(ScAddress(2, 1, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), pDoc->GetString(ScAddress(3, 1, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("fruits"), pDoc->GetString(ScAddress(4, 1, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("apple"), pDoc->GetString(ScAddress(5, 1, 1)));
- CPPUNIT_ASSERT_EQUAL(OUString("hat"), pDoc->GetString(ScAddress(6, 1, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"apple"_ustr, pDoc->GetString(ScAddress(1, 1, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"apple"_ustr, pDoc->GetString(ScAddress(2, 1, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"TRUE"_ustr, pDoc->GetString(ScAddress(3, 1, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"fruits"_ustr, pDoc->GetString(ScAddress(4, 1, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"apple"_ustr, pDoc->GetString(ScAddress(5, 1, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"hat"_ustr, pDoc->GetString(ScAddress(6, 1, 1)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf125099)
@@ -1088,18 +1088,18 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf125099)
createScDoc("ods/tdf125099.ods");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("03:53:46"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("03:23:59"), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"03:53:46"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"03:23:59"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
ScDocShell* pDocSh = getScDocShell();
pDocSh->DoHardRecalc();
- CPPUNIT_ASSERT_EQUAL(OUString("03:53:46"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"03:53:46"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
// Without the fix in place, this would have failed with
// - Expected: 03:24:00
// - Actual : 03:23:59
- CPPUNIT_ASSERT_EQUAL(OUString("03:24:00"), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"03:24:00"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf134455)
@@ -1107,14 +1107,14 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf134455)
createScDoc("xlsx/tdf134455.xlsx");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("00:05"), pDoc->GetString(ScAddress(3, 4, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("00:10"), pDoc->GetString(ScAddress(3, 5, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("00:59"), pDoc->GetString(ScAddress(3, 6, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"00:05"_ustr, pDoc->GetString(ScAddress(3, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"00:10"_ustr, pDoc->GetString(ScAddress(3, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"00:59"_ustr, pDoc->GetString(ScAddress(3, 6, 0)));
// Without the fix in place, TIMEVALUE would have returned Err:502 for values
// greater than 59
- CPPUNIT_ASSERT_EQUAL(OUString("01:05"), pDoc->GetString(ScAddress(3, 7, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("04:00"), pDoc->GetString(ScAddress(3, 8, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"01:05"_ustr, pDoc->GetString(ScAddress(3, 7, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"04:00"_ustr, pDoc->GetString(ScAddress(3, 8, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf119533)
@@ -1125,12 +1125,12 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf119533)
// Without fix in place, this test would have failed with
// - Expected: 0.5
// - Actual : 0.483333333333333
- CPPUNIT_ASSERT_EQUAL(OUString("0.5"), pDoc->GetString(ScAddress(4, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0.5"_ustr, pDoc->GetString(ScAddress(4, 0, 0)));
// Without fix in place, this test would have failed with
// - Expected: 9.5
// - Actual : 9.51666666666667
- CPPUNIT_ASSERT_EQUAL(OUString("9.5"), pDoc->GetString(ScAddress(5, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"9.5"_ustr, pDoc->GetString(ScAddress(5, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf127982)
@@ -1139,18 +1139,18 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf127982)
ScDocument* pDoc = getScDoc();
// Without the fix in place, these cells would be empty
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pDoc->GetString(ScAddress(3, 5, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("R6"), pDoc->GetString(ScAddress(3, 6, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("R7"), pDoc->GetString(ScAddress(3, 7, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pDoc->GetString(ScAddress(3, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"R6"_ustr, pDoc->GetString(ScAddress(3, 6, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"R7"_ustr, pDoc->GetString(ScAddress(3, 7, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pDoc->GetString(ScAddress(4, 5, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("R6"), pDoc->GetString(ScAddress(4, 6, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("R7"), pDoc->GetString(ScAddress(4, 7, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pDoc->GetString(ScAddress(4, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"R6"_ustr, pDoc->GetString(ScAddress(4, 6, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"R7"_ustr, pDoc->GetString(ScAddress(4, 7, 0)));
// Without the fix in place, these cells would be empty
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pDoc->GetString(ScAddress(4, 5, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("R6"), pDoc->GetString(ScAddress(4, 6, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("R7"), pDoc->GetString(ScAddress(4, 7, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pDoc->GetString(ScAddress(4, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"R6"_ustr, pDoc->GetString(ScAddress(4, 6, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"R7"_ustr, pDoc->GetString(ScAddress(4, 7, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf109409)
@@ -1159,24 +1159,24 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf109409)
ScDocument* pDoc = getScDoc();
// TEXTJOIN
- CPPUNIT_ASSERT_EQUAL(OUString("A1;B1;A2;B2;A3;B3"), pDoc->GetString(ScAddress(3, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("A1;B1;A2;B2;A3;B3"), pDoc->GetString(ScAddress(3, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("A1;A2;A3;B1;B2;B3"), pDoc->GetString(ScAddress(3, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A1;B1;A2;B2;A3;B3"_ustr, pDoc->GetString(ScAddress(3, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A1;B1;A2;B2;A3;B3"_ustr, pDoc->GetString(ScAddress(3, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A1;A2;A3;B1;B2;B3"_ustr, pDoc->GetString(ScAddress(3, 4, 0)));
// Without the fix in place, it would have failed with
//- Expected: A1;B1;A2;B2;A3;B3
//- Actual : A1;A2;A3;B1;B2;B3
- CPPUNIT_ASSERT_EQUAL(OUString("A1;B1;A2;B2;A3;B3"), pDoc->GetString(ScAddress(3, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A1;B1;A2;B2;A3;B3"_ustr, pDoc->GetString(ScAddress(3, 5, 0)));
// CONCAT
- CPPUNIT_ASSERT_EQUAL(OUString("A1B1A2B2A3B3"), pDoc->GetString(ScAddress(6, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("A1B1A2B2A3B3"), pDoc->GetString(ScAddress(6, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("A1A2A3B1B2B3"), pDoc->GetString(ScAddress(6, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A1B1A2B2A3B3"_ustr, pDoc->GetString(ScAddress(6, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A1B1A2B2A3B3"_ustr, pDoc->GetString(ScAddress(6, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A1A2A3B1B2B3"_ustr, pDoc->GetString(ScAddress(6, 4, 0)));
// Without the fix in place, it would have failed with
//- Expected: A1B1A2B2A3B3
//- Actual : A1A2A3B1B2B3
- CPPUNIT_ASSERT_EQUAL(OUString("A1B1A2B2A3B3"), pDoc->GetString(ScAddress(6, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A1B1A2B2A3B3"_ustr, pDoc->GetString(ScAddress(6, 5, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf132105)
@@ -1185,23 +1185,23 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf132105)
ScDocument* pDoc = getScDoc();
// MATCH
- CPPUNIT_ASSERT_EQUAL(OUString("5"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("5"), pDoc->GetString(ScAddress(1, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"5"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"5"_ustr, pDoc->GetString(ScAddress(1, 1, 0)));
// COUNT
- CPPUNIT_ASSERT_EQUAL(OUString("0"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("20"), pDoc->GetString(ScAddress(1, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"20"_ustr, pDoc->GetString(ScAddress(1, 2, 0)));
// COUNTA
- CPPUNIT_ASSERT_EQUAL(OUString("20"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("20"), pDoc->GetString(ScAddress(1, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"20"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"20"_ustr, pDoc->GetString(ScAddress(1, 3, 0)));
// COUNTBLANK
// Without the fix in place, it would have failed with
// - Expected: 0
//- Actual : Err:504
- CPPUNIT_ASSERT_EQUAL(OUString("0"), pDoc->GetString(ScAddress(0, 4, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("0"), pDoc->GetString(ScAddress(1, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pDoc->GetString(ScAddress(1, 4, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf131424)
@@ -1221,9 +1221,9 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf100709XLSX)
createScDoc("xlsx/tdf100709.xlsx");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B52 should not be formatted with a $", OUString("218"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B52 should not be formatted with a $", u"218"_ustr,
pDoc->GetString(1, 51, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell A75 should not be formatted as a date", OUString("218"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell A75 should not be formatted as a date", u"218"_ustr,
pDoc->GetString(0, 74, 0));
}
@@ -1233,7 +1233,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf97598XLSX)
ScDocument* pDoc = getScDoc();
OUString aStr = pDoc->GetString(0, 0, 0); // A1
- CPPUNIT_ASSERT_EQUAL(OUString("Cell A1"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"Cell A1"_ustr, aStr);
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf83672XLSX)
@@ -1245,7 +1245,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf83672XLSX)
uno::Reference<drawing::XShape> xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xShapeProperties(xShape, uno::UNO_QUERY);
sal_Int32 nRotate = 0;
- xShapeProperties->getPropertyValue("RotateAngle") >>= nRotate;
+ xShapeProperties->getPropertyValue(u"RotateAngle"_ustr) >>= nRotate;
CPPUNIT_ASSERT(nRotate != 0);
}
@@ -1306,17 +1306,17 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testBackgroundColorStandardXLSXML)
};
const std::vector<Check> aChecks = {
- { OUString("Background Color"), COL_BLACK, COL_TRANSPARENT },
- { OUString("Dark Red"), COL_WHITE, Color(192, 0, 0) },
- { OUString("Red"), COL_WHITE, COL_LIGHTRED },
- { OUString("Orange"), COL_WHITE, Color(255, 192, 0) },
- { OUString("Yellow"), COL_WHITE, COL_YELLOW },
- { OUString("Light Green"), COL_WHITE, Color(146, 208, 80) },
- { OUString("Green"), COL_WHITE, Color(0, 176, 80) },
- { OUString("Light Blue"), COL_WHITE, Color(0, 176, 240) },
- { OUString("Blue"), COL_WHITE, Color(0, 112, 192) },
- { OUString("Dark Blue"), COL_WHITE, Color(0, 32, 96) },
- { OUString("Purple"), COL_WHITE, Color(112, 48, 160) },
+ { u"Background Color"_ustr, COL_BLACK, COL_TRANSPARENT },
+ { u"Dark Red"_ustr, COL_WHITE, Color(192, 0, 0) },
+ { u"Red"_ustr, COL_WHITE, COL_LIGHTRED },
+ { u"Orange"_ustr, COL_WHITE, Color(255, 192, 0) },
+ { u"Yellow"_ustr, COL_WHITE, COL_YELLOW },
+ { u"Light Green"_ustr, COL_WHITE, Color(146, 208, 80) },
+ { u"Green"_ustr, COL_WHITE, Color(0, 176, 80) },
+ { u"Light Blue"_ustr, COL_WHITE, Color(0, 176, 240) },
+ { u"Blue"_ustr, COL_WHITE, Color(0, 112, 192) },
+ { u"Dark Blue"_ustr, COL_WHITE, Color(0, 32, 96) },
+ { u"Purple"_ustr, COL_WHITE, Color(112, 48, 160) },
};
for (size_t nRow = 0; nRow < aChecks.size(); ++nRow)
@@ -1343,19 +1343,17 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf131536)
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(3, 9, 0));
CPPUNIT_ASSERT_EQUAL(
- OUString(
- "=IF(D$4=\"-\",\"-\",MID(TEXT(INDEX($Comparison.$I:$J,$Comparison.$A5,$Comparison.D$2),"
- "\"\")"
- ",2,4)"
- "=RIGHT(TEXT(INDEX($Comparison.$L:$Z,$Comparison.$A5,$Comparison.D$4),\"\"),4))"),
+ u"=IF(D$4=\"-\",\"-\",MID(TEXT(INDEX($Comparison.$I:$J,$Comparison.$A5,$Comparison.D$2),"
+ "\"\")"
+ ",2,4)"
+ "=RIGHT(TEXT(INDEX($Comparison.$L:$Z,$Comparison.$A5,$Comparison.D$4),\"\"),4))"_ustr,
pDoc->GetFormula(3, 9, 0));
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(4, 9, 0));
CPPUNIT_ASSERT_EQUAL(
- OUString(
- "=IF(D$4=\"-\",\"-\",MID(TEXT(INDEX($Comparison.$I:$J,$Comparison.$A5,$Comparison.D$2),"
- "\"0\"),2,4)"
- "=RIGHT(TEXT(INDEX($Comparison.$L:$Z,$Comparison.$A5,$Comparison.D$4),\"0\"),4))"),
+ u"=IF(D$4=\"-\",\"-\",MID(TEXT(INDEX($Comparison.$I:$J,$Comparison.$A5,$Comparison.D$2),"
+ "\"0\"),2,4)"
+ "=RIGHT(TEXT(INDEX($Comparison.$L:$Z,$Comparison.$A5,$Comparison.D$4),\"0\"),4))"_ustr,
pDoc->GetFormula(4, 9, 0));
}
@@ -1364,18 +1362,18 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf130583)
createScDoc("ods/tdf130583.ods");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("b"), pDoc->GetString(ScAddress(1, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("c"), pDoc->GetString(ScAddress(1, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), pDoc->GetString(ScAddress(1, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("d"), pDoc->GetString(ScAddress(1, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("#N/A"), pDoc->GetString(ScAddress(1, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"b"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"c"_ustr, pDoc->GetString(ScAddress(1, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, pDoc->GetString(ScAddress(1, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"d"_ustr, pDoc->GetString(ScAddress(1, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#N/A"_ustr, pDoc->GetString(ScAddress(1, 4, 0)));
// Without the fix in place, SWITCH would have returned #VALUE!
- CPPUNIT_ASSERT_EQUAL(OUString("b"), pDoc->GetString(ScAddress(4, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("c"), pDoc->GetString(ScAddress(4, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), pDoc->GetString(ScAddress(4, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("d"), pDoc->GetString(ScAddress(4, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("#N/A"), pDoc->GetString(ScAddress(4, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"b"_ustr, pDoc->GetString(ScAddress(4, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"c"_ustr, pDoc->GetString(ScAddress(4, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, pDoc->GetString(ScAddress(4, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"d"_ustr, pDoc->GetString(ScAddress(4, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#N/A"_ustr, pDoc->GetString(ScAddress(4, 4, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf85617)
@@ -1406,13 +1404,13 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf42481)
createScDoc("ods/tdf42481.ods");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("#VALUE!"), pDoc->GetString(ScAddress(3, 9, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#VALUE!"_ustr, pDoc->GetString(ScAddress(3, 9, 0)));
// Without the fix in place, this test would have failed with
// - Expected: #VALUE!
// - Actual : 14
- CPPUNIT_ASSERT_EQUAL(OUString("#VALUE!"), pDoc->GetString(ScAddress(3, 10, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("14"), pDoc->GetString(ScAddress(3, 11, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#VALUE!"_ustr, pDoc->GetString(ScAddress(3, 10, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"14"_ustr, pDoc->GetString(ScAddress(3, 11, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testNamedExpressionsXLSXML)
@@ -1426,18 +1424,18 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testNamedExpressionsXLSXML)
// A7
ScAddress aPos(0, 6, 0);
CPPUNIT_ASSERT_EQUAL(15.0, pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(MyRange)"),
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(MyRange)"_ustr,
pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// B7
aPos.IncCol();
CPPUNIT_ASSERT_EQUAL(55.0, pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(MyRange2)"),
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(MyRange2)"_ustr,
pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
- const ScRangeData* pRD = pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ const ScRangeData* pRD = pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pRD);
- pRD = pDoc->GetRangeName()->findByUpperName("MYRANGE2");
+ pRD = pDoc->GetRangeName()->findByUpperName(u"MYRANGE2"_ustr);
CPPUNIT_ASSERT(pRD);
}
@@ -1450,22 +1448,22 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testNamedExpressionsXLSXML)
// A7 on Sheet1
ScAddress aPos(0, 6, 0);
CPPUNIT_ASSERT_EQUAL(27.0, pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(MyRange)"),
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(MyRange)"_ustr,
pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// A7 on Sheet2
aPos.IncTab();
CPPUNIT_ASSERT_EQUAL(74.0, pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(MyRange)"),
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(MyRange)"_ustr,
pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
const ScRangeName* pRN = pDoc->GetRangeName(0);
CPPUNIT_ASSERT(pRN);
- const ScRangeData* pRD = pRN->findByUpperName("MYRANGE");
+ const ScRangeData* pRD = pRN->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pRD);
pRN = pDoc->GetRangeName(1);
CPPUNIT_ASSERT(pRN);
- pRD = pRN->findByUpperName("MYRANGE");
+ pRD = pRN->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pRD);
}
}
@@ -1490,15 +1488,14 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testEmptyRowsXLSXML)
};
ScRange aDataRange;
- aDataRange.Parse("A1:B9", *pDoc);
+ aDataRange.Parse(u"A1:B9"_ustr, *pDoc);
bool bSuccess = checkOutput(pDoc, aDataRange, aOutputCheck, "Expected output");
CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
}
ScAddress aPos;
- aPos.Parse("B9", *pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B4:B8)"),
- pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ aPos.Parse(u"B9"_ustr, *pDoc);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B4:B8)"_ustr, pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testBorderDirectionsXLSXML)
diff --git a/sc/qa/unit/subsequent_filters_test3.cxx b/sc/qa/unit/subsequent_filters_test3.cxx
index ed2718342f5d..14b2e315112e 100644
--- a/sc/qa/unit/subsequent_filters_test3.cxx
+++ b/sc/qa/unit/subsequent_filters_test3.cxx
@@ -61,7 +61,7 @@ public:
};
ScFiltersTest3::ScFiltersTest3()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
@@ -319,25 +319,25 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testActiveXCheckboxXLSX)
uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY);
uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(
- true, bool(xServiceInfo->supportsService("com.sun.star.form.component.CheckBox")));
+ true, bool(xServiceInfo->supportsService(u"com.sun.star.form.component.CheckBox"_ustr)));
// Check custom label
OUString sLabel;
- xPropertySet->getPropertyValue("Label") >>= sLabel;
- CPPUNIT_ASSERT_EQUAL(OUString("Custom Caption"), sLabel);
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= sLabel;
+ CPPUNIT_ASSERT_EQUAL(u"Custom Caption"_ustr, sLabel);
// Check background color (highlight system color)
Color nColor;
- xPropertySet->getPropertyValue("BackgroundColor") >>= nColor;
+ xPropertySet->getPropertyValue(u"BackgroundColor"_ustr) >>= nColor;
CPPUNIT_ASSERT_EQUAL(Color(0x316AC5), nColor);
// Check Text color (active border system color)
- xPropertySet->getPropertyValue("TextColor") >>= nColor;
+ xPropertySet->getPropertyValue(u"TextColor"_ustr) >>= nColor;
CPPUNIT_ASSERT_EQUAL(Color(0xD4D0C8), nColor);
// Check state of the checkbox
sal_Int16 nState;
- xPropertySet->getPropertyValue("State") >>= nState;
+ xPropertySet->getPropertyValue(u"State"_ustr) >>= nState;
CPPUNIT_ASSERT_EQUAL(sal_Int16(1), nState);
}
@@ -356,7 +356,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf60673)
uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY);
OUString sLabel;
- xPropertySet->getPropertyValue("Label") >>= sLabel;
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= sLabel;
// Without the fix in place, this test would have failed with
// - Expected: PL: ĄŚŻŹĆŃŁÓĘ
@@ -378,8 +378,8 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testtdf120301_xmlSpaceParsingXLSX)
UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> XPropSet(xControlShape->getControl(), uno::UNO_QUERY_THROW);
OUString sCaption;
- XPropSet->getPropertyValue("Label") >>= sCaption;
- CPPUNIT_ASSERT_EQUAL(OUString("Check Box 1"), sCaption);
+ XPropSet->getPropertyValue(u"Label"_ustr) >>= sCaption;
+ CPPUNIT_ASSERT_EQUAL(u"Check Box 1"_ustr, sCaption);
}
namespace
@@ -461,7 +461,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf150815_RepaintSparkline)
CPPUNIT_ASSERT(pSparkline);
ScTabViewShell* pViewShell = getViewShell();
- pViewShell->EnterData(0, 0, 0, "10");
+ pViewShell->EnterData(0, 0, 0, u"10"_ustr);
CPPUNIT_ASSERT(aListener.mbCalled);
}
@@ -471,7 +471,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf137091)
// Set the system locale to Turkish
SvtSysLocaleOptions aOptions;
OUString sLocaleConfigString = aOptions.GetLanguageTag().getBcp47();
- aOptions.SetLocaleConfigString("tr-TR");
+ aOptions.SetLocaleConfigString(u"tr-TR"_ustr);
aOptions.Commit();
comphelper::ScopeGuard g([&aOptions, &sLocaleConfigString] {
aOptions.SetLocaleConfigString(sLocaleConfigString);
@@ -484,7 +484,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf137091)
// Without the fix in place, this test would have failed with
// - Expected: 28/4
// - Actual : Err:507
- CPPUNIT_ASSERT_EQUAL(OUString("28/4"), pDoc->GetString(ScAddress(2, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"28/4"_ustr, pDoc->GetString(ScAddress(2, 1, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf141495)
@@ -492,7 +492,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf141495)
// Set the system locale to Turkish
SvtSysLocaleOptions aOptions;
OUString sLocaleConfigString = aOptions.GetLanguageTag().getBcp47();
- aOptions.SetLocaleConfigString("tr-TR");
+ aOptions.SetLocaleConfigString(u"tr-TR"_ustr);
aOptions.Commit();
comphelper::ScopeGuard g([&aOptions, &sLocaleConfigString] {
aOptions.SetLocaleConfigString(sLocaleConfigString);
@@ -508,7 +508,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf141495)
// Without the fix in place, this test would have failed with
// - Expected: 44926
// - Actual : #ADDIN?
- CPPUNIT_ASSERT_EQUAL(OUString("44926"), pDoc->GetString(ScAddress(11, 6, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"44926"_ustr, pDoc->GetString(ScAddress(11, 6, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf70455)
@@ -544,7 +544,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf137453)
// Without the fix in place, this test would have failed with
// - Expected: 3333333333/100
// - Actual : -961633963/100
- CPPUNIT_ASSERT_EQUAL(OUString("3333333333/100"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"3333333333/100"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf112780)
@@ -556,10 +556,10 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf112780)
// Without the fix in place, this test would have failed with
// - Expected:
// - Actual : #VALUE!
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(3, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(3, 5, 0)));
OUString aFormula = pDoc->GetFormula(3, 5, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=G6+J6+M6"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=G6+J6+M6"_ustr, aFormula);
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf72470)
@@ -570,7 +570,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf72470)
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("name"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"name"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_EQUAL(u"أسمي walid"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
}
@@ -734,7 +734,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testShapeRotationImport)
uno::Reference<drawing::XShape> xShape(xPage->getByIndex(ind), uno::UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xShapeProperties(xShape, uno::UNO_QUERY);
- uno::Any nRotProp = xShapeProperties->getPropertyValue("RotateAngle");
+ uno::Any nRotProp = xShapeProperties->getPropertyValue(u"RotateAngle"_ustr);
sal_Int32 nRot = nRotProp.get<sal_Int32>();
const OString sNote = "RotateAngle = " + OString::number(nRot);
@@ -760,7 +760,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testShapeDisplacementOnRotationImport)
uno::Reference<drawing::XShape> xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xShapeProperties(xShape, uno::UNO_QUERY_THROW);
- uno::Any aRectProp = xShapeProperties->getPropertyValue("FrameRect");
+ uno::Any aRectProp = xShapeProperties->getPropertyValue(u"FrameRect"_ustr);
awt::Rectangle aRectangle = aRectProp.get<awt::Rectangle>();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aRectangle.X);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aRectangle.Y);
@@ -779,10 +779,10 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTextBoxBodyUpright)
// Check that we imported "Upright".
bool isUpright = false;
- if (xShapeProperties->getPropertySetInfo()->hasPropertyByName("InteropGrabBag"))
+ if (xShapeProperties->getPropertySetInfo()->hasPropertyByName(u"InteropGrabBag"_ustr))
{
uno::Sequence<beans::PropertyValue> aGrabBag;
- xShapeProperties->getPropertyValue("InteropGrabBag") >>= aGrabBag;
+ xShapeProperties->getPropertyValue(u"InteropGrabBag"_ustr) >>= aGrabBag;
for (auto& aProp : aGrabBag)
{
if (aProp.Name == "Upright")
@@ -797,7 +797,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTextBoxBodyUpright)
// Check the TextPreRotateAngle has the compensation for the additional 90deg area rotation,
// which is added in Shape::createAndInsert to get the same rendering as in MS Office.
sal_Int32 nAngle;
- uno::Any aGeom = xShapeProperties->getPropertyValue("CustomShapeGeometry");
+ uno::Any aGeom = xShapeProperties->getPropertyValue(u"CustomShapeGeometry"_ustr);
auto aGeomSeq = aGeom.get<Sequence<beans::PropertyValue>>();
for (const auto& aProp : aGeomSeq)
{
@@ -822,8 +822,8 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTextBoxBodyRotateAngle)
// Check the text direction.
sal_Int16 eWritingMode = text::WritingMode2::LR_TB;
- if (xShapeProperties->getPropertySetInfo()->hasPropertyByName("WritingMode"))
- xShapeProperties->getPropertyValue("WritingMode") >>= eWritingMode;
+ if (xShapeProperties->getPropertySetInfo()->hasPropertyByName(u"WritingMode"_ustr))
+ xShapeProperties->getPropertyValue(u"WritingMode"_ustr) >>= eWritingMode;
CPPUNIT_ASSERT_EQUAL(sal_Int16(text::WritingMode2::BT_LR), eWritingMode);
}
@@ -885,7 +885,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testDeleteCircles)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pPage->GetObjCount());
// The value of A1 change to Hello1.
- pDoc->SetString(0, 0, 0, "Hello1");
+ pDoc->SetString(0, 0, 0, u"Hello1"_ustr);
// Check that the data is valid.(True if text length = 6)
const ScValidationData* pData = pDoc->GetValidationEntry(1);
@@ -1137,12 +1137,12 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testInvalidBareBiff5)
aPos = ScAddress(0, 1, 0);
CPPUNIT_ASSERT_EQUAL(CELLTYPE_FORMULA, pDoc->GetCellType(aPos));
OUString sFormula = pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab());
- CPPUNIT_ASSERT_EQUAL(OUString("=TRUE()"), sFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=TRUE()"_ustr, sFormula);
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(aPos));
aPos.IncCol();
CPPUNIT_ASSERT_EQUAL(CELLTYPE_FORMULA, pDoc->GetCellType(aPos));
sFormula = pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab());
- CPPUNIT_ASSERT_EQUAL(OUString("=FALSE()"), sFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=FALSE()"_ustr, sFormula);
CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(aPos));
aPos.IncCol();
CPPUNIT_ASSERT_EQUAL(CELLTYPE_NONE, pDoc->GetCellType(aPos));
@@ -1348,7 +1348,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf151818_SmartArtFontColor)
uno::Reference<beans::XPropertySet> xPortion(xPara->createEnumeration()->nextElement(),
uno::UNO_QUERY);
Color nActualColor{ 0 };
- xPortion->getPropertyValue("CharColor") >>= nActualColor;
+ xPortion->getPropertyValue(u"CharColor"_ustr) >>= nActualColor;
// Without fix the test would have failed with:
// - Expected: rgba[44546aff]
// - Actual : rgba[ffffffff], that is text was white
@@ -1358,7 +1358,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf151818_SmartArtFontColor)
// oox::drawingml::Color::getSchemeColorIndex()
// Without fix the color scheme was "lt1" (1) but should be "dk2" (2).
CPPUNIT_ASSERT_EQUAL(sal_Int16(2),
- xPortion->getPropertyValue("CharColorTheme").get<sal_Int16>());
+ xPortion->getPropertyValue(u"CharColorTheme"_ustr).get<sal_Int16>());
if (!bUseGroup)
{
@@ -1480,7 +1480,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf98657)
CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf88821)
{
- setImportFilterName("calc_HTML_WebQuery");
+ setImportFilterName(u"calc_HTML_WebQuery"_ustr);
createScDoc("html/tdf88821.html");
ScDocument* pDoc = getScDoc();
@@ -1491,7 +1491,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf88821)
CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf88821_2)
{
- setImportFilterName("calc_HTML_WebQuery");
+ setImportFilterName(u"calc_HTML_WebQuery"_ustr);
createScDoc("html/tdf88821-2.html");
ScDocument* pDoc = getScDoc();
@@ -1503,7 +1503,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf88821_2)
CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf103960)
{
- setImportFilterName("calc_HTML_WebQuery");
+ setImportFilterName(u"calc_HTML_WebQuery"_ustr);
createScDoc("html/tdf103960.html");
ScDocument* pDoc = getScDoc();
@@ -1517,8 +1517,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testRhbz1390776)
createScDoc("xml/rhbz1390776.xml");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong range", OUString("=SUM(A18:A23)"),
- pDoc->GetFormula(0, 27, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong range", u"=SUM(A18:A23)"_ustr, pDoc->GetFormula(0, 27, 0));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf104310)
@@ -1551,9 +1550,9 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf104310)
std::vector<ScTypedStrData> aList;
pData->FillSelectionList(aList, ScAddress(0, 1, 0));
CPPUNIT_ASSERT_EQUAL(size_t(3), aList.size());
- CPPUNIT_ASSERT_EQUAL(OUString("1"), aList[0].GetString());
- CPPUNIT_ASSERT_EQUAL(OUString("2,3"), aList[1].GetString());
- CPPUNIT_ASSERT_EQUAL(OUString("4"), aList[2].GetString());
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, aList[0].GetString());
+ CPPUNIT_ASSERT_EQUAL(u"2,3"_ustr, aList[1].GetString());
+ CPPUNIT_ASSERT_EQUAL(u"4"_ustr, aList[2].GetString());
}
}
@@ -1598,12 +1597,13 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf128951)
// 2. Create a new sheet instance
css::uno::Reference<css::lang::XMultiServiceFactory> xFac(mxComponent,
css::uno::UNO_QUERY_THROW);
- auto xSheet = xFac->createInstance("com.sun.star.sheet.Spreadsheet");
+ auto xSheet = xFac->createInstance(u"com.sun.star.sheet.Spreadsheet"_ustr);
// 3. Insert sheet into the spreadsheet (was throwing IllegalArgumentException)
css::uno::Reference<css::sheet::XSpreadsheetDocument> xDoc(mxComponent,
css::uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT_NO_THROW(xDoc->getSheets()->insertByName("mustNotThrow", css::uno::Any(xSheet)));
+ CPPUNIT_ASSERT_NO_THROW(
+ xDoc->getSheets()->insertByName(u"mustNotThrow"_ustr, css::uno::Any(xSheet)));
}
namespace
@@ -1742,7 +1742,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf130725)
css::uno::Reference<css::sheet::XCellRangesAccess> xSheets(xDoc->getSheets(),
css::uno::UNO_QUERY_THROW);
css::uno::Reference<css::table::XCell> xCell = xSheets->getCellByPosition(0, 0, 0);
- xCell->setFormula("0.0042"); // this assumes en-US locale
+ xCell->setFormula(u"0.0042"_ustr); // this assumes en-US locale
// 3. Check that the value is the nearest double-precision representation of the decimal 0.0042
// (it was 0.0042000000000000006 instead of 0.0041999999999999997).
diff --git a/sc/qa/unit/subsequent_filters_test4.cxx b/sc/qa/unit/subsequent_filters_test4.cxx
index 1adab95122e2..90eb7915f389 100644
--- a/sc/qa/unit/subsequent_filters_test4.cxx
+++ b/sc/qa/unit/subsequent_filters_test4.cxx
@@ -72,7 +72,7 @@ class ScFiltersTest4 : public ScModelTestBase
{
public:
ScFiltersTest4()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
@@ -129,7 +129,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf131575)
loadWithParams(createFileURL(u"xlsx/tdf131575.xlsx"), aParams);
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("ETAT DES SORTIES"), pDoc->GetString(1, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"ETAT DES SORTIES"_ustr, pDoc->GetString(1, 0, 0));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf76115)
@@ -143,7 +143,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf76115)
loadWithParams(createFileURL(u"xlsx/tdf76115.xlsx"), aParams);
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("Filial"), pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Filial"_ustr, pDoc->GetString(0, 0, 0));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testLegacyOptionButtonGroupBox)
@@ -162,8 +162,8 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testLegacyOptionButtonGroupBox)
uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(),
uno::UNO_QUERY_THROW);
// The radio buttons are grouped by GroupBoxes - so the name comes from the group shape name
- xPropertySet->getPropertyValue("GroupName") >>= sGroupName;
- CPPUNIT_ASSERT_EQUAL(OUString("Casella di gruppo 1"), sGroupName);
+ xPropertySet->getPropertyValue(u"GroupName"_ustr) >>= sGroupName;
+ CPPUNIT_ASSERT_EQUAL(u"Casella di gruppo 1"_ustr, sGroupName);
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testActiveXOptionButtonGroup)
@@ -181,34 +181,34 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testActiveXOptionButtonGroup)
UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(),
uno::UNO_QUERY_THROW);
- xPropertySet->getPropertyValue("GroupName") >>= sGroupName;
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet1"), sGroupName);
+ xPropertySet->getPropertyValue(u"GroupName"_ustr) >>= sGroupName;
+ CPPUNIT_ASSERT_EQUAL(u"Sheet1"_ustr, sGroupName);
// Optionbuttons (without Group names) were not grouped.
// The two optionbuttons should have the same auto-generated group name.
OUString sGroupName2; //ActiveX controls
xControlShape.set(xIA_DrawPage->getByIndex(2), uno::UNO_QUERY_THROW);
xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY_THROW);
- xPropertySet->getPropertyValue("GroupName") >>= sGroupName2;
+ xPropertySet->getPropertyValue(u"GroupName"_ustr) >>= sGroupName2;
CPPUNIT_ASSERT_EQUAL(false, sGroupName2.isEmpty());
OUString sGroupName3;
xControlShape.set(xIA_DrawPage->getByIndex(3), uno::UNO_QUERY_THROW);
xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY_THROW);
- xPropertySet->getPropertyValue("GroupName") >>= sGroupName3;
+ xPropertySet->getPropertyValue(u"GroupName"_ustr) >>= sGroupName3;
CPPUNIT_ASSERT_EQUAL(sGroupName2, sGroupName3);
CPPUNIT_ASSERT(sGroupName != sGroupName3);
OUString sGroupName4; //Form controls
xControlShape.set(xIA_DrawPage->getByIndex(4), uno::UNO_QUERY_THROW);
xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY_THROW);
- xPropertySet->getPropertyValue("GroupName") >>= sGroupName4;
+ xPropertySet->getPropertyValue(u"GroupName"_ustr) >>= sGroupName4;
CPPUNIT_ASSERT_EQUAL(false, sGroupName4.isEmpty());
OUString sGroupName5;
xControlShape.set(xIA_DrawPage->getByIndex(5), uno::UNO_QUERY_THROW);
xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY_THROW);
- xPropertySet->getPropertyValue("GroupName") >>= sGroupName5;
+ xPropertySet->getPropertyValue(u"GroupName"_ustr) >>= sGroupName5;
CPPUNIT_ASSERT_EQUAL(sGroupName4, sGroupName5);
CPPUNIT_ASSERT(sGroupName2 != sGroupName5);
CPPUNIT_ASSERT(sGroupName != sGroupName5);
@@ -216,13 +216,13 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testActiveXOptionButtonGroup)
OUString sGroupName7; //Form radiobutton autogrouped by GroupBox
xControlShape.set(xIA_DrawPage->getByIndex(7), uno::UNO_QUERY_THROW);
xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY_THROW);
- xPropertySet->getPropertyValue("GroupName") >>= sGroupName7;
- CPPUNIT_ASSERT_EQUAL(OUString("autoGroup_Group Box 7"), sGroupName7);
+ xPropertySet->getPropertyValue(u"GroupName"_ustr) >>= sGroupName7;
+ CPPUNIT_ASSERT_EQUAL(u"autoGroup_Group Box 7"_ustr, sGroupName7);
OUString sGroupName8;
xControlShape.set(xIA_DrawPage->getByIndex(8), uno::UNO_QUERY_THROW);
xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY_THROW);
- xPropertySet->getPropertyValue("GroupName") >>= sGroupName8;
+ xPropertySet->getPropertyValue(u"GroupName"_ustr) >>= sGroupName8;
CPPUNIT_ASSERT_EQUAL(sGroupName7, sGroupName8);
CPPUNIT_ASSERT(sGroupName4 != sGroupName8);
CPPUNIT_ASSERT(sGroupName2 != sGroupName8);
@@ -231,13 +231,13 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testActiveXOptionButtonGroup)
OUString sGroupName9; //Form radiobutton not fully inside GroupBox
xControlShape.set(xIA_DrawPage->getByIndex(9), uno::UNO_QUERY_THROW);
xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY_THROW);
- xPropertySet->getPropertyValue("GroupName") >>= sGroupName9;
+ xPropertySet->getPropertyValue(u"GroupName"_ustr) >>= sGroupName9;
CPPUNIT_ASSERT_EQUAL(sGroupName4, sGroupName9);
OUString sGroupName10; //ActiveX unaffected by GroupBox
xControlShape.set(xIA_DrawPage->getByIndex(10), uno::UNO_QUERY_THROW);
xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY_THROW);
- xPropertySet->getPropertyValue("GroupName") >>= sGroupName10;
+ xPropertySet->getPropertyValue(u"GroupName"_ustr) >>= sGroupName10;
CPPUNIT_ASSERT_EQUAL(sGroupName, sGroupName10);
}
@@ -252,13 +252,13 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testChartImportODS)
pDoc->GetTableCount());
OUString aName;
pDoc->GetName(0, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Empty"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Empty"_ustr, aName);
pDoc->GetName(1, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Chart"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Chart"_ustr, aName);
pDoc->GetName(2, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Data"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Data"_ustr, aName);
pDoc->GetName(3, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Title"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Title"_ustr, aName);
// Retrieve the chart object instance from the 2nd page (for the 2nd sheet).
const SdrOle2Obj* pOleObj = getSingleChartObject(*pDoc, 1);
@@ -292,17 +292,17 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testChartImportXLS)
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testNumberFormatHTML)
{
- setImportFilterName("calc_HTML_WebQuery");
+ setImportFilterName(u"calc_HTML_WebQuery"_ustr);
createScDoc("html/numberformat.html");
ScDocument* pDoc = getScDoc();
// Check the header just in case.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell value is not as expected", OUString("Product"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell value is not as expected", u"Product"_ustr,
pDoc->GetString(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell value is not as expected", OUString("Price"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell value is not as expected", u"Price"_ustr,
pDoc->GetString(1, 0, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell value is not as expected", OUString("Note"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell value is not as expected", u"Note"_ustr,
pDoc->GetString(2, 0, 0));
// B2 should be imported as a value cell.
@@ -318,11 +318,11 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testNumberFormatCSV)
ScDocument* pDoc = getScDoc();
// Check the header just in case.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell value is not as expected", OUString("Product"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell value is not as expected", u"Product"_ustr,
pDoc->GetString(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell value is not as expected", OUString("Price"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell value is not as expected", u"Price"_ustr,
pDoc->GetString(1, 0, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell value is not as expected", OUString("Note"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell value is not as expected", u"Note"_ustr,
pDoc->GetString(2, 0, 0));
// B2 should be imported as a value cell.
@@ -433,14 +433,13 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testRichTextContentODS)
// Normal simple string with no formatting.
aPos.IncRow();
CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("Normal"), pDoc->GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL(u"Normal"_ustr, pDoc->GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
// Normal string with bold applied to the whole cell.
{
aPos.IncRow();
CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("All bold"),
- pDoc->GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL(u"All bold"_ustr, pDoc->GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
const ScPatternAttr* pAttr = pDoc->GetPattern(aPos.Col(), aPos.Row(), aPos.Tab());
CPPUNIT_ASSERT_MESSAGE("Failed to get cell attribute.", pAttr);
const SvxWeightItem& rWeightItem = pAttr->GetItem(ATTR_FONT_WEIGHT);
@@ -455,11 +454,11 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testRichTextContentODS)
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), pEditText->GetParagraphCount());
OUString aParaText = pEditText->GetText(0);
- CPPUNIT_ASSERT_EQUAL(OUString("one"), aParaText);
+ CPPUNIT_ASSERT_EQUAL(u"one"_ustr, aParaText);
aParaText = pEditText->GetText(1);
- CPPUNIT_ASSERT_EQUAL(OUString("two"), aParaText);
+ CPPUNIT_ASSERT_EQUAL(u"two"_ustr, aParaText);
aParaText = pEditText->GetText(2);
- CPPUNIT_ASSERT_EQUAL(OUString("three"), aParaText);
+ CPPUNIT_ASSERT_EQUAL(u"three"_ustr, aParaText);
// Cell with sheet name field item.
aPos.IncRow();
@@ -471,8 +470,8 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testRichTextContentODS)
CPPUNIT_ASSERT_MESSAGE("Unexpected text.", aParaText.startsWith("Sheet name is "));
CPPUNIT_ASSERT_MESSAGE("Sheet name field item not found.",
pEditText->HasField(text::textfield::Type::TABLE));
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet name is Test."), ScEditUtil::GetString(*pEditText, pDoc));
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet name is ?."), ScEditUtil::GetString(*pEditText, nullptr));
+ CPPUNIT_ASSERT_EQUAL(u"Sheet name is Test."_ustr, ScEditUtil::GetString(*pEditText, pDoc));
+ CPPUNIT_ASSERT_EQUAL(u"Sheet name is ?."_ustr, ScEditUtil::GetString(*pEditText, nullptr));
// Cell with URL field item.
aPos.IncRow();
@@ -484,9 +483,9 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testRichTextContentODS)
CPPUNIT_ASSERT_MESSAGE("Unexpected text.", aParaText.startsWith("URL: "));
CPPUNIT_ASSERT_MESSAGE("URL field item not found.",
pEditText->HasField(text::textfield::Type::URL));
- CPPUNIT_ASSERT_EQUAL(OUString("URL: http://libreoffice.org"),
+ CPPUNIT_ASSERT_EQUAL(u"URL: http://libreoffice.org"_ustr,
ScEditUtil::GetString(*pEditText, pDoc));
- CPPUNIT_ASSERT_EQUAL(OUString("URL: http://libreoffice.org"),
+ CPPUNIT_ASSERT_EQUAL(u"URL: http://libreoffice.org"_ustr,
ScEditUtil::GetString(*pEditText, nullptr));
// Cell with Date field item.
@@ -514,8 +513,8 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testRichTextContentODS)
CPPUNIT_ASSERT_MESSAGE("Unexpected text.", aParaText.startsWith("Title: "));
CPPUNIT_ASSERT_MESSAGE("DocInfo title field item not found.",
pEditText->HasField(text::textfield::Type::DOCINFO_TITLE));
- CPPUNIT_ASSERT_EQUAL(OUString("Title: Test Document"), ScEditUtil::GetString(*pEditText, pDoc));
- CPPUNIT_ASSERT_EQUAL(OUString("Title: ?"), ScEditUtil::GetString(*pEditText, nullptr));
+ CPPUNIT_ASSERT_EQUAL(u"Title: Test Document"_ustr, ScEditUtil::GetString(*pEditText, pDoc));
+ CPPUNIT_ASSERT_EQUAL(u"Title: ?"_ustr, ScEditUtil::GetString(*pEditText, nullptr));
// Cell with sentence with both bold and italic sequences.
aPos.IncRow();
@@ -524,7 +523,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testRichTextContentODS)
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pEditText->GetParagraphCount());
aParaText = pEditText->GetText(0);
- CPPUNIT_ASSERT_EQUAL(OUString("Sentence with bold and italic."), aParaText);
+ CPPUNIT_ASSERT_EQUAL(u"Sentence with bold and italic."_ustr, aParaText);
std::vector<EECharAttrib> aAttribs;
pEditText->GetCharAttribs(0, aAttribs);
{
@@ -557,11 +556,11 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testRichTextContentODS)
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), pEditText->GetParagraphCount());
aParaText = pEditText->GetText(0);
- CPPUNIT_ASSERT_EQUAL(OUString("bold"), aParaText);
+ CPPUNIT_ASSERT_EQUAL(u"bold"_ustr, aParaText);
aParaText = pEditText->GetText(1);
- CPPUNIT_ASSERT_EQUAL(OUString("italic"), aParaText);
+ CPPUNIT_ASSERT_EQUAL(u"italic"_ustr, aParaText);
aParaText = pEditText->GetText(2);
- CPPUNIT_ASSERT_EQUAL(OUString("underlined"), aParaText);
+ CPPUNIT_ASSERT_EQUAL(u"underlined"_ustr, aParaText);
// first line is bold.
pEditText->GetCharAttribs(0, aAttribs);
@@ -640,13 +639,12 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testRichTextContentODS)
// Embedded spaces as <text:s text:c='4' />, normal text
aPos.IncRow();
CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("one two"),
- pDoc->GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL(u"one two"_ustr, pDoc->GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
// Leading space as <text:s />.
aPos.IncRow();
CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString(" =3+4"), pDoc->GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL(u" =3+4"_ustr, pDoc->GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
// Embedded spaces with <text:s text:c='4' /> inside a <text:span>, text
// partly bold.
@@ -656,7 +654,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testRichTextContentODS)
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pEditText->GetParagraphCount());
aParaText = pEditText->GetText(0);
- CPPUNIT_ASSERT_EQUAL(OUString("one two"), aParaText);
+ CPPUNIT_ASSERT_EQUAL(u"one two"_ustr, aParaText);
pEditText->GetCharAttribs(0, aAttribs);
{
auto it = std::find_if(aAttribs.begin(), aAttribs.end(), [](const EECharAttrib& rAttrib) {
@@ -667,7 +665,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testRichTextContentODS)
if (bHasBold)
{
OUString aSeg = aParaText.copy(it->nStart, it->nEnd - it->nStart);
- CPPUNIT_ASSERT_EQUAL(OUString("e t"), aSeg);
+ CPPUNIT_ASSERT_EQUAL(u"e t"_ustr, aSeg);
}
CPPUNIT_ASSERT_MESSAGE("Expected a bold sequence.", bHasBold);
}
@@ -745,7 +743,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testCondFormatImportCellIs)
CPPUNIT_ASSERT_EQUAL(ScConditionMode::Equal, pCondition->GetOperation());
OUString aStr = pCondition->GetExpression(ScAddress(0, 0, 0), 0);
- CPPUNIT_ASSERT_EQUAL(OUString("$Sheet2.$A$2"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"$Sheet2.$A$2"_ustr, aStr);
pEntry = pFormat->GetEntry(1);
CPPUNIT_ASSERT(pEntry);
@@ -755,7 +753,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testCondFormatImportCellIs)
CPPUNIT_ASSERT_EQUAL(ScConditionMode::Equal, pCondition->GetOperation());
aStr = pCondition->GetExpression(ScAddress(0, 0, 0), 0);
- CPPUNIT_ASSERT_EQUAL(OUString("$Sheet2.$A$1"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"$Sheet2.$A$1"_ustr, aStr);
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testCondFormatThemeColorXLSX)
@@ -1043,7 +1041,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testColorScaleNumWithRefXLSX)
CPPUNIT_ASSERT(pColorScale);
const ScColorScaleEntry* pColorScaleEntry = pColorScale->GetEntry(1);
- CPPUNIT_ASSERT_EQUAL(OUString("=$A$1"),
+ CPPUNIT_ASSERT_EQUAL(u"=$A$1"_ustr,
pColorScaleEntry->GetFormula(formula::FormulaGrammar::GRAM_NATIVE));
}
@@ -1060,25 +1058,25 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf153514)
ScStyleSheet* pStyleSheet;
// Case sensitive tests
- pStyleSheet = pStyleSheetPool->FindCaseIns("aBcD", SfxStyleFamily::Para);
- CPPUNIT_ASSERT_EQUAL(OUString("aBcD"), pStyleSheet->GetName());
- pStyleSheet = pStyleSheetPool->FindCaseIns("abCd", SfxStyleFamily::Para);
- CPPUNIT_ASSERT_EQUAL(OUString("abCd"), pStyleSheet->GetName());
- pStyleSheet = pStyleSheetPool->FindCaseIns("Abcd", SfxStyleFamily::Para);
- CPPUNIT_ASSERT_EQUAL(OUString("Abcd"), pStyleSheet->GetName());
- pStyleSheet = pStyleSheetPool->FindCaseIns("ABCD", SfxStyleFamily::Para);
- CPPUNIT_ASSERT_EQUAL(OUString("ABCD"), pStyleSheet->GetName());
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"aBcD"_ustr, SfxStyleFamily::Para);
+ CPPUNIT_ASSERT_EQUAL(u"aBcD"_ustr, pStyleSheet->GetName());
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"abCd"_ustr, SfxStyleFamily::Para);
+ CPPUNIT_ASSERT_EQUAL(u"abCd"_ustr, pStyleSheet->GetName());
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"Abcd"_ustr, SfxStyleFamily::Para);
+ CPPUNIT_ASSERT_EQUAL(u"Abcd"_ustr, pStyleSheet->GetName());
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"ABCD"_ustr, SfxStyleFamily::Para);
+ CPPUNIT_ASSERT_EQUAL(u"ABCD"_ustr, pStyleSheet->GetName());
// Case insensitive tests
- pStyleSheet = pStyleSheetPool->FindCaseIns("abcd", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"abcd"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT(pStyleSheet);
CPPUNIT_ASSERT(pStyleSheet->GetName().equalsIgnoreAsciiCase("abcd"));
CPPUNIT_ASSERT(pStyleSheet->GetName() != "abcd");
- pStyleSheet = pStyleSheetPool->FindCaseIns("ABCd", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"ABCd"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT(pStyleSheet);
CPPUNIT_ASSERT(pStyleSheet->GetName().equalsIgnoreAsciiCase("ABCd"));
CPPUNIT_ASSERT(pStyleSheet->GetName() != "ABCd");
// Not match tests
- pStyleSheet = pStyleSheetPool->FindCaseIns("NotFound", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"NotFound"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT(!pStyleSheet);
}
@@ -1096,7 +1094,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
/* Test cases for Style "Name1"
* Has Border and Fill.
*/
- ScStyleSheet* pStyleSheet = pStyleSheetPool->FindCaseIns("Name1", SfxStyleFamily::Para);
+ ScStyleSheet* pStyleSheet = pStyleSheetPool->FindCaseIns(u"Name1"_ustr, SfxStyleFamily::Para);
const SfxPoolItem* pItem = nullptr;
CPPUNIT_ASSERT_MESSAGE("Style Name1 : Doesn't have Attribute background, but it should have.",
@@ -1130,7 +1128,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
/* Test for Style "Name2"
* Has 4 sided borders + Diagonal borders.
*/
- pStyleSheet = pStyleSheetPool->FindCaseIns("Name2", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"Name2"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT_MESSAGE("Style Name2 : Doesn't have Attribute background, but it should have.",
pStyleSheet->GetItemSet().HasItem(ATTR_BORDER, &pItem));
@@ -1173,7 +1171,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
/* Test for Style "Name3"
* Hidden, protected and content is printed.
*/
- pStyleSheet = pStyleSheetPool->FindCaseIns("Name3", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"Name3"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT_MESSAGE("Style Name3 : Doesn't have Attribute Protection, but it should have.",
pStyleSheet->GetItemSet().HasItem(ATTR_PROTECTION, &pItem));
@@ -1183,7 +1181,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
/* Test for Style "Name4"
* Hidden, protected and content is printed.
*/
- pStyleSheet = pStyleSheetPool->FindCaseIns("Name4", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"Name4"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT_MESSAGE("Style Name4 : Doesn't have Attribute Protection, but it should have.",
pStyleSheet->GetItemSet().HasItem(ATTR_PROTECTION, &pItem));
@@ -1193,7 +1191,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
/* Test for Style "Name5"
* Hidden, protected and content is printed.
*/
- pStyleSheet = pStyleSheetPool->FindCaseIns("Name5", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"Name5"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT_MESSAGE("Style Name5 : Doesn't have Attribute Protection, but it should have.",
pStyleSheet->GetItemSet().HasItem(ATTR_PROTECTION, &pItem));
@@ -1212,12 +1210,12 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
/* Test for Style "Name6"
* Has Font name, posture, weight, color, height
*/
- pStyleSheet = pStyleSheetPool->FindCaseIns("Name6", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"Name6"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT_MESSAGE("Style Name6 : Doesn't have Attribute Font, but it should have.",
pStyleSheet->GetItemSet().HasItem(ATTR_FONT, &pItem));
const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(pItem);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Style Name6 :Error with Font name", OUString("Liberation Sans"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Style Name6 :Error with Font name", u"Liberation Sans"_ustr,
pFontItem->GetStyleName());
CPPUNIT_ASSERT_MESSAGE("Style Name6 : Doesn't have Attribute Font Height, but it should have.",
@@ -1260,7 +1258,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
/* Test for Style Name "7"
* Has strikethrough single
*/
- pStyleSheet = pStyleSheetPool->FindCaseIns("Name7", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"Name7"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT_MESSAGE("Style Name7 : Doesn't have Attribute Strikeout, but it should have.",
pStyleSheet->GetItemSet().HasItem(ATTR_FONT_CROSSEDOUT, &pItem));
@@ -1271,7 +1269,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
/* Test for Style Name "8"
* Has strikethrough bold
*/
- pStyleSheet = pStyleSheetPool->FindCaseIns("Name8", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"Name8"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT_MESSAGE("Style Name8 : Doesn't have Attribute Strikeout, but it should have.",
pStyleSheet->GetItemSet().HasItem(ATTR_FONT_CROSSEDOUT, &pItem));
@@ -1282,7 +1280,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
/* Test for Style Name "9"
* Has strikethrough slash
*/
- pStyleSheet = pStyleSheetPool->FindCaseIns("Name9", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"Name9"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT_MESSAGE("Style Name9 : Doesn't have Attribute Strikeout, but it should have.",
pStyleSheet->GetItemSet().HasItem(ATTR_FONT_CROSSEDOUT, &pItem));
@@ -1294,7 +1292,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
* Has ver align, and hor align
*/
- pStyleSheet = pStyleSheetPool->FindCaseIns("Name10", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"Name10"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT_MESSAGE("Style Name10 : Doesn't have Attribute hor justify, but it should have.",
pStyleSheet->GetItemSet().HasItem(ATTR_HOR_JUSTIFY, &pItem));
@@ -1302,7 +1300,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Style Name10 :Error with hor justify", SvxCellHorJustify::Right,
pHorJustify->GetValue());
- pStyleSheet = pStyleSheetPool->FindCaseIns("Name10", SfxStyleFamily::Para);
+ pStyleSheet = pStyleSheetPool->FindCaseIns(u"Name10"_ustr, SfxStyleFamily::Para);
CPPUNIT_ASSERT_MESSAGE("Style Name10 : Doesn't have Attribute ver justify, but it should have.",
pStyleSheet->GetItemSet().HasItem(ATTR_VER_JUSTIFY, &pItem));
@@ -1332,10 +1330,10 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
}
};
- checkFontWeight("Accent", WEIGHT_BOLD);
- checkFontWeight("Accent 1", WEIGHT_BOLD); // inherits from 'Accent'
- checkFontWeight("Accent 2", WEIGHT_BOLD); // inherits from 'Accent'
- checkFontWeight("Accent 3", WEIGHT_BOLD); // inherits from 'Accent'
+ checkFontWeight(u"Accent"_ustr, WEIGHT_BOLD);
+ checkFontWeight(u"Accent 1"_ustr, WEIGHT_BOLD); // inherits from 'Accent'
+ checkFontWeight(u"Accent 2"_ustr, WEIGHT_BOLD); // inherits from 'Accent'
+ checkFontWeight(u"Accent 3"_ustr, WEIGHT_BOLD); // inherits from 'Accent'
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testLiteralInFormulaXLS)
@@ -1452,23 +1450,23 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf129681)
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("Lamb"), pDoc->GetString(ScAddress(4, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Beef"), pDoc->GetString(ScAddress(4, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Pork"), pDoc->GetString(ScAddress(4, 4, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Goat"), pDoc->GetString(ScAddress(4, 5, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Goat"), pDoc->GetString(ScAddress(4, 6, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("#VALUE!"), pDoc->GetString(ScAddress(4, 7, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("#VALUE!"), pDoc->GetString(ScAddress(4, 8, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Deer"), pDoc->GetString(ScAddress(4, 9, 0)));
-
- CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(ScAddress(6, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2"), pDoc->GetString(ScAddress(6, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("3"), pDoc->GetString(ScAddress(6, 4, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("5"), pDoc->GetString(ScAddress(6, 5, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("8"), pDoc->GetString(ScAddress(6, 6, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("#VALUE!"), pDoc->GetString(ScAddress(6, 7, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("#VALUE!"), pDoc->GetString(ScAddress(6, 8, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("#VALUE!"), pDoc->GetString(ScAddress(6, 9, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Lamb"_ustr, pDoc->GetString(ScAddress(4, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Beef"_ustr, pDoc->GetString(ScAddress(4, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Pork"_ustr, pDoc->GetString(ScAddress(4, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Goat"_ustr, pDoc->GetString(ScAddress(4, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Goat"_ustr, pDoc->GetString(ScAddress(4, 6, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#VALUE!"_ustr, pDoc->GetString(ScAddress(4, 7, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#VALUE!"_ustr, pDoc->GetString(ScAddress(4, 8, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Deer"_ustr, pDoc->GetString(ScAddress(4, 9, 0)));
+
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(ScAddress(6, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2"_ustr, pDoc->GetString(ScAddress(6, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"3"_ustr, pDoc->GetString(ScAddress(6, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"5"_ustr, pDoc->GetString(ScAddress(6, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"8"_ustr, pDoc->GetString(ScAddress(6, 6, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#VALUE!"_ustr, pDoc->GetString(ScAddress(6, 7, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#VALUE!"_ustr, pDoc->GetString(ScAddress(6, 8, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#VALUE!"_ustr, pDoc->GetString(ScAddress(6, 9, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf149484)
@@ -1479,7 +1477,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf149484)
// Without the fix in place, this test would have failed with
// - Expected: -TRUE-
// - Actual : TRUE
- CPPUNIT_ASSERT_EQUAL(OUString("-TRUE-"), pDoc->GetString(0, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"-TRUE-"_ustr, pDoc->GetString(0, 2, 0));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testEscapedUnicodeXLSX)
@@ -1488,7 +1486,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testEscapedUnicodeXLSX)
ScDocument* pDoc = getScDoc();
// Without the fix, there would be "_x000D_" after every new-line char.
- CPPUNIT_ASSERT_EQUAL(OUString("Line 1\nLine 2\nLine 3\nLine 4"), pDoc->GetString(1, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Line 1\nLine 2\nLine 3\nLine 4"_ustr, pDoc->GetString(1, 1, 0));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf144758_DBDataDefaultOrientation)
@@ -1536,16 +1534,16 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testSharedFormulaXLS)
pDoc = getScDoc();
pDoc->CalcAll();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A1*20"), pDoc->GetFormula(1, 0, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A2*20"), pDoc->GetFormula(1, 1, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A3*20"), pDoc->GetFormula(1, 2, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A1*20"_ustr, pDoc->GetFormula(1, 0, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A2*20"_ustr, pDoc->GetFormula(1, 1, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A3*20"_ustr, pDoc->GetFormula(1, 2, 0));
// There is an intentional gap at row 4.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A5*20"), pDoc->GetFormula(1, 4, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A6*20"), pDoc->GetFormula(1, 5, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A7*20"), pDoc->GetFormula(1, 6, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A8*20"), pDoc->GetFormula(1, 7, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A5*20"_ustr, pDoc->GetFormula(1, 4, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A6*20"_ustr, pDoc->GetFormula(1, 5, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A7*20"_ustr, pDoc->GetFormula(1, 6, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A8*20"_ustr, pDoc->GetFormula(1, 7, 0));
// We re-group formula cells on load. Let's check that as well.
@@ -1640,11 +1638,11 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testSheetNamesXLSX)
std::vector<OUString> aTabNames = pDoc->GetAllTableNames();
CPPUNIT_ASSERT_EQUAL_MESSAGE("The document should have 5 sheets in total.", size_t(5),
aTabNames.size());
- CPPUNIT_ASSERT_EQUAL(OUString("S&P"), aTabNames[0]);
- CPPUNIT_ASSERT_EQUAL(OUString("Sam's Club"), aTabNames[1]);
- CPPUNIT_ASSERT_EQUAL(OUString("\"The Sheet\""), aTabNames[2]);
- CPPUNIT_ASSERT_EQUAL(OUString("A<B"), aTabNames[3]);
- CPPUNIT_ASSERT_EQUAL(OUString("C>D"), aTabNames[4]);
+ CPPUNIT_ASSERT_EQUAL(u"S&P"_ustr, aTabNames[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Sam's Club"_ustr, aTabNames[1]);
+ CPPUNIT_ASSERT_EQUAL(u"\"The Sheet\""_ustr, aTabNames[2]);
+ CPPUNIT_ASSERT_EQUAL(u"A<B"_ustr, aTabNames[3]);
+ CPPUNIT_ASSERT_EQUAL(u"C>D"_ustr, aTabNames[4]);
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf155046)
@@ -1655,7 +1653,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf155046)
// Without the fix in place, this test would have failed with
// - Expected: TRUE
// - Actual : FALSE
- CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), pDoc->GetString(ScAddress(2, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"TRUE"_ustr, pDoc->GetString(ScAddress(2, 2, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf150599)
@@ -1666,8 +1664,8 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf150599)
// Without the fix in place, this test would have failed with
// - Expected: 1
// - Actual : #IND:?
- CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("32"), pDoc->GetString(ScAddress(31, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"32"_ustr, pDoc->GetString(ScAddress(31, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testCommentSize)
@@ -1693,7 +1691,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testCommentSize)
CPPUNIT_ASSERT_EQUAL(tools::Long(2899), rOldRect.getOpenWidth());
CPPUNIT_ASSERT_EQUAL(tools::Long(939), rOldRect.getOpenHeight());
- pNote->SetText(aPos, "first\nsecond\nthird");
+ pNote->SetText(aPos, u"first\nsecond\nthird"_ustr);
const tools::Rectangle& rNewRect = pCaption->GetLogicRect();
CPPUNIT_ASSERT_EQUAL(rOldRect.getOpenWidth(), rNewRect.getOpenWidth());
@@ -1972,7 +1970,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf155402)
OUString aFilename = pDoc->GetString(1, 0, 0);
sal_Int32 nPos = aFilename.lastIndexOf('/');
aFilename = OUString::Concat(aFilename.subView(nPos));
- CPPUNIT_ASSERT_EQUAL(OUString("/[tdf155402.xlsx]Sheet1"), aFilename);
+ CPPUNIT_ASSERT_EQUAL(u"/[tdf155402.xlsx]Sheet1"_ustr, aFilename);
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf142905)
@@ -1984,7 +1982,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf142905)
// After recalculation it is fixed.
// - Expected: " 3M "
// - Actual : "3M"
- CPPUNIT_ASSERT_EQUAL(OUString(" 3M "), pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u" 3M "_ustr, pDoc->GetString(2, 0, 0));
}
CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf125580)
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 4c28c9f8874a..0a3f9855b564 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -113,7 +113,7 @@ public:
};
ScTiledRenderingTest::ScTiledRenderingTest()
- : UnoApiXmlTest("/sc/qa/unit/tiledrendering/data/"),
+ : UnoApiXmlTest(u"/sc/qa/unit/tiledrendering/data/"_ustr),
m_callbackWrapper(&callback, this)
{
}
@@ -190,7 +190,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testRowColumnSelections)
{ "Row", uno::Any(sal_Int32(5 - 1)) },
{ "Modifier", uno::Any(sal_uInt16(0)) }
}));
- dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, aArgs);
// Check if it is selected
OString aResult = apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), "text/plain;charset=utf-8"_ostr);
@@ -200,7 +200,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testRowColumnSelections)
// Select the 10th row with shift modifier
aArgs = comphelper::InitPropertySequence({ { "Row", uno::Any(static_cast<sal_Int32>(10 - 1)) },
{ "Modifier", uno::Any(KEY_SHIFT) } });
- dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, aArgs);
// Check if all the rows from 5th to 10th get selected
aResult = apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), "text/plain;charset=utf-8"_ostr);
@@ -210,7 +210,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testRowColumnSelections)
// Select the 10th row with ctrl modifier
aArgs = comphelper::InitPropertySequence({ { "Row", uno::Any(static_cast<sal_Int32>(13 - 1)) },
{ "Modifier", uno::Any(KEY_MOD1) } });
- dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, aArgs);
// When we copy this, we don't get anything useful, but we must not crash
// (used to happen)
@@ -222,7 +222,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testRowColumnSelections)
// Select Column 5 with ctrl modifier
aArgs = comphelper::InitPropertySequence({ { "Col", uno::Any(static_cast<sal_Int32>(5 - 1)) },
{ "Modifier", uno::Any(KEY_MOD1) } });
- dispatchCommand(mxComponent, ".uno:SelectColumn", aArgs);
+ dispatchCommand(mxComponent, u".uno:SelectColumn"_ustr, aArgs);
// When we copy this, we don't get anything useful, but we must not crash
// (used to happen)
@@ -235,17 +235,17 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testRowColumnSelections)
// First Deselect Row 13 because copy doesn't work for multiple selections
aArgs = comphelper::InitPropertySequence({ { "Row", uno::Any(static_cast<sal_Int32>(13 - 1)) },
{ "Modifier", uno::Any(KEY_MOD1) } });
- dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, aArgs);
// Deselect row 10
aArgs = comphelper::InitPropertySequence({ { "Row", uno::Any(static_cast<sal_Int32>(10 - 1)) },
{ "Modifier", uno::Any(KEY_MOD1) } });
- dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, aArgs);
// Click at row 6 holding shift
aArgs = comphelper::InitPropertySequence({ { "Row", uno::Any(static_cast<sal_Int32>(6 - 1)) },
{ "Modifier", uno::Any(KEY_SHIFT) } });
- dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, aArgs);
// only row 5 should remain selected
aResult = apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), "text/plain;charset=utf-8"_ostr);
@@ -305,7 +305,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testEmptyColumnSelection)
{ "Col", uno::Any(sal_Int32(1000 - 1)) },
{ "Modifier", uno::Any(sal_uInt16(0)) }
}));
- dispatchCommand(mxComponent, ".uno:SelectColumn", aArgs);
+ dispatchCommand(mxComponent, u".uno:SelectColumn"_ustr, aArgs);
// should be an empty string
CPPUNIT_ASSERT_EQUAL(OString(), apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), "text/plain;charset=utf-8"_ostr));
@@ -675,7 +675,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testSpellOnlineRenderParameter)
uno::Sequence<beans::PropertyValue> aPropertyValues =
{
- comphelper::makePropertyValue(".uno:SpellOnline", uno::Any(!bSet)),
+ comphelper::makePropertyValue(u".uno:SpellOnline"_ustr, uno::Any(!bSet)),
};
pModelObj->initializeForTiledRendering(aPropertyValues);
@@ -693,7 +693,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testTextViewSelection)
// Create a selection on two cells in the second view, that's a text selection in LOK terms.
aView1.m_bTextViewSelectionInvalidated = false;
- dispatchCommand(mxComponent, ".uno:GoRightSel", {});
+ dispatchCommand(mxComponent, u".uno:GoRightSel"_ustr, {});
// Make sure the first view got its notification.
CPPUNIT_ASSERT(aView1.m_bTextViewSelectionInvalidated);
}
@@ -707,9 +707,9 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testDocumentSizeChanged)
// Go to the A30 cell -- that will extend the document size.
uno::Sequence<beans::PropertyValue> aPropertyValues =
{
- comphelper::makePropertyValue("ToPoint", OUString("$A$30")),
+ comphelper::makePropertyValue(u"ToPoint"_ustr, u"$A$30"_ustr),
};
- dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues);
+ dispatchCommand(mxComponent, u".uno:GoToCell"_ustr, aPropertyValues);
// Assert that the size in the payload is not 0.
CPPUNIT_ASSERT(m_aDocumentSize.getWidth() > 0);
CPPUNIT_ASSERT(m_aDocumentSize.getHeight() > 0);
@@ -784,7 +784,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testMoveShapeHandle)
{"NewPosX", uno::Any(x+1)},
{"NewPosY", uno::Any(y+1)}
}));
- dispatchCommand(mxComponent, ".uno:MoveShapeHandle", aPropertyValues);
+ dispatchCommand(mxComponent, u".uno:MoveShapeHandle"_ustr, aPropertyValues);
CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty());
lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y);
CPPUNIT_ASSERT_EQUAL(x-1, oldX);
@@ -810,7 +810,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testColRowResize)
{ "ColumnWidth", uno::Any(sal_uInt16(4000)) }, // 4cm
{ "Column", uno::Any(sal_Int16(3)) }
}));
- dispatchCommand(mxComponent, ".uno:ColumnWidth", aArgs);
+ dispatchCommand(mxComponent, u".uno:ColumnWidth"_ustr, aArgs);
sal_uInt16 nWidth = o3tl::convert(rDoc.GetColWidth(static_cast<SCCOL>(2), static_cast<SCTAB>(0), false), o3tl::Length::twip, o3tl::Length::mm100);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(4001), nWidth);
@@ -820,7 +820,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testColRowResize)
{ "RowHeight", uno::Any(sal_uInt16(2000)) },
{ "Row", uno::Any(sal_Int16(5)) },
}));
- dispatchCommand(mxComponent, ".uno:RowHeight", aArgs2);
+ dispatchCommand(mxComponent, u".uno:RowHeight"_ustr, aArgs2);
sal_uInt16 nHeight = o3tl::convert(rDoc.GetRowHeight(static_cast<SCROW>(4), static_cast<SCTAB>(0), false), o3tl::Length::twip, o3tl::Length::mm100);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(2000), nHeight);
@@ -830,7 +830,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoShells)
{
ScModelObj* pModelObj = createDoc("small.ods");
// Clear the currently selected cell.
- dispatchCommand(mxComponent, ".uno:ClearContents", {});
+ dispatchCommand(mxComponent, u".uno:ClearContents"_ustr, {});
auto pDocShell = dynamic_cast<ScDocShell*>(pModelObj->GetEmbeddedObject());
CPPUNIT_ASSERT(pDocShell);
@@ -1009,7 +1009,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testAutoSum)
ViewCallback aView;
uno::Sequence<beans::PropertyValue> aArgs;
- dispatchCommand(mxComponent, ".uno:AutoSum", aArgs);
+ dispatchCommand(mxComponent, u".uno:AutoSum"_ustr, aArgs);
CPPUNIT_ASSERT(aView.m_sCellFormula.startsWith("=SUM("));
}
@@ -1021,21 +1021,21 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testHideColRow)
{ "Col", uno::Any(sal_Int32(2 - 1)) },
{ "Modifier", uno::Any(KEY_SHIFT) }
}));
- dispatchCommand(mxComponent, ".uno:SelectColumn", aArgs);
+ dispatchCommand(mxComponent, u".uno:SelectColumn"_ustr, aArgs);
uno::Sequence<beans::PropertyValue> aArgs2( comphelper::InitPropertySequence({
{ "Col", uno::Any(sal_Int32(3 - 1)) },
{ "Modifier", uno::Any(sal_uInt16(0)) }
}));
- dispatchCommand(mxComponent, ".uno:SelectColumn", aArgs2);
+ dispatchCommand(mxComponent, u".uno:SelectColumn"_ustr, aArgs2);
}
SCCOL nOldCurX = ScDocShell::GetViewData()->GetCurX();
SCROW nOldCurY = ScDocShell::GetViewData()->GetCurY();
{
uno::Sequence<beans::PropertyValue> aArgs;
- dispatchCommand(mxComponent, ".uno:HideColumn", aArgs);
+ dispatchCommand(mxComponent, u".uno:HideColumn"_ustr, aArgs);
}
SCCOL nNewCurX = ScDocShell::GetViewData()->GetCurX();
@@ -1047,20 +1047,20 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testHideColRow)
{ "Row", uno::Any(sal_Int32(6 - 1)) },
{ "Modifier", uno::Any(KEY_SHIFT) }
}));
- dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, aArgs);
uno::Sequence<beans::PropertyValue> aArgs2( comphelper::InitPropertySequence({
{ "Row", uno::Any(sal_Int32(7 - 1)) },
{ "Modifier", uno::Any(sal_uInt16(0)) }
}));
- dispatchCommand(mxComponent, ".uno:SelectRow", aArgs2);
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, aArgs2);
}
nOldCurX = ScDocShell::GetViewData()->GetCurX();
nOldCurY = ScDocShell::GetViewData()->GetCurY();
{
uno::Sequence<beans::PropertyValue> aArgs;
- dispatchCommand(mxComponent, ".uno:HideRow", aArgs);
+ dispatchCommand(mxComponent, u".uno:HideRow"_ustr, aArgs);
}
nNewCurX = ScDocShell::GetViewData()->GetCurX();
nNewCurY = ScDocShell::GetViewData()->GetCurY();
@@ -1085,7 +1085,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testInvalidateOnCopyPasteCells)
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RIGHT | KEY_SHIFT);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RIGHT | KEY_SHIFT);
Scheduler::ProcessEventsToIdle();
- dispatchCommand(mxComponent, ".uno:Copy", aArgs);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, aArgs);
// move to destination cell
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN);
@@ -1098,7 +1098,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testInvalidateOnCopyPasteCells)
// paste cells
aView.m_bInvalidateTiles = false;
- dispatchCommand(mxComponent, ".uno:Paste", aArgs);
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, aArgs);
CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
}
@@ -1122,7 +1122,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testInvalidateOnInserRowCol)
// insert row
aView.m_bInvalidateTiles = false;
aView.m_aInvalidations.clear();
- dispatchCommand(mxComponent, ".uno:InsertRows", aArgs);
+ dispatchCommand(mxComponent, u".uno:InsertRows"_ustr, aArgs);
CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
CPPUNIT_ASSERT_EQUAL(size_t(1), aView.m_aInvalidations.size());
CPPUNIT_ASSERT_EQUAL(tools::Rectangle(-75, 51240, 32212230, 63990), aView.m_aInvalidations[0]);
@@ -1138,7 +1138,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testInvalidateOnInserRowCol)
// insert column
aView.m_bInvalidateTiles = false;
aView.m_aInvalidations.clear();
- dispatchCommand(mxComponent, ".uno:InsertColumns", aArgs);
+ dispatchCommand(mxComponent, u".uno:InsertColumns"_ustr, aArgs);
CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
CPPUNIT_ASSERT_EQUAL(size_t(1), aView.m_aInvalidations.size());
CPPUNIT_ASSERT_EQUAL(tools::Rectangle(254925, -15, 32212230, 63990), aView.m_aInvalidations[0]);
@@ -1171,10 +1171,10 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCommentCallback)
// Add a new comment
uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence(
{
- {"Text", uno::Any(OUString("Comment"))},
- {"Author", uno::Any(OUString("LOK User1"))},
+ {"Text", uno::Any(u"Comment"_ustr)},
+ {"Author", uno::Any(u"LOK User1"_ustr)},
}));
- dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
+ dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aArgs);
// We received a LOK_CALLBACK_COMMENT callback with comment 'Add' action
CPPUNIT_ASSERT_EQUAL(std::string("Add"), aView1.m_aCommentCallbackResult.get<std::string>("action"));
@@ -1194,7 +1194,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCommentCallback)
if (pTabViewShell)
pTabViewShell->SetCursor(2, 2);
- dispatchCommand(mxComponent, ".uno:DeleteRows", {});
+ dispatchCommand(mxComponent, u".uno:DeleteRows"_ustr, {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(std::string("4 3 4 3"), aView1.m_aCommentCallbackResult.get<std::string>("cellRange"));
CPPUNIT_ASSERT_EQUAL(std::string("4 3 4 3"), aView2.m_aCommentCallbackResult.get<std::string>("cellRange"));
@@ -1203,7 +1203,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCommentCallback)
if (pTabViewShell)
pTabViewShell->SetCursor(2, 2);
- dispatchCommand(mxComponent, ".uno:DeleteColumns", {});
+ dispatchCommand(mxComponent, u".uno:DeleteColumns"_ustr, {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(std::string("3 3 3 3"), aView1.m_aCommentCallbackResult.get<std::string>("cellRange"));
CPPUNIT_ASSERT_EQUAL(std::string("3 3 3 3"), aView2.m_aCommentCallbackResult.get<std::string>("cellRange"));
@@ -1218,10 +1218,10 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCommentCallback)
aArgs = comphelper::InitPropertySequence(
{
{"Id", uno::Any(OUString::createFromAscii(aCommentId))},
- {"Text", uno::Any(OUString("Edited comment"))},
- {"Author", uno::Any(OUString("LOK User2"))},
+ {"Text", uno::Any(u"Edited comment"_ustr)},
+ {"Author", uno::Any(u"LOK User2"_ustr)},
});
- dispatchCommand(mxComponent, ".uno:EditAnnotation", aArgs);
+ dispatchCommand(mxComponent, u".uno:EditAnnotation"_ustr, aArgs);
// We received a LOK_CALLBACK_COMMENT callback with comment 'Modify' action
CPPUNIT_ASSERT_EQUAL(std::string("Modify"), aView1.m_aCommentCallbackResult.get<std::string>("action"));
@@ -1242,7 +1242,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCommentCallback)
{
{"Id", uno::Any(OUString::createFromAscii(aCommentId))}
});
- dispatchCommand(mxComponent, ".uno:DeleteNote", aArgs);
+ dispatchCommand(mxComponent, u".uno:DeleteNote"_ustr, aArgs);
// We received a LOK_CALLBACK_COMMENT callback with comment 'Remove' action
CPPUNIT_ASSERT_EQUAL(std::string("Remove"), aView1.m_aCommentCallbackResult.get<std::string>("action"));
@@ -1285,13 +1285,13 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoLimiting)
// try to execute undo in view #2
SfxLokHelper::setView(nView2);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
// check that undo has not been executed on view #2
CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetUndoActionCount());
// try to execute undo in view #1
SfxLokHelper::setView(nView1);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
// check that undo has been executed on view #1
CPPUNIT_ASSERT_EQUAL(std::size_t(0), pUndoManager->GetUndoActionCount());
@@ -1300,13 +1300,13 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoLimiting)
// try to execute redo in view #2
SfxLokHelper::setView(nView2);
- dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
// check that redo has not been executed on view #2
CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetRedoActionCount());
// try to execute redo in view #1
SfxLokHelper::setView(nView1);
- dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
// check that redo has been executed on view #1
CPPUNIT_ASSERT_EQUAL(std::size_t(0), pUndoManager->GetRedoActionCount());
}
@@ -1343,7 +1343,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoRepairDispatch)
// try to execute undo in view #2
SfxLokHelper::setView(nView2);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
// check that undo has not been executed on view #2
CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetUndoActionCount());
@@ -1353,7 +1353,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoRepairDispatch)
{
{"Repair", uno::Any(true)}
}));
- dispatchCommand(mxComponent, ".uno:Undo", aPropertyValues);
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, aPropertyValues);
// check that undo has been executed on view #2 in repair mode
CPPUNIT_ASSERT_EQUAL(std::size_t(0), pUndoManager->GetUndoActionCount());
}
@@ -1382,13 +1382,13 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testInsertGraphicInvalidations)
uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({
{ "FileName", uno::Any(createFileURL(u"smile.png")) }
}));
- dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs);
+ dispatchCommand(mxComponent, u".uno:InsertGraphic"_ustr, aArgs);
CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
// undo image insertion in view and see if both views are invalidated
aView.m_bInvalidateTiles = false;
uno::Sequence<beans::PropertyValue> aArgs2;
- dispatchCommand(mxComponent, ".uno:Undo", aArgs2);
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, aArgs2);
CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
}
@@ -1581,7 +1581,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testLanguageStatus)
}
{
- SfxStringItem aLangString(SID_LANGUAGE_STATUS, "Default_Spanish (Bolivia)");
+ SfxStringItem aLangString(SID_LANGUAGE_STATUS, u"Default_Spanish (Bolivia)"_ustr);
pView1->GetViewFrame().GetDispatcher()->ExecuteList(SID_LANGUAGE_STATUS,
SfxCallMode::SYNCHRON, { &aLangString });
}
@@ -1611,8 +1611,8 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testMultiViewCopyPaste)
ScDocument* pDoc = pModelObj->GetDocument();
CPPUNIT_ASSERT(pDoc);
- pDoc->SetString(ScAddress(0, 0, 0), "TestCopy1");
- pDoc->SetString(ScAddress(1, 0, 0), "TestCopy2");
+ pDoc->SetString(ScAddress(0, 0, 0), u"TestCopy1"_ustr);
+ pDoc->SetString(ScAddress(1, 0, 0), u"TestCopy2"_ustr);
// view #1
ScTabViewShell* pView1 = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
@@ -1646,8 +1646,8 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testMultiViewCopyPaste)
pView2->SetCursor(1, 1);
pView2->GetViewFrame().GetBindings().Execute(SID_PASTE);
- CPPUNIT_ASSERT_EQUAL(OUString("TestCopy1"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("TestCopy2"), pDoc->GetString(ScAddress(1, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"TestCopy1"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"TestCopy2"_ustr, pDoc->GetString(ScAddress(1, 1, 0)));
SfxViewShell::Current()->setLibreOfficeKitViewCallback(nullptr);
SfxLokHelper::setView(nView1);
@@ -1675,7 +1675,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testIMESupport)
{
pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, aInput);
}
- pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+ pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, u""_ustr);
// commit the string to the cell
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
@@ -1767,17 +1767,17 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testSpellOnlineParameter)
uno::Sequence<beans::PropertyValue> params =
{
- comphelper::makePropertyValue("Enable", uno::Any(!bSet)),
+ comphelper::makePropertyValue(u"Enable"_ustr, uno::Any(!bSet)),
};
- dispatchCommand(mxComponent, ".uno:SpellOnline", params);
+ dispatchCommand(mxComponent, u".uno:SpellOnline"_ustr, params);
CPPUNIT_ASSERT_EQUAL(!bSet, pView->IsAutoSpell());
// set the same state as now and we don't expect any change (no-toggle)
params =
{
- comphelper::makePropertyValue("Enable", uno::Any(!bSet)),
+ comphelper::makePropertyValue(u"Enable"_ustr, uno::Any(!bSet)),
};
- dispatchCommand(mxComponent, ".uno:SpellOnline", params);
+ dispatchCommand(mxComponent, u".uno:SpellOnline"_ustr, params);
CPPUNIT_ASSERT_EQUAL(!bSet, pView->IsAutoSpell());
}
@@ -1794,7 +1794,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testVbaRangeCopyPaste)
SfxObjectShell::CallXScript(
mxComponent,
- "vnd.sun.Star.script:Standard.Module1.Test_RangeCopyPaste?language=Basic&location=document",
+ u"vnd.sun.Star.script:Standard.Module1.Test_RangeCopyPaste?language=Basic&location=document"_ustr,
aParams, aRet, aOutParamIndex, aOutParam);
CPPUNIT_ASSERT(!pDocShell->GetClipData().is());
@@ -1961,10 +1961,10 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testInsertDeletePageInvalidation)
aView1.m_aInvalidations.clear();
uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({
- { "Name", uno::Any(OUString("")) },
+ { "Name", uno::Any(u""_ustr) },
{ "Index", uno::Any(sal_Int32(1)) }
}));
- dispatchCommand(mxComponent, ".uno:Insert", aArgs);
+ dispatchCommand(mxComponent, u".uno:Insert"_ustr, aArgs);
CPPUNIT_ASSERT(aView1.m_bInvalidateTiles);
CPPUNIT_ASSERT_EQUAL(size_t(2), aView1.m_aInvalidations.size());
CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1000000000, 1000000000), aView1.m_aInvalidations[0]);
@@ -1976,7 +1976,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testInsertDeletePageInvalidation)
uno::Sequence<beans::PropertyValue> aArgs2( comphelper::InitPropertySequence({
{ "Index", uno::Any(sal_Int32(1)) }
}));
- dispatchCommand(mxComponent, ".uno:Remove", aArgs2);
+ dispatchCommand(mxComponent, u".uno:Remove"_ustr, aArgs2);
CPPUNIT_ASSERT(aView1.m_bInvalidateTiles);
CPPUNIT_ASSERT_EQUAL(size_t(1), aView1.m_aInvalidations.size());
CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1000000000, 1000000000), aView1.m_aInvalidations[0]);
@@ -2517,7 +2517,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testPasteIntoWrapTextCell)
CPPUNIT_ASSERT(pView);
// create source text in A1
- OUString sCopyContent("Very long text to copy");
+ OUString sCopyContent(u"Very long text to copy"_ustr);
pDoc->SetString(0, 0, 0, sCopyContent);
// copy A1
@@ -2548,7 +2548,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testPasteIntoWrapTextCell)
CPPUNIT_ASSERT_EQUAL("rows sizes"_ostr, aView.m_sInvalidateSheetGeometry);
// create new source text in A2
- OUString sCopyContent2("Very long text to copy 2");
+ OUString sCopyContent2(u"Very long text to copy 2"_ustr);
pDoc->SetString(0, 1, 0, sCopyContent2);
Scheduler::ProcessEventsToIdle();
@@ -2598,7 +2598,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testSortAscendingDescending)
// sort ascending
uno::Sequence<beans::PropertyValue> aArgs;
- dispatchCommand(mxComponent, ".uno:SortAscending", aArgs);
+ dispatchCommand(mxComponent, u".uno:SortAscending"_ustr, aArgs);
// check it's sorted
for (SCROW r = 0; r < 6; ++r)
@@ -2611,7 +2611,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testSortAscendingDescending)
aView.m_sInvalidateSheetGeometry = ""_ostr;
// sort descending
- dispatchCommand(mxComponent, ".uno:SortDescending", aArgs);
+ dispatchCommand(mxComponent, u".uno:SortDescending"_ustr, aArgs);
// check it's sorted
for (SCROW r = 0; r < 6; ++r)
@@ -2636,29 +2636,29 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testAutoInputStringBlock)
CPPUNIT_ASSERT(pView);
ScDocument* pDoc = pModelObj->GetDocument();
- pDoc->SetString(ScAddress(0, 3, 0), "ABC"); // A4
- pDoc->SetString(ScAddress(0, 4, 0), "BAC"); // A5
+ pDoc->SetString(ScAddress(0, 3, 0), u"ABC"_ustr); // A4
+ pDoc->SetString(ScAddress(0, 4, 0), u"BAC"_ustr); // A5
ScFieldEditEngine& rEE = pDoc->GetEditEngine();
- rEE.SetText("XYZ");
+ rEE.SetText(u"XYZ"_ustr);
pDoc->SetEditText(ScAddress(0, 5, 0), rEE.CreateTextObject()); // A6
pDoc->SetValue(ScAddress(0, 6, 0), 123);
- pDoc->SetString(ScAddress(0, 7, 0), "ZZZ"); // A8
+ pDoc->SetString(ScAddress(0, 7, 0), u"ZZZ"_ustr); // A8
ScAddress aA1(0, 0, 0);
lcl_typeCharsInCell("X", aA1.Col(), aA1.Row(), pView, pModelObj); // Type 'X' in A1
- CPPUNIT_ASSERT_EQUAL_MESSAGE("A1 should autocomplete", OUString("XYZ"), pDoc->GetString(aA1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("A1 should autocomplete", u"XYZ"_ustr, pDoc->GetString(aA1));
ScAddress aA3(0, 2, 0); // Adjacent to the string "superblock" A4:A8
lcl_typeCharsInCell("X", aA3.Col(), aA3.Row(), pView, pModelObj); // Type 'X' in A3
- CPPUNIT_ASSERT_EQUAL_MESSAGE("A3 should autocomplete", OUString("XYZ"), pDoc->GetString(aA3));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("A3 should autocomplete", u"XYZ"_ustr, pDoc->GetString(aA3));
ScAddress aA9(0, 8, 0); // Adjacent to the string "superblock" A4:A8
lcl_typeCharsInCell("X", aA9.Col(), aA9.Row(), pView, pModelObj); // Type 'X' in A9
- CPPUNIT_ASSERT_EQUAL_MESSAGE("A9 should autocomplete", OUString("XYZ"), pDoc->GetString(aA9));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("A9 should autocomplete", u"XYZ"_ustr, pDoc->GetString(aA9));
ScAddress aA11(0, 10, 0);
lcl_typeCharsInCell("X", aA11.Col(), aA11.Row(), pView, pModelObj); // Type 'X' in A11
- CPPUNIT_ASSERT_EQUAL_MESSAGE("A11 should autocomplete", OUString("XYZ"), pDoc->GetString(aA11));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("A11 should autocomplete", u"XYZ"_ustr, pDoc->GetString(aA11));
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testAutoInputExactMatch)
@@ -2669,43 +2669,43 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testAutoInputExactMatch)
CPPUNIT_ASSERT(pView);
ScDocument* pDoc = pModelObj->GetDocument();
- pDoc->SetString(ScAddress(0, 1, 0), "Simple"); // A2
- pDoc->SetString(ScAddress(0, 2, 0), "Simple"); // A3
- pDoc->SetString(ScAddress(0, 3, 0), "Sing"); // A4
+ pDoc->SetString(ScAddress(0, 1, 0), u"Simple"_ustr); // A2
+ pDoc->SetString(ScAddress(0, 2, 0), u"Simple"_ustr); // A3
+ pDoc->SetString(ScAddress(0, 3, 0), u"Sing"_ustr); // A4
ScFieldEditEngine& rEE = pDoc->GetEditEngine();
- rEE.SetText("Case");
+ rEE.SetText(u"Case"_ustr);
pDoc->SetEditText(ScAddress(0, 4, 0), rEE.CreateTextObject()); // A5
- pDoc->SetString(ScAddress(0, 5, 0), "Time"); // A6
- pDoc->SetString(ScAddress(0, 6, 0), "Castle"); // A7
+ pDoc->SetString(ScAddress(0, 5, 0), u"Time"_ustr); // A6
+ pDoc->SetString(ScAddress(0, 6, 0), u"Castle"_ustr); // A7
ScAddress aA8(0, 7, 0);
lcl_typeCharsInCell("S", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "S" in A8
// Should show the partial completion "i".
- CPPUNIT_ASSERT_EQUAL_MESSAGE("1: A8 should have partial completion Si", OUString("Si"), pDoc->GetString(aA8));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("1: A8 should have partial completion Si", u"Si"_ustr, pDoc->GetString(aA8));
lcl_typeCharsInCell("Si", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "Si" in A8
// Should not show any suggestions.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("2: A8 should not show suggestions", OUString("Si"), pDoc->GetString(aA8));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("2: A8 should not show suggestions", u"Si"_ustr, pDoc->GetString(aA8));
lcl_typeCharsInCell("Sim", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "Sim" in A8
// Should autocomplete to "Simple" which is the only match.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("3: A8 should autocomplete", OUString("Simple"), pDoc->GetString(aA8));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("3: A8 should autocomplete", u"Simple"_ustr, pDoc->GetString(aA8));
lcl_typeCharsInCell("Sin", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "Sin" in A8
// Should autocomplete to "Sing" which is the only match.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("4: A8 should autocomplete", OUString("Sing"), pDoc->GetString(aA8));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("4: A8 should autocomplete", u"Sing"_ustr, pDoc->GetString(aA8));
lcl_typeCharsInCell("C", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "C" in A8
// Should show the partial completion "as".
- CPPUNIT_ASSERT_EQUAL_MESSAGE("5: A8 should have partial completion Cas", OUString("Cas"), pDoc->GetString(aA8));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("5: A8 should have partial completion Cas", u"Cas"_ustr, pDoc->GetString(aA8));
lcl_typeCharsInCell("Cast", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "Cast" in A8
// Should autocomplete to "Castle" which is the only match.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("6: A8 should autocomplete", OUString("Castle"), pDoc->GetString(aA8));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("6: A8 should autocomplete", u"Castle"_ustr, pDoc->GetString(aA8));
lcl_typeCharsInCell("T", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "T" in A8
// Should autocomplete to "Time" which is the only match.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("7: A8 should autocomplete", OUString("Time"), pDoc->GetString(aA8));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("7: A8 should autocomplete", u"Time"_ustr, pDoc->GetString(aA8));
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testEditCursorBounds)
@@ -2810,10 +2810,10 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testSheetViewDataCrash)
// Imitate online while creating a new sheet on empty.ods.
uno::Sequence<beans::PropertyValue> aArgs(
comphelper::InitPropertySequence({
- { "Name", uno::Any(OUString("NewSheet")) },
+ { "Name", uno::Any(u"NewSheet"_ustr) },
{ "Index", uno::Any(sal_Int32(2)) }
}));
- dispatchCommand(mxComponent, ".uno:Insert", aArgs);
+ dispatchCommand(mxComponent, u".uno:Insert"_ustr, aArgs);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::PAGEDOWN | KEY_MOD1);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEDOWN | KEY_MOD1);
Scheduler::ProcessEventsToIdle();
@@ -2847,7 +2847,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testTextBoxInsert)
comphelper::InitPropertySequence({
{ "CreateDirectly", uno::Any(true) }
}));
- dispatchCommand(mxComponent, ".uno:DrawText", aArgs);
+ dispatchCommand(mxComponent, u".uno:DrawText"_ustr, aArgs);
// check if we have textbox selected
CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty());
@@ -2881,10 +2881,10 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCommentCellCopyPaste)
// Add a new comment
uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence(
{
- {"Text", uno::Any(OUString("LOK Comment Cell B2"))},
- {"Author", uno::Any(OUString("LOK Client"))},
+ {"Text", uno::Any(u"LOK Comment Cell B2"_ustr)},
+ {"Author", uno::Any(u"LOK Client"_ustr)},
}));
- dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
+ dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aArgs);
// We received a LOK_CALLBACK_COMMENT callback with comment 'Add' action
CPPUNIT_ASSERT_EQUAL(std::string("Add"), aView.m_aCommentCallbackResult.get<std::string>("action"));
@@ -2900,11 +2900,11 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCommentCellCopyPaste)
// Single cell(with comment) copy paste test
{
- dispatchCommand(mxComponent, ".uno:Copy", aCopyPasteArgs);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, aCopyPasteArgs);
pTabViewShell->SetCursor(1, 49);
Scheduler::ProcessEventsToIdle();
- dispatchCommand(mxComponent, ".uno:Paste", aCopyPasteArgs); // Paste to cell B50
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, aCopyPasteArgs); // Paste to cell B50
// We received a LOK_CALLBACK_COMMENT callback with comment 'Add' action
CPPUNIT_ASSERT_EQUAL(std::string("Add"), aView.m_aCommentCallbackResult.get<std::string>("action"));
@@ -2930,11 +2930,11 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCommentCellCopyPaste)
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RIGHT | KEY_SHIFT);
Scheduler::ProcessEventsToIdle();
- dispatchCommand(mxComponent, ".uno:Copy", aCopyPasteArgs);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, aCopyPasteArgs);
pTabViewShell->SetCursor(3, 49);
Scheduler::ProcessEventsToIdle();
- dispatchCommand(mxComponent, ".uno:Paste", aCopyPasteArgs); // Paste to cell D50
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, aCopyPasteArgs); // Paste to cell D50
// We received a LOK_CALLBACK_COMMENT callback with comment 'Add' action
CPPUNIT_ASSERT_EQUAL(std::string("Add"), aView.m_aCommentCallbackResult.get<std::string>("action"));
@@ -2953,7 +2953,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testInvalidEntrySave)
loadFromFile(u"validity.xlsx");
// .uno:Save modifies the original file, make a copy first
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
pModelObj->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
@@ -2973,7 +2973,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testInvalidEntrySave)
false /* bInEdit */, false /* bCommit */); // Type "7/8" in A8
uno::Sequence<beans::PropertyValue> aArgs;
- dispatchCommand(mxComponent, ".uno:Save", aArgs);
+ dispatchCommand(mxComponent, u".uno:Save"_ustr, aArgs);
CPPUNIT_ASSERT_MESSAGE("Should not be marked modified after save", !pDocSh->IsModified());
@@ -3036,13 +3036,13 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoReordering)
// try to execute undo in view #1
SfxLokHelper::setView(nView1);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
// check that undo has been executed on view #1
CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetUndoActionCount());
// try to execute undo in view #2
SfxLokHelper::setView(nView2);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
// check that undo has been executed on view #2
CPPUNIT_ASSERT_EQUAL(std::size_t(0), pUndoManager->GetUndoActionCount());
}
@@ -3090,8 +3090,8 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoReorderingRedo)
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(std::size_t(2), pUndoManager->GetUndoActionCount());
- CPPUNIT_ASSERT_EQUAL(OUString("xx"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("yy"), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"xx"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"yy"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
// text edit a different cell in view #2
SfxLokHelper::setView(nView2);
@@ -3105,17 +3105,17 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoReorderingRedo)
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(std::size_t(3), pUndoManager->GetUndoActionCount());
- CPPUNIT_ASSERT_EQUAL(OUString("xx"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("yy"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("CC"), pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"xx"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"yy"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"CC"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
// View 1 presses undo, and the second cell is erased
SfxLokHelper::setView(nView1);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(std::size_t(2), pUndoManager->GetUndoActionCount());
- CPPUNIT_ASSERT_EQUAL(OUString("xx"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("CC"), pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"xx"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"CC"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
// Verify that the UNDO buttons/actions are still enabled
{
@@ -3130,11 +3130,11 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoReorderingRedo)
}
// View 1 presses undo again, and the first cell is erased
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetUndoActionCount());
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("CC"), pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"CC"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoReorderingMulti)
@@ -3180,8 +3180,8 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoReorderingMulti)
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(std::size_t(2), pUndoManager->GetUndoActionCount());
- CPPUNIT_ASSERT_EQUAL(OUString("xx"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("CC"), pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"xx"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"CC"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
// and another cell in view #2
pView2->SetCursor(0, 3);
@@ -3193,17 +3193,17 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoReorderingMulti)
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(std::size_t(3), pUndoManager->GetUndoActionCount());
- CPPUNIT_ASSERT_EQUAL(OUString("xx"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("CC"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("DD"), pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"xx"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"CC"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"DD"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
// View 1 presses undo
SfxLokHelper::setView(nView1);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(std::size_t(2), pUndoManager->GetUndoActionCount());
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("CC"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("DD"), pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"CC"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"DD"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testGetViewRenderState)
@@ -3226,10 +3226,10 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testGetViewRenderState)
{
uno::Sequence<beans::PropertyValue> aPropertyValues = comphelper::InitPropertySequence(
{
- { "NewTheme", uno::Any(OUString("Dark")) },
+ { "NewTheme", uno::Any(u"Dark"_ustr) },
}
);
- dispatchCommand(mxComponent, ".uno:ChangeTheme", aPropertyValues);
+ dispatchCommand(mxComponent, u".uno:ChangeTheme"_ustr, aPropertyValues);
}
CPPUNIT_ASSERT_EQUAL("S;Dark"_ostr, pModelObj->getViewRenderState());
@@ -3274,7 +3274,7 @@ void testInvalidateOnTextEditWithDifferentZoomLevels::TestBody(const ColRowZoom&
CPPUNIT_ASSERT(pModelObj);
ScDocument* pDoc = pModelObj->GetDocument();
CPPUNIT_ASSERT(pDoc);
- OUString sZoomUnoCmd = ".uno:ZoomPlus";
+ OUString sZoomUnoCmd = u".uno:ZoomPlus"_ustr;
int nZoomLevel = rData.zoom;
if (nZoomLevel < 0)
{
@@ -3400,7 +3400,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testNoInvalidateOnSave)
loadFromFile(u"invalidate-on-save.ods");
// .uno:Save modifies the original file, make a copy first
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
pModelObj->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
@@ -3414,7 +3414,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testNoInvalidateOnSave)
ViewCallback aView;
uno::Sequence<beans::PropertyValue> aArgs;
- dispatchCommand(mxComponent, ".uno:Save", aArgs);
+ dispatchCommand(mxComponent, u".uno:Save"_ustr, aArgs);
Scheduler::ProcessEventsToIdle();
@@ -3500,12 +3500,12 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCellMinimalInvalidations)
{
pView->SetCursor(aD4.Col(), aD4.Row());
uno::Sequence<beans::PropertyValue> aArgs;
- dispatchCommand(mxComponent, ".uno:Copy", aArgs);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, aArgs);
pView->SetCursor(aA8.Col(), aA8.Row());
Scheduler::ProcessEventsToIdle();
ViewCallback aView;
- dispatchCommand(mxComponent, ".uno:Paste", aArgs);
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, aArgs);
Scheduler::ProcessEventsToIdle();
checkSampleInvalidation(aView, false);
@@ -3687,7 +3687,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testStatusBarLocale)
SfxLokHelper::createView();
ViewCallback aView2;
SfxViewShell* pView2 = SfxViewShell::Current();
- pView2->SetLOKLocale("de-DE");
+ pView2->SetLOKLocale(u"de-DE"_ustr);
{
SfxViewFrame& rFrame = pView2->GetViewFrame();
SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool(&rFrame);
@@ -3702,7 +3702,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testStatusBarLocale)
// When creating a cell selection in the 2nd view and processing jobs with the 1st view set to
// active:
- comphelper::dispatchCommand(".uno:GoDownSel", {});
+ comphelper::dispatchCommand(u".uno:GoDownSel"_ustr, {});
SfxLokHelper::setView(nView1);
pView2->GetViewFrame().GetBindings().GetTimer().Invoke();
// Once more to hit the pImpl->bMsgDirty = false case in SfxBindings::NextJob_Impl().
@@ -3895,8 +3895,8 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testNumberFormatLocaleMultiUser)
{
// setup core language to FR as it will be the first session
SvtSysLocaleOptions aLocalOptions;
- aLocalOptions.SetLocaleConfigString("fr-FR");
- aLocalOptions.SetUILocaleConfigString("fr-FR");
+ aLocalOptions.SetLocaleConfigString(u"fr-FR"_ustr);
+ aLocalOptions.SetUILocaleConfigString(u"fr-FR"_ustr);
aLocalOptions.Commit();
loadFromFile(u"numlocale.xlsx");
@@ -3910,7 +3910,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testNumberFormatLocaleMultiUser)
int nViewFR = SfxLokHelper::getView();
ViewCallback aView1;
SfxViewShell* pViewFR = SfxViewShell::Current();
- pViewFR->SetLOKLocale("fr-FR");
+ pViewFR->SetLOKLocale(u"fr-FR"_ustr);
// modify G12 with FR and use French keywords in the format
SfxLokHelper::setView(nViewFR);
@@ -3918,7 +3918,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testNumberFormatLocaleMultiUser)
sal_Int32 nCheckPos;
SvNumFormatType nType;
sal_uInt32 nFormat;
- OUString aNumberFormat("JJ/MM/AAAA");
+ OUString aNumberFormat(u"JJ/MM/AAAA"_ustr);
SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
pFormatter->PutEntry(aNumberFormat, nCheckPos, nType, nFormat);
ScAddress aCellPos1(/*nColP=*/6, /*nRowP=*/11, /*nTabP=*/0);
@@ -3930,13 +3930,13 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testNumberFormatLocaleMultiUser)
{
// now setup DE language in core
SvtSysLocaleOptions aLocalOptions;
- aLocalOptions.SetLocaleConfigString("de-DE");
- aLocalOptions.SetUILocaleConfigString("de-DE");
+ aLocalOptions.SetLocaleConfigString(u"de-DE"_ustr);
+ aLocalOptions.SetUILocaleConfigString(u"de-DE"_ustr);
aLocalOptions.Commit();
// save and reopen
// .uno:Save modifies the original file, make a copy first
- saveAndReload("Calc MS Excel 2007 VBA XML");
+ saveAndReload(u"Calc MS Excel 2007 VBA XML"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
CPPUNIT_ASSERT(pModelObj);
@@ -3947,7 +3947,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testNumberFormatLocaleMultiUser)
Scheduler::ProcessEventsToIdle();
uno::Sequence<beans::PropertyValue> aArgs;
- dispatchCommand(mxComponent, ".uno:Save", aArgs);
+ dispatchCommand(mxComponent, u".uno:Save"_ustr, aArgs);
Scheduler::ProcessEventsToIdle();
@@ -3956,7 +3956,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testNumberFormatLocaleMultiUser)
// verify that format is correct (German), doesn't have any "string" inside
sal_uInt32 nNumberFormat = pDoc->GetNumberFormat(/*col=*/6, /*row=*/11, /*tab=*/0);
const SvNumberformat* pNumberFormat = pDoc->GetFormatTable()->GetEntry(nNumberFormat);
- CPPUNIT_ASSERT_EQUAL(OUString("TT.MM.JJ"), pNumberFormat->GetFormatstring());
+ CPPUNIT_ASSERT_EQUAL(u"TT.MM.JJ"_ustr, pNumberFormat->GetFormatstring());
}
}
diff --git a/sc/qa/unit/tiledrendering2/tiledrendering2.cxx b/sc/qa/unit/tiledrendering2/tiledrendering2.cxx
index 737a0be6a3c8..b6f084738b43 100644
--- a/sc/qa/unit/tiledrendering2/tiledrendering2.cxx
+++ b/sc/qa/unit/tiledrendering2/tiledrendering2.cxx
@@ -39,7 +39,7 @@ public:
};
Test::Test()
- : UnoApiXmlTest("/sc/qa/unit/tiledrendering2/data/")
+ : UnoApiXmlTest(u"/sc/qa/unit/tiledrendering2/data/"_ustr)
{
}
@@ -157,11 +157,11 @@ CPPUNIT_TEST_FIXTURE(Test, testSidebarLocale)
int nView1 = SfxLokHelper::getView();
ViewCallback aView1;
SfxViewShell* pView1 = SfxViewShell::Current();
- pView1->SetLOKLocale("en-US");
+ pView1->SetLOKLocale(u"en-US"_ustr);
SfxLokHelper::createView();
ViewCallback aView2;
SfxViewShell* pView2 = SfxViewShell::Current();
- pView2->SetLOKLocale("de-DE");
+ pView2->SetLOKLocale(u"de-DE"_ustr);
TestLokCallbackWrapper::InitializeSidebar();
Scheduler::ProcessEventsToIdle();
aView2.m_aStateChanges.clear();
@@ -186,15 +186,15 @@ CPPUNIT_TEST_FIXTURE(Test, testCopyMultiSelection)
ViewCallback aView1;
// Get the center of A3:
uno::Sequence<beans::PropertyValue> aPropertyValues = {
- comphelper::makePropertyValue("ToPoint", OUString("$A$3")),
+ comphelper::makePropertyValue(u"ToPoint"_ustr, u"$A$3"_ustr),
};
- dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues);
+ dispatchCommand(mxComponent, u".uno:GoToCell"_ustr, aPropertyValues);
Point aPoint = aView1.m_aCellCursorBounds.Center();
// Go to A1:
aPropertyValues = {
- comphelper::makePropertyValue("ToPoint", OUString("$A$1")),
+ comphelper::makePropertyValue(u"ToPoint"_ustr, u"$A$1"_ustr),
};
- dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues);
+ dispatchCommand(mxComponent, u".uno:GoToCell"_ustr, aPropertyValues);
// Ctrl-click on A3:
int nCtrl = KEY_MOD1;
pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, aPoint.getX(), aPoint.getY(), 1,
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 496f9d5ff05b..d68697830c23 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -107,13 +107,13 @@ void Test::getNewDocShell( ScDocShellRef& rDocShellRef )
CPPUNIT_TEST_FIXTURE(Test, testCollator)
{
- sal_Int32 nRes = ScGlobal::GetCollator().compareString("A", "B");
+ sal_Int32 nRes = ScGlobal::GetCollator().compareString(u"A"_ustr, u"B"_ustr);
CPPUNIT_ASSERT_MESSAGE("these strings are supposed to be different!", nRes != 0);
}
CPPUNIT_TEST_FIXTURE(Test, testSharedStringPool)
{
- m_pDoc->InsertTab(0, "foo");
+ m_pDoc->InsertTab(0, u"foo"_ustr);
svl::SharedStringPool& rPool = m_pDoc->GetSharedStringPool();
size_t extraCount = rPool.getCount(); // internal items such as SharedString::getEmptyString()
@@ -175,9 +175,9 @@ CPPUNIT_TEST_FIXTURE(Test, testSharedStringPool)
CPPUNIT_ASSERT_EQUAL(extraCountIgnoreCase, rPool.getCountIgnoreCase());
// Now, compare string and edit text cells.
- m_pDoc->SetString(ScAddress(0,0,0), "Andy and Bruce"); // A1
+ m_pDoc->SetString(ScAddress(0,0,0), "Andy and Bruce"); // A1 // [-loplugin:ostr]
ScFieldEditEngine& rEE = m_pDoc->GetEditEngine();
- rEE.SetTextCurrentDefaults("Andy and Bruce");
+ rEE.SetTextCurrentDefaults(u"Andy and Bruce"_ustr);
ESelection aSel;
aSel.nStartPara = aSel.nEndPara = 0;
@@ -211,7 +211,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSharedStringPool)
CPPUNIT_ASSERT_MESSAGE("Failed to get a valid string ID.", aSS2.isValid());
CPPUNIT_ASSERT_EQUAL(aSS1.getData(), aSS2.getData());
- rEE.SetTextCurrentDefaults("ANDY and BRUCE");
+ rEE.SetTextCurrentDefaults(u"ANDY and BRUCE"_ustr);
m_pDoc->SetEditText(ScAddress(2,0,0), rEE.CreateTextObject()); // C1
aSS2 = m_pDoc->GetSharedString(ScAddress(2,0,0));
CPPUNIT_ASSERT_MESSAGE("Failed to get a valid string ID.", aSS2.isValid());
@@ -259,12 +259,12 @@ CPPUNIT_TEST_FIXTURE(Test, testSharedStringPoolUndoDoc)
} aTest;
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(ScAddress(0,0,0), "Header");
- m_pDoc->SetString(ScAddress(0,1,0), "A1");
- m_pDoc->SetString(ScAddress(0,2,0), "A2");
- m_pDoc->SetString(ScAddress(0,3,0), "A3");
+ m_pDoc->SetString(ScAddress(0,0,0), u"Header"_ustr);
+ m_pDoc->SetString(ScAddress(0,1,0), u"A1"_ustr);
+ m_pDoc->SetString(ScAddress(0,2,0), u"A2"_ustr);
+ m_pDoc->SetString(ScAddress(0,3,0), u"A3"_ustr);
ScDocument aUndoDoc(SCDOCMODE_UNDO);
aUndoDoc.InitUndo(*m_pDoc, 0, 0);
@@ -284,7 +284,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSharedStringPoolUndoDoc)
CPPUNIT_TEST_FIXTURE(Test, testRangeList)
{
- m_pDoc->InsertTab(0, "foo");
+ m_pDoc->InsertTab(0, u"foo"_ustr);
ScRangeList aRL;
aRL.push_back(ScRange(1,1,0,3,10,0));
@@ -352,14 +352,14 @@ CPPUNIT_TEST_FIXTURE(Test, testInput)
{
CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
- m_pDoc->InsertTab (0, "foo"));
+ m_pDoc->InsertTab (0, u"foo"_ustr));
OUString test;
- m_pDoc->SetString(0, 0, 0, "'10.5");
+ m_pDoc->SetString(0, 0, 0, u"'10.5"_ustr);
test = m_pDoc->GetString(0, 0, 0);
bool bTest = test == "10.5";
CPPUNIT_ASSERT_MESSAGE("String number should have the first apostrophe stripped.", bTest);
- m_pDoc->SetString(0, 0, 0, "'apple'");
+ m_pDoc->SetString(0, 0, 0, u"'apple'"_ustr);
test = m_pDoc->GetString(0, 0, 0);
bTest = test == "apple'";
CPPUNIT_ASSERT_MESSAGE("Text content should have the first apostrophe stripped.", bTest);
@@ -367,9 +367,9 @@ CPPUNIT_TEST_FIXTURE(Test, testInput)
// Customized string handling policy.
ScSetStringParam aParam;
aParam.setTextInput();
- m_pDoc->SetString(0, 0, 0, "000123", &aParam);
+ m_pDoc->SetString(0, 0, 0, u"000123"_ustr, &aParam);
test = m_pDoc->GetString(0, 0, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Text content should have been treated as string, not number.", OUString("000123"), test);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Text content should have been treated as string, not number.", u"000123"_ustr, test);
m_pDoc->DeleteTab(0);
}
@@ -377,10 +377,10 @@ CPPUNIT_TEST_FIXTURE(Test, testInput)
CPPUNIT_TEST_FIXTURE(Test, testColumnIterator) // tdf#118620
{
CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
- m_pDoc->InsertTab (0, "foo"));
+ m_pDoc->InsertTab (0, u"foo"_ustr));
- m_pDoc->SetString(0, 0, 0, "'10.5");
- m_pDoc->SetString(0, m_pDoc->MaxRow()-5, 0, "42.0");
+ m_pDoc->SetString(0, 0, 0, u"'10.5"_ustr);
+ m_pDoc->SetString(0, m_pDoc->MaxRow()-5, 0, u"42.0"_ustr);
std::optional<sc::ColumnIterator> it = m_pDoc->GetColumnIterator(0, 0, m_pDoc->MaxRow() - 10, m_pDoc->MaxRow());
while (it->hasCell())
{
@@ -395,7 +395,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf66613)
{
// Create different print ranges and col/row repetitions for two tabs
const SCTAB nFirstTab = 0;
- CPPUNIT_ASSERT(m_pDoc->InsertTab(nFirstTab, "FirstPrintRange"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(nFirstTab, u"FirstPrintRange"_ustr));
ScRange aFirstPrintRange(0, 0, nFirstTab, 2, 2, nFirstTab);
m_pDoc->AddPrintRange(nFirstTab, aFirstPrintRange);
ScRange aFirstRepeatColRange(0, 0, nFirstTab, 0, 0, nFirstTab);
@@ -404,7 +404,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf66613)
m_pDoc->SetRepeatRowRange(nFirstTab, aFirstRepeatRowRange);
const SCTAB nSecondTab = 1;
- CPPUNIT_ASSERT(m_pDoc->InsertTab(nSecondTab, "SecondPrintRange"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(nSecondTab, u"SecondPrintRange"_ustr));
ScRange aSecondPrintRange(0, 0, nSecondTab, 3, 3, nSecondTab);
m_pDoc->AddPrintRange(nSecondTab, aSecondPrintRange);
ScRange aSecondRepeatColRange(1, 1, nSecondTab, 1, 1, nSecondTab);
@@ -457,8 +457,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf66613)
CPPUNIT_TEST_FIXTURE(Test, testTdf113027)
{
// Insert some sheets including a whitespace in their name and switch the grammar to R1C1
- CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Sheet 1"));
- CPPUNIT_ASSERT(m_pDoc->InsertTab(1, "Sheet 2"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(0, u"Sheet 1"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(1, u"Sheet 2"_ustr));
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
// Add a formula containing a remote reference, i.e., to another sheet
@@ -474,7 +474,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113027)
// - Expected: ='Sheet 2'!R1C1
// - Actual : ='Sheet 2'!RC
// i.e. the cell reference was not changed from relative to absolute
- CPPUNIT_ASSERT_EQUAL(OUString("='Sheet 2'!R1C1"), aFinder.GetText());
+ CPPUNIT_ASSERT_EQUAL(u"='Sheet 2'!R1C1"_ustr, aFinder.GetText());
m_pDoc->DeleteTab(0);
m_pDoc->DeleteTab(1);
@@ -482,29 +482,29 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113027)
CPPUNIT_TEST_FIXTURE(Test, testTdf90698)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
- m_pDoc->SetString(ScAddress(0,0,0), "=(1;2)");
+ CPPUNIT_ASSERT(m_pDoc->InsertTab (0, u"Test"_ustr));
+ m_pDoc->SetString(ScAddress(0,0,0), u"=(1;2)"_ustr);
// Without the fix in place, this would have failed with
// - Expected: =(1;2)
// - Actual : =(1~2)
OUString aFormula = m_pDoc->GetFormula(0,0,0);
- CPPUNIT_ASSERT_EQUAL(OUString("=(1;2)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=(1;2)"_ustr, aFormula);
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf114406)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
- m_pDoc->SetString(ScAddress(0,0,0), "5");
- m_pDoc->SetString(ScAddress(1,0,0), "=A1/100%");
+ CPPUNIT_ASSERT(m_pDoc->InsertTab (0, u"Test"_ustr));
+ m_pDoc->SetString(ScAddress(0,0,0), u"5"_ustr);
+ m_pDoc->SetString(ScAddress(1,0,0), u"=A1/100%"_ustr);
// Without the fix in place, this would have failed with
// - Expected: =A1/100%
// - Actual : =A1/1
OUString aFormula = m_pDoc->GetFormula(1,0,0);
- CPPUNIT_ASSERT_EQUAL(OUString("=A1/100%"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=A1/100%"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(ScAddress(1,0,0)));
@@ -513,7 +513,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf114406)
CPPUNIT_TEST_FIXTURE(Test, testTdf93951)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab (0, u"Test"_ustr));
m_pDoc->SetString(ScAddress(0,0,0), u"=2*§*2"_ustr);
OUString aFormula = m_pDoc->GetFormula(0,0,0);
@@ -528,47 +528,47 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf93951)
CPPUNIT_TEST_FIXTURE(Test, testTdf134490)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab (0, u"Test"_ustr));
- m_pDoc->SetString(ScAddress(0,0,0), "--1");
- m_pDoc->SetString(ScAddress(0,1,0), "---1");
- m_pDoc->SetString(ScAddress(0,2,0), "+-1");
- m_pDoc->SetString(ScAddress(0,3,0), "+--1");
+ m_pDoc->SetString(ScAddress(0,0,0), u"--1"_ustr);
+ m_pDoc->SetString(ScAddress(0,1,0), u"---1"_ustr);
+ m_pDoc->SetString(ScAddress(0,2,0), u"+-1"_ustr);
+ m_pDoc->SetString(ScAddress(0,3,0), u"+--1"_ustr);
// Without the fix in place, this test would have failed with
// - Expected: --1
// - Actual : -1
- CPPUNIT_ASSERT_EQUAL(OUString("--1"), m_pDoc->GetString(ScAddress(0,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("---1"), m_pDoc->GetString(ScAddress(0,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("+-1"), m_pDoc->GetString(ScAddress(0,2,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("+--1"), m_pDoc->GetString(ScAddress(0,3,0)));
+ CPPUNIT_ASSERT_EQUAL(u"--1"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"---1"_ustr, m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"+-1"_ustr, m_pDoc->GetString(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(u"+--1"_ustr, m_pDoc->GetString(ScAddress(0,3,0)));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf135249)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab (0, u"Test"_ustr));
- m_pDoc->SetString(ScAddress(0,0,0), "1:60");
- m_pDoc->SetString(ScAddress(0,1,0), "1:123");
- m_pDoc->SetString(ScAddress(0,2,0), "1:1:123");
- m_pDoc->SetString(ScAddress(0,3,0), "0:123");
- m_pDoc->SetString(ScAddress(0,4,0), "0:0:123");
- m_pDoc->SetString(ScAddress(0,5,0), "0:123:59");
+ m_pDoc->SetString(ScAddress(0,0,0), u"1:60"_ustr);
+ m_pDoc->SetString(ScAddress(0,1,0), u"1:123"_ustr);
+ m_pDoc->SetString(ScAddress(0,2,0), u"1:1:123"_ustr);
+ m_pDoc->SetString(ScAddress(0,3,0), u"0:123"_ustr);
+ m_pDoc->SetString(ScAddress(0,4,0), u"0:0:123"_ustr);
+ m_pDoc->SetString(ScAddress(0,5,0), u"0:123:59"_ustr);
// These are not valid duration inputs
- CPPUNIT_ASSERT_EQUAL(OUString("1:60"), m_pDoc->GetString(ScAddress(0,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("1:123"), m_pDoc->GetString(ScAddress(0,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("1:1:123"), m_pDoc->GetString(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(u"1:60"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"1:123"_ustr, m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"1:1:123"_ustr, m_pDoc->GetString(ScAddress(0,2,0)));
// These are valid duration inputs
// Without the fix in place, this test would have failed with
// - Expected: 02:03:00 AM
// - Actual : 0:123
- CPPUNIT_ASSERT_EQUAL(OUString("02:03:00 AM"), m_pDoc->GetString(ScAddress(0,3,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("12:02:03 AM"), m_pDoc->GetString(ScAddress(0,4,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("02:03:59 AM"), m_pDoc->GetString(ScAddress(0,5,0)));
+ CPPUNIT_ASSERT_EQUAL(u"02:03:00 AM"_ustr, m_pDoc->GetString(ScAddress(0,3,0)));
+ CPPUNIT_ASSERT_EQUAL(u"12:02:03 AM"_ustr, m_pDoc->GetString(ScAddress(0,4,0)));
+ CPPUNIT_ASSERT_EQUAL(u"02:03:59 AM"_ustr, m_pDoc->GetString(ScAddress(0,5,0)));
m_pDoc->DeleteTab(0);
}
@@ -576,10 +576,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135249)
CPPUNIT_TEST_FIXTURE(Test, testDocStatistics)
{
SCTAB nStartTabs = m_pDoc->GetTableCount();
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Failed to increment sheet count.",
static_cast<SCTAB>(nStartTabs+1), m_pDoc->GetTableCount());
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Failed to increment sheet count.",
static_cast<SCTAB>(nStartTabs+2), m_pDoc->GetTableCount());
@@ -588,19 +588,19 @@ CPPUNIT_TEST_FIXTURE(Test, testDocStatistics)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64>(1), m_pDoc->GetCellCount());
m_pDoc->SetValue(ScAddress(2,2,0), 2.5);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64>(2), m_pDoc->GetCellCount());
- m_pDoc->SetString(ScAddress(1,1,1), "Test");
+ m_pDoc->SetString(ScAddress(1,1,1), u"Test"_ustr);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64>(3), m_pDoc->GetCellCount());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64>(0), m_pDoc->GetFormulaGroupCount());
- m_pDoc->SetString(ScAddress(3,0,1), "=A1");
+ m_pDoc->SetString(ScAddress(3,0,1), u"=A1"_ustr);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64>(1), m_pDoc->GetFormulaGroupCount());
- m_pDoc->SetString(ScAddress(3,1,1), "=A2");
- m_pDoc->SetString(ScAddress(3,2,1), "=A3");
+ m_pDoc->SetString(ScAddress(3,1,1), u"=A2"_ustr);
+ m_pDoc->SetString(ScAddress(3,2,1), u"=A3"_ustr);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64>(1), m_pDoc->GetFormulaGroupCount());
- m_pDoc->SetString(ScAddress(3,3,1), "=A5");
- m_pDoc->SetString(ScAddress(3,4,1), "=A6");
+ m_pDoc->SetString(ScAddress(3,3,1), u"=A5"_ustr);
+ m_pDoc->SetString(ScAddress(3,4,1), u"=A6"_ustr);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64>(2), m_pDoc->GetFormulaGroupCount());
- m_pDoc->SetString(ScAddress(3,1,1), "=A3");
+ m_pDoc->SetString(ScAddress(3,1,1), u"=A3"_ustr);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64>(4), m_pDoc->GetFormulaGroupCount());
m_pDoc->DeleteTab(1);
@@ -611,7 +611,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDocStatistics)
CPPUNIT_TEST_FIXTURE(Test, testRowForHeight)
{
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
m_pDoc->SetRowHeightRange( 0, 9, 0, 100);
m_pDoc->SetRowHeightRange(10, 19, 0, 200);
m_pDoc->SetRowHeightRange(20, 29, 0, 300);
@@ -650,12 +650,12 @@ CPPUNIT_TEST_FIXTURE(Test, testDataEntries)
* The 'data entries' data is a list of strings used for suggestions as
* the user types in new cell value.
*/
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(ScAddress(0,5,0), "Andy");
- m_pDoc->SetString(ScAddress(0,6,0), "Bruce");
- m_pDoc->SetString(ScAddress(0,7,0), "Charlie");
- m_pDoc->SetString(ScAddress(0,10,0), "Andy");
+ m_pDoc->SetString(ScAddress(0,5,0), u"Andy"_ustr);
+ m_pDoc->SetString(ScAddress(0,6,0), u"Bruce"_ustr);
+ m_pDoc->SetString(ScAddress(0,7,0), u"Charlie"_ustr);
+ m_pDoc->SetString(ScAddress(0,10,0), u"Andy"_ustr);
std::vector<ScTypedStrData> aEntries;
m_pDoc->GetDataEntries(0, 0, 0, aEntries); // Try at the very top.
@@ -663,11 +663,11 @@ CPPUNIT_TEST_FIXTURE(Test, testDataEntries)
// Entries are supposed to be sorted in ascending order, and are all unique.
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aEntries.size());
std::vector<ScTypedStrData>::const_iterator it = aEntries.begin();
- CPPUNIT_ASSERT_EQUAL(OUString("Andy"), it->GetString());
+ CPPUNIT_ASSERT_EQUAL(u"Andy"_ustr, it->GetString());
++it;
- CPPUNIT_ASSERT_EQUAL(OUString("Bruce"), it->GetString());
+ CPPUNIT_ASSERT_EQUAL(u"Bruce"_ustr, it->GetString());
++it;
- CPPUNIT_ASSERT_EQUAL(OUString("Charlie"), it->GetString());
+ CPPUNIT_ASSERT_EQUAL(u"Charlie"_ustr, it->GetString());
++it;
CPPUNIT_ASSERT_MESSAGE("The entries should have ended here.", bool(it == aEntries.end()));
@@ -677,11 +677,11 @@ CPPUNIT_TEST_FIXTURE(Test, testDataEntries)
// Make sure we get the same set of suggestions.
it = aEntries.begin();
- CPPUNIT_ASSERT_EQUAL(OUString("Andy"), it->GetString());
+ CPPUNIT_ASSERT_EQUAL(u"Andy"_ustr, it->GetString());
++it;
- CPPUNIT_ASSERT_EQUAL(OUString("Bruce"), it->GetString());
+ CPPUNIT_ASSERT_EQUAL(u"Bruce"_ustr, it->GetString());
++it;
- CPPUNIT_ASSERT_EQUAL(OUString("Charlie"), it->GetString());
+ CPPUNIT_ASSERT_EQUAL(u"Charlie"_ustr, it->GetString());
++it;
CPPUNIT_ASSERT_MESSAGE("The entries should have ended here.", bool(it == aEntries.end()));
@@ -694,18 +694,18 @@ CPPUNIT_TEST_FIXTURE(Test, testSelectionFunction)
* Selection function is responsible for displaying quick calculation
* results in the status bar.
*/
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Insert values into B2:B4.
- m_pDoc->SetString(ScAddress(1,1,0), "=1"); // formula
+ m_pDoc->SetString(ScAddress(1,1,0), u"=1"_ustr); // formula
m_pDoc->SetValue(ScAddress(1,2,0), 2.0);
m_pDoc->SetValue(ScAddress(1,3,0), 3.0);
// Insert strings into B5:B8.
- m_pDoc->SetString(ScAddress(1,4,0), "A");
- m_pDoc->SetString(ScAddress(1,5,0), "B");
- m_pDoc->SetString(ScAddress(1,6,0), "=\"C\""); // formula
- m_pDoc->SetString(ScAddress(1,7,0), "D");
+ m_pDoc->SetString(ScAddress(1,4,0), u"A"_ustr);
+ m_pDoc->SetString(ScAddress(1,5,0), u"B"_ustr);
+ m_pDoc->SetString(ScAddress(1,6,0), u"=\"C\""_ustr); // formula
+ m_pDoc->SetString(ScAddress(1,7,0), u"D"_ustr);
// Insert values into D2:D4.
m_pDoc->SetValue(ScAddress(3,1,0), 4.0);
@@ -714,11 +714,11 @@ CPPUNIT_TEST_FIXTURE(Test, testSelectionFunction)
// Insert edit text into D5.
ScFieldEditEngine& rEE = m_pDoc->GetEditEngine();
- rEE.SetTextCurrentDefaults("Rich Text");
+ rEE.SetTextCurrentDefaults(u"Rich Text"_ustr);
m_pDoc->SetEditText(ScAddress(3,4,0), rEE.CreateTextObject());
// Insert Another string into D6.
- m_pDoc->SetString(ScAddress(3,5,0), "E");
+ m_pDoc->SetString(ScAddress(3,5,0), u"E"_ustr);
// Select B2:B8 & D2:D8 disjoint region.
ScRangeList aRanges;
@@ -830,8 +830,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSelectionFunction)
// Calculate function across selected sheets.
clearSheet(m_pDoc, 0);
- m_pDoc->InsertTab(1, "Test2");
- m_pDoc->InsertTab(2, "Test3");
+ m_pDoc->InsertTab(1, u"Test2"_ustr);
+ m_pDoc->InsertTab(2, u"Test3"_ustr);
// Set values at B2 and C3 on each sheet.
m_pDoc->SetValue(ScAddress(1,1,0), 1.0);
@@ -863,13 +863,13 @@ CPPUNIT_TEST_FIXTURE(Test, testSelectionFunction)
CPPUNIT_TEST_FIXTURE(Test, testMarkedCellIteration)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Insert cells to A1, A5, B2 and C3.
- m_pDoc->SetString(ScAddress(0,0,0), "California");
+ m_pDoc->SetString(ScAddress(0,0,0), u"California"_ustr);
m_pDoc->SetValue(ScAddress(0,4,0), 1.2);
- m_pDoc->SetEditText(ScAddress(1,1,0), "Boston");
- m_pDoc->SetFormula(ScAddress(2,2,0), "=SUM(1,2,3)", m_pDoc->GetGrammar());
+ m_pDoc->SetEditText(ScAddress(1,1,0), u"Boston"_ustr);
+ m_pDoc->SetFormula(ScAddress(2,2,0), u"=SUM(1,2,3)"_ustr, m_pDoc->GetGrammar());
// Select A1:C5.
ScMarkData aMarkData(m_pDoc->GetSheetLimits());
@@ -915,29 +915,29 @@ CPPUNIT_TEST_FIXTURE(Test, testMarkedCellIteration)
CPPUNIT_TEST_FIXTURE(Test, testCopyToDocument)
{
- CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, "src"));
+ CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, u"src"_ustr));
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
- m_pDoc->SetString(0, 0, 0, "Header");
- m_pDoc->SetString(0, 1, 0, "1");
- m_pDoc->SetString(0, 2, 0, "2");
- m_pDoc->SetString(0, 3, 0, "3");
- m_pDoc->SetString(0, 4, 0, "=4/2");
+ m_pDoc->SetString(0, 0, 0, u"Header"_ustr);
+ m_pDoc->SetString(0, 1, 0, u"1"_ustr);
+ m_pDoc->SetString(0, 2, 0, u"2"_ustr);
+ m_pDoc->SetString(0, 3, 0, u"3"_ustr);
+ m_pDoc->SetString(0, 4, 0, u"=4/2"_ustr);
m_pDoc->CalcAll();
//note on A1
ScAddress aAdrA1 (0, 0, 0); // numerical cell content
ScPostIt* pNote = m_pDoc->GetOrCreateNote(aAdrA1);
- pNote->SetText(aAdrA1, "Hello world in A1");
+ pNote->SetText(aAdrA1, u"Hello world in A1"_ustr);
// Copy statically to another document.
ScDocShellRef xDocSh2;
getNewDocShell(xDocSh2);
ScDocument* pDestDoc = &xDocSh2->GetDocument();
- pDestDoc->InsertTab(0, "src");
+ pDestDoc->InsertTab(0, u"src"_ustr);
pDestDoc->InitDrawLayer(xDocSh2.get()); // for note caption objects
m_pDoc->CopyStaticToDocument(ScRange(0,1,0,0,3,0), 0, *pDestDoc); // Copy A2:A4
@@ -1005,7 +1005,7 @@ bool Test::checkHorizontalIterator(ScDocument& rDoc, const std::vector<std::vect
CPPUNIT_TEST_FIXTURE(Test, testHorizontalIterator)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
{
// Raw data - mixed types
@@ -1151,7 +1151,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHorizontalIterator)
CPPUNIT_TEST_FIXTURE(Test, testValueIterator)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Turn on "precision as shown" option.
ScDocOptions aOpt = m_pDoc->GetDocOptions();
@@ -1185,7 +1185,7 @@ CPPUNIT_TEST_FIXTURE(Test, testValueIterator)
CPPUNIT_TEST_FIXTURE(Test, testHorizontalAttrIterator)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Set the background color of B2:C3,D2,E3,C4:D4,B5:D5 to blue
ScPatternAttr aCellBackColor(m_pDoc->getCellAttributeHelper());
@@ -1226,7 +1226,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHorizontalAttrIterator)
CPPUNIT_TEST_FIXTURE(Test, testIteratorsUnallocatedColumnsAttributes)
{
- m_pDoc->InsertTab(0, "Tab1");
+ m_pDoc->InsertTab(0, u"Tab1"_ustr);
// Set values in first two columns, to ensure allocation of those columns.
m_pDoc->SetValue(ScAddress(0,1,0), 1);
@@ -1285,7 +1285,7 @@ CPPUNIT_TEST_FIXTURE(Test, testIteratorsUnallocatedColumnsAttributes)
CPPUNIT_TEST_FIXTURE(Test, testIteratorsDefPattern)
{
- m_pDoc->InsertTab(0, "Tab1");
+ m_pDoc->InsertTab(0, u"Tab1"_ustr);
// The default pattern is the default style, which can be edited by the user.
// As such iterators should not ignore it by default, because it might contain
@@ -1336,7 +1336,7 @@ CPPUNIT_TEST_FIXTURE(Test, testIteratorsDefPattern)
CPPUNIT_TEST_FIXTURE(Test, testLastChangedColFlagsWidth)
{
- m_pDoc->InsertTab(0, "Tab1");
+ m_pDoc->InsertTab(0, u"Tab1"_ustr);
constexpr SCCOL firstChangedCol = 100;
assert( firstChangedCol > m_pDoc->GetAllocatedColumnsCount(0));
@@ -1444,10 +1444,10 @@ CPPUNIT_TEST_FIXTURE(Test, testCellBroadcaster)
* More direct test for cell broadcaster management, used to track formula
* dependencies.
*/
- CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, "foo"));
+ CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, u"foo"_ustr));
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
- m_pDoc->SetString(ScAddress(1,0,0), "=A1"); // B1 depends on A1.
+ m_pDoc->SetString(ScAddress(1,0,0), u"=A1"_ustr); // B1 depends on A1.
double val = m_pDoc->GetValue(ScAddress(1,0,0)); // A1 is empty, so the result should be 0.
CPPUNIT_ASSERT_EQUAL(0.0, val);
@@ -1500,7 +1500,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCellBroadcaster)
// Clear everything and start over.
clearRange(m_pDoc, ScRange(0,0,0,10,100,0));
- m_pDoc->SetString(ScAddress(1,0,0), "=A1"); // B1 depends on A1.
+ m_pDoc->SetString(ScAddress(1,0,0), u"=A1"_ustr); // B1 depends on A1.
pBC = m_pDoc->GetBroadcaster(ScAddress(0,0,0));
CPPUNIT_ASSERT_MESSAGE("Broadcaster should exist in A1.", pBC);
@@ -1519,9 +1519,9 @@ CPPUNIT_TEST_FIXTURE(Test, testCellBroadcaster)
clearRange(m_pDoc, ScRange(0,0,0,10,100,0));
// B1:B3 depends on A1:A3
- m_pDoc->SetString(ScAddress(1,0,0), "=A1");
- m_pDoc->SetString(ScAddress(1,1,0), "=A2");
- m_pDoc->SetString(ScAddress(1,2,0), "=A3");
+ m_pDoc->SetString(ScAddress(1,0,0), u"=A1"_ustr);
+ m_pDoc->SetString(ScAddress(1,1,0), u"=A2"_ustr);
+ m_pDoc->SetString(ScAddress(1,2,0), u"=A3"_ustr);
CPPUNIT_ASSERT_MESSAGE("Relative reference check in B1 failed.",
checkRelativeRefToken(*m_pDoc, ScAddress(1,0,0), -1, 0));
CPPUNIT_ASSERT_MESSAGE("Relative reference check in B2 failed.",
@@ -1573,7 +1573,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCellBroadcaster)
for (SCROW i = 0; i < 20; ++i)
{
m_pDoc->SetValue(ScAddress(0,i,0), val++);
- m_pDoc->SetString(ScAddress(1,i,0), "=RC[-1]");
+ m_pDoc->SetString(ScAddress(1,i,0), u"=RC[-1]"_ustr);
}
}
@@ -1602,8 +1602,8 @@ CPPUNIT_TEST_FIXTURE(Test, testCellBroadcaster)
clearRange(m_pDoc, ScRange(0,0,0,10,100,0));
m_pDoc->SetValue(ScAddress(0,0,0), 2.0);
- m_pDoc->SetString(ScAddress(1,0,0), "=A1");
- m_pDoc->SetString(ScAddress(2,0,0), "=B1");
+ m_pDoc->SetString(ScAddress(1,0,0), u"=A1"_ustr);
+ m_pDoc->SetString(ScAddress(2,0,0), u"=B1"_ustr);
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(0,0,0));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(1,0,0));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(2,0,0));
@@ -1639,27 +1639,27 @@ CPPUNIT_TEST_FIXTURE(Test, testFuncParam)
{
CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
- m_pDoc->InsertTab (0, "foo"));
+ m_pDoc->InsertTab (0, u"foo"_ustr));
// First, the normal case, with no missing parameters.
- m_pDoc->SetString(0, 0, 0, "=AVERAGE(1;2;3)");
+ m_pDoc->SetString(0, 0, 0, u"=AVERAGE(1;2;3)"_ustr);
m_pDoc->CalcFormulaTree(false, false);
double val = m_pDoc->GetValue(0, 0, 0);
ASSERT_DOUBLES_EQUAL_MESSAGE("incorrect result", 2.0, val);
// Now function with missing parameters. Missing values should be treated
// as zeros.
- m_pDoc->SetString(0, 0, 0, "=AVERAGE(1;;;)");
+ m_pDoc->SetString(0, 0, 0, u"=AVERAGE(1;;;)"_ustr);
m_pDoc->CalcFormulaTree(false, false);
val = m_pDoc->GetValue(0, 0, 0);
ASSERT_DOUBLES_EQUAL_MESSAGE("incorrect result", 0.25, val);
// Conversion of string to numeric argument.
- m_pDoc->SetString(0, 0, 0, "=\"\"+3"); // empty string
- m_pDoc->SetString(0, 1, 0, "=\" \"+3"); // only blank
- m_pDoc->SetString(0, 2, 0, "=\" 4 \"+3"); // number in blanks
- m_pDoc->SetString(0, 3, 0, "=\" x \"+3"); // non-numeric
- m_pDoc->SetString(0, 4, 0, "=\"4.4\"+3"); // locale dependent
+ m_pDoc->SetString(0, 0, 0, u"=\"\"+3"_ustr); // empty string
+ m_pDoc->SetString(0, 1, 0, u"=\" \"+3"_ustr); // only blank
+ m_pDoc->SetString(0, 2, 0, u"=\" 4 \"+3"_ustr); // number in blanks
+ m_pDoc->SetString(0, 3, 0, u"=\" x \"+3"_ustr); // non-numeric
+ m_pDoc->SetString(0, 4, 0, u"=\"4.4\"+3"_ustr); // locale dependent
OUString aVal;
ScCalcConfig aConfig;
@@ -1676,7 +1676,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFuncParam)
val = m_pDoc->GetValue(0, 2, 0);
ASSERT_DOUBLES_EQUAL_MESSAGE("incorrect result", 7.0, val);
aVal = m_pDoc->GetString( 0, 3, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
val = m_pDoc->GetValue(0, 4, 0);
ASSERT_DOUBLES_EQUAL_MESSAGE("incorrect result", 7.4, val);
@@ -1686,13 +1686,13 @@ CPPUNIT_TEST_FIXTURE(Test, testFuncParam)
m_pDoc->SetCalcConfig(aConfig);
m_pDoc->CalcAll();
aVal = m_pDoc->GetString( 0, 0, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
aVal = m_pDoc->GetString( 0, 1, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
val = m_pDoc->GetValue(0, 2, 0);
ASSERT_DOUBLES_EQUAL_MESSAGE("incorrect result", 7.0, val);
aVal = m_pDoc->GetString( 0, 3, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
val = m_pDoc->GetValue(0, 4, 0);
ASSERT_DOUBLES_EQUAL_MESSAGE("incorrect result", 7.4, val);
@@ -1708,9 +1708,9 @@ CPPUNIT_TEST_FIXTURE(Test, testFuncParam)
val = m_pDoc->GetValue(0, 2, 0);
ASSERT_DOUBLES_EQUAL_MESSAGE("incorrect result", 7.0, val);
aVal = m_pDoc->GetString( 0, 3, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
aVal = m_pDoc->GetString( 0, 4, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
// With "Convert only unambiguous" and "Empty string as zero"=False option.
aConfig.meStringConversion = ScCalcConfig::StringConversion::UNAMBIGUOUS;
@@ -1718,15 +1718,15 @@ CPPUNIT_TEST_FIXTURE(Test, testFuncParam)
m_pDoc->SetCalcConfig(aConfig);
m_pDoc->CalcAll();
aVal = m_pDoc->GetString( 0, 0, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
aVal = m_pDoc->GetString( 0, 1, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
m_pDoc->GetValue(0, 2, 0);
ASSERT_DOUBLES_EQUAL_MESSAGE("incorrect result", 7.0, val);
aVal = m_pDoc->GetString( 0, 3, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
aVal = m_pDoc->GetString( 0, 4, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
// With "Treat as zero" ("Empty string as zero" is ignored).
aConfig.meStringConversion = ScCalcConfig::StringConversion::ZERO;
@@ -1750,15 +1750,15 @@ CPPUNIT_TEST_FIXTURE(Test, testFuncParam)
m_pDoc->SetCalcConfig(aConfig);
m_pDoc->CalcAll();
aVal = m_pDoc->GetString( 0, 0, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
aVal = m_pDoc->GetString( 0, 1, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
aVal = m_pDoc->GetString( 0, 2, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
aVal = m_pDoc->GetString( 0, 3, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
aVal = m_pDoc->GetString( 0, 4, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("incorrect result", u"#VALUE!"_ustr, aVal);
m_pDoc->DeleteTab(0);
}
@@ -1772,7 +1772,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNamedRange)
{ "MyRange3", "$Sheet1.$C$1:$C$100", 4 }
};
- CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, "Sheet1"));
+ CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, u"Sheet1"_ustr));
m_pDoc->SetValue (0, 0, 0, 101);
@@ -1794,7 +1794,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNamedRange)
}
// Test usage in formula expression.
- m_pDoc->SetString (1, 0, 0, "=A1/Divisor");
+ m_pDoc->SetString (1, 0, 0, u"=A1/Divisor"_ustr);
m_pDoc->CalcAll();
double result = m_pDoc->GetValue (1, 0, 0);
@@ -1813,10 +1813,10 @@ CPPUNIT_TEST_FIXTURE(Test, testNamedRange)
}
// Test using another-sheet-local name, scope Sheet1.
- ScRangeData* pLocal1 = new ScRangeData( *m_pDoc, "local1", ScAddress(0,0,0));
- ScRangeData* pLocal2 = new ScRangeData( *m_pDoc, "local2", "$Sheet1.$A$1");
- ScRangeData* pLocal3 = new ScRangeData( *m_pDoc, "local3", "Sheet1.$A$1");
- ScRangeData* pLocal4 = new ScRangeData( *m_pDoc, "local4", "$A$1"); // implicit relative sheet reference
+ ScRangeData* pLocal1 = new ScRangeData( *m_pDoc, u"local1"_ustr, ScAddress(0,0,0));
+ ScRangeData* pLocal2 = new ScRangeData( *m_pDoc, u"local2"_ustr, u"$Sheet1.$A$1"_ustr);
+ ScRangeData* pLocal3 = new ScRangeData( *m_pDoc, u"local3"_ustr, u"Sheet1.$A$1"_ustr);
+ ScRangeData* pLocal4 = new ScRangeData( *m_pDoc, u"local4"_ustr, u"$A$1"_ustr); // implicit relative sheet reference
std::unique_ptr<ScRangeName> pLocalRangeName1(new ScRangeName);
pLocalRangeName1->insert(pLocal1);
pLocalRangeName1->insert(pLocal2);
@@ -1824,11 +1824,11 @@ CPPUNIT_TEST_FIXTURE(Test, testNamedRange)
pLocalRangeName1->insert(pLocal4);
m_pDoc->SetRangeName(0, std::move(pLocalRangeName1));
- CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (1, "Sheet2"));
+ CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (1, u"Sheet2"_ustr));
// Use other-sheet-local name of Sheet1 on Sheet2.
ScAddress aPos(1,0,1);
- OUString aFormula("=Sheet1.local1+Sheet1.local2+Sheet1.local3+Sheet1.local4");
+ OUString aFormula(u"=Sheet1.local1+Sheet1.local2+Sheet1.local3+Sheet1.local4"_ustr);
m_pDoc->SetString(aPos, aFormula);
OUString aString = m_pDoc->GetFormula(1,0,1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("formula string should be equal", aFormula, aString);
@@ -1843,7 +1843,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNamedRange)
CPPUNIT_TEST_FIXTURE(Test, testInsertNameList)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
static const RangeNameDef aNames[] = {
{ "MyRange1", "$Test.$A$1:$A$100", 1 },
@@ -1978,7 +1978,7 @@ struct PartiallyFilledEmptyMatrix
else if (nCol == 8 && nRow == 2)
{
CPPUNIT_ASSERT_EQUAL_MESSAGE("element is not of value type", int(ScMatValType::String), static_cast<int>(rVal.nType));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("element value is not what is expected", OUString("Test"), rVal.aStr.getString());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("element value is not what is expected", u"Test"_ustr, rVal.aStr.getString());
}
else if (nCol == 8 && nRow == 11)
{
@@ -2055,7 +2055,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMatrix)
pMat->PutBoolean(true, 1, 1);
pMat->PutDouble(-12.5, 4, 5);
- pMat->PutString(rPool.intern("Test"), 8, 2);
+ pMat->PutString(rPool.intern(u"Test"_ustr), 8, 2);
pMat->PutEmptyPath(8, 11);
checkMatrixElements<PartiallyFilledEmptyMatrix>(*pMat);
@@ -2077,7 +2077,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMatrix)
pMat->PutDouble(-25, 1, 1);
CPPUNIT_ASSERT_EQUAL(-25.0, pMat->GetMinValue(false));
CPPUNIT_ASSERT_EQUAL(-8.0, pMat->GetMaxValue(false));
- pMat->PutString(rPool.intern("Test"), 0, 0);
+ pMat->PutString(rPool.intern(u"Test"_ustr), 0, 0);
CPPUNIT_ASSERT_EQUAL(0.0, pMat->GetMaxValue(true)); // text as zero.
CPPUNIT_ASSERT_EQUAL(-8.0, pMat->GetMaxValue(false)); // ignore text.
pMat->PutBoolean(true, 0, 0);
@@ -2093,7 +2093,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMatrix)
pMat = new ScMatrix(3, 3);
pMat->PutDouble(2.5, 0, 0);
pMat->PutDouble(1.2, 0, 1);
- pMat->PutString(rPool.intern("A"), 1, 1);
+ pMat->PutString(rPool.intern(u"A"_ustr), 1, 1);
pMat->PutDouble(2.3, 2, 1);
pMat->PutDouble(-20, 2, 2);
@@ -2115,7 +2115,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMatrix)
}
pMat2 = new ScMatrix(3, 3, 10.0);
- pMat2->PutString(rPool.intern("B"), 1, 0);
+ pMat2->PutString(rPool.intern(u"B"_ustr), 1, 0);
pMat2->MergeDoubleArrayMultiply(aDoubles);
{
@@ -2133,58 +2133,58 @@ CPPUNIT_TEST_FIXTURE(Test, testMatrix)
CPPUNIT_TEST_FIXTURE(Test, testMatrixComparisonWithErrors)
{
- m_pDoc->InsertTab(0, "foo");
+ m_pDoc->InsertTab(0, u"foo"_ustr);
// Insert the source values in A1:A2.
- m_pDoc->SetString(0, 0, 0, "=1/0");
+ m_pDoc->SetString(0, 0, 0, u"=1/0"_ustr);
m_pDoc->SetValue( 0, 1, 0, 1.0);
// Create a matrix formula in B3:B4 referencing A1:A2 and doing a greater
// than comparison on it's values. Error value must be propagated.
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(1, 2, 1, 3, aMark, "=A1:A2>0");
+ m_pDoc->InsertMatrixFormula(1, 2, 1, 3, aMark, u"=A1:A2>0"_ustr);
- CPPUNIT_ASSERT_EQUAL(OUString("#DIV/0!"), m_pDoc->GetString(0,0,0));
+ CPPUNIT_ASSERT_EQUAL(u"#DIV/0!"_ustr, m_pDoc->GetString(0,0,0));
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue( 0,1,0));
- CPPUNIT_ASSERT_EQUAL(OUString("#DIV/0!"), m_pDoc->GetString(1,2,0));
- CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), m_pDoc->GetString(1,3,0));
+ CPPUNIT_ASSERT_EQUAL(u"#DIV/0!"_ustr, m_pDoc->GetString(1,2,0));
+ CPPUNIT_ASSERT_EQUAL(u"TRUE"_ustr, m_pDoc->GetString(1,3,0));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testMatrixConditionalBooleanResult)
{
- m_pDoc->InsertTab(0, "foo");
+ m_pDoc->InsertTab(0, u"foo"_ustr);
// Create matrix formulas in A1:B1,A2:B2,A3:B3,A4:B4 producing mixed
// boolean and numeric results in an unformatted area.
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula( 0,0, 1,0, aMark, "=IF({1;0};TRUE();42)"); // {TRUE,42}
- m_pDoc->InsertMatrixFormula( 0,1, 1,1, aMark, "=IF({0;1};TRUE();42)"); // {42,1} aim for {42,TRUE}
- m_pDoc->InsertMatrixFormula( 0,2, 1,2, aMark, "=IF({1;0};42;FALSE())"); // {42,0} aim for {42,FALSE}
- m_pDoc->InsertMatrixFormula( 0,3, 1,3, aMark, "=IF({0;1};42;FALSE())"); // {FALSE,42}
-
- CPPUNIT_ASSERT_EQUAL( OUString("TRUE"), m_pDoc->GetString(0,0,0));
- CPPUNIT_ASSERT_EQUAL( OUString("42"), m_pDoc->GetString(1,0,0));
- CPPUNIT_ASSERT_EQUAL( OUString("42"), m_pDoc->GetString(0,1,0));
+ m_pDoc->InsertMatrixFormula( 0,0, 1,0, aMark, u"=IF({1;0};TRUE();42)"_ustr); // {TRUE,42}
+ m_pDoc->InsertMatrixFormula( 0,1, 1,1, aMark, u"=IF({0;1};TRUE();42)"_ustr); // {42,1} aim for {42,TRUE}
+ m_pDoc->InsertMatrixFormula( 0,2, 1,2, aMark, u"=IF({1;0};42;FALSE())"_ustr); // {42,0} aim for {42,FALSE}
+ m_pDoc->InsertMatrixFormula( 0,3, 1,3, aMark, u"=IF({0;1};42;FALSE())"_ustr); // {FALSE,42}
+
+ CPPUNIT_ASSERT_EQUAL( u"TRUE"_ustr, m_pDoc->GetString(0,0,0));
+ CPPUNIT_ASSERT_EQUAL( u"42"_ustr, m_pDoc->GetString(1,0,0));
+ CPPUNIT_ASSERT_EQUAL( u"42"_ustr, m_pDoc->GetString(0,1,0));
//CPPUNIT_ASSERT_EQUAL( OUString("TRUE"), m_pDoc->GetString(1,1,0)); // not yet
- CPPUNIT_ASSERT_EQUAL( OUString("42"), m_pDoc->GetString(0,2,0));
+ CPPUNIT_ASSERT_EQUAL( u"42"_ustr, m_pDoc->GetString(0,2,0));
//CPPUNIT_ASSERT_EQUAL( OUString("FALSE"), m_pDoc->GetString(1,2,0)); // not yet
- CPPUNIT_ASSERT_EQUAL( OUString("FALSE"), m_pDoc->GetString(0,3,0));
- CPPUNIT_ASSERT_EQUAL( OUString("42"), m_pDoc->GetString(1,3,0));
+ CPPUNIT_ASSERT_EQUAL( u"FALSE"_ustr, m_pDoc->GetString(0,3,0));
+ CPPUNIT_ASSERT_EQUAL( u"42"_ustr, m_pDoc->GetString(1,3,0));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testEnterMixedMatrix)
{
- m_pDoc->InsertTab(0, "foo");
+ m_pDoc->InsertTab(0, u"foo"_ustr);
// Insert the source values in A1:B2.
- m_pDoc->SetString(0, 0, 0, "A");
- m_pDoc->SetString(1, 0, 0, "B");
+ m_pDoc->SetString(0, 0, 0, u"A"_ustr);
+ m_pDoc->SetString(1, 0, 0, u"B"_ustr);
double val = 1.0;
m_pDoc->SetValue(0, 1, 0, val);
val = 2.0;
@@ -2193,7 +2193,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEnterMixedMatrix)
// Create a matrix range in A4:B5 referencing A1:B2.
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(0, 3, 1, 4, aMark, "=A1:B2");
+ m_pDoc->InsertMatrixFormula(0, 3, 1, 4, aMark, u"=A1:B2"_ustr);
CPPUNIT_ASSERT_EQUAL(m_pDoc->GetString(0,0,0), m_pDoc->GetString(0,3,0));
CPPUNIT_ASSERT_EQUAL(m_pDoc->GetString(1,0,0), m_pDoc->GetString(1,3,0));
@@ -2207,20 +2207,20 @@ CPPUNIT_TEST_FIXTURE(Test, testMatrixEditable)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Values in A1:B1.
m_pDoc->SetValue(ScAddress(0,0,0), 1.0);
m_pDoc->SetValue(ScAddress(1,0,0), 2.0);
// A2 is a normal formula.
- m_pDoc->SetString(ScAddress(0,1,0), "=5");
+ m_pDoc->SetString(ScAddress(0,1,0), u"=5"_ustr);
// A3:A4 is a matrix.
ScRange aMatRange(0,2,0,0,3,0);
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SetMarkArea(aMatRange);
- m_pDoc->InsertMatrixFormula(0, 2, 0, 3, aMark, "=TRANSPOSE(A1:B1)");
+ m_pDoc->InsertMatrixFormula(0, 2, 0, 3, aMark, u"=TRANSPOSE(A1:B1)"_ustr);
// Check their values.
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(ScAddress(0,1,0)));
@@ -2248,11 +2248,11 @@ CPPUNIT_TEST_FIXTURE(Test, testMatrixEditable)
CPPUNIT_TEST_FIXTURE(Test, testCellCopy)
{
- m_pDoc->InsertTab(0, "TestTab");
+ m_pDoc->InsertTab(0, u"TestTab"_ustr);
ScAddress aSrc(0,0,0);
ScAddress aDest(0,1,0);
- OUString aStr("please copy me");
- m_pDoc->SetString(aSrc, "please copy me");
+ OUString aStr(u"please copy me"_ustr);
+ m_pDoc->SetString(aSrc, u"please copy me"_ustr);
CPPUNIT_ASSERT_EQUAL(aStr, m_pDoc->GetString(aSrc));
// copy to self - why not ?
m_pDoc->CopyCellToDocument(aSrc,aDest,*m_pDoc);
@@ -2261,7 +2261,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCellCopy)
CPPUNIT_TEST_FIXTURE(Test, testSheetCopy)
{
- m_pDoc->InsertTab(0, "TestTab");
+ m_pDoc->InsertTab(0, u"TestTab"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("document should have one sheet to begin with.",
static_cast<SCTAB>(1), m_pDoc->GetTableCount());
@@ -2269,15 +2269,15 @@ CPPUNIT_TEST_FIXTURE(Test, testSheetCopy)
m_pDoc->InitDrawLayer(m_xDocShell.get());
// Insert text in A1.
- m_pDoc->SetString(ScAddress(0,0,0), "copy me");
+ m_pDoc->SetString(ScAddress(0,0,0), u"copy me"_ustr);
// Insert edit cells in B1:B3.
ScFieldEditEngine& rEE = m_pDoc->GetEditEngine();
- rEE.SetTextCurrentDefaults("Edit 1");
+ rEE.SetTextCurrentDefaults(u"Edit 1"_ustr);
m_pDoc->SetEditText(ScAddress(1,0,0), rEE.CreateTextObject());
- rEE.SetTextCurrentDefaults("Edit 2");
+ rEE.SetTextCurrentDefaults(u"Edit 2"_ustr);
m_pDoc->SetEditText(ScAddress(1,1,0), rEE.CreateTextObject());
- rEE.SetTextCurrentDefaults("Edit 3");
+ rEE.SetTextCurrentDefaults(u"Edit 3"_ustr);
m_pDoc->SetEditText(ScAddress(1,2,0), rEE.CreateTextObject());
SCROW nRow1, nRow2;
@@ -2289,7 +2289,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSheetCopy)
// insert a note
ScAddress aAdrA1 (0,2,0); // empty cell content.
ScPostIt *pNoteA1 = m_pDoc->GetOrCreateNote(aAdrA1);
- pNoteA1->SetText(aAdrA1, "Hello world in A3");
+ pNoteA1->SetText(aAdrA1, u"Hello world in A3"_ustr);
// Copy and test the result.
m_pDoc->CopyTab(0, 1);
@@ -2301,18 +2301,18 @@ CPPUNIT_TEST_FIXTURE(Test, testSheetCopy)
CPPUNIT_ASSERT_EQUAL_MESSAGE("copied sheet should also have all rows visible as the original.", SCROW(0), nRow1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("copied sheet should also have all rows visible as the original.", m_pDoc->MaxRow(), nRow2);
CPPUNIT_ASSERT_MESSAGE("There should be note on A3 in new sheet", m_pDoc->HasNote(ScAddress(0,2,1)));
- CPPUNIT_ASSERT_EQUAL(OUString("copy me"), m_pDoc->GetString(ScAddress(0,0,1)));
+ CPPUNIT_ASSERT_EQUAL(u"copy me"_ustr, m_pDoc->GetString(ScAddress(0,0,1)));
// Check the copied edit cells.
const EditTextObject* pEditObj = m_pDoc->GetEditText(ScAddress(1,0,1));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell in B1.", pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("Edit 1"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"Edit 1"_ustr, pEditObj->GetText(0));
pEditObj = m_pDoc->GetEditText(ScAddress(1,1,1));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell in B2.", pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("Edit 2"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"Edit 2"_ustr, pEditObj->GetText(0));
pEditObj = m_pDoc->GetEditText(ScAddress(1,2,1));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell in B3.", pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("Edit 3"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"Edit 3"_ustr, pEditObj->GetText(0));
m_pDoc->DeleteTab(1);
@@ -2352,7 +2352,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSheetCopy)
CPPUNIT_TEST_FIXTURE(Test, testSheetMove)
{
- m_pDoc->InsertTab(0, "TestTab1");
+ m_pDoc->InsertTab(0, u"TestTab1"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("document should have one sheet to begin with.", static_cast<SCTAB>(1), m_pDoc->GetTableCount());
SCROW nRow1, nRow2;
bool bHidden = m_pDoc->RowHidden(0, 0, &nRow1, &nRow2);
@@ -2361,7 +2361,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSheetMove)
CPPUNIT_ASSERT_EQUAL_MESSAGE("new sheet should have all rows visible", m_pDoc->MaxRow(), nRow2);
//test if inserting before another sheet works
- m_pDoc->InsertTab(0, "TestTab2");
+ m_pDoc->InsertTab(0, u"TestTab2"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("document should have two sheets", static_cast<SCTAB>(2), m_pDoc->GetTableCount());
bHidden = m_pDoc->RowHidden(0, 0, &nRow1, &nRow2);
CPPUNIT_ASSERT_MESSAGE("new sheet should have all rows visible", !bHidden);
@@ -2377,7 +2377,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSheetMove)
CPPUNIT_ASSERT_EQUAL_MESSAGE("copied sheet should also have all rows visible as the original.", m_pDoc->MaxRow(), nRow2);
OUString aName;
m_pDoc->GetName(0, aName);
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "sheets should have changed places", OUString("TestTab1"), aName);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "sheets should have changed places", u"TestTab1"_ustr, aName);
m_pDoc->SetRowHidden(5, 10, 0, true);
bHidden = m_pDoc->RowHidden(0, 0, &nRow1, &nRow2);
@@ -2409,14 +2409,14 @@ CPPUNIT_TEST_FIXTURE(Test, testSheetMove)
CPPUNIT_ASSERT_EQUAL_MESSAGE("rows 11 - maxrow should be visible", SCROW(11), nRow1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("rows 11 - maxrow should be visible", m_pDoc->MaxRow(), nRow2);
m_pDoc->GetName(0, aName);
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "sheets should have changed places", OUString("TestTab2"), aName);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "sheets should have changed places", u"TestTab2"_ustr, aName);
m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testDataArea)
{
- m_pDoc->InsertTab(0, "Data");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
// Totally empty sheet should be rightfully considered empty in all accounts.
CPPUNIT_ASSERT_MESSAGE("Sheet is expected to be empty.", m_pDoc->IsPrintEmpty(0, 0, 100, 100, 0));
@@ -2439,7 +2439,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDataArea)
m_pDoc->IsBlockEmpty(0, 0, 100, 100, 0));
// Adding a real cell content should turn the block non-empty.
- m_pDoc->SetString(0, 0, 0, "Some text");
+ m_pDoc->SetString(0, 0, 0, u"Some text"_ustr);
CPPUNIT_ASSERT_MESSAGE("Now the block should not be empty with a real cell content.",
!m_pDoc->IsBlockEmpty(0, 0, 100, 100, 0));
@@ -2453,14 +2453,14 @@ CPPUNIT_TEST_FIXTURE(Test, testStreamValid)
/**
* Make sure the sheet streams are invalidated properly.
*/
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
- m_pDoc->InsertTab(2, "Sheet3");
- m_pDoc->InsertTab(3, "Sheet4");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
+ m_pDoc->InsertTab(2, u"Sheet3"_ustr);
+ m_pDoc->InsertTab(3, u"Sheet4"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("We should have 4 sheet instances.", static_cast<SCTAB>(4), m_pDoc->GetTableCount());
- OUString a1("A1");
- OUString a2("A2");
+ OUString a1(u"A1"_ustr);
+ OUString a2(u"A2"_ustr);
OUString test;
// Put values into Sheet1.
@@ -2472,10 +2472,10 @@ CPPUNIT_TEST_FIXTURE(Test, testStreamValid)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected value in Sheet1.A2", test, a2);
// Put formulas into Sheet2 to Sheet4 to reference values from Sheet1.
- m_pDoc->SetString(0, 0, 1, "=Sheet1.A1");
- m_pDoc->SetString(0, 1, 1, "=Sheet1.A2");
- m_pDoc->SetString(0, 0, 2, "=Sheet1.A1");
- m_pDoc->SetString(0, 0, 3, "=Sheet1.A2");
+ m_pDoc->SetString(0, 0, 1, u"=Sheet1.A1"_ustr);
+ m_pDoc->SetString(0, 1, 1, u"=Sheet1.A2"_ustr);
+ m_pDoc->SetString(0, 0, 2, u"=Sheet1.A1"_ustr);
+ m_pDoc->SetString(0, 0, 3, u"=Sheet1.A2"_ustr);
test = m_pDoc->GetString(0, 0, 1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected value in Sheet2.A1", test, a1);
@@ -3019,7 +3019,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFunctionLists)
CPPUNIT_TEST_FIXTURE(Test, testGraphicsInGroup)
{
- m_pDoc->InsertTab(0, "TestTab");
+ m_pDoc->InsertTab(0, u"TestTab"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("document should have one sheet to begin with.",
static_cast<SCTAB>(1), m_pDoc->GetTableCount());
SCROW nRow1, nRow2;
@@ -3139,8 +3139,8 @@ CPPUNIT_TEST_FIXTURE(Test, testGraphicsInGroup)
CPPUNIT_TEST_FIXTURE(Test, testGraphicsOnSheetMove)
{
- m_pDoc->InsertTab(0, "Tab1");
- m_pDoc->InsertTab(1, "Tab2");
+ m_pDoc->InsertTab(0, u"Tab1"_ustr);
+ m_pDoc->InsertTab(1, u"Tab2"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be only 2 sheets to begin with", static_cast<SCTAB>(2), m_pDoc->GetTableCount());
m_pDoc->InitDrawLayer();
@@ -3168,7 +3168,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGraphicsOnSheetMove)
// Insert a new sheet at left-end, and make sure the object has moved to
// the 2nd page.
- m_pDoc->InsertTab(0, "NewTab");
+ m_pDoc->InsertTab(0, u"NewTab"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be 3 sheets.", static_cast<SCTAB>(3), m_pDoc->GetTableCount());
pPage = pDrawLayer->GetPage(0);
CPPUNIT_ASSERT_MESSAGE("1st sheet should have no object.", pPage);
@@ -3234,12 +3234,12 @@ CPPUNIT_TEST_FIXTURE(Test, testToggleRefFlag)
// the document, as ScRefFinder does not depend on the content of the
// document except for the sheet names.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
{
// Calc A1: basic 2D reference
- OUString aFormula("=B100");
+ OUString aFormula(u"=B100"_ustr);
ScAddress aPos(1, 5, 0);
ScRefFinder aFinder(aFormula, aPos, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
@@ -3249,28 +3249,28 @@ CPPUNIT_TEST_FIXTURE(Test, testToggleRefFlag)
// column relative / row relative -> column absolute / row absolute
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong conversion.", OUString("=$B$100"), aFormula );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong conversion.", u"=$B$100"_ustr, aFormula );
// column absolute / row absolute -> column relative / row absolute
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong conversion.", OUString("=B$100"), aFormula );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong conversion.", u"=B$100"_ustr, aFormula );
// column relative / row absolute -> column absolute / row relative
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong conversion.", OUString("=$B100"), aFormula );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong conversion.", u"=$B100"_ustr, aFormula );
// column absolute / row relative -> column relative / row relative
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong conversion.", OUString("=B100"), aFormula );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong conversion.", u"=B100"_ustr, aFormula );
}
{
// Excel R1C1: basic 2D reference
- OUString aFormula("=R2C1");
+ OUString aFormula(u"=R2C1"_ustr);
ScAddress aPos(3, 5, 0);
ScRefFinder aFinder(aFormula, aPos, *m_pDoc, formula::FormulaGrammar::CONV_XL_R1C1);
@@ -3280,28 +3280,28 @@ CPPUNIT_TEST_FIXTURE(Test, testToggleRefFlag)
// column absolute / row absolute -> column relative / row absolute
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL(OUString("=R2C[-3]"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=R2C[-3]"_ustr, aFormula);
// column relative / row absolute - > column absolute / row relative
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL(OUString("=R[-4]C1"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=R[-4]C1"_ustr, aFormula);
// column absolute / row relative -> column relative / row relative
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL(OUString("=R[-4]C[-3]"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=R[-4]C[-3]"_ustr, aFormula);
// column relative / row relative -> column absolute / row absolute
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL(OUString("=R2C1"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=R2C1"_ustr, aFormula);
}
{
// Excel R1C1: Selection at the end of the formula string and does not
// overlap the formula string at all (inspired by fdo#39135).
- OUString aFormula("=R1C1");
+ OUString aFormula(u"=R1C1"_ustr);
ScAddress aPos(1, 1, 0);
ScRefFinder aFinder(aFormula, aPos, *m_pDoc, formula::FormulaGrammar::CONV_XL_R1C1);
@@ -3312,30 +3312,30 @@ CPPUNIT_TEST_FIXTURE(Test, testToggleRefFlag)
sal_Int32 n = aFormula.getLength();
aFinder.ToggleRel(n, n);
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL(OUString("=R1C[-1]"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=R1C[-1]"_ustr, aFormula);
// Make the row relative.
n = aFormula.getLength();
aFinder.ToggleRel(n, n);
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL(OUString("=R[-1]C1"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=R[-1]C1"_ustr, aFormula);
// Make both relative.
n = aFormula.getLength();
aFinder.ToggleRel(n, n);
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL(OUString("=R[-1]C[-1]"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=R[-1]C[-1]"_ustr, aFormula);
// Back to the original.
n = aFormula.getLength();
aFinder.ToggleRel(n, n);
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL(OUString("=R1C1"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=R1C1"_ustr, aFormula);
}
{
// Calc A1:
- OUString aFormula("=A1+4");
+ OUString aFormula(u"=A1+4"_ustr);
ScAddress aPos(1, 1, 0);
ScRefFinder aFinder(aFormula, aPos, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
@@ -3345,19 +3345,19 @@ CPPUNIT_TEST_FIXTURE(Test, testToggleRefFlag)
// Set the cursor over the 'A1' part and toggle.
aFinder.ToggleRel(2, 2);
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL(OUString("=$A$1+4"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=$A$1+4"_ustr, aFormula);
aFinder.ToggleRel(2, 2);
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL(OUString("=A$1+4"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=A$1+4"_ustr, aFormula);
aFinder.ToggleRel(2, 2);
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL(OUString("=$A1+4"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=$A1+4"_ustr, aFormula);
aFinder.ToggleRel(2, 2);
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_EQUAL(OUString("=A1+4"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=A1+4"_ustr, aFormula);
}
// TODO: Add more test cases esp. for 3D references, Excel A1 syntax, and
@@ -3368,7 +3368,7 @@ CPPUNIT_TEST_FIXTURE(Test, testToggleRefFlag)
CPPUNIT_TEST_FIXTURE(Test, testAutofilter)
{
- m_pDoc->InsertTab( 0, "Test" );
+ m_pDoc->InsertTab( 0, u"Test"_ustr );
// cell contents (0 = empty cell)
const char* aData[][3] = {
@@ -3388,7 +3388,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAutofilter)
if (aData[i][j])
m_pDoc->SetString(j, i, 0, OUString::createFromAscii(aData[i][j]));
- ScDBData* pDBData = new ScDBData("NONAME", 0, 0, 0, nCols-1, nRows-1);
+ ScDBData* pDBData = new ScDBData(u"NONAME"_ustr, 0, 0, 0, nCols-1, nRows-1);
m_pDoc->SetAnonymousDBData(0, std::unique_ptr<ScDBData>(pDBData));
pDBData->SetAutoFilter(true);
@@ -3478,9 +3478,9 @@ CPPUNIT_TEST_FIXTURE(Test, testAutofilter)
CPPUNIT_TEST_FIXTURE(Test, testAutoFilterTimeValue)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(ScAddress(0,0,0), "Hours");
+ m_pDoc->SetString(ScAddress(0,0,0), u"Hours"_ustr);
m_pDoc->SetValue(ScAddress(0,1,0), 72.3604166666671);
m_pDoc->SetValue(ScAddress(0,2,0), 265);
@@ -3499,8 +3499,8 @@ CPPUNIT_TEST_FIXTURE(Test, testAutoFilterTimeValue)
printRange(m_pDoc, ScRange(0,0,0,0,2,0), "Data"); // A1:A3
// Make sure the hour:minute:second format is really applied.
- CPPUNIT_ASSERT_EQUAL(OUString("1736:39:00"), m_pDoc->GetString(ScAddress(0,1,0))); // A2
- CPPUNIT_ASSERT_EQUAL(OUString("6360:00:00"), m_pDoc->GetString(ScAddress(0,2,0))); // A3
+ CPPUNIT_ASSERT_EQUAL(u"1736:39:00"_ustr, m_pDoc->GetString(ScAddress(0,1,0))); // A2
+ CPPUNIT_ASSERT_EQUAL(u"6360:00:00"_ustr, m_pDoc->GetString(ScAddress(0,2,0))); // A3
// Filter by the A2 value. Only A1 and A2 should be visible.
ScQueryParam aParam;
@@ -3509,7 +3509,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAutoFilterTimeValue)
rEntry.bDoQuery = true;
rEntry.nField = 0;
rEntry.eOp = SC_EQUAL;
- rEntry.GetQueryItem().maString = m_pDoc->GetSharedStringPool().intern("1736:39:00");
+ rEntry.GetQueryItem().maString = m_pDoc->GetSharedStringPool().intern(u"1736:39:00"_ustr);
rEntry.GetQueryItem().meType = ScQueryEntry::ByString;
pDBData->SetQueryParam(aParam);
@@ -3527,14 +3527,14 @@ CPPUNIT_TEST_FIXTURE(Test, testAutoFilterTimeValue)
CPPUNIT_TEST_FIXTURE(Test, testAutofilterOptimizations)
{
- m_pDoc->InsertTab( 0, "Test" );
+ m_pDoc->InsertTab( 0, u"Test"_ustr );
constexpr SCCOL nCols = 4;
constexpr SCROW nRows = 200;
- m_pDoc->SetString(0, 0, 0, "Column1");
- m_pDoc->SetString(1, 0, 0, "Column2");
- m_pDoc->SetString(2, 0, 0, "Column3");
- m_pDoc->SetString(3, 0, 0, "Column4");
+ m_pDoc->SetString(0, 0, 0, u"Column1"_ustr);
+ m_pDoc->SetString(1, 0, 0, u"Column2"_ustr);
+ m_pDoc->SetString(2, 0, 0, u"Column3"_ustr);
+ m_pDoc->SetString(3, 0, 0, u"Column4"_ustr);
// Fill 1st column with 0-199, 2nd with 1-200, 3rd with "1000"-"1199", 4th with "1001-1200"
// (the pairs are off by one to each other to check filtering out a value filters out
@@ -3547,7 +3547,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAutofilterOptimizations)
m_pDoc->SetString(3, i + 1, 0, "val" + OUString::number(i+1000+1));
}
- ScDBData* pDBData = new ScDBData("NONAME", 0, 0, 0, nCols, nRows);
+ ScDBData* pDBData = new ScDBData(u"NONAME"_ustr, 0, 0, 0, nCols, nRows);
m_pDoc->SetAnonymousDBData(0, std::unique_ptr<ScDBData>(pDBData));
pDBData->SetAutoFilter(true);
@@ -3631,12 +3631,12 @@ CPPUNIT_TEST_FIXTURE(Test, testAutofilterOptimizations)
CPPUNIT_TEST_FIXTURE(Test, testTdf76441)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// The result will be different depending on whether the format is set before
// or after inserting the string
- OUString aCode = "MM:SS";
+ OUString aCode = u"MM:SS"_ustr;
sal_Int32 nCheckPos;
SvNumFormatType nType;
sal_uInt32 nFormat;
@@ -3648,23 +3648,23 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf76441)
rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat));
{
// First insert the string, then the format
- m_pDoc->SetString(ScAddress(0,0,0), "01:20");
+ m_pDoc->SetString(ScAddress(0,0,0), u"01:20"_ustr);
m_pDoc->ApplyPattern(0, 0, 0, aNewAttrs);
- CPPUNIT_ASSERT_EQUAL(OUString("20:00"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"20:00"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
}
{
// First set the format, then insert the string
m_pDoc->ApplyPattern(0, 1, 0, aNewAttrs);
- m_pDoc->SetString(ScAddress(0,1,0), "01:20");
+ m_pDoc->SetString(ScAddress(0,1,0), u"01:20"_ustr);
// Without the fix in place, this test would have failed with
// - Expected: 01:20
// - Actual : 20:00
- CPPUNIT_ASSERT_EQUAL(OUString("01:20"), m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"01:20"_ustr, m_pDoc->GetString(ScAddress(0,1,0)));
}
m_pDoc->DeleteTab(0);
@@ -3672,9 +3672,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf76441)
CPPUNIT_TEST_FIXTURE(Test, testTdf76836)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- OUString aCode = "\"192.168.0.\"@";
+ OUString aCode = u"\"192.168.0.\"@"_ustr;
sal_Int32 nCheckPos;
SvNumFormatType nType;
sal_uInt32 nFormat;
@@ -3691,37 +3691,37 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf76836)
// Without the fix in place, this test would have failed with
// - Expected: 10
// - Actual : 192.168.0.10
- CPPUNIT_ASSERT_EQUAL(OUString("10"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"10"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
m_pDoc->ApplyPattern(0, 1, 0, aNewAttrs);
- m_pDoc->SetString(ScAddress(0,1,0), "10");
- CPPUNIT_ASSERT_EQUAL(OUString("192.168.0.10"), m_pDoc->GetString(ScAddress(0,1,0)));
+ m_pDoc->SetString(ScAddress(0,1,0), u"10"_ustr);
+ CPPUNIT_ASSERT_EQUAL(u"192.168.0.10"_ustr, m_pDoc->GetString(ScAddress(0,1,0)));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf151752)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(ScAddress(0,0,0), "66000:00");
+ m_pDoc->SetString(ScAddress(0,0,0), u"66000:00"_ustr);
// Without the fix in place, this test would have failed with
// - Expected: 66000:00:00
// - Actual : 464:00:00
- CPPUNIT_ASSERT_EQUAL(OUString("66000:00:00"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"66000:00:00"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf142186)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// The result will be different depending on whether the format is set before
// or after inserting the string
- OUString aCode = "0\".\"0";
+ OUString aCode = u"0\".\"0"_ustr;
sal_Int32 nCheckPos;
SvNumFormatType nType;
sal_uInt32 nFormat;
@@ -3733,23 +3733,23 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142186)
rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat));
{
// First insert the string, then the format
- m_pDoc->SetString(ScAddress(0,0,0), "123.45");
+ m_pDoc->SetString(ScAddress(0,0,0), u"123.45"_ustr);
m_pDoc->ApplyPattern(0, 0, 0, aNewAttrs);
- CPPUNIT_ASSERT_EQUAL(OUString("12.3"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"12.3"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
}
{
// First set the format, then insert the string
m_pDoc->ApplyPattern(0, 1, 0, aNewAttrs);
- m_pDoc->SetString(ScAddress(0,1,0), "123.45");
+ m_pDoc->SetString(ScAddress(0,1,0), u"123.45"_ustr);
// Without the fix in place, this test would have failed with
// - Expected: 12.3
// - Actual : 1234.5
- CPPUNIT_ASSERT_EQUAL(OUString("12.3"), m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"12.3"_ustr, m_pDoc->GetString(ScAddress(0,1,0)));
}
m_pDoc->DeleteTab(0);
@@ -3757,7 +3757,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142186)
CPPUNIT_TEST_FIXTURE(Test, testTdf137063)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
m_pDoc->SetValue(0,0,0, 0.000000006);
m_pDoc->SetValue(0,1,0, 0.0000000006);
@@ -3765,17 +3765,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf137063)
// Without the fix in place, this test would have failed with
// - Expected: 0.000000006
// - Actual : 6E-09
- CPPUNIT_ASSERT_EQUAL(OUString("0.000000006"), m_pDoc->GetString(ScAddress(0,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("6E-10"), m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"0.000000006"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"6E-10"_ustr, m_pDoc->GetString(ScAddress(0,1,0)));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf126342)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- OUString aCode = "YYYY-MM-DD";
+ OUString aCode = u"YYYY-MM-DD"_ustr;
sal_Int32 nCheckPos;
SvNumFormatType nType;
sal_uInt32 nFormat;
@@ -3787,24 +3787,24 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126342)
rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat));
m_pDoc->ApplyPattern(0, 0, 0, aNewAttrs);
- m_pDoc->SetString(ScAddress(0,0,0), "11/7/19");
+ m_pDoc->SetString(ScAddress(0,0,0), u"11/7/19"_ustr);
- CPPUNIT_ASSERT_EQUAL(OUString("2019-11-07"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"2019-11-07"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
// Overwrite the existing date with the exact same input
- m_pDoc->SetString(ScAddress(0,0,0), "11/7/19");
+ m_pDoc->SetString(ScAddress(0,0,0), u"11/7/19"_ustr);
// Without the fix in place, this test would have failed with
// - Expected: 2019-11-07
// - Actual : 2011-07-19
- CPPUNIT_ASSERT_EQUAL(OUString("2019-11-07"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"2019-11-07"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testAdvancedFilter)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// cell contents (nullptr = empty cell)
std::vector<std::vector<const char*>> aData = {
@@ -3876,7 +3876,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAdvancedFilter)
aItems = aEntry.GetQueryItems();
CPPUNIT_ASSERT_EQUAL(size_t(1), aItems.size());
CPPUNIT_ASSERT_EQUAL(ScQueryEntry::ByString, aItems[0].meType);
- CPPUNIT_ASSERT_EQUAL(OUString("R"), aItems[0].maString.getString());
+ CPPUNIT_ASSERT_EQUAL(u"R"_ustr, aItems[0].maString.getString());
// perform the query.
m_pDoc->Query(0, aQueryParam, true);
@@ -3901,16 +3901,16 @@ CPPUNIT_TEST_FIXTURE(Test, testAdvancedFilter)
CPPUNIT_TEST_FIXTURE(Test, testDateFilterContains)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
constexpr SCCOL nCols = 1;
constexpr SCROW nRows = 5;
- m_pDoc->SetString(0, 0, 0, "Date");
- m_pDoc->SetString(0, 1, 0, "1/2/2021");
- m_pDoc->SetString(0, 2, 0, "2/1/1999");
- m_pDoc->SetString(0, 3, 0, "2/1/1997");
- m_pDoc->SetString(0, 4, 0, "3/3/2001");
- m_pDoc->SetString(0, 5, 0, "3/3/1996");
+ m_pDoc->SetString(0, 0, 0, u"Date"_ustr);
+ m_pDoc->SetString(0, 1, 0, u"1/2/2021"_ustr);
+ m_pDoc->SetString(0, 2, 0, u"2/1/1999"_ustr);
+ m_pDoc->SetString(0, 3, 0, u"2/1/1997"_ustr);
+ m_pDoc->SetString(0, 4, 0, u"3/3/2001"_ustr);
+ m_pDoc->SetString(0, 5, 0, u"3/3/1996"_ustr);
// Set the fields as dates.
SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
@@ -3920,7 +3920,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDateFilterContains)
rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat));
m_pDoc->ApplyPatternAreaTab(0, 1, 0, 5, 0, aNewAttrs); // apply it to A1:A6
- ScDBData* pDBData = new ScDBData("NONAME", 0, 0, 0, nCols, nRows);
+ ScDBData* pDBData = new ScDBData(u"NONAME"_ustr, 0, 0, 0, nCols, nRows);
m_pDoc->SetAnonymousDBData(0, std::unique_ptr<ScDBData>(pDBData));
pDBData->SetAutoFilter(true);
@@ -3937,7 +3937,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDateFilterContains)
rEntry.bDoQuery = true;
rEntry.nField = 0;
rEntry.eOp = SC_CONTAINS;
- rEntry.GetQueryItem().maString = m_pDoc->GetSharedStringPool().intern("2");
+ rEntry.GetQueryItem().maString = m_pDoc->GetSharedStringPool().intern(u"2"_ustr);
pDBData->SetQueryParam(aParam);
// perform the query.
@@ -3955,31 +3955,31 @@ CPPUNIT_TEST_FIXTURE(Test, testDateFilterContains)
CPPUNIT_TEST_FIXTURE(Test, testTdf98642)
{
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->SetString(0, 0, 0, "test");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->SetString(0, 0, 0, u"test"_ustr);
- ScRangeData* pName1 = new ScRangeData( *m_pDoc, "name1", "$Sheet1.$A$1");
- ScRangeData* pName2 = new ScRangeData( *m_pDoc, "name2", "$Sheet1.$A$1");
+ ScRangeData* pName1 = new ScRangeData( *m_pDoc, u"name1"_ustr, u"$Sheet1.$A$1"_ustr);
+ ScRangeData* pName2 = new ScRangeData( *m_pDoc, u"name2"_ustr, u"$Sheet1.$A$1"_ustr);
std::unique_ptr<ScRangeName> pGlobalRangeName(new ScRangeName());
pGlobalRangeName->insert(pName1);
pGlobalRangeName->insert(pName2);
m_pDoc->SetRangeName(std::move(pGlobalRangeName));
- m_pDoc->SetString(1, 0, 0, "=name1");
- m_pDoc->SetString(1, 1, 0, "=name2");
+ m_pDoc->SetString(1, 0, 0, u"=name1"_ustr);
+ m_pDoc->SetString(1, 1, 0, u"=name2"_ustr);
- CPPUNIT_ASSERT_EQUAL(OUString("test"), m_pDoc->GetString(1, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("test"), m_pDoc->GetString(1, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"test"_ustr, m_pDoc->GetString(1, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"test"_ustr, m_pDoc->GetString(1, 1, 0));
OUString aFormula = m_pDoc->GetFormula(1,0,0);
- CPPUNIT_ASSERT_EQUAL(OUString("=name1"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=name1"_ustr, aFormula);
aFormula = m_pDoc->GetFormula(1,1,0);
// Without the fix in place, this test would have failed with
// - Expected: =name2
// - Actual : =name1
- CPPUNIT_ASSERT_EQUAL(OUString("=name2"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=name2"_ustr, aFormula);
m_pDoc->DeleteTab(0);
}
@@ -3988,7 +3988,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMergedCells)
{
//test merge and unmerge
//TODO: an undo/redo test for this would be a good idea
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
m_pDoc->DoMerge(1, 1, 3, 3, 0, false);
SCCOL nEndCol = 1;
SCROW nEndRow = 1;
@@ -4011,11 +4011,11 @@ CPPUNIT_TEST_FIXTURE(Test, testRenameTable)
//TODO: set name1 and name2 and do an undo to check if name 1 is set now
//TODO: also check if new name for table is same as another table
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
//test case 1 , rename table2 to sheet 1, it should return error
- OUString nameToSet = "Sheet1";
+ OUString nameToSet = u"Sheet1"_ustr;
ScDocFunc& rDocFunc = m_xDocShell->GetDocFunc();
CPPUNIT_ASSERT_MESSAGE("name same as another table is being set", !rDocFunc.RenameTable(1,nameToSet,false,true) );
@@ -4055,7 +4055,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSetBackgroundColor)
//test set background color
//TODO: set color1 and set color2 and do an undo to check if color1 is set now.
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
Color aColor;
//test yellow
@@ -4084,16 +4084,16 @@ CPPUNIT_TEST_FIXTURE(Test, testUpdateReference)
{
//test that formulas are correctly updated during sheet delete
//TODO: add tests for relative references, updating of named ranges, ...
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
- m_pDoc->InsertTab(2, "Sheet3");
- m_pDoc->InsertTab(3, "Sheet4");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
+ m_pDoc->InsertTab(2, u"Sheet3"_ustr);
+ m_pDoc->InsertTab(3, u"Sheet4"_ustr);
m_pDoc->SetValue(0,0,2, 1);
m_pDoc->SetValue(1,0,2, 2);
m_pDoc->SetValue(1,1,3, 4);
- m_pDoc->SetString(2,0,2, "=A1+B1");
- m_pDoc->SetString(2,1,2, "=Sheet4.B2+A1");
+ m_pDoc->SetString(2,0,2, u"=A1+B1"_ustr);
+ m_pDoc->SetString(2,1,2, u"=Sheet4.B2+A1"_ustr);
double aValue;
aValue = m_pDoc->GetValue(2,0,2);
@@ -4115,13 +4115,13 @@ CPPUNIT_TEST_FIXTURE(Test, testUpdateReference)
ASSERT_DOUBLES_EQUAL_MESSAGE("after deleting second sheet formula does not return correct result", 5, aValue);
//test adding two sheets
- m_pDoc->InsertTab(0, "Sheet2");
+ m_pDoc->InsertTab(0, u"Sheet2"_ustr);
aValue = m_pDoc->GetValue(2,0,1);
ASSERT_DOUBLES_EQUAL_MESSAGE("after inserting first sheet formula does not return correct result", 3, aValue);
aValue = m_pDoc->GetValue(2,1,1);
ASSERT_DOUBLES_EQUAL_MESSAGE("after inserting first sheet formula does not return correct result", 5, aValue);
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
aValue = m_pDoc->GetValue(2,0,2);
ASSERT_DOUBLES_EQUAL_MESSAGE("after inserting second sheet formula does not return correct result", 3, aValue);
aValue = m_pDoc->GetValue(2,1,2);
@@ -4151,10 +4151,10 @@ CPPUNIT_TEST_FIXTURE(Test, testUpdateReference)
// Test positional update and invalidation of lookup cache for insertion
// and deletion within entire column reference.
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
- m_pDoc->SetString(0,1,0, "s1");
- m_pDoc->SetString(0,0,1, "=MATCH(\"s1\";Sheet1.A:A;0)");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
+ m_pDoc->SetString(0,1,0, u"s1"_ustr);
+ m_pDoc->SetString(0,0,1, u"=MATCH(\"s1\";Sheet1.A:A;0)"_ustr);
aValue = m_pDoc->GetValue(0,0,1);
ASSERT_DOUBLES_EQUAL_MESSAGE("unexpected MATCH result", 2, aValue);
m_pDoc->InsertRow(0,0,m_pDoc->MaxCol(),0,0,1); // insert 1 row before row 1 in Sheet1
@@ -4169,18 +4169,18 @@ CPPUNIT_TEST_FIXTURE(Test, testUpdateReference)
CPPUNIT_TEST_FIXTURE(Test, testSearchCells)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(ScAddress(0,0,0), "A");
- m_pDoc->SetString(ScAddress(0,1,0), "B");
- m_pDoc->SetString(ScAddress(0,2,0), "A");
+ m_pDoc->SetString(ScAddress(0,0,0), u"A"_ustr);
+ m_pDoc->SetString(ScAddress(0,1,0), u"B"_ustr);
+ m_pDoc->SetString(ScAddress(0,2,0), u"A"_ustr);
// Leave A4 blank.
- m_pDoc->SetString(ScAddress(0,4,0), "A");
- m_pDoc->SetString(ScAddress(0,5,0), "B");
- m_pDoc->SetString(ScAddress(0,6,0), "C");
+ m_pDoc->SetString(ScAddress(0,4,0), u"A"_ustr);
+ m_pDoc->SetString(ScAddress(0,5,0), u"B"_ustr);
+ m_pDoc->SetString(ScAddress(0,6,0), u"C"_ustr);
SvxSearchItem aItem(SID_SEARCH_ITEM);
- aItem.SetSearchString("A");
+ aItem.SetSearchString(u"A"_ustr);
aItem.SetCommand(SvxSearchCmd::FIND_ALL);
ScMarkData aMarkData(m_pDoc->GetSheetLimits());
aMarkData.SelectOneTable(0);
@@ -4206,14 +4206,14 @@ CPPUNIT_TEST_FIXTURE(Test, testSearchCells)
CPPUNIT_TEST_FIXTURE(Test, testFormulaPosition)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScAddress aPos(0,0,0); // A1
- m_pDoc->SetString(aPos, "=ROW()");
+ m_pDoc->SetString(aPos, u"=ROW()"_ustr);
aPos.IncRow(); // A2
- m_pDoc->SetString(aPos, "=ROW()");
+ m_pDoc->SetString(aPos, u"=ROW()"_ustr);
aPos.SetRow(3); // A4;
- m_pDoc->SetString(aPos, "=ROW()");
+ m_pDoc->SetString(aPos, u"=ROW()"_ustr);
{
SCROW aRows[] = { 0, 1, 3 };
@@ -4278,10 +4278,10 @@ CPPUNIT_TEST_FIXTURE(Test, testJumpToPrecedentsDependents)
*/
// Precedent is another cell that the cell references, while dependent is
// another cell that references it.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(2, 0, 0, "=A1+A2+B3"); // C1
- m_pDoc->SetString(2, 1, 0, "=A1"); // C2
+ m_pDoc->SetString(2, 0, 0, u"=A1+A2+B3"_ustr); // C1
+ m_pDoc->SetString(2, 1, 0, u"=A1"_ustr); // C2
m_pDoc->CalcAll();
std::vector<ScTokenRef> aRefTokens;
@@ -4325,36 +4325,36 @@ CPPUNIT_TEST_FIXTURE(Test, testJumpToPrecedentsDependents)
CPPUNIT_TEST_FIXTURE(Test, testTdf149665)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(0, 0, 0, "''1");
+ m_pDoc->SetString(0, 0, 0, u"''1"_ustr);
// Without the fix in place, this test would have failed with
// - Expected: '1
// - Actual : ''1
- CPPUNIT_ASSERT_EQUAL( OUString("'1"), m_pDoc->GetString( 0, 0, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"'1"_ustr, m_pDoc->GetString( 0, 0, 0 ) );
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf64001)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
ScMarkData aMarkData(m_pDoc->GetSheetLimits());
aMarkData.SelectTable(0, true);
- m_pDoc->SetString( 0, 0, 0, "TRUE" );
+ m_pDoc->SetString( 0, 0, 0, u"TRUE"_ustr );
m_pDoc->Fill( 0, 0, 0, 0, nullptr, aMarkData, 9, FILL_TO_BOTTOM, FILL_AUTO );
for (SCCOL i = 0; i < 10; ++i)
{
- CPPUNIT_ASSERT_EQUAL( OUString("TRUE"), m_pDoc->GetString( 0, i, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"TRUE"_ustr, m_pDoc->GetString( 0, i, 0 ) );
}
- m_pDoc->SetString( 0, 10, 0, "FALSE" );
+ m_pDoc->SetString( 0, 10, 0, u"FALSE"_ustr );
- m_pDoc->SetString( 1, 0, 0, "=COUNTIF(A1:A11;TRUE)" );
+ m_pDoc->SetString( 1, 0, 0, u"=COUNTIF(A1:A11;TRUE)"_ustr );
// Without the fix in place, this test would have failed with
// - Expected: 10
@@ -4366,7 +4366,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf64001)
CPPUNIT_TEST_FIXTURE(Test, testAutoFill)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
m_pDoc->SetValue(0,0,0,1);
@@ -4414,20 +4414,20 @@ CPPUNIT_TEST_FIXTURE(Test, testAutoFill)
}
// test auto fill user data lists
- m_pDoc->SetString( 0, 100, 0, "January" );
+ m_pDoc->SetString( 0, 100, 0, u"January"_ustr );
m_pDoc->Fill( 0, 100, 0, 100, nullptr, aMarkData, 2, FILL_TO_BOTTOM, FILL_AUTO );
OUString aTestValue = m_pDoc->GetString( 0, 101, 0 );
- CPPUNIT_ASSERT_EQUAL( OUString("February"), aTestValue );
+ CPPUNIT_ASSERT_EQUAL( u"February"_ustr, aTestValue );
aTestValue = m_pDoc->GetString( 0, 102, 0 );
- CPPUNIT_ASSERT_EQUAL( OUString("March"), aTestValue );
+ CPPUNIT_ASSERT_EQUAL( u"March"_ustr, aTestValue );
// test that two same user data list entries will not result in incremental fill
- m_pDoc->SetString( 0, 101, 0, "January" );
+ m_pDoc->SetString( 0, 101, 0, u"January"_ustr );
m_pDoc->Fill( 0, 100, 0, 101, nullptr, aMarkData, 2, FILL_TO_BOTTOM, FILL_AUTO );
for ( SCROW i = 102; i <= 103; ++i )
{
aTestValue = m_pDoc->GetString( 0, i, 0 );
- CPPUNIT_ASSERT_EQUAL( OUString("January"), aTestValue );
+ CPPUNIT_ASSERT_EQUAL( u"January"_ustr, aTestValue );
}
// Clear column A for a new test.
@@ -4469,7 +4469,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAutoFill)
for(SCROW nRow = 0; nRow < 10; ++nRow)
m_pDoc->SetValue(100, 100 + nRow, 0, 1);
- m_pDoc->SetString(100, 110, 0, "=A111");
+ m_pDoc->SetString(100, 110, 0, u"=A111"_ustr);
m_pDoc->Fill(100, 110, 100, 110, nullptr, aMarkData, 10, FILL_TO_TOP, FILL_AUTO);
for(SCROW nRow = 110; nRow >= 100; --nRow)
@@ -4483,152 +4483,152 @@ CPPUNIT_TEST_FIXTURE(Test, testAutoFill)
clearRange(m_pDoc, ScRange(0,0,0,0,m_pDoc->MaxRow(),0));
m_pDoc->SetRowHidden(0, m_pDoc->MaxRow(), 0, false); // Show all rows.
- m_pDoc->SetString( 0, 100, 0, "2012-10-31" );
- m_pDoc->SetString( 0, 101, 0, "2012-10-31" );
+ m_pDoc->SetString( 0, 100, 0, u"2012-10-31"_ustr );
+ m_pDoc->SetString( 0, 101, 0, u"2012-10-31"_ustr );
m_pDoc->Fill( 0, 100, 0, 101, nullptr, aMarkData, 3, FILL_TO_BOTTOM, FILL_AUTO );
// tdf#89754, Without the fix in place, this test would have failed with
// - Expected: 2012-10-31
// - Actual : 2012-11-01
- CPPUNIT_ASSERT_EQUAL( OUString("2012-10-31"), m_pDoc->GetString( 0, 102, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("2012-10-31"), m_pDoc->GetString( 0, 103, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("2012-10-31"), m_pDoc->GetString( 0, 104, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"2012-10-31"_ustr, m_pDoc->GetString( 0, 102, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"2012-10-31"_ustr, m_pDoc->GetString( 0, 103, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"2012-10-31"_ustr, m_pDoc->GetString( 0, 104, 0 ) );
// Clear column A for a new test.
clearRange(m_pDoc, ScRange(0, 0, 0, 0, m_pDoc->MaxRow(), 0));
m_pDoc->SetRowHidden(0, m_pDoc->MaxRow(), 0, false); // Show all rows.
- m_pDoc->SetString(0, 100, 0, "2019-10-31");
- m_pDoc->SetString(0, 101, 0, "2019-11-30");
- m_pDoc->SetString(0, 102, 0, "2019-12-31");
+ m_pDoc->SetString(0, 100, 0, u"2019-10-31"_ustr);
+ m_pDoc->SetString(0, 101, 0, u"2019-11-30"_ustr);
+ m_pDoc->SetString(0, 102, 0, u"2019-12-31"_ustr);
m_pDoc->Fill(0, 100, 0, 102, nullptr, aMarkData, 3, FILL_TO_BOTTOM, FILL_AUTO);
// tdf#58745, Without the fix in place, this test would have failed with
// - Expected: 2020-01-31
// - Actual : 2019-01-11
- CPPUNIT_ASSERT_EQUAL(OUString("2020-01-31"), m_pDoc->GetString(0, 103, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("2020-02-29"), m_pDoc->GetString(0, 104, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("2020-03-31"), m_pDoc->GetString(0, 105, 0));
+ CPPUNIT_ASSERT_EQUAL(u"2020-01-31"_ustr, m_pDoc->GetString(0, 103, 0));
+ CPPUNIT_ASSERT_EQUAL(u"2020-02-29"_ustr, m_pDoc->GetString(0, 104, 0));
+ CPPUNIT_ASSERT_EQUAL(u"2020-03-31"_ustr, m_pDoc->GetString(0, 105, 0));
// Clear column A for a new test.
clearRange(m_pDoc, ScRange(0,0,0,0,m_pDoc->MaxRow(),0));
m_pDoc->SetRowHidden(0, m_pDoc->MaxRow(), 0, false); // Show all rows.
- m_pDoc->SetString( 0, 50, 0, "1.0" );
- m_pDoc->SetString( 0, 51, 0, "1.1" );
- m_pDoc->SetString( 0, 52, 0, "1.2" );
- m_pDoc->SetString( 0, 53, 0, "1.3" );
+ m_pDoc->SetString( 0, 50, 0, u"1.0"_ustr );
+ m_pDoc->SetString( 0, 51, 0, u"1.1"_ustr );
+ m_pDoc->SetString( 0, 52, 0, u"1.2"_ustr );
+ m_pDoc->SetString( 0, 53, 0, u"1.3"_ustr );
m_pDoc->Fill( 0, 50, 0, 53, nullptr, aMarkData, 3, FILL_TO_BOTTOM, FILL_AUTO );
- CPPUNIT_ASSERT_EQUAL( OUString("1.4"), m_pDoc->GetString( 0, 54, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("1.5"), m_pDoc->GetString( 0, 55, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("1.6"), m_pDoc->GetString( 0, 56, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"1.4"_ustr, m_pDoc->GetString( 0, 54, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"1.5"_ustr, m_pDoc->GetString( 0, 55, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"1.6"_ustr, m_pDoc->GetString( 0, 56, 0 ) );
- m_pDoc->SetString( 0, 60, 0, "4.0" );
- m_pDoc->SetString( 0, 61, 0, "4.1" );
- m_pDoc->SetString( 0, 62, 0, "4.2" );
- m_pDoc->SetString( 0, 63, 0, "4.3" );
+ m_pDoc->SetString( 0, 60, 0, u"4.0"_ustr );
+ m_pDoc->SetString( 0, 61, 0, u"4.1"_ustr );
+ m_pDoc->SetString( 0, 62, 0, u"4.2"_ustr );
+ m_pDoc->SetString( 0, 63, 0, u"4.3"_ustr );
m_pDoc->Fill( 0, 60, 0, 63, nullptr, aMarkData, 3, FILL_TO_BOTTOM, FILL_AUTO );
// tdf#37424: Without the fix in place, this test would have failed with
// - Expected: 4.4
// - Actual : 5
- CPPUNIT_ASSERT_EQUAL( OUString("4.4"), m_pDoc->GetString( 0, 64, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("4.5"), m_pDoc->GetString( 0, 65, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("4.6"), m_pDoc->GetString( 0, 66, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"4.4"_ustr, m_pDoc->GetString( 0, 64, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"4.5"_ustr, m_pDoc->GetString( 0, 65, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"4.6"_ustr, m_pDoc->GetString( 0, 66, 0 ) );
// Clear column A for a new test.
clearRange(m_pDoc, ScRange(0,0,0,0,m_pDoc->MaxRow(),0));
m_pDoc->SetRowHidden(0, m_pDoc->MaxRow(), 0, false); // Show all rows.
- m_pDoc->SetString( 0, 70, 0, "001-001-001" );
+ m_pDoc->SetString( 0, 70, 0, u"001-001-001"_ustr );
m_pDoc->Fill( 0, 70, 0, 70, nullptr, aMarkData, 3, FILL_TO_BOTTOM, FILL_AUTO );
// tdf#105268: Without the fix in place, this test would have failed with
// - Expected: 001-001-002
// - Actual : 001-001000
- CPPUNIT_ASSERT_EQUAL( OUString("001-001-002"), m_pDoc->GetString( 0, 71, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("001-001-003"), m_pDoc->GetString( 0, 72, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("001-001-004"), m_pDoc->GetString( 0, 73, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"001-001-002"_ustr, m_pDoc->GetString( 0, 71, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"001-001-003"_ustr, m_pDoc->GetString( 0, 72, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"001-001-004"_ustr, m_pDoc->GetString( 0, 73, 0 ) );
// Clear column A for a new test.
clearRange(m_pDoc, ScRange(0,0,0,0,m_pDoc->MaxRow(),0));
m_pDoc->SetRowHidden(0, m_pDoc->MaxRow(), 0, false); // Show all rows.
- m_pDoc->SetString( 0, 80, 0, "1%" );
+ m_pDoc->SetString( 0, 80, 0, u"1%"_ustr );
m_pDoc->Fill( 0, 80, 0, 80, nullptr, aMarkData, 3, FILL_TO_BOTTOM, FILL_AUTO );
// tdf#89998: Without the fix in place, this test would have failed with
// - Expected: 2.00%
// - Actual : 101.00%
- CPPUNIT_ASSERT_EQUAL( OUString("2.00%"), m_pDoc->GetString( 0, 81, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("3.00%"), m_pDoc->GetString( 0, 82, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("4.00%"), m_pDoc->GetString( 0, 83, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"2.00%"_ustr, m_pDoc->GetString( 0, 81, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"3.00%"_ustr, m_pDoc->GetString( 0, 82, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"4.00%"_ustr, m_pDoc->GetString( 0, 83, 0 ) );
// Clear column A for a new test.
clearRange(m_pDoc, ScRange(0,0,0,0,m_pDoc->MaxRow(),0));
m_pDoc->SetRowHidden(0, m_pDoc->MaxRow(), 0, false); // Show all rows.
- m_pDoc->SetString( 0, 0, 0, "1" );
- m_pDoc->SetString( 0, 1, 0, "1.1" );
+ m_pDoc->SetString( 0, 0, 0, u"1"_ustr );
+ m_pDoc->SetString( 0, 1, 0, u"1.1"_ustr );
m_pDoc->Fill( 0, 0, 0, 1, nullptr, aMarkData, 60, FILL_TO_BOTTOM, FILL_AUTO );
// tdf#129606: Without the fix in place, this test would have failed with
// - Expected: 6
// - Actual : 6.00000000000001
- CPPUNIT_ASSERT_EQUAL( OUString("6"), m_pDoc->GetString( 0, 50, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"6"_ustr, m_pDoc->GetString( 0, 50, 0 ) );
// Clear column A for a new test.
clearRange(m_pDoc, ScRange(0,0,0,0,m_pDoc->MaxRow(),0));
m_pDoc->SetRowHidden(0, m_pDoc->MaxRow(), 0, false); // Show all rows.
- m_pDoc->SetString( 0, 0, 0, "2022-10-01 00:00:00.000" );
- m_pDoc->SetString( 0, 1, 0, "2022-10-01 01:00:00.000" );
+ m_pDoc->SetString( 0, 0, 0, u"2022-10-01 00:00:00.000"_ustr );
+ m_pDoc->SetString( 0, 1, 0, u"2022-10-01 01:00:00.000"_ustr );
m_pDoc->Fill( 0, 0, 0, 1, nullptr, aMarkData, 25, FILL_TO_BOTTOM, FILL_AUTO );
// tdf#151460: Without the fix in place, this test would have failed with
// - Expected: 2022-10-01 20:00:00.000
// - Actual : 2022-10-01 19:59:59.999
- CPPUNIT_ASSERT_EQUAL( OUString("2022-10-01 20:00:00.000"), m_pDoc->GetString( 0, 20, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"2022-10-01 20:00:00.000"_ustr, m_pDoc->GetString( 0, 20, 0 ) );
// Clear column A for a new test.
clearRange(m_pDoc, ScRange(0,0,0,0,m_pDoc->MaxRow(),0));
m_pDoc->SetRowHidden(0, m_pDoc->MaxRow(), 0, false); // Show all rows.
- m_pDoc->SetString( 0, 0, 0, "1st" );
+ m_pDoc->SetString( 0, 0, 0, u"1st"_ustr );
m_pDoc->Fill( 0, 0, 0, 0, nullptr, aMarkData, 5, FILL_TO_BOTTOM, FILL_AUTO );
- CPPUNIT_ASSERT_EQUAL( OUString("1st"), m_pDoc->GetString( 0, 0, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("2nd"), m_pDoc->GetString( 0, 1, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("3rd"), m_pDoc->GetString( 0, 2, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"1st"_ustr, m_pDoc->GetString( 0, 0, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"2nd"_ustr, m_pDoc->GetString( 0, 1, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"3rd"_ustr, m_pDoc->GetString( 0, 2, 0 ) );
// Clear column A for a new test.
clearRange(m_pDoc, ScRange(0,0,0,0,m_pDoc->MaxRow(),0));
m_pDoc->SetRowHidden(0, m_pDoc->MaxRow(), 0, false); // Show all rows.
- m_pDoc->SetString( 0, 200, 0, "15:00" );
- m_pDoc->SetString( 0, 201, 0, "15:20" );
+ m_pDoc->SetString( 0, 200, 0, u"15:00"_ustr );
+ m_pDoc->SetString( 0, 201, 0, u"15:20"_ustr );
m_pDoc->Fill( 0, 200, 0, 201, nullptr, aMarkData, 25, FILL_TO_BOTTOM, FILL_AUTO );
- CPPUNIT_ASSERT_EQUAL( OUString("03:00:00 PM"), m_pDoc->GetString( 0, 200, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"03:00:00 PM"_ustr, m_pDoc->GetString( 0, 200, 0 ) );
// tdf#153517: Without the fix in place, this test would have failed with
// - Expected: 03:20:00 PM
// - Actual : 03:19:59 PM
- CPPUNIT_ASSERT_EQUAL( OUString("03:20:00 PM"), m_pDoc->GetString( 0, 201, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("03:40:00 PM"), m_pDoc->GetString( 0, 202, 0 ) );
- CPPUNIT_ASSERT_EQUAL( OUString("04:00:00 PM"), m_pDoc->GetString( 0, 203, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"03:20:00 PM"_ustr, m_pDoc->GetString( 0, 201, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"03:40:00 PM"_ustr, m_pDoc->GetString( 0, 202, 0 ) );
+ CPPUNIT_ASSERT_EQUAL( u"04:00:00 PM"_ustr, m_pDoc->GetString( 0, 203, 0 ) );
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testAutoFillSimple)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
m_pDoc->SetValue(0, 0, 0, 1);
- m_pDoc->SetString(0, 1, 0, "=10");
+ m_pDoc->SetString(0, 1, 0, u"=10"_ustr);
ScMarkData aMarkData(m_pDoc->GetSheetLimits());
aMarkData.SelectTable(0, true);
@@ -4665,7 +4665,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFindAreaPosVertical)
{ "1", "1", "1" },
};
- m_pDoc->InsertTab(0, "Test1");
+ m_pDoc->InsertTab(0, u"Test1"_ustr);
clearRange( m_pDoc, ScRange(0, 0, 0, 1, aData.size(), 0));
ScAddress aPos(0,0,0);
ScRange aDataRange = insertRangeData( m_pDoc, aPos, aData);
@@ -4731,7 +4731,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFindAreaPosColRight)
{ "", "", "1", "1", "1", "", "1" },
};
- m_pDoc->InsertTab(0, "test1");
+ m_pDoc->InsertTab(0, u"test1"_ustr);
clearRange( m_pDoc, ScRange(0, 0, 0, 7, aData.size(), 0));
ScAddress aPos(0,0,0);
ScRange aDataRange = insertRangeData( m_pDoc, aPos, aData);
@@ -4786,12 +4786,12 @@ CPPUNIT_TEST_FIXTURE(Test, testFindAreaPosColRight)
CPPUNIT_TEST_FIXTURE(Test, testShiftCells)
{
- m_pDoc->InsertTab(0, "foo");
+ m_pDoc->InsertTab(0, u"foo"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
- OUString aTestVal("Some Text");
+ OUString aTestVal(u"Some Text"_ustr);
// Text into cell E5.
m_pDoc->SetString(4, 3, 0, aTestVal);
@@ -4799,7 +4799,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShiftCells)
// put a Note in cell E5
ScAddress rAddr(4, 3, 0);
ScPostIt* pNote = m_pDoc->GetOrCreateNote(rAddr);
- pNote->SetText(rAddr, "Hello");
+ pNote->SetText(rAddr, u"Hello"_ustr);
CPPUNIT_ASSERT_MESSAGE("there should be a note", m_pDoc->HasNote(4, 3, 0));
@@ -4826,7 +4826,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShiftCells)
CPPUNIT_TEST_FIXTURE(Test, testNoteDefaultStyle)
{
- m_pDoc->InsertTab(0, "PostIts");
+ m_pDoc->InsertTab(0, u"PostIts"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
@@ -4842,7 +4842,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteDefaultStyle)
CPPUNIT_TEST_FIXTURE(Test, testNoteBasic)
{
- m_pDoc->InsertTab(0, "PostIts");
+ m_pDoc->InsertTab(0, u"PostIts"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
@@ -4859,8 +4859,8 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteBasic)
ScAddress aAddr(2, 2, 0); // cell C3
ScPostIt *pNote = m_pDoc->GetOrCreateNote(aAddr);
- pNote->SetText(aAddr, "Hello world");
- pNote->SetAuthor("Jim Bob");
+ pNote->SetText(aAddr, u"Hello world"_ustr);
+ pNote->SetAuthor(u"Jim Bob"_ustr);
ScPostIt *pGetNote = m_pDoc->GetNote(aAddr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("note should be itself", pNote, pGetNote);
@@ -4882,7 +4882,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteBasic)
CPPUNIT_ASSERT_EQUAL_MESSAGE("note not there", pNote, m_pDoc->GetNote(aAddr));
// Insert a new sheet to shift the current sheet to the right.
- m_pDoc->InsertTab(0, "Table2");
+ m_pDoc->InsertTab(0, u"Table2"_ustr);
CPPUNIT_ASSERT_MESSAGE("note hasn't moved", !m_pDoc->GetNote(aAddr));
aAddr.IncTab(); // Move to the next sheet.
CPPUNIT_ASSERT_EQUAL_MESSAGE("note not there", pNote, m_pDoc->GetNote(aAddr));
@@ -4911,7 +4911,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteBasic)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Note at D3 should have shifted left to C3.", pNote, m_pDoc->GetNote(aAddr));
// Insert a text where the note is.
- m_pDoc->SetString(aAddr, "Note is here.");
+ m_pDoc->SetString(aAddr, u"Note is here."_ustr);
// Delete row 1. This should shift the note from C3 to C2.
m_pDoc->DeleteRow(0, 0, m_pDoc->MaxCol(), 0, 0, 1);
@@ -4923,15 +4923,15 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteBasic)
CPPUNIT_TEST_FIXTURE(Test, testNoteDeleteRow)
{
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
ScAddress aPos(1, 1, 0);
ScPostIt* pNote = m_pDoc->GetOrCreateNote(aPos);
- pNote->SetText(aPos, "Hello");
- pNote->SetAuthor("Jim Bob");
+ pNote->SetText(aPos, u"Hello"_ustr);
+ pNote->SetAuthor(u"Jim Bob"_ustr);
CPPUNIT_ASSERT_MESSAGE("there should be a note", m_pDoc->HasNote(1, 1, 0));
@@ -4945,12 +4945,12 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteDeleteRow)
// Set values and notes into B3:B4.
aPos = ScAddress(1,2,0); // B3
- m_pDoc->SetString(aPos, "First");
- ScNoteUtil::CreateNoteFromString(*m_pDoc, aPos, "First Note", false, false);
+ m_pDoc->SetString(aPos, u"First"_ustr);
+ ScNoteUtil::CreateNoteFromString(*m_pDoc, aPos, u"First Note"_ustr, false, false);
aPos = ScAddress(1,3,0); // B4
- m_pDoc->SetString(aPos, "Second");
- ScNoteUtil::CreateNoteFromString(*m_pDoc, aPos, "Second Note", false, false);
+ m_pDoc->SetString(aPos, u"Second"_ustr);
+ ScNoteUtil::CreateNoteFromString(*m_pDoc, aPos, u"Second Note"_ustr, false, false);
// Delete row 2.
ScDocFunc& rDocFunc = m_xDocShell->GetDocFunc();
@@ -4961,10 +4961,10 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteDeleteRow)
// Check to make sure the notes have shifted upward.
pNote = m_pDoc->GetNote(ScAddress(1,1,0));
CPPUNIT_ASSERT_MESSAGE("B2 should have a note.", pNote);
- CPPUNIT_ASSERT_EQUAL(OUString("First Note"), pNote->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"First Note"_ustr, pNote->GetText());
pNote = m_pDoc->GetNote(ScAddress(1,2,0));
CPPUNIT_ASSERT_MESSAGE("B3 should have a note.", pNote);
- CPPUNIT_ASSERT_EQUAL(OUString("Second Note"), pNote->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"Second Note"_ustr, pNote->GetText());
pNote = m_pDoc->GetNote(ScAddress(1,3,0));
CPPUNIT_ASSERT_MESSAGE("B4 should NOT have a note.", !pNote);
@@ -4979,17 +4979,17 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteDeleteRow)
CPPUNIT_ASSERT_MESSAGE("B2 should NOT have a note.", !pNote);
pNote = m_pDoc->GetNote(ScAddress(1,2,0));
CPPUNIT_ASSERT_MESSAGE("B3 should have a note.", pNote);
- CPPUNIT_ASSERT_EQUAL(OUString("First Note"), pNote->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"First Note"_ustr, pNote->GetText());
pNote = m_pDoc->GetNote(ScAddress(1,3,0));
CPPUNIT_ASSERT_MESSAGE("B4 should have a note.", pNote);
- CPPUNIT_ASSERT_EQUAL(OUString("Second Note"), pNote->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"Second Note"_ustr, pNote->GetText());
// Delete row 3.
rDocFunc.DeleteCells(ScRange(0,2,0,m_pDoc->MaxCol(),2,0), &aMark, DelCellCmd::CellsUp, true);
pNote = m_pDoc->GetNote(ScAddress(1,2,0));
CPPUNIT_ASSERT_MESSAGE("B3 should have a note.", pNote);
- CPPUNIT_ASSERT_EQUAL(OUString("Second Note"), pNote->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"Second Note"_ustr, pNote->GetText());
pNote = m_pDoc->GetNote(ScAddress(1,3,0));
CPPUNIT_ASSERT_MESSAGE("B4 should NOT have a note.", !pNote);
@@ -4997,25 +4997,25 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteDeleteRow)
pUndoMgr->Undo();
pNote = m_pDoc->GetNote(ScAddress(1,2,0));
CPPUNIT_ASSERT_MESSAGE("B3 should have a note.", pNote);
- CPPUNIT_ASSERT_EQUAL(OUString("First Note"), pNote->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"First Note"_ustr, pNote->GetText());
pNote = m_pDoc->GetNote(ScAddress(1,3,0));
CPPUNIT_ASSERT_MESSAGE("B4 should have a note.", pNote);
- CPPUNIT_ASSERT_EQUAL(OUString("Second Note"), pNote->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"Second Note"_ustr, pNote->GetText());
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testNoteDeleteCol)
{
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
ScAddress rAddr(1, 1, 0);
ScPostIt* pNote = m_pDoc->GetOrCreateNote(rAddr);
- pNote->SetText(rAddr, "Hello");
- pNote->SetAuthor("Jim Bob");
+ pNote->SetText(rAddr, u"Hello"_ustr);
+ pNote->SetAuthor(u"Jim Bob"_ustr);
CPPUNIT_ASSERT_MESSAGE("there should be a note", m_pDoc->HasNote(1, 1, 0));
@@ -5028,7 +5028,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteDeleteCol)
CPPUNIT_TEST_FIXTURE(Test, testNoteLifeCycle)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
@@ -5037,14 +5037,14 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteLifeCycle)
ScPostIt* pNote = m_pDoc->GetOrCreateNote(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to insert a new cell comment.", pNote);
- pNote->SetText(aPos, "New note");
+ pNote->SetText(aPos, u"New note"_ustr);
std::unique_ptr<ScPostIt> pNote2 = m_pDoc->ReleaseNote(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("This note instance is expected to be identical to the original.", pNote, pNote2.get());
CPPUNIT_ASSERT_MESSAGE("The note shouldn't be here after it's been released.", !m_pDoc->HasNote(aPos));
// Modify the internal state of the note instance to make sure it's really
// been released.
- pNote->SetText(aPos, "New content");
+ pNote->SetText(aPos, u"New content"_ustr);
// Re-insert the note back to the same place.
m_pDoc->SetNote(aPos, std::move(pNote2));
@@ -5136,7 +5136,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteLifeCycle)
ScDocShellRef xDocSh2;
getNewDocShell(xDocSh2);
ScDocument* pDoc2 = &xDocSh2->GetDocument();
- pDoc2->InsertTab(0, "OtherSheet1");
+ pDoc2->InsertTab(0, u"OtherSheet1"_ustr);
pDoc2->InitDrawLayer(xDocSh2.get());
ScAddress aPosB5(1,4,0);
@@ -5173,24 +5173,24 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteLifeCycle)
CPPUNIT_TEST_FIXTURE(Test, testNoteCopyPaste)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
// Insert in B2 a text and cell comment.
ScAddress aPos(1,1,0);
- m_pDoc->SetString(aPos, "Text");
+ m_pDoc->SetString(aPos, u"Text"_ustr);
ScPostIt* pNote = m_pDoc->GetOrCreateNote(aPos);
CPPUNIT_ASSERT(pNote);
- pNote->SetText(aPos, "Note1");
+ pNote->SetText(aPos, u"Note1"_ustr);
// Insert in B4 a number and cell comment.
aPos.SetRow(3);
m_pDoc->SetValue(aPos, 1.1);
pNote = m_pDoc->GetOrCreateNote(aPos);
CPPUNIT_ASSERT(pNote);
- pNote->SetText(aPos, "Note2");
+ pNote->SetText(aPos, u"Note2"_ustr);
// Copy B2:B4 to clipboard.
ScMarkData aMark(m_pDoc->GetSheetLimits());
@@ -5204,11 +5204,11 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteCopyPaste)
// Make sure the notes are in the clipboard.
pNote = aClipDoc.GetNote(ScAddress(1,1,0));
CPPUNIT_ASSERT(pNote);
- CPPUNIT_ASSERT_EQUAL(OUString("Note1"), pNote->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"Note1"_ustr, pNote->GetText());
pNote = aClipDoc.GetNote(ScAddress(1,3,0));
CPPUNIT_ASSERT(pNote);
- CPPUNIT_ASSERT_EQUAL(OUString("Note2"), pNote->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"Note2"_ustr, pNote->GetText());
// Paste to B6:B8 but only cell notes.
ScRange aDestRange(1,5,0,1,7,0);
@@ -5217,11 +5217,11 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteCopyPaste)
// Make sure the notes are there.
pNote = m_pDoc->GetNote(ScAddress(1,5,0));
CPPUNIT_ASSERT(pNote);
- CPPUNIT_ASSERT_EQUAL(OUString("Note1"), pNote->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"Note1"_ustr, pNote->GetText());
pNote = m_pDoc->GetNote(ScAddress(1,7,0));
CPPUNIT_ASSERT(pNote);
- CPPUNIT_ASSERT_EQUAL(OUString("Note2"), pNote->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"Note2"_ustr, pNote->GetText());
// Test that GetNotesInRange includes the end of its range
// and so can find the note
@@ -5235,7 +5235,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteCopyPaste)
// tdf#112454
CPPUNIT_TEST_FIXTURE(Test, testNoteContainsNotesInRange)
{
- m_pDoc->InsertTab(0, "PostIts");
+ m_pDoc->InsertTab(0, u"PostIts"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
@@ -5257,18 +5257,18 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteContainsNotesInRange)
CPPUNIT_TEST_FIXTURE(Test, testAreasWithNotes)
{
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
ScAddress rAddr(1, 5, 0);
ScPostIt* pNote = m_pDoc->GetOrCreateNote(rAddr);
- pNote->SetText(rAddr, "Hello");
- pNote->SetAuthor("Jim Bob");
+ pNote->SetText(rAddr, u"Hello"_ustr);
+ pNote->SetAuthor(u"Jim Bob"_ustr);
ScAddress rAddrMin(2, 2, 0);
ScPostIt* pNoteMin = m_pDoc->GetOrCreateNote(rAddrMin);
- pNoteMin->SetText(rAddrMin, "Hello");
+ pNoteMin->SetText(rAddrMin, u"Hello"_ustr);
SCCOL col;
SCROW row;
@@ -5318,8 +5318,8 @@ CPPUNIT_TEST_FIXTURE(Test, testAreasWithNotes)
// now add cells with value, check that notes are taken into account in good cases
- m_pDoc->SetString(0, 3, 0, "Some Text");
- m_pDoc->SetString(3, 3, 0, "Some Text");
+ m_pDoc->SetString(0, 3, 0, u"Some Text"_ustr);
+ m_pDoc->SetString(3, 3, 0, u"Some Text"_ustr);
dataFound = m_pDoc->GetDataStart(0,col,row);
@@ -5365,7 +5365,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAreasWithNotes)
CPPUNIT_TEST_FIXTURE(Test, testAnchoredRotatedShape)
{
- m_pDoc->InsertTab(0, "TestTab");
+ m_pDoc->InsertTab(0, u"TestTab"_ustr);
SCROW nRow1, nRow2;
bool bHidden = m_pDoc->RowHidden(0, 0, &nRow1, &nRow2);
CPPUNIT_ASSERT_MESSAGE("new sheet should have all rows visible", !bHidden);
@@ -5438,7 +5438,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAnchoredRotatedShape)
CPPUNIT_TEST_FIXTURE(Test, testCellTextWidth)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScAddress aTopCell(0, 0, 0);
@@ -5447,7 +5447,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCellTextWidth)
CPPUNIT_ASSERT_MESSAGE("Column should have no text widths stored.", !pIter->hasCell());
// Sheet only has one cell.
- m_pDoc->SetString(0, 0, 0, "Only one cell");
+ m_pDoc->SetString(0, 0, 0, u"Only one cell"_ustr);
pIter.reset(new ScColumnTextWidthIterator(*m_pDoc, aTopCell, m_pDoc->MaxRow()));
CPPUNIT_ASSERT_MESSAGE("Column should have a cell.", pIter->hasCell());
CPPUNIT_ASSERT_EQUAL(SCROW(0), pIter->getPos());
@@ -5459,11 +5459,11 @@ CPPUNIT_TEST_FIXTURE(Test, testCellTextWidth)
// Set values to row 2 through 6.
for (SCROW i = 2; i <= 6; ++i)
- m_pDoc->SetString(0, i, 0, "foo");
+ m_pDoc->SetString(0, i, 0, u"foo"_ustr);
// Set values to row 10 through 18.
for (SCROW i = 10; i <= 18; ++i)
- m_pDoc->SetString(0, i, 0, "foo");
+ m_pDoc->SetString(0, i, 0, u"foo"_ustr);
{
// Full range.
@@ -5557,7 +5557,7 @@ static bool checkEditTextIterator(sc::EditTextIterator& rIter, const char** pChe
CPPUNIT_TEST_FIXTURE(Test, testEditTextIterator)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
{
// First, try with an empty sheet.
@@ -5570,7 +5570,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEditTextIterator)
{
// Only set one edit cell.
- rEditEngine.SetTextCurrentDefaults("A2");
+ rEditEngine.SetTextCurrentDefaults(u"A2"_ustr);
m_pDoc->SetEditText(ScAddress(0,1,0), rEditEngine.CreateTextObject());
sc::EditTextIterator aIter(*m_pDoc,0);
const char* pChecks[] = { "A2", nullptr };
@@ -5579,11 +5579,11 @@ CPPUNIT_TEST_FIXTURE(Test, testEditTextIterator)
{
// Add a series of edit cells.
- rEditEngine.SetTextCurrentDefaults("A5");
+ rEditEngine.SetTextCurrentDefaults(u"A5"_ustr);
m_pDoc->SetEditText(ScAddress(0,4,0), rEditEngine.CreateTextObject());
- rEditEngine.SetTextCurrentDefaults("A6");
+ rEditEngine.SetTextCurrentDefaults(u"A6"_ustr);
m_pDoc->SetEditText(ScAddress(0,5,0), rEditEngine.CreateTextObject());
- rEditEngine.SetTextCurrentDefaults("A7");
+ rEditEngine.SetTextCurrentDefaults(u"A7"_ustr);
m_pDoc->SetEditText(ScAddress(0,6,0), rEditEngine.CreateTextObject());
sc::EditTextIterator aIter(*m_pDoc,0);
const char* pChecks[] = { "A2", "A5", "A6", "A7", nullptr };
@@ -5592,11 +5592,11 @@ CPPUNIT_TEST_FIXTURE(Test, testEditTextIterator)
{
// Add more edit cells to column C. Skip column B.
- rEditEngine.SetTextCurrentDefaults("C1");
+ rEditEngine.SetTextCurrentDefaults(u"C1"_ustr);
m_pDoc->SetEditText(ScAddress(2,0,0), rEditEngine.CreateTextObject());
- rEditEngine.SetTextCurrentDefaults("C3");
+ rEditEngine.SetTextCurrentDefaults(u"C3"_ustr);
m_pDoc->SetEditText(ScAddress(2,2,0), rEditEngine.CreateTextObject());
- rEditEngine.SetTextCurrentDefaults("C4");
+ rEditEngine.SetTextCurrentDefaults(u"C4"_ustr);
m_pDoc->SetEditText(ScAddress(2,3,0), rEditEngine.CreateTextObject());
sc::EditTextIterator aIter(*m_pDoc,0);
const char* pChecks[] = { "A2", "A5", "A6", "A7", "C1", "C3", "C4", nullptr };
@@ -5605,9 +5605,9 @@ CPPUNIT_TEST_FIXTURE(Test, testEditTextIterator)
{
// Add some numeric, string and formula cells. This shouldn't affect the outcome.
- m_pDoc->SetString(ScAddress(0,99,0), "=ROW()");
+ m_pDoc->SetString(ScAddress(0,99,0), u"=ROW()"_ustr);
m_pDoc->SetValue(ScAddress(1,3,0), 1.2);
- m_pDoc->SetString(ScAddress(2,4,0), "Simple string");
+ m_pDoc->SetString(ScAddress(2,4,0), u"Simple string"_ustr);
sc::EditTextIterator aIter(*m_pDoc,0);
const char* pChecks[] = { "A2", "A5", "A6", "A7", "C1", "C3", "C4", nullptr };
CPPUNIT_ASSERT_MESSAGE("Wrong iterator behavior.", checkEditTextIterator(aIter, pChecks));
@@ -5621,21 +5621,21 @@ CPPUNIT_TEST_FIXTURE(Test, testImportStream)
sc::AutoCalcSwitch aAC(*m_pDoc, true); // turn on auto calc.
sc::UndoSwitch aUndo(*m_pDoc, true); // enable undo.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(ScAddress(0,1,0), "=SUM(A1:C1)"); // A2
+ m_pDoc->SetString(ScAddress(0,1,0), u"=SUM(A1:C1)"_ustr); // A2
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(0,1,0)));
// CSV import options.
ScAsciiOptions aOpt;
- aOpt.SetFieldSeps(",");
+ aOpt.SetFieldSeps(u","_ustr);
// Import values to A1:C1.
ScImportExport aObj(*m_pDoc, ScAddress(0,0,0));
aObj.SetImportBroadcast(true);
aObj.SetExtOptions(aOpt);
- aObj.ImportString("1,2,3", SotClipboardFormatId::STRING);
+ aObj.ImportString(u"1,2,3"_ustr, SotClipboardFormatId::STRING);
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(1,0,0)));
@@ -5674,7 +5674,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDeleteContents)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
sc::UndoSwitch aUndoSwitch(*m_pDoc, true); // enable undo.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
m_pDoc->SetValue(ScAddress(3,1,0), 1.0);
m_pDoc->SetValue(ScAddress(3,2,0), 1.0);
@@ -5684,7 +5684,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDeleteContents)
m_pDoc->SetValue(ScAddress(3,6,0), 1.0);
m_pDoc->SetValue(ScAddress(3,7,0), 1.0);
m_pDoc->SetValue(ScAddress(3,8,0), 1.0);
- m_pDoc->SetString(ScAddress(3,15,0), "=SUM(D2:D15)");
+ m_pDoc->SetString(ScAddress(3,15,0), u"=SUM(D2:D15)"_ustr);
CPPUNIT_ASSERT_EQUAL(8.0, m_pDoc->GetValue(ScAddress(3,15,0))); // formula
@@ -5713,12 +5713,12 @@ CPPUNIT_TEST_FIXTURE(Test, testDeleteContents)
CPPUNIT_TEST_FIXTURE(Test, testTransliterateText)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Set texts to A1:A3.
- m_pDoc->SetString(ScAddress(0,0,0), "Mike");
- m_pDoc->SetString(ScAddress(0,1,0), "Noah");
- m_pDoc->SetString(ScAddress(0,2,0), "Oscar");
+ m_pDoc->SetString(ScAddress(0,0,0), u"Mike"_ustr);
+ m_pDoc->SetString(ScAddress(0,1,0), u"Noah"_ustr);
+ m_pDoc->SetString(ScAddress(0,2,0), u"Oscar"_ustr);
// Change them to uppercase.
ScMarkData aMark(m_pDoc->GetSheetLimits());
@@ -5727,23 +5727,23 @@ CPPUNIT_TEST_FIXTURE(Test, testTransliterateText)
rFunc.TransliterateText(
aMark, TransliterationFlags::LOWERCASE_UPPERCASE, true);
- CPPUNIT_ASSERT_EQUAL(OUString("MIKE"), m_pDoc->GetString(ScAddress(0,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("NOAH"), m_pDoc->GetString(ScAddress(0,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("OSCAR"), m_pDoc->GetString(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(u"MIKE"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"NOAH"_ustr, m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"OSCAR"_ustr, m_pDoc->GetString(ScAddress(0,2,0)));
// Test the undo and redo.
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
CPPUNIT_ASSERT_MESSAGE("Failed to get undo manager.", pUndoMgr);
pUndoMgr->Undo();
- CPPUNIT_ASSERT_EQUAL(OUString("Mike"), m_pDoc->GetString(ScAddress(0,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Noah"), m_pDoc->GetString(ScAddress(0,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Oscar"), m_pDoc->GetString(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Mike"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Noah"_ustr, m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Oscar"_ustr, m_pDoc->GetString(ScAddress(0,2,0)));
pUndoMgr->Redo();
- CPPUNIT_ASSERT_EQUAL(OUString("MIKE"), m_pDoc->GetString(ScAddress(0,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("NOAH"), m_pDoc->GetString(ScAddress(0,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("OSCAR"), m_pDoc->GetString(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(u"MIKE"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"NOAH"_ustr, m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"OSCAR"_ustr, m_pDoc->GetString(ScAddress(0,2,0)));
m_pDoc->DeleteTab(0);
}
@@ -5753,7 +5753,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFormulaToValue)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true);
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
std::vector<std::vector<const char*>> aData = {
{ "=1", "=RC[-1]*2", "=ISFORMULA(RC[-1])" },
@@ -5913,7 +5913,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFormulaToValue2)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true);
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
std::vector<std::vector<const char*>> aData = {
{ "=1", "=ISFORMULA(RC[-1])" },
@@ -5985,7 +5985,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFormulaToValue2)
CPPUNIT_TEST_FIXTURE(Test, testColumnFindEditCells)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Test the basics with real edit cells, using Column A.
@@ -5997,7 +5997,7 @@ CPPUNIT_TEST_FIXTURE(Test, testColumnFindEditCells)
CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be no edit cells.", SCROW(-1), nResRow);
ScFieldEditEngine& rEE = m_pDoc->GetEditEngine();
- rEE.SetTextCurrentDefaults("Test");
+ rEE.SetTextCurrentDefaults(u"Test"_ustr);
m_pDoc->SetEditText(ScAddress(0,0,0), rEE.CreateTextObject());
const EditTextObject* pObj = m_pDoc->GetEditText(ScAddress(0,0,0));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell here.", pObj);
@@ -6021,7 +6021,7 @@ CPPUNIT_TEST_FIXTURE(Test, testColumnFindEditCells)
nResRow = m_pDoc->GetFirstEditTextRow(aRange);
CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be an edit cell in specified range.", SCROW(0), nResRow);
- m_pDoc->SetString(ScAddress(0,0,0), "Test");
+ m_pDoc->SetString(ScAddress(0,0,0), u"Test"_ustr);
m_pDoc->SetValue(ScAddress(0,2,0), 1.0);
ScRefCellValue aCell;
aCell.assign(*m_pDoc, ScAddress(0,0,0));
@@ -6040,9 +6040,9 @@ CPPUNIT_TEST_FIXTURE(Test, testColumnFindEditCells)
// Test with non-edit cell but with ambiguous script type.
- m_pDoc->SetString(ScAddress(1,11,0), "Some text");
- m_pDoc->SetString(ScAddress(1,12,0), "Some text");
- m_pDoc->SetString(ScAddress(1,13,0), "Other text");
+ m_pDoc->SetString(ScAddress(1,11,0), u"Some text"_ustr);
+ m_pDoc->SetString(ScAddress(1,12,0), u"Some text"_ustr);
+ m_pDoc->SetString(ScAddress(1,13,0), u"Other text"_ustr);
m_pDoc->SetScriptType(ScAddress(1,11,0), (SvtScriptType::LATIN | SvtScriptType::ASIAN));
m_pDoc->SetScriptType(ScAddress(1,12,0), (SvtScriptType::LATIN | SvtScriptType::ASIAN));
@@ -6054,7 +6054,7 @@ CPPUNIT_TEST_FIXTURE(Test, testColumnFindEditCells)
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(12), nResRow);
for (SCROW i = 0; i <= 5; ++i)
- m_pDoc->SetString(ScAddress(2,i,0), "Text");
+ m_pDoc->SetString(ScAddress(2,i,0), u"Text"_ustr);
m_pDoc->SetScriptType(ScAddress(2,5,0), (SvtScriptType::LATIN | SvtScriptType::ASIAN));
@@ -6067,7 +6067,7 @@ CPPUNIT_TEST_FIXTURE(Test, testColumnFindEditCells)
CPPUNIT_TEST_FIXTURE(Test, testSetFormula)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
static struct aInputs
{
@@ -6097,7 +6097,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSetFormula)
CPPUNIT_TEST_FIXTURE(Test, testMultipleDataCellsInRange)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScRange aRange(1,2,0); // B3
sc::MultiDataCellState aState = m_pDoc->HasMultipleDataCells(aRange);
@@ -6136,8 +6136,8 @@ CPPUNIT_TEST_FIXTURE(Test, testMultipleDataCellsInRange)
// Set string cells to D4 and F5, and query D3:F5. D4 should be the first
// non-empty cell.
- m_pDoc->SetString(ScAddress(3,3,0), "foo");
- m_pDoc->SetString(ScAddress(5,4,0), "bar");
+ m_pDoc->SetString(ScAddress(3,3,0), u"foo"_ustr);
+ m_pDoc->SetString(ScAddress(5,4,0), u"bar"_ustr);
aRange = ScRange(3,2,0,5,4,0);
aState = m_pDoc->HasMultipleDataCells(aRange);
CPPUNIT_ASSERT_EQUAL(sc::MultiDataCellState::HasMultipleCells, aState.meState);
@@ -6151,31 +6151,31 @@ CPPUNIT_TEST_FIXTURE(Test, testMultipleDataCellsInRange)
CPPUNIT_TEST_FIXTURE(Test, testFormulaWizardSubformula)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(ScAddress(1,0,0), "=1"); // B1
- m_pDoc->SetString(ScAddress(1,1,0), "=1/0"); // B2
- m_pDoc->SetString(ScAddress(1,2,0), "=gibberish"); // B3
+ m_pDoc->SetString(ScAddress(1,0,0), u"=1"_ustr); // B1
+ m_pDoc->SetString(ScAddress(1,1,0), u"=1/0"_ustr); // B2
+ m_pDoc->SetString(ScAddress(1,2,0), u"=gibberish"_ustr); // B3
- ScSimpleFormulaCalculator aFCell1( *m_pDoc, ScAddress(0,0,0), "=B1:B3", true );
+ ScSimpleFormulaCalculator aFCell1( *m_pDoc, ScAddress(0,0,0), u"=B1:B3"_ustr, true );
FormulaError nErrCode = aFCell1.GetErrCode();
CPPUNIT_ASSERT( nErrCode == FormulaError::NONE || aFCell1.IsMatrix() );
- CPPUNIT_ASSERT_EQUAL( OUString("{1|#DIV/0!|#NAME?}"), aFCell1.GetString().getString() );
+ CPPUNIT_ASSERT_EQUAL( u"{1|#DIV/0!|#NAME?}"_ustr, aFCell1.GetString().getString() );
- m_pDoc->SetString(ScAddress(1,0,0), "=NA()"); // B1
- m_pDoc->SetString(ScAddress(1,1,0), "2"); // B2
- m_pDoc->SetString(ScAddress(1,2,0), "=1+2"); // B3
- ScSimpleFormulaCalculator aFCell2( *m_pDoc, ScAddress(0,0,0), "=B1:B3", true );
+ m_pDoc->SetString(ScAddress(1,0,0), u"=NA()"_ustr); // B1
+ m_pDoc->SetString(ScAddress(1,1,0), u"2"_ustr); // B2
+ m_pDoc->SetString(ScAddress(1,2,0), u"=1+2"_ustr); // B3
+ ScSimpleFormulaCalculator aFCell2( *m_pDoc, ScAddress(0,0,0), u"=B1:B3"_ustr, true );
nErrCode = aFCell2.GetErrCode();
CPPUNIT_ASSERT( nErrCode == FormulaError::NONE || aFCell2.IsMatrix() );
- CPPUNIT_ASSERT_EQUAL( OUString("{#N/A|2|3}"), aFCell2.GetString().getString() );
+ CPPUNIT_ASSERT_EQUAL( u"{#N/A|2|3}"_ustr, aFCell2.GetString().getString() );
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(Test, testDiagonalBorders)
{
- m_pDoc->InsertTab(0, "Diagonal");
+ m_pDoc->InsertTab(0, u"Diagonal"_ustr);
ScAddress aPos;
const editeng::SvxBorderLine* pLine;
@@ -6246,7 +6246,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDiagonalBorders)
CPPUNIT_TEST_FIXTURE(Test, testWholeDocBorders)
{
- m_pDoc->InsertTab(0, "Borders");
+ m_pDoc->InsertTab(0, u"Borders"_ustr);
// Set outside border to be on all sides, and inside borders to be only vertical.
// This should result in edge borders of the spreadsheets being set, but internal
@@ -6318,7 +6318,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWholeDocBorders)
CPPUNIT_TEST_FIXTURE(Test, testSetStringAndNote)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
@@ -6326,9 +6326,9 @@ CPPUNIT_TEST_FIXTURE(Test, testSetStringAndNote)
//note on A1
ScAddress aAdrA1 (0, 0, 0);
ScPostIt* pNote = m_pDoc->GetOrCreateNote(aAdrA1);
- pNote->SetText(aAdrA1, "Hello world in A1");
+ pNote->SetText(aAdrA1, u"Hello world in A1"_ustr);
- m_pDoc->SetString(0, 0, 0, "");
+ m_pDoc->SetString(0, 0, 0, u""_ustr);
pNote = m_pDoc->GetNote(aAdrA1);
CPPUNIT_ASSERT(pNote);
@@ -6338,7 +6338,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSetStringAndNote)
CPPUNIT_TEST_FIXTURE(Test, testUndoDataAnchor)
{
- m_pDoc->InsertTab(0, "Tab1");
+ m_pDoc->InsertTab(0, u"Tab1"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be only 1 sheets to begin with",
static_cast<SCTAB>(1), m_pDoc->GetTableCount());
@@ -6534,7 +6534,7 @@ void Test::checkPrecisionAsShown( OUString& rCode, double fValue, double fExpect
CPPUNIT_TEST_FIXTURE(Test, testPrecisionAsShown)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Turn on "precision as shown" option.
setCalcAsShown( m_pDoc, true);
@@ -6676,7 +6676,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPrecisionAsShown)
CPPUNIT_TEST_FIXTURE(Test, testProtectedSheetEditByRow)
{
ScDocFunc& rDocFunc = m_xDocShell->GetDocFunc();
- m_pDoc->InsertTab(0, "Protected");
+ m_pDoc->InsertTab(0, u"Protected"_ustr);
{
// Remove protected flags from rows 2-5.
@@ -6725,13 +6725,13 @@ CPPUNIT_TEST_FIXTURE(Test, testProtectedSheetEditByRow)
CPPUNIT_ASSERT_MESSAGE("row insertion at row 10 should succeed.", bInserted);
}
- m_pDoc->InsertTab(1, "Matrix"); // This sheet is unprotected.
+ m_pDoc->InsertTab(1, u"Matrix"_ustr); // This sheet is unprotected.
{
// Insert matrix into B2:C3.
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(1);
- m_pDoc->InsertMatrixFormula(1, 1, 2, 2, aMark, "={1;2|3;4}");
+ m_pDoc->InsertMatrixFormula(1, 1, 2, 2, aMark, u"={1;2|3;4}"_ustr);
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(1,1,1)));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(2,1,1)));
@@ -6752,7 +6752,7 @@ CPPUNIT_TEST_FIXTURE(Test, testProtectedSheetEditByRow)
CPPUNIT_TEST_FIXTURE(Test, testProtectedSheetEditByColumn)
{
ScDocFunc& rDocFunc = m_xDocShell->GetDocFunc();
- m_pDoc->InsertTab(0, "Protected");
+ m_pDoc->InsertTab(0, u"Protected"_ustr);
{
// Remove protected flags from columns B to E.
@@ -6801,13 +6801,13 @@ CPPUNIT_TEST_FIXTURE(Test, testProtectedSheetEditByColumn)
CPPUNIT_ASSERT_MESSAGE("column insertion at column 10 should succeed.", bInserted);
}
- m_pDoc->InsertTab(1, "Matrix"); // This sheet is unprotected.
+ m_pDoc->InsertTab(1, u"Matrix"_ustr); // This sheet is unprotected.
{
// Insert matrix into B2:C3.
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(1);
- m_pDoc->InsertMatrixFormula(1, 1, 2, 2, aMark, "={1;2|3;4}");
+ m_pDoc->InsertMatrixFormula(1, 1, 2, 2, aMark, u"={1;2|3;4}"_ustr);
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(1,1,1)));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(2,1,1)));
@@ -6827,7 +6827,7 @@ CPPUNIT_TEST_FIXTURE(Test, testProtectedSheetEditByColumn)
CPPUNIT_TEST_FIXTURE(Test, testInsertColumnsWithFormulaCells)
{
- m_pDoc->InsertTab(0, "Tab1");
+ m_pDoc->InsertTab(0, u"Tab1"_ustr);
std::set<SCCOL> aCols = m_pDoc->QueryColumnsWithFormulaCells(0);
CPPUNIT_ASSERT_MESSAGE("empty sheet should contain no formula cells.", aCols.empty());
@@ -6838,9 +6838,9 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertColumnsWithFormulaCells)
};
// insert formula cells in columns 2, 4 and 6.
- m_pDoc->SetFormula(ScAddress(2, 2, 0), "=1", m_pDoc->GetGrammar());
- m_pDoc->SetFormula(ScAddress(4, 2, 0), "=1", m_pDoc->GetGrammar());
- m_pDoc->SetFormula(ScAddress(6, 2, 0), "=1", m_pDoc->GetGrammar());
+ m_pDoc->SetFormula(ScAddress(2, 2, 0), u"=1"_ustr, m_pDoc->GetGrammar());
+ m_pDoc->SetFormula(ScAddress(4, 2, 0), u"=1"_ustr, m_pDoc->GetGrammar());
+ m_pDoc->SetFormula(ScAddress(6, 2, 0), u"=1"_ustr, m_pDoc->GetGrammar());
aCols = m_pDoc->QueryColumnsWithFormulaCells(0);
@@ -6870,7 +6870,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertColumnsWithFormulaCells)
CPPUNIT_TEST_FIXTURE(Test, testDocumentModelAccessor_getDocumentCurrencies)
{
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
// Check document currencies - expect 0
auto pAccessor = m_xDocShell->GetDocumentModelAccessor();
diff --git a/sc/qa/unit/ucalc_DocumentThemes.cxx b/sc/qa/unit/ucalc_DocumentThemes.cxx
index 0c3296cbb637..83878d02186d 100644
--- a/sc/qa/unit/ucalc_DocumentThemes.cxx
+++ b/sc/qa/unit/ucalc_DocumentThemes.cxx
@@ -29,7 +29,7 @@ namespace
CPPUNIT_TEST_FIXTURE(DocumentThemesTest, testGetTheme)
{
m_pDoc->InitDrawLayer();
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScDrawLayer* pDrawLayer = m_pDoc->GetDrawLayer();
CPPUNIT_ASSERT(pDrawLayer);
@@ -40,7 +40,7 @@ CPPUNIT_TEST_FIXTURE(DocumentThemesTest, testGetTheme)
CPPUNIT_TEST_FIXTURE(DocumentThemesTest, testChangeTheme)
{
m_pDoc->InitDrawLayer();
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScDrawLayer* pDrawLayer = m_pDoc->GetDrawLayer();
CPPUNIT_ASSERT(pDrawLayer);
diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx
index b38632743f65..4ff4b69dfd82 100644
--- a/sc/qa/unit/ucalc_condformat.cxx
+++ b/sc/qa/unit/ucalc_condformat.cxx
@@ -95,7 +95,7 @@ sal_uInt32 addSingleCellCondFormat(ScDocument* pDoc, const ScAddress& rAddr, sal
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct, rCondition, "",
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct, rCondition, u""_ustr,
*pDoc, ScAddress(0,0,0), ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
return pDoc->AddCondFormat(std::move(pFormat), 0);
@@ -110,13 +110,13 @@ class TestCondformat : public ScUcalcTestBase
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatINSDEL)
{
// fdo#62206
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRangeList aRangeList(ScRange(0,0,0,0,3,0));
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,u"=B2"_ustr,u""_ustr,*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormatData(pFormat->GetRange(), 0, 1);
@@ -128,21 +128,21 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatINSDEL)
CPPUNIT_ASSERT_EQUAL(static_cast<const ScRangeList&>(ScRange(2,0,0,2,3,0)), rRange);
OUString aExpr = pEntry->GetExpression(ScAddress(2,0,0), 0);
- CPPUNIT_ASSERT_EQUAL(OUString("D2"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"D2"_ustr, aExpr);
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertCol)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRangeList aRangeList(ScRange(0,0,0,3,3,0));
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,u"=B2"_ustr,u""_ustr,*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormatData(pFormat->GetRange(), 0, 1);
@@ -158,14 +158,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertCol)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertRow)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRangeList aRangeList(ScRange(0,0,0,3,3,0));
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,u"=B2"_ustr,u""_ustr,*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormatData(pFormat->GetRange(), 0, 1);
@@ -181,7 +181,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertRow)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertDeleteSheets)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Add a conditional format to B2:B4.
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
@@ -192,7 +192,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertDeleteSheets)
// Add condition in which if the value equals 2, set the "Result" style.
ScCondFormatEntry* pEntry = new ScCondFormatEntry(
- ScConditionMode::Equal, "=2", "" , *m_pDoc, ScAddress(0,0,0), ScResId(STR_STYLENAME_RESULT));
+ ScConditionMode::Equal, u"=2"_ustr, u""_ustr , *m_pDoc, ScAddress(0,0,0), ScResId(STR_STYLENAME_RESULT));
pFormatTmp->AddEntry(pEntry);
// Apply the format to the range.
@@ -214,7 +214,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertDeleteSheets)
ScDocFunc& rFunc = m_xDocShell->GetDocFunc();
// Insert a new sheet at the left.
- bool bInserted = rFunc.InsertTable(0, "Inserted", true, true);
+ bool bInserted = rFunc.InsertTable(0, u"Inserted"_ustr, true, true);
CPPUNIT_ASSERT(bInserted);
pList = m_pDoc->GetCondFormList(1);
@@ -288,7 +288,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertDeleteSheets)
CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarCondCopyPaste)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRange aCondFormatRange(0, 0, 0, 2, 0, 0);
@@ -339,7 +339,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarCondCopyPaste)
CPPUNIT_TEST_FIXTURE(TestCondformat, testColorScaleInMergedCell)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
m_pDoc->SetValue(ScAddress(0, 0, 0), 1.0);
// Add a conditional format to A1.
@@ -391,7 +391,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testColorScaleInMergedCell)
CPPUNIT_TEST_FIXTURE(TestCondformat, testColorScaleCondCopyPaste)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRange aCondFormatRange(0, 0, 0, 2, 0, 0);
@@ -441,14 +441,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testColorScaleCondCopyPaste)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPaste)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRange aCondFormatRange(0,0,0,3,3,0);
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,u"=B2"_ustr,u""_ustr,*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
sal_uInt32 nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0);
@@ -481,14 +481,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPaste)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCell)
{
//e.g. fdo#82503
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRange aCondFormatRange(0,0,0,3,3,0);
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,u"=B2"_ustr,u""_ustr,*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
sal_uInt32 nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0);
@@ -521,14 +521,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCell)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCellToRange)
{
//e.g. fdo#82503
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRange aCondFormatRange(0,0,0,3,3,0);
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,u"=B2"_ustr,u""_ustr,*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
sal_uInt32 nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0);
@@ -567,14 +567,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCellToRange)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCellIntoSameFormatRange)
{
// e.g., tdf#95295
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRange aCondFormatRange(0, 0, 0, 3, 3, 0);
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct, "=B2", "", *m_pDoc, ScAddress(0, 0, 0), ScResId(STR_STYLENAME_RESULT));
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct, u"=B2"_ustr, u""_ustr, *m_pDoc, ScAddress(0, 0, 0), ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
sal_uInt32 nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0);
@@ -605,14 +605,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCellIntoSameFormatRa
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleRowToRange)
{
//e.g. tdf#106242
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRange aCondFormatRange(0,0,0,0,0,0);
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,u"=B2"_ustr,u""_ustr,*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
auto pFormatTmp = pFormat.get();
m_pDoc->AddCondFormat(std::move(pFormat), 0);
@@ -637,14 +637,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleRowToRange)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleRowToRange2)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRange aCondFormatRange(0,0,0,0,0,0);
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,u"=B2"_ustr,u""_ustr,*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormat(std::move(pFormat), 0);
@@ -667,14 +667,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleRowToRange2)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSheetBetweenDoc)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRange aCondFormatRange(0,0,0,3,3,0);
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,u"=B2"_ustr,u""_ustr,*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormat(std::move(pFormat), 0);
@@ -689,14 +689,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSheetBetweenDoc)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSheet)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
ScRange aCondFormatRange(0,0,0,3,3,0);
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,u"=B2"_ustr,u""_ustr,*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormat(std::move(pFormat), 0);
@@ -722,7 +722,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSheet)
CPPUNIT_TEST_FIXTURE(TestCondformat, testIconSet)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
@@ -760,7 +760,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testIconSet)
CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarLengthAutomaticAxis)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
static const ScDataBarLengthData aValues[] = {
{ 2, 0 },
@@ -824,7 +824,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarLengthAutomaticAxis)
CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarLengthMiddleAxis)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
static const ScDataBarLengthData aValues[] = {
{ 1, 25.0 },
@@ -869,14 +869,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarLengthMiddleAxis)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatEndsWithStr)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// case insensitive matching
- ScConditionEntry aEntry(ScConditionMode::EndsWith, "\"teststring\"", "", *m_pDoc, ScAddress(),
- "", "", formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
+ ScConditionEntry aEntry(ScConditionMode::EndsWith, u"\"teststring\""_ustr, u""_ustr, *m_pDoc, ScAddress(),
+ u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
svl::SharedStringPool& rStringPool = m_pDoc->GetSharedStringPool();
- svl::SharedString aStr = rStringPool.intern("SimpleTestString");
+ svl::SharedString aStr = rStringPool.intern(u"SimpleTestString"_ustr);
ScRefCellValue aVal(&aStr);
ScAddress aPos(0, 0, 0);
@@ -888,10 +888,10 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatEndsWithStr)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatEndsWithVal)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- ScConditionEntry aEntry(ScConditionMode::EndsWith, "2", "", *m_pDoc, ScAddress(),
- "", "", formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
+ ScConditionEntry aEntry(ScConditionMode::EndsWith, u"2"_ustr, u""_ustr, *m_pDoc, ScAddress(),
+ u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
for (sal_Int32 i = 0; i < 15; ++i)
{
@@ -908,11 +908,11 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatEndsWithVal)
CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerSingleCellToSingleCell)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
ScCompiler aCompiler(*m_pDoc, ScAddress(10, 10, 0), formula::FormulaGrammar::GRAM_ENGLISH);
- std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString("A1"));
+ std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString(u"A1"_ustr));
ScFormulaListener aListener(*m_pDoc);
@@ -926,11 +926,11 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerSingleCellToSingleCell)
CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerSingleCellToMultipleCells)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
ScCompiler aCompiler(*m_pDoc, ScAddress(10, 10, 0), formula::FormulaGrammar::GRAM_ENGLISH);
- std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString("A1"));
+ std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString(u"A1"_ustr));
ScFormulaListener aListener(*m_pDoc);
@@ -944,11 +944,11 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerSingleCellToMultipleCell
CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerMultipleCellsToSingleCell)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
ScCompiler aCompiler(*m_pDoc, ScAddress(10, 10, 0), formula::FormulaGrammar::GRAM_ENGLISH);
- std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString("A1"));
+ std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString(u"A1"_ustr));
ScFormulaListener aListener(*m_pDoc);
@@ -962,11 +962,11 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerMultipleCellsToSingleCel
CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerMultipleCellsToMultipleCells)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
ScCompiler aCompiler(*m_pDoc, ScAddress(10, 10, 0), formula::FormulaGrammar::GRAM_ENGLISH);
- std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString("A1"));
+ std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString(u"A1"_ustr));
ScFormulaListener aListener(*m_pDoc);
@@ -980,16 +980,16 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerMultipleCellsToMultipleC
CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerUpdateInsertTab)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
ScCompiler aCompiler(*m_pDoc, ScAddress(10, 10, 0), formula::FormulaGrammar::GRAM_ENGLISH);
- std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString("A1"));
+ std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString(u"A1"_ustr));
ScFormulaListener aListener(*m_pDoc);
aListener.addTokenArray(pTokenArray.get(), ScAddress(10, 10, 0));
CPPUNIT_ASSERT(!aListener.NeedsRepaint());
- m_pDoc->InsertTab(0, "new_tab");
+ m_pDoc->InsertTab(0, u"new_tab"_ustr);
// check that the listener has moved to the new sheet
m_pDoc->SetValue(ScAddress(0, 0, 1), 1.0);
@@ -1004,11 +1004,11 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerUpdateInsertTab)
CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerUpdateDeleteTab)
{
- m_pDoc->InsertTab(0, "test");
- m_pDoc->InsertTab(0, "to_delete");
+ m_pDoc->InsertTab(0, u"test"_ustr);
+ m_pDoc->InsertTab(0, u"to_delete"_ustr);
ScCompiler aCompiler(*m_pDoc, ScAddress(10, 10, 1), formula::FormulaGrammar::GRAM_ENGLISH);
- std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString("A1"));
+ std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString(u"A1"_ustr));
ScFormulaListener aListener(*m_pDoc);
aListener.addTokenArray(pTokenArray.get(), ScAddress(10, 10, 1));
@@ -1025,10 +1025,10 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerUpdateDeleteTab)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateMoveTab)
{
- m_pDoc->InsertTab(0, "test");
- m_pDoc->InsertTab(1, "Test2");
+ m_pDoc->InsertTab(0, u"test"_ustr);
+ m_pDoc->InsertTab(1, u"Test2"_ustr);
- ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, "A1", "", *m_pDoc, ScAddress(10, 10, 0), "", "", formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
+ ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"A1"_ustr, u""_ustr, *m_pDoc, ScAddress(10, 10, 0), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
pFormat->SetRange(ScRange(10, 10, 0, 10, 12, 0));
@@ -1062,9 +1062,9 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateMoveTab)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateInsertTab)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
- ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, "A1", "", *m_pDoc, ScAddress(10, 10, 0), "", "", formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
+ ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"A1"_ustr, u""_ustr, *m_pDoc, ScAddress(10, 10, 0), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
pFormat->SetRange(ScRange(10, 10, 0, 10, 12, 0));
@@ -1083,7 +1083,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateInsertTab)
CPPUNIT_ASSERT(!pEntry->NeedsRepaint());
}
- m_pDoc->InsertTab(0, "test2");
+ m_pDoc->InsertTab(0, u"test2"_ustr);
// the conditional format should listen to A1:A3 on the second sheet
for (SCROW nRow = 0; nRow < 3; ++nRow)
@@ -1101,10 +1101,10 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateInsertTab)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateDeleteTab)
{
- m_pDoc->InsertTab(0, "test");
- m_pDoc->InsertTab(1, "Test2");
+ m_pDoc->InsertTab(0, u"test"_ustr);
+ m_pDoc->InsertTab(1, u"Test2"_ustr);
- ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, "A1", "", *m_pDoc, ScAddress(10, 10, 1), "", "", formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
+ ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"A1"_ustr, u""_ustr, *m_pDoc, ScAddress(10, 10, 1), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
pFormat->SetRange(ScRange(10, 10, 1, 10, 12, 1));
@@ -1134,10 +1134,10 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateDeleteTab)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateReference)
{
- m_pDoc->InsertTab(0, "test");
- m_pDoc->InsertTab(1, "Test2");
+ m_pDoc->InsertTab(0, u"test"_ustr);
+ m_pDoc->InsertTab(1, u"Test2"_ustr);
- ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, "A1", "", *m_pDoc, ScAddress(10, 10, 0), "", "", formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
+ ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"A1"_ustr, u""_ustr, *m_pDoc, ScAddress(10, 10, 0), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
pFormat->SetRange(ScRange(10, 10, 0, 10, 12, 0));
@@ -1159,9 +1159,9 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateReference)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateReferenceDelRow)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
- ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, "B6", "", *m_pDoc, ScAddress(0, 5, 0), "", "", formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
+ ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"B6"_ustr, u""_ustr, *m_pDoc, ScAddress(0, 5, 0), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
pFormat->SetRange(ScRange(0, 5, 0, 0, 5, 0));
@@ -1173,16 +1173,16 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateReferenceDelRow)
m_pDoc->DeleteRow(0, 0, m_pDoc->MaxCol(), 0, 4, 1);
OUString aStr = pEntry->GetExpression(ScAddress(0, 4, 0), 0);
- CPPUNIT_ASSERT_EQUAL(OUString("B5"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"B5"_ustr, aStr);
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateReferenceInsRow)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
- ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, "B6", "", *m_pDoc, ScAddress(0, 5, 0), "", "", formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
+ ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"B6"_ustr, u""_ustr, *m_pDoc, ScAddress(0, 5, 0), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
pFormat->SetRange(ScRange(0, 5, 0, 0, 5, 0));
@@ -1194,16 +1194,16 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateReferenceInsRow)
m_pDoc->InsertRow(0, 0, m_pDoc->MaxCol(), 0, 4, 1);
OUString aStr = pEntry->GetExpression(ScAddress(0, 6, 0), 0);
- CPPUNIT_ASSERT_EQUAL(OUString("B7"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"B7"_ustr, aStr);
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUndoList)
{
- m_pDoc->InsertTab(0, "test");
+ m_pDoc->InsertTab(0, u"test"_ustr);
- ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, "B6", "", *m_pDoc, ScAddress(0, 5, 0), "", "", formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
+ ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"B6"_ustr, u""_ustr, *m_pDoc, ScAddress(0, 5, 0), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
pFormat->AddEntry(pEntry);
@@ -1243,10 +1243,10 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUndoList)
CPPUNIT_TEST_FIXTURE(TestCondformat, testMultipleSingleCellCondFormatCopyPaste)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- sal_uInt32 nFirstCondFormatKey = addSingleCellCondFormat(m_pDoc, ScAddress(0, 0, 0), 1, "=A2");
- sal_uInt32 nSecondCondFormatKey = addSingleCellCondFormat(m_pDoc, ScAddress(1, 0, 0), 2, "=B3");
+ sal_uInt32 nFirstCondFormatKey = addSingleCellCondFormat(m_pDoc, ScAddress(0, 0, 0), 1, u"=A2"_ustr);
+ sal_uInt32 nSecondCondFormatKey = addSingleCellCondFormat(m_pDoc, ScAddress(1, 0, 0), 2, u"=B3"_ustr);
ScDocument aClipDoc(SCDOCMODE_CLIP);
copyToClip(m_pDoc, ScRange(0,0,0,2,0,0), &aClipDoc);
@@ -1275,10 +1275,10 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testMultipleSingleCellCondFormatCopyPaste)
CPPUNIT_TEST_FIXTURE(TestCondformat, testDeduplicateMultipleCondFormats)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- sal_uInt32 nFirstCondFormatKey = addSingleCellCondFormat(m_pDoc, ScAddress(0, 0, 0), 1, "=B2");
- sal_uInt32 nSecondCondFormatKey = addSingleCellCondFormat(m_pDoc, ScAddress(1, 0, 0), 2, "=B2");
+ sal_uInt32 nFirstCondFormatKey = addSingleCellCondFormat(m_pDoc, ScAddress(0, 0, 0), 1, u"=B2"_ustr);
+ sal_uInt32 nSecondCondFormatKey = addSingleCellCondFormat(m_pDoc, ScAddress(1, 0, 0), 2, u"=B2"_ustr);
ScDocument aClipDoc(SCDOCMODE_CLIP);
copyToClip(m_pDoc, ScRange(0,0,0,2,0,0), &aClipDoc);
@@ -1307,7 +1307,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDeduplicateMultipleCondFormats)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatListenToOwnRange)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
@@ -1341,7 +1341,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatListenToOwnRange)
CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatVolatileFunctionRecalc)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
m_pDoc->SetValue(0, 0, 0, 0.5);
@@ -1351,7 +1351,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatVolatileFunctionRecalc)
ScRangeList aRangeList(ScRange(0,0,0,10,0,0));
pFormat->SetRange(aRangeList);
- ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Greater,"RAND()","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Greater,u"RAND()"_ustr,u""_ustr,*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pEntry->SetParent(pFormat.get());
m_pDoc->AddCondFormatData(pFormat->GetRange(), 0, 1);
@@ -1380,7 +1380,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatVolatileFunctionRecalc)
CPPUNIT_TEST_FIXTURE(TestCondformat, testConditionStyleInMergedCell)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
PaintListener aListener;
aListener.StartListening(*m_xDocShell);
@@ -1396,7 +1396,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testConditionStyleInMergedCell)
// Add condition in which if the value equals 1, set the "Good" style.
ScCondFormatEntry* pEntry = new ScCondFormatEntry(
- ScConditionMode::Equal, "=1", "", *m_pDoc, ScAddress(0, 0, 0), ScResId(STR_STYLENAME_GOOD));
+ ScConditionMode::Equal, u"=1"_ustr, u""_ustr, *m_pDoc, ScAddress(0, 0, 0), ScResId(STR_STYLENAME_GOOD));
pFormat->AddEntry(pEntry);
// Apply the format to the range.
diff --git a/sc/qa/unit/ucalc_copypaste.cxx b/sc/qa/unit/ucalc_copypaste.cxx
index 5cd1d9409b8b..139cdac314c6 100644
--- a/sc/qa/unit/ucalc_copypaste.cxx
+++ b/sc/qa/unit/ucalc_copypaste.cxx
@@ -233,8 +233,8 @@ void TestCopyPaste::prepareUndoAfterPaste(ScDocumentUniquePtr& pPasteUndoDoc,
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPaste)
{
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
@@ -247,19 +247,19 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPaste)
m_pDoc->SetValue(3, 1, 0, 1);
m_pDoc->SetValue(3, 2, 0, 2);
m_pDoc->SetValue(3, 3, 0, 3);
- m_pDoc->SetString(2, 0, 0, "test");
+ m_pDoc->SetString(2, 0, 0, u"test"_ustr);
ScAddress aAdr(0, 0, 0);
//create some range names, local and global
- ScRangeData* pLocal1 = new ScRangeData(*m_pDoc, "local1", aAdr);
- ScRangeData* pLocal2 = new ScRangeData(*m_pDoc, "local2", aAdr);
- ScRangeData* pLocal3 = new ScRangeData(*m_pDoc, "local3", "$Sheet1.$A$1");
- ScRangeData* pLocal4 = new ScRangeData(*m_pDoc, "local4", "Sheet1.$A$1");
- ScRangeData* pLocal5
- = new ScRangeData(*m_pDoc, "local5", "$A$1"); // implicit relative sheet reference
- ScRangeData* pGlobal = new ScRangeData(*m_pDoc, "global", aAdr);
+ ScRangeData* pLocal1 = new ScRangeData(*m_pDoc, u"local1"_ustr, aAdr);
+ ScRangeData* pLocal2 = new ScRangeData(*m_pDoc, u"local2"_ustr, aAdr);
+ ScRangeData* pLocal3 = new ScRangeData(*m_pDoc, u"local3"_ustr, u"$Sheet1.$A$1"_ustr);
+ ScRangeData* pLocal4 = new ScRangeData(*m_pDoc, u"local4"_ustr, u"Sheet1.$A$1"_ustr);
+ ScRangeData* pLocal5 = new ScRangeData(*m_pDoc, u"local5"_ustr,
+ u"$A$1"_ustr); // implicit relative sheet reference
+ ScRangeData* pGlobal = new ScRangeData(*m_pDoc, u"global"_ustr, aAdr);
constexpr OUString aGlobal2Symbol(u"$Sheet1.$A$1:$A$23"_ustr);
- ScRangeData* pGlobal2 = new ScRangeData(*m_pDoc, "global2", aGlobal2Symbol);
+ ScRangeData* pGlobal2 = new ScRangeData(*m_pDoc, u"global2"_ustr, aGlobal2Symbol);
std::unique_ptr<ScRangeName> pGlobalRangeName(new ScRangeName());
pGlobalRangeName->insert(pGlobal);
pGlobalRangeName->insert(pGlobal2);
@@ -273,16 +273,16 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPaste)
m_pDoc->SetRangeName(0, std::move(pLocalRangeName1));
// Add formula to B1.
- OUString aFormulaString("=local1+global+SUM($C$1:$D$4)+local3+local4+local5");
+ OUString aFormulaString(u"=local1+global+SUM($C$1:$D$4)+local3+local4+local5"_ustr);
m_pDoc->SetString(1, 0, 0, aFormulaString);
double fValue = m_pDoc->GetValue(ScAddress(1, 0, 0));
ASSERT_DOUBLES_EQUAL_MESSAGE("formula should return 11", 11, fValue);
// add notes to A1:C1
- setNote(0, 0, 0, "Hello world in A1"); // empty cell content
- setNote(1, 0, 0, "Hello world in B1"); // formula cell content
- setNote(2, 0, 0, "Hello world in C1"); // string cell content
+ setNote(0, 0, 0, u"Hello world in A1"_ustr); // empty cell content
+ setNote(1, 0, 0, u"Hello world in B1"_ustr); // formula cell content
+ setNote(2, 0, 0, u"Hello world in C1"_ustr); // string cell content
//copy Sheet1.A1:C1 to Sheet2.A2:C2
ScRange aRange(0, 0, 0, 2, 0, 0);
@@ -311,7 +311,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPaste)
ScRange aSheet2A1(0, 0, 1, 0, 0, 1);
//check local range name after copying
- pLocal1 = m_pDoc->GetRangeName(1)->findByUpperName(OUString("LOCAL1"));
+ pLocal1 = m_pDoc->GetRangeName(1)->findByUpperName(u"LOCAL1"_ustr);
CPPUNIT_ASSERT_MESSAGE("local range name 1 should be copied", pLocal1);
ScRange aRangeLocal1;
bool bIsValidRef1 = pLocal1->IsValidReference(aRangeLocal1);
@@ -319,10 +319,10 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPaste)
CPPUNIT_ASSERT_EQUAL_MESSAGE("local range 1 should now point to Sheet2.A1", aSheet2A1,
aRangeLocal1);
- pLocal2 = m_pDoc->GetRangeName(1)->findByUpperName(OUString("LOCAL2"));
+ pLocal2 = m_pDoc->GetRangeName(1)->findByUpperName(u"LOCAL2"_ustr);
CPPUNIT_ASSERT_MESSAGE("local2 should not be copied", !pLocal2);
- pLocal3 = m_pDoc->GetRangeName(1)->findByUpperName(OUString("LOCAL3"));
+ pLocal3 = m_pDoc->GetRangeName(1)->findByUpperName(u"LOCAL3"_ustr);
CPPUNIT_ASSERT_MESSAGE("local range name 3 should be copied", pLocal3);
ScRange aRangeLocal3;
bool bIsValidRef3 = pLocal3->IsValidReference(aRangeLocal3);
@@ -330,7 +330,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPaste)
CPPUNIT_ASSERT_EQUAL_MESSAGE("local range 3 should now point to Sheet2.A1", aSheet2A1,
aRangeLocal3);
- pLocal4 = m_pDoc->GetRangeName(1)->findByUpperName(OUString("LOCAL4"));
+ pLocal4 = m_pDoc->GetRangeName(1)->findByUpperName(u"LOCAL4"_ustr);
CPPUNIT_ASSERT_MESSAGE("local range name 4 should be copied", pLocal4);
ScRange aRangeLocal4;
bool bIsValidRef4 = pLocal4->IsValidReference(aRangeLocal4);
@@ -338,7 +338,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPaste)
CPPUNIT_ASSERT_EQUAL_MESSAGE("local range 4 should now point to Sheet2.A1", aSheet2A1,
aRangeLocal4);
- pLocal5 = m_pDoc->GetRangeName(1)->findByUpperName(OUString("LOCAL5"));
+ pLocal5 = m_pDoc->GetRangeName(1)->findByUpperName(u"LOCAL5"_ustr);
CPPUNIT_ASSERT_MESSAGE("local range name 5 should be copied", pLocal5);
ScRange aRangeLocal5;
bool bIsValidRef5 = pLocal5->IsValidReference(aRangeLocal5);
@@ -374,7 +374,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPaste)
fValue = m_pDoc->GetValue(ScAddress(1, 1, 1));
ASSERT_DOUBLES_EQUAL_MESSAGE("formula should return 1 after redo", 1.0, fValue);
aString = m_pDoc->GetString(2, 1, 1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell Sheet2.C2 should contain: test", OUString("test"), aString);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell Sheet2.C2 should contain: test", u"test"_ustr, aString);
aString = m_pDoc->GetFormula(1, 1, 1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Formula should be correct again", aFormulaString, aString);
@@ -401,7 +401,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPaste)
m_pDoc->CopyFromClip(aRange, aMark, InsertDeleteFlags::ALL, nullptr, &aClipDoc2);
// The global2 range must not have changed.
- pGlobal2 = m_pDoc->GetRangeName()->findByUpperName("GLOBAL2");
+ pGlobal2 = m_pDoc->GetRangeName()->findByUpperName(u"GLOBAL2"_ustr);
CPPUNIT_ASSERT_MESSAGE("GLOBAL2 name not found", pGlobal2);
OUString aSymbol = pGlobal2->GetSymbol();
CPPUNIT_ASSERT_EQUAL_MESSAGE("GLOBAL2 named range changed", aGlobal2Symbol, aSymbol);
@@ -414,8 +414,8 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteAsLink)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // Turn on auto calc.
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
m_pDoc->SetValue(ScAddress(0, 0, 0), 1); // A1
m_pDoc->SetValue(ScAddress(0, 1, 0), 2); // A2
@@ -451,22 +451,22 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteAsLink)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteTranspose)
{
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
m_pDoc->SetValue(0, 0, 0, 1);
- m_pDoc->SetString(1, 0, 0, "=A1+1");
- m_pDoc->SetString(2, 0, 0, "test");
+ m_pDoc->SetString(1, 0, 0, u"=A1+1"_ustr);
+ m_pDoc->SetString(2, 0, 0, u"test"_ustr);
// add notes to A1:C1
- setNote(0, 0, 0, "Hello world in A1"); // numerical cell content
- setNote(1, 0, 0, "Hello world in B1"); // formula cell content
- setNote(2, 0, 0, "Hello world in C1"); // string cell content
+ setNote(0, 0, 0, u"Hello world in A1"_ustr); // numerical cell content
+ setNote(1, 0, 0, u"Hello world in B1"_ustr); // formula cell content
+ setNote(2, 0, 0, u"Hello world in C1"_ustr); // string cell content
// transpose clipboard, paste and check on Sheet2
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
ScRange aSrcRange(0, 0, 0, 2, 0, 0);
ScDocument aNewClipDoc(SCDOCMODE_CLIP);
@@ -483,13 +483,13 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteTranspose)
//check cell content after transposed copy/paste
OUString aString = m_pDoc->GetString(3, 3, 1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell Sheet2.D4 should contain: test", OUString("test"), aString);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell Sheet2.D4 should contain: test", u"test"_ustr, aString);
double fValue = m_pDoc->GetValue(ScAddress(3, 1, 1));
ASSERT_DOUBLES_EQUAL_MESSAGE("transposed copied cell should return 1", 1, fValue);
fValue = m_pDoc->GetValue(ScAddress(3, 2, 1));
ASSERT_DOUBLES_EQUAL_MESSAGE("transposed copied formula should return 2", 2, fValue);
aString = m_pDoc->GetFormula(3, 2, 1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed formula should point on Sheet2.D2", OUString("=D2+1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed formula should point on Sheet2.D2", u"=D2+1"_ustr,
aString);
// check notes after transposed copy/paste
@@ -514,8 +514,8 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMergedCellsTranspose)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // Turn on auto calc.
- m_pDoc->InsertTab(srcSheet, "Sheet1");
- m_pDoc->InsertTab(destSheet, "Sheet2");
+ m_pDoc->InsertTab(srcSheet, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(destSheet, u"Sheet2"_ustr);
m_pDoc->SetValue(0, 0, srcSheet, 1); // A1
m_pDoc->SetValue(0, 1, srcSheet, 2); // A2
@@ -583,8 +583,8 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMergedCellsFilteredTrans
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // Turn on auto calc.
- m_pDoc->InsertTab(srcSheet, "Sheet1");
- m_pDoc->InsertTab(destSheet, "Sheet2");
+ m_pDoc->InsertTab(srcSheet, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(destSheet, u"Sheet2"_ustr);
m_pDoc->SetValue(0, 0, srcSheet, 1); // A1
m_pDoc->SetValue(0, 1, srcSheet, 2); // A2
@@ -595,7 +595,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMergedCellsFilteredTrans
m_pDoc->DoMerge(0, 2, 1, 2, srcSheet, false); // Merge A3 and B3
// Filter row 1
- ScDBData* pDBData = new ScDBData("TRANSPOSE_TEST_DATA", srcSheet, 0, 0, 0, 3);
+ ScDBData* pDBData = new ScDBData(u"TRANSPOSE_TEST_DATA"_ustr, srcSheet, 0, 0, 0, 3);
m_pDoc->SetAnonymousDBData(0, std::unique_ptr<ScDBData>(pDBData));
pDBData->SetAutoFilter(true);
@@ -674,8 +674,8 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAsLinkTranspose)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // Turn on auto calc.
- m_pDoc->InsertTab(srcSheet, "Sheet1");
- m_pDoc->InsertTab(destSheet, "Sheet2");
+ m_pDoc->InsertTab(srcSheet, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(destSheet, u"Sheet2"_ustr);
m_pDoc->SetValue(0, 0, srcSheet, 1); // A1
m_pDoc->SetValue(0, 1, srcSheet, 2); // A2
@@ -699,13 +699,13 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAsLinkTranspose)
// Check pasted content to make sure they reference the correct cells.
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell B2.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", OUString("=$Sheet1.$A$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", u"=$Sheet1.$A$1"_ustr,
m_pDoc->GetFormula(1, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(1.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(2, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C2", OUString("=$Sheet1.$A$2"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C2", u"=$Sheet1.$A$2"_ustr,
m_pDoc->GetFormula(2, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(2.0, pFC->GetValue());
@@ -714,7 +714,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAsLinkTranspose)
pFC = m_pDoc->GetFormulaCell(ScAddress(4, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", OUString("=$Sheet1.$A$4"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", u"=$Sheet1.$A$4"_ustr,
m_pDoc->GetFormula(4, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(4.0, pFC->GetValue());
@@ -730,15 +730,15 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAsLinkFilteredTranspose)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // Turn on auto calc.
- m_pDoc->InsertTab(srcSheet, "Sheet1");
- m_pDoc->InsertTab(destSheet, "Sheet2");
+ m_pDoc->InsertTab(srcSheet, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(destSheet, u"Sheet2"_ustr);
m_pDoc->SetValue(0, 0, srcSheet, 1); // A1
m_pDoc->SetValue(0, 1, srcSheet, 2); // A2
m_pDoc->SetValue(0, 3, srcSheet, 4); // A4
// Filter row 1
- ScDBData* pDBData = new ScDBData("TRANSPOSE_TEST_DATA", srcSheet, 0, 0, 0, 3);
+ ScDBData* pDBData = new ScDBData(u"TRANSPOSE_TEST_DATA"_ustr, srcSheet, 0, 0, 0, 3);
m_pDoc->SetAnonymousDBData(0, std::unique_ptr<ScDBData>(pDBData));
pDBData->SetAutoFilter(true);
@@ -792,7 +792,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAsLinkFilteredTranspose)
// Check pasted content to make sure they reference the correct cells.
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell B2.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", OUString("=$Sheet1.$A$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", u"=$Sheet1.$A$1"_ustr,
m_pDoc->GetFormula(1, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(1.0, pFC->GetValue());
@@ -801,7 +801,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAsLinkFilteredTranspose)
pFC = m_pDoc->GetFormulaCell(ScAddress(3, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", OUString("=$Sheet1.$A$4"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", u"=$Sheet1.$A$4"_ustr,
m_pDoc->GetFormula(3, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(4.0, pFC->GetValue());
@@ -818,8 +818,8 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowAsLinkTrans
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // Turn on auto calc.
- m_pDoc->InsertTab(srcSheet, "Sheet1");
- m_pDoc->InsertTab(destSheet, "Sheet2");
+ m_pDoc->InsertTab(srcSheet, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(destSheet, u"Sheet2"_ustr);
m_pDoc->SetValue(0, 0, srcSheet, 1); // A1
m_pDoc->SetValue(1, 0, srcSheet, 2); // B1
@@ -854,13 +854,13 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowAsLinkTrans
// Check pasted content to make sure they reference the correct cells.
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell B2.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", OUString("=$Sheet1.$A$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", u"=$Sheet1.$A$1"_ustr,
m_pDoc->GetFormula(1, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(1.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(1, 2, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell B3.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B3", OUString("=$Sheet1.$B$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B3", u"=$Sheet1.$B$1"_ustr,
m_pDoc->GetFormula(1, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(2.0, pFC->GetValue());
@@ -869,19 +869,19 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowAsLinkTrans
pFC = m_pDoc->GetFormulaCell(ScAddress(1, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B5", OUString("=$Sheet1.$D$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B5", u"=$Sheet1.$D$1"_ustr,
m_pDoc->GetFormula(1, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(4.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(2, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell C2.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C2", OUString("=$Sheet1.$A$3"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C2", u"=$Sheet1.$A$3"_ustr,
m_pDoc->GetFormula(2, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(2, 2, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell C3.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C3", OUString("=$Sheet1.$B$3"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C3", u"=$Sheet1.$B$3"_ustr,
m_pDoc->GetFormula(2, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(12.0, pFC->GetValue());
@@ -890,7 +890,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowAsLinkTrans
pFC = m_pDoc->GetFormulaCell(ScAddress(2, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C5", OUString("=$Sheet1.$D$3"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C5", u"=$Sheet1.$D$3"_ustr,
m_pDoc->GetFormula(2, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(14.0, pFC->GetValue());
@@ -907,8 +907,8 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowAsLinkFilte
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // Turn on auto calc.
- m_pDoc->InsertTab(srcSheet, "Sheet1");
- m_pDoc->InsertTab(destSheet, "Sheet2");
+ m_pDoc->InsertTab(srcSheet, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(destSheet, u"Sheet2"_ustr);
m_pDoc->SetValue(0, 0, srcSheet, 1); // A1
m_pDoc->SetValue(1, 0, srcSheet, 2); // B1
@@ -931,7 +931,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowAsLinkFilte
m_pDoc->SetValue(3, 5, srcSheet, 114); // D6
// Filter row 1
- ScDBData* pDBData = new ScDBData("TRANSPOSE_TEST_DATA", srcSheet, 0, 0, 3, 3);
+ ScDBData* pDBData = new ScDBData(u"TRANSPOSE_TEST_DATA"_ustr, srcSheet, 0, 0, 3, 3);
m_pDoc->SetAnonymousDBData(0, std::unique_ptr<ScDBData>(pDBData));
pDBData->SetAutoFilter(true);
@@ -984,13 +984,13 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowAsLinkFilte
// Check pasted content to make sure they reference the correct cells.
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell B2.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", OUString("=$Sheet1.$A$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", u"=$Sheet1.$A$1"_ustr,
m_pDoc->GetFormula(1, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(1.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(1, 2, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell B3.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B3", OUString("=$Sheet1.$B$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B3", u"=$Sheet1.$B$1"_ustr,
m_pDoc->GetFormula(1, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(2.0, pFC->GetValue());
@@ -999,19 +999,19 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowAsLinkFilte
pFC = m_pDoc->GetFormulaCell(ScAddress(1, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B5", OUString("=$Sheet1.$D$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B5", u"=$Sheet1.$D$1"_ustr,
m_pDoc->GetFormula(1, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(4.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(2, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell C2.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C2", OUString("=$Sheet1.$A$3"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C2", u"=$Sheet1.$A$3"_ustr,
m_pDoc->GetFormula(2, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(2, 2, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell C3.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C3", OUString("=$Sheet1.$B$3"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C3", u"=$Sheet1.$B$3"_ustr,
m_pDoc->GetFormula(2, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(12.0, pFC->GetValue());
@@ -1020,19 +1020,19 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowAsLinkFilte
pFC = m_pDoc->GetFormulaCell(ScAddress(2, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C5", OUString("=$Sheet1.$D$3"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C5", u"=$Sheet1.$D$3"_ustr,
m_pDoc->GetFormula(2, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(14.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(3, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell D2.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", OUString("=$Sheet1.$A$6"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", u"=$Sheet1.$A$6"_ustr,
m_pDoc->GetFormula(3, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(111.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(3, 2, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell D3.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D3", OUString("=$Sheet1.$B$6"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D3", u"=$Sheet1.$B$6"_ustr,
m_pDoc->GetFormula(3, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(112.0, pFC->GetValue());
@@ -1041,7 +1041,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowAsLinkFilte
pFC = m_pDoc->GetFormulaCell(ScAddress(3, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D5", OUString("=$Sheet1.$D$6"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D5", u"=$Sheet1.$D$6"_ustr,
m_pDoc->GetFormula(3, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(114.0, pFC->GetValue());
@@ -1058,8 +1058,8 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColAsLinkTrans
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // Turn on auto calc.
- m_pDoc->InsertTab(srcSheet, "Sheet1");
- m_pDoc->InsertTab(destSheet, "Sheet2");
+ m_pDoc->InsertTab(srcSheet, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(destSheet, u"Sheet2"_ustr);
m_pDoc->SetValue(0, 0, srcSheet, 1); // A1
m_pDoc->SetValue(0, 1, srcSheet, 2); // A2
@@ -1094,13 +1094,13 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColAsLinkTrans
// Check pasted content to make sure they reference the correct cells.
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell B2.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", OUString("=$Sheet1.$A$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", u"=$Sheet1.$A$1"_ustr,
m_pDoc->GetFormula(1, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(1.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(2, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell C2.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C2", OUString("=$Sheet1.$A$2"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C2", u"=$Sheet1.$A$2"_ustr,
m_pDoc->GetFormula(2, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(2.0, pFC->GetValue());
@@ -1109,19 +1109,19 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColAsLinkTrans
pFC = m_pDoc->GetFormulaCell(ScAddress(4, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", OUString("=$Sheet1.$A$4"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", u"=$Sheet1.$A$4"_ustr,
m_pDoc->GetFormula(4, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(4.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(1, 2, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell B3.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B3", OUString("=$Sheet1.$C$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B3", u"=$Sheet1.$C$1"_ustr,
m_pDoc->GetFormula(1, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(2, 2, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell C3.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C3", OUString("=$Sheet1.$C$2"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C3", u"=$Sheet1.$C$2"_ustr,
m_pDoc->GetFormula(2, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(12.0, pFC->GetValue());
@@ -1130,7 +1130,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColAsLinkTrans
pFC = m_pDoc->GetFormulaCell(ScAddress(4, 2, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E3", OUString("=$Sheet1.$C$4"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E3", u"=$Sheet1.$C$4"_ustr,
m_pDoc->GetFormula(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(14.0, pFC->GetValue());
@@ -1147,8 +1147,8 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColAsLinkFilte
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // Turn on auto calc.
- m_pDoc->InsertTab(srcSheet, "Sheet1");
- m_pDoc->InsertTab(destSheet, "Sheet2");
+ m_pDoc->InsertTab(srcSheet, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(destSheet, u"Sheet2"_ustr);
m_pDoc->SetValue(0, 0, srcSheet, 1); // A1
m_pDoc->SetValue(0, 1, srcSheet, 2); // A2
@@ -1159,7 +1159,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColAsLinkFilte
m_pDoc->SetValue(2, 3, srcSheet, 14); // C4
// Filter row 1
- ScDBData* pDBData = new ScDBData("TRANSPOSE_TEST_DATA", srcSheet, 0, 0, 0, 3);
+ ScDBData* pDBData = new ScDBData(u"TRANSPOSE_TEST_DATA"_ustr, srcSheet, 0, 0, 0, 3);
m_pDoc->SetAnonymousDBData(0, std::unique_ptr<ScDBData>(pDBData));
pDBData->SetAutoFilter(true);
@@ -1207,7 +1207,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColAsLinkFilte
// Check pasted content to make sure they reference the correct cells.
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell B2.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", OUString("=$Sheet1.$A$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", u"=$Sheet1.$A$1"_ustr,
m_pDoc->GetFormula(1, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(1.0, pFC->GetValue());
@@ -1216,13 +1216,13 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColAsLinkFilte
pFC = m_pDoc->GetFormulaCell(ScAddress(3, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", OUString("=$Sheet1.$A$4"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", u"=$Sheet1.$A$4"_ustr,
m_pDoc->GetFormula(3, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(4.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(1, 2, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell B3.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B3", OUString("=$Sheet1.$C$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B3", u"=$Sheet1.$C$1"_ustr,
m_pDoc->GetFormula(1, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, pFC->GetValue());
@@ -1231,7 +1231,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColAsLinkFilte
pFC = m_pDoc->GetFormulaCell(ScAddress(3, 2, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D3", OUString("=$Sheet1.$C$4"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D3", u"=$Sheet1.$C$4"_ustr,
m_pDoc->GetFormula(3, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(14.0, pFC->GetValue());
@@ -1247,8 +1247,8 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAllAsLinkTranspose)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // Turn on auto calc.
- m_pDoc->InsertTab(srcSheet, "Sheet1");
- m_pDoc->InsertTab(destSheet, "Sheet2");
+ m_pDoc->InsertTab(srcSheet, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(destSheet, u"Sheet2"_ustr);
m_pDoc->SetValue(0, 0, srcSheet, 1); // A1
m_pDoc->SetValue(0, 1, srcSheet, 2); // A2
@@ -1272,25 +1272,25 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAllAsLinkTranspose)
// Check pasted content to make sure they reference the correct cells.
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell B2.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", OUString("=$Sheet1.$A$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", u"=$Sheet1.$A$1"_ustr,
m_pDoc->GetFormula(1, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(1.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(2, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C2", OUString("=$Sheet1.$A$2"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C2", u"=$Sheet1.$A$2"_ustr,
m_pDoc->GetFormula(2, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(2.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(3, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", OUString("=$Sheet1.$A$3"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", u"=$Sheet1.$A$3"_ustr,
m_pDoc->GetFormula(3, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(0.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(4, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", OUString("=$Sheet1.$A$4"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", u"=$Sheet1.$A$4"_ustr,
m_pDoc->GetFormula(4, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(4.0, pFC->GetValue());
@@ -1306,15 +1306,15 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAllAsLinkFilteredTranspo
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // Turn on auto calc.
- m_pDoc->InsertTab(srcSheet, "Sheet1");
- m_pDoc->InsertTab(destSheet, "Sheet2");
+ m_pDoc->InsertTab(srcSheet, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(destSheet, u"Sheet2"_ustr);
m_pDoc->SetValue(0, 0, srcSheet, 1); // A1
m_pDoc->SetValue(0, 1, srcSheet, 2); // A2
m_pDoc->SetValue(0, 3, srcSheet, 4); // A4
// Filter row 1
- ScDBData* pDBData = new ScDBData("TRANSPOSE_TEST_DATA", srcSheet, 0, 0, 0, 3);
+ ScDBData* pDBData = new ScDBData(u"TRANSPOSE_TEST_DATA"_ustr, srcSheet, 0, 0, 0, 3);
m_pDoc->SetAnonymousDBData(0, std::unique_ptr<ScDBData>(pDBData));
pDBData->SetAutoFilter(true);
@@ -1368,19 +1368,19 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAllAsLinkFilteredTranspo
// Check pasted content to make sure they reference the correct cells.
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell B2.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", OUString("=$Sheet1.$A$1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B2", u"=$Sheet1.$A$1"_ustr,
m_pDoc->GetFormula(1, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(1.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(2, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C2", OUString("=$Sheet1.$A$3"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C2", u"=$Sheet1.$A$3"_ustr,
m_pDoc->GetFormula(2, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(0.0, pFC->GetValue());
pFC = m_pDoc->GetFormulaCell(ScAddress(3, 1, destSheet));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", OUString("=$Sheet1.$A$4"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", u"=$Sheet1.$A$4"_ustr,
m_pDoc->GetFormula(3, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(4.0, pFC->GetValue());
@@ -1418,7 +1418,7 @@ void TestCopyPaste::executeCopyPasteSpecial(const SCTAB srcSheet, const SCTAB de
for (int i = 0; i < srcSheet; ++i)
m_pDoc->InsertTab(i, "Empty Tab " + OUString::number(i));
- m_pDoc->InsertTab(srcSheet, "SrcSheet");
+ m_pDoc->InsertTab(srcSheet, u"SrcSheet"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
@@ -1480,45 +1480,45 @@ void TestCopyPaste::executeCopyPasteSpecial(const SCTAB srcSheet, const SCTAB de
m_pDoc->SetValue(1, 4, srcSheet, 3);
m_pDoc->SetValue(1, 5, srcSheet, 4);
// col C
- m_pDoc->SetString(2, 2, srcSheet, "=B3+10");
- m_pDoc->SetString(2, 3, srcSheet, "=B4+20");
- m_pDoc->SetString(2, 4, srcSheet, "=E5+30");
- m_pDoc->SetString(2, 5, srcSheet, "=B4+40");
+ m_pDoc->SetString(2, 2, srcSheet, u"=B3+10"_ustr);
+ m_pDoc->SetString(2, 3, srcSheet, u"=B4+20"_ustr);
+ m_pDoc->SetString(2, 4, srcSheet, u"=E5+30"_ustr);
+ m_pDoc->SetString(2, 5, srcSheet, u"=B4+40"_ustr);
// col D
- m_pDoc->SetString(3, 2, srcSheet, "a");
- m_pDoc->SetString(3, 3, srcSheet, "b");
- m_pDoc->SetString(3, 4, srcSheet, "c");
- m_pDoc->SetString(3, 5, srcSheet, "d");
+ m_pDoc->SetString(3, 2, srcSheet, u"a"_ustr);
+ m_pDoc->SetString(3, 3, srcSheet, u"b"_ustr);
+ m_pDoc->SetString(3, 4, srcSheet, u"c"_ustr);
+ m_pDoc->SetString(3, 5, srcSheet, u"d"_ustr);
// col E
- rEditEngine.SetTextCurrentDefaults("R1");
+ rEditEngine.SetTextCurrentDefaults(u"R1"_ustr);
m_pDoc->SetEditText(ScAddress(4, 2, srcSheet), rEditEngine.CreateTextObject());
- rEditEngine.SetTextCurrentDefaults("R2");
+ rEditEngine.SetTextCurrentDefaults(u"R2"_ustr);
m_pDoc->SetEditText(ScAddress(4, 3, srcSheet), rEditEngine.CreateTextObject());
m_pDoc->SetValue(4, 4, srcSheet, 5);
- rEditEngine.SetTextCurrentDefaults("R4");
+ rEditEngine.SetTextCurrentDefaults(u"R4"_ustr);
m_pDoc->SetEditText(ScAddress(4, 5, srcSheet), rEditEngine.CreateTextObject());
// col F
m_pDoc->SetValue(5, 2, srcSheet, 9);
- m_pDoc->SetString(5, 2, srcSheet, "=B3+B5+60");
+ m_pDoc->SetString(5, 2, srcSheet, u"=B3+B5+60"_ustr);
m_pDoc->SetEmptyCell(ScAddress(5, 3, srcSheet));
m_pDoc->SetEmptyCell(ScAddress(5, 4, srcSheet));
- m_pDoc->SetString(5, 5, srcSheet, "=B3+B5+70");
+ m_pDoc->SetString(5, 5, srcSheet, u"=B3+B5+70"_ustr);
// col G
m_pDoc->SetValue(6, 2, srcSheet, 9);
- m_pDoc->SetString(6, 2, srcSheet, "=SUMIF(B3:B6;\"<4\")");
+ m_pDoc->SetString(6, 2, srcSheet, u"=SUMIF(B3:B6;\"<4\")"_ustr);
m_pDoc->SetEmptyCell(ScAddress(6, 3, srcSheet));
m_pDoc->SetEmptyCell(ScAddress(6, 4, srcSheet));
- m_pDoc->SetString(6, 5, srcSheet, "=C$3+$B$5+80");
+ m_pDoc->SetString(6, 5, srcSheet, u"=C$3+$B$5+80"_ustr);
const SfxPoolItem* pItem = nullptr;
// row 6, additional row for MultiRange test case, otherwise not selected
m_pDoc->SetValue(1, 6, srcSheet, 6);
- m_pDoc->SetString(2, 6, srcSheet, "q");
- m_pDoc->SetString(3, 6, srcSheet, "r");
- m_pDoc->SetString(4, 6, srcSheet, "s");
- m_pDoc->SetString(5, 6, srcSheet, "t");
- m_pDoc->SetString(6, 6, srcSheet, "u");
+ m_pDoc->SetString(2, 6, srcSheet, u"q"_ustr);
+ m_pDoc->SetString(3, 6, srcSheet, u"r"_ustr);
+ m_pDoc->SetString(4, 6, srcSheet, u"s"_ustr);
+ m_pDoc->SetString(5, 6, srcSheet, u"t"_ustr);
+ m_pDoc->SetString(6, 6, srcSheet, u"u"_ustr);
// row 7, not selected
m_pDoc->SetValue(1, 7, srcSheet, -1);
@@ -1569,43 +1569,50 @@ void TestCopyPaste::executeCopyPasteSpecial(const SCTAB srcSheet, const SCTAB de
m_pDoc->SetValue(9, 7, srcSheet, 136);
// row 16, refs to copied/cut range
- m_pDoc->SetString(1, 16, srcSheet, "=C5");
- m_pDoc->SetString(2, 16, srcSheet, "=$C$5");
- m_pDoc->SetString(3, 16, srcSheet, "=$C5");
- m_pDoc->SetString(4, 16, srcSheet, "=C$5");
- m_pDoc->SetString(5, 16, srcSheet, "=SUM(C5:C5)");
- m_pDoc->SetString(6, 16, srcSheet, "=SUM($C$5:$C$5)");
- m_pDoc->SetString(7, 16, srcSheet, "=SUM($C5:$C5)");
- m_pDoc->SetString(8, 16, srcSheet, "=SUM(C$5:C$5)");
- m_pDoc->SetString(9, 16, srcSheet, "=SUM($B$3:$B$6)");
- m_pDoc->SetString(10, 16, srcSheet, "=SUM($B$3:$B$10)");
+ m_pDoc->SetString(1, 16, srcSheet, u"=C5"_ustr);
+ m_pDoc->SetString(2, 16, srcSheet, u"=$C$5"_ustr);
+ m_pDoc->SetString(3, 16, srcSheet, u"=$C5"_ustr);
+ m_pDoc->SetString(4, 16, srcSheet, u"=C$5"_ustr);
+ m_pDoc->SetString(5, 16, srcSheet, u"=SUM(C5:C5)"_ustr);
+ m_pDoc->SetString(6, 16, srcSheet, u"=SUM($C$5:$C$5)"_ustr);
+ m_pDoc->SetString(7, 16, srcSheet, u"=SUM($C5:$C5)"_ustr);
+ m_pDoc->SetString(8, 16, srcSheet, u"=SUM(C$5:C$5)"_ustr);
+ m_pDoc->SetString(9, 16, srcSheet, u"=SUM($B$3:$B$6)"_ustr);
+ m_pDoc->SetString(10, 16, srcSheet, u"=SUM($B$3:$B$10)"_ustr);
// Cell position is used for ranges relative to current position
ScAddress cellC6(2, 5, srcSheet);
ScAddress cellA1(0, 0, srcSheet);
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_C5", cellC6, "$SrcSheet.C5"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_aCa5", cellA1, "$SrcSheet.$C$5"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_aC5", cellC6, "$SrcSheet.$C5"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_Ca5", cellC6, "$SrcSheet.C$5"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_C5_C5", cellC6, "$SrcSheet.C5:C5"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_aCa5_aCa5", cellA1, "$SrcSheet.$C$5:$C$5"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_aC5_aC5", cellC6, "$SrcSheet.$C5:$C5"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_aC5_aC5", cellC6, "$SrcSheet.$C5:$C5"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_Ca5_Ca5", cellC6, "$SrcSheet.C$5:C$5"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_aCa5_aCa8", cellA1, "$SrcSheet.$B$3:$B$6"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_aCa5_aCa10", cellA1, "$SrcSheet.$B$3:$B$10"));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_C5"_ustr, cellC6, u"$SrcSheet.C5"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_aCa5"_ustr, cellA1, u"$SrcSheet.$C$5"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_aC5"_ustr, cellC6, u"$SrcSheet.$C5"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_Ca5"_ustr, cellC6, u"$SrcSheet.C$5"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_C5_C5"_ustr, cellC6, u"$SrcSheet.C5:C5"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_aCa5_aCa5"_ustr, cellA1, u"$SrcSheet.$C$5:$C$5"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_aC5_aC5"_ustr, cellC6, u"$SrcSheet.$C5:$C5"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_aC5_aC5"_ustr, cellC6, u"$SrcSheet.$C5:$C5"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_Ca5_Ca5"_ustr, cellC6, u"$SrcSheet.C$5:C$5"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_aCa5_aCa8"_ustr, cellA1, u"$SrcSheet.$B$3:$B$6"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_aCa5_aCa10"_ustr, cellA1, u"$SrcSheet.$B$3:$B$10"_ustr));
// row 17, refs to copied/cut range using range
- m_pDoc->SetString(1, 17, srcSheet, "=Range_C5");
- m_pDoc->SetString(2, 17, srcSheet, "=Range_aCa5");
- m_pDoc->SetString(3, 17, srcSheet, "=Range_aC5");
- m_pDoc->SetString(4, 17, srcSheet, "=Range_Ca5");
- m_pDoc->SetString(5, 17, srcSheet, "=SUM(Range_C5_C5)");
- m_pDoc->SetString(6, 17, srcSheet, "=SUM(Range_aCa5_aCa5)");
- m_pDoc->SetString(7, 17, srcSheet, "=SUM(Range_aC5_aC5)");
- m_pDoc->SetString(8, 17, srcSheet, "=SUM(Range_Ca5_Ca5)");
- m_pDoc->SetString(9, 17, srcSheet, "=SUM(Range_aCa5_aCa8)");
- m_pDoc->SetString(10, 17, srcSheet, "=SUM(Range_aCa5_aCa10)");
+ m_pDoc->SetString(1, 17, srcSheet, u"=Range_C5"_ustr);
+ m_pDoc->SetString(2, 17, srcSheet, u"=Range_aCa5"_ustr);
+ m_pDoc->SetString(3, 17, srcSheet, u"=Range_aC5"_ustr);
+ m_pDoc->SetString(4, 17, srcSheet, u"=Range_Ca5"_ustr);
+ m_pDoc->SetString(5, 17, srcSheet, u"=SUM(Range_C5_C5)"_ustr);
+ m_pDoc->SetString(6, 17, srcSheet, u"=SUM(Range_aCa5_aCa5)"_ustr);
+ m_pDoc->SetString(7, 17, srcSheet, u"=SUM(Range_aC5_aC5)"_ustr);
+ m_pDoc->SetString(8, 17, srcSheet, u"=SUM(Range_Ca5_Ca5)"_ustr);
+ m_pDoc->SetString(9, 17, srcSheet, u"=SUM(Range_aCa5_aCa8)"_ustr);
+ m_pDoc->SetString(10, 17, srcSheet, u"=SUM(Range_aCa5_aCa10)"_ustr);
// add patterns
ScPatternAttr aCellBlueColor(m_pDoc->getCellAttributeHelper());
@@ -1671,39 +1678,39 @@ void TestCopyPaste::executeCopyPasteSpecial(const SCTAB srcSheet, const SCTAB de
// add notes to B3:F4
// add notes row 2
- setNote(1, 2, srcSheet, "Note A1");
- setNote(2, 2, srcSheet, "Note B1");
+ setNote(1, 2, srcSheet, u"Note A1"_ustr);
+ setNote(2, 2, srcSheet, u"Note B1"_ustr);
// No note on D3
- setNote(4, 2, srcSheet, "Note D1");
+ setNote(4, 2, srcSheet, u"Note D1"_ustr);
// No note on F3
// No note on G3
// add notes row 3
- setNote(1, 3, srcSheet, "Note A2");
+ setNote(1, 3, srcSheet, u"Note A2"_ustr);
// No note on C4
- setNote(3, 3, srcSheet, "Note C2");
- setNote(4, 3, srcSheet, "Note D2");
- setNote(5, 4, srcSheet, "Note E2");
- setNote(6, 3, srcSheet, "Note F2");
+ setNote(3, 3, srcSheet, u"Note C2"_ustr);
+ setNote(4, 3, srcSheet, u"Note D2"_ustr);
+ setNote(5, 4, srcSheet, u"Note E2"_ustr);
+ setNote(6, 3, srcSheet, u"Note F2"_ustr);
// add notes row 4
- setNote(1, 4, srcSheet, "Note A3");
- setNote(2, 4, srcSheet, "Note B3");
- setNote(3, 4, srcSheet, "Note C3");
- setNote(4, 4, srcSheet, "Note D3");
+ setNote(1, 4, srcSheet, u"Note A3"_ustr);
+ setNote(2, 4, srcSheet, u"Note B3"_ustr);
+ setNote(3, 4, srcSheet, u"Note C3"_ustr);
+ setNote(4, 4, srcSheet, u"Note D3"_ustr);
// No note on F5
// No note on G5
// add notes row 5
// No note on B6
- setNote(2, 5, srcSheet, "Note B4");
- setNote(3, 5, srcSheet, "Note C4");
- setNote(4, 5, srcSheet, "Note D4");
- setNote(5, 5, srcSheet, "Note E4");
- setNote(6, 5, srcSheet, "Note F4");
+ setNote(2, 5, srcSheet, u"Note B4"_ustr);
+ setNote(3, 5, srcSheet, u"Note C4"_ustr);
+ setNote(4, 5, srcSheet, u"Note D4"_ustr);
+ setNote(5, 5, srcSheet, u"Note E4"_ustr);
+ setNote(6, 5, srcSheet, u"Note F4"_ustr);
// row 6 for multi range row selection
- setNote(3, 6, srcSheet, "Note C5");
+ setNote(3, 6, srcSheet, u"Note C5"_ustr);
// Recalc if needed
if (bMultiRangeSelection && bTranspose && eDirection == ScClipParam::Row
@@ -1716,8 +1723,9 @@ void TestCopyPaste::executeCopyPasteSpecial(const SCTAB srcSheet, const SCTAB de
// Filter out row 3
if (bApplyFilter)
{
- ScDBData* pDBData = new ScDBData("TRANSPOSE_TEST_DATA", srcSheet, nStartCol, nStartRow,
- nStartCol + nSrcCols - 1, nStartRow + nSrcRows - 1);
+ ScDBData* pDBData
+ = new ScDBData(u"TRANSPOSE_TEST_DATA"_ustr, srcSheet, nStartCol, nStartRow,
+ nStartCol + nSrcCols - 1, nStartRow + nSrcRows - 1);
m_pDoc->SetAnonymousDBData(srcSheet, std::unique_ptr<ScDBData>(pDBData));
pDBData->SetAutoFilter(true);
@@ -1759,57 +1767,57 @@ void TestCopyPaste::executeCopyPasteSpecial(const SCTAB srcSheet, const SCTAB de
m_pDoc->InsertTab(i, "Empty Tab " + OUString::number(i));
if (srcSheet != destSheet)
- m_pDoc->InsertTab(destSheet, "DestSheet");
-
- m_pDoc->SetString(3, 101, srcSheet, "=DestSheet.D1");
- m_pDoc->SetString(3, 102, srcSheet, "=DestSheet.D2");
- m_pDoc->SetString(3, 103, srcSheet, "=DestSheet.D3");
- m_pDoc->SetString(3, 104, srcSheet, "=DestSheet.D4");
- m_pDoc->SetString(3, 105, srcSheet, "=DestSheet.D5");
- m_pDoc->SetString(3, 106, srcSheet, "=DestSheet.D6");
- m_pDoc->SetString(3, 107, srcSheet, "=DestSheet.D7");
- m_pDoc->SetString(4, 101, srcSheet, "=DestSheet.E1");
- m_pDoc->SetString(4, 102, srcSheet, "=DestSheet.E2");
- m_pDoc->SetString(4, 103, srcSheet, "=DestSheet.E3");
- m_pDoc->SetString(4, 104, srcSheet, "=DestSheet.E4");
- m_pDoc->SetString(4, 105, srcSheet, "=DestSheet.E5");
- m_pDoc->SetString(4, 106, srcSheet, "=DestSheet.E6");
- m_pDoc->SetString(4, 107, srcSheet, "=DestSheet.E7");
- m_pDoc->SetString(5, 101, srcSheet, "=DestSheet.F1");
- m_pDoc->SetString(5, 102, srcSheet, "=DestSheet.F2");
- m_pDoc->SetString(5, 103, srcSheet, "=DestSheet.F3");
- m_pDoc->SetString(5, 104, srcSheet, "=DestSheet.F4");
- m_pDoc->SetString(5, 105, srcSheet, "=DestSheet.F5");
- m_pDoc->SetString(5, 106, srcSheet, "=DestSheet.F6");
- m_pDoc->SetString(5, 107, srcSheet, "=DestSheet.F7");
- m_pDoc->SetString(6, 101, srcSheet, "=DestSheet.G1");
- m_pDoc->SetString(6, 102, srcSheet, "=DestSheet.G2");
- m_pDoc->SetString(6, 103, srcSheet, "=DestSheet.G3");
- m_pDoc->SetString(6, 104, srcSheet, "=DestSheet.G4");
- m_pDoc->SetString(6, 105, srcSheet, "=DestSheet.G5");
- m_pDoc->SetString(6, 106, srcSheet, "=DestSheet.G6");
- m_pDoc->SetString(6, 107, srcSheet, "=DestSheet.G7");
- m_pDoc->SetString(7, 101, srcSheet, "=DestSheet.H1");
- m_pDoc->SetString(7, 102, srcSheet, "=DestSheet.H2");
- m_pDoc->SetString(7, 103, srcSheet, "=DestSheet.H3");
- m_pDoc->SetString(7, 104, srcSheet, "=DestSheet.H4");
- m_pDoc->SetString(7, 105, srcSheet, "=DestSheet.H5");
- m_pDoc->SetString(7, 106, srcSheet, "=DestSheet.H6");
- m_pDoc->SetString(7, 107, srcSheet, "=DestSheet.H7");
- m_pDoc->SetString(8, 101, srcSheet, "=DestSheet.I1");
- m_pDoc->SetString(8, 102, srcSheet, "=DestSheet.I2");
- m_pDoc->SetString(8, 103, srcSheet, "=DestSheet.I3");
- m_pDoc->SetString(8, 104, srcSheet, "=DestSheet.I4");
- m_pDoc->SetString(8, 105, srcSheet, "=DestSheet.I5");
- m_pDoc->SetString(8, 106, srcSheet, "=DestSheet.I6");
- m_pDoc->SetString(8, 107, srcSheet, "=DestSheet.I7");
- m_pDoc->SetString(9, 101, srcSheet, "=DestSheet.J1");
- m_pDoc->SetString(9, 102, srcSheet, "=DestSheet.J2");
- m_pDoc->SetString(9, 103, srcSheet, "=DestSheet.J3");
- m_pDoc->SetString(9, 104, srcSheet, "=DestSheet.J4");
- m_pDoc->SetString(9, 105, srcSheet, "=DestSheet.J5");
- m_pDoc->SetString(9, 106, srcSheet, "=DestSheet.J6");
- m_pDoc->SetString(9, 107, srcSheet, "=DestSheet.J7");
+ m_pDoc->InsertTab(destSheet, u"DestSheet"_ustr);
+
+ m_pDoc->SetString(3, 101, srcSheet, u"=DestSheet.D1"_ustr);
+ m_pDoc->SetString(3, 102, srcSheet, u"=DestSheet.D2"_ustr);
+ m_pDoc->SetString(3, 103, srcSheet, u"=DestSheet.D3"_ustr);
+ m_pDoc->SetString(3, 104, srcSheet, u"=DestSheet.D4"_ustr);
+ m_pDoc->SetString(3, 105, srcSheet, u"=DestSheet.D5"_ustr);
+ m_pDoc->SetString(3, 106, srcSheet, u"=DestSheet.D6"_ustr);
+ m_pDoc->SetString(3, 107, srcSheet, u"=DestSheet.D7"_ustr);
+ m_pDoc->SetString(4, 101, srcSheet, u"=DestSheet.E1"_ustr);
+ m_pDoc->SetString(4, 102, srcSheet, u"=DestSheet.E2"_ustr);
+ m_pDoc->SetString(4, 103, srcSheet, u"=DestSheet.E3"_ustr);
+ m_pDoc->SetString(4, 104, srcSheet, u"=DestSheet.E4"_ustr);
+ m_pDoc->SetString(4, 105, srcSheet, u"=DestSheet.E5"_ustr);
+ m_pDoc->SetString(4, 106, srcSheet, u"=DestSheet.E6"_ustr);
+ m_pDoc->SetString(4, 107, srcSheet, u"=DestSheet.E7"_ustr);
+ m_pDoc->SetString(5, 101, srcSheet, u"=DestSheet.F1"_ustr);
+ m_pDoc->SetString(5, 102, srcSheet, u"=DestSheet.F2"_ustr);
+ m_pDoc->SetString(5, 103, srcSheet, u"=DestSheet.F3"_ustr);
+ m_pDoc->SetString(5, 104, srcSheet, u"=DestSheet.F4"_ustr);
+ m_pDoc->SetString(5, 105, srcSheet, u"=DestSheet.F5"_ustr);
+ m_pDoc->SetString(5, 106, srcSheet, u"=DestSheet.F6"_ustr);
+ m_pDoc->SetString(5, 107, srcSheet, u"=DestSheet.F7"_ustr);
+ m_pDoc->SetString(6, 101, srcSheet, u"=DestSheet.G1"_ustr);
+ m_pDoc->SetString(6, 102, srcSheet, u"=DestSheet.G2"_ustr);
+ m_pDoc->SetString(6, 103, srcSheet, u"=DestSheet.G3"_ustr);
+ m_pDoc->SetString(6, 104, srcSheet, u"=DestSheet.G4"_ustr);
+ m_pDoc->SetString(6, 105, srcSheet, u"=DestSheet.G5"_ustr);
+ m_pDoc->SetString(6, 106, srcSheet, u"=DestSheet.G6"_ustr);
+ m_pDoc->SetString(6, 107, srcSheet, u"=DestSheet.G7"_ustr);
+ m_pDoc->SetString(7, 101, srcSheet, u"=DestSheet.H1"_ustr);
+ m_pDoc->SetString(7, 102, srcSheet, u"=DestSheet.H2"_ustr);
+ m_pDoc->SetString(7, 103, srcSheet, u"=DestSheet.H3"_ustr);
+ m_pDoc->SetString(7, 104, srcSheet, u"=DestSheet.H4"_ustr);
+ m_pDoc->SetString(7, 105, srcSheet, u"=DestSheet.H5"_ustr);
+ m_pDoc->SetString(7, 106, srcSheet, u"=DestSheet.H6"_ustr);
+ m_pDoc->SetString(7, 107, srcSheet, u"=DestSheet.H7"_ustr);
+ m_pDoc->SetString(8, 101, srcSheet, u"=DestSheet.I1"_ustr);
+ m_pDoc->SetString(8, 102, srcSheet, u"=DestSheet.I2"_ustr);
+ m_pDoc->SetString(8, 103, srcSheet, u"=DestSheet.I3"_ustr);
+ m_pDoc->SetString(8, 104, srcSheet, u"=DestSheet.I4"_ustr);
+ m_pDoc->SetString(8, 105, srcSheet, u"=DestSheet.I5"_ustr);
+ m_pDoc->SetString(8, 106, srcSheet, u"=DestSheet.I6"_ustr);
+ m_pDoc->SetString(8, 107, srcSheet, u"=DestSheet.I7"_ustr);
+ m_pDoc->SetString(9, 101, srcSheet, u"=DestSheet.J1"_ustr);
+ m_pDoc->SetString(9, 102, srcSheet, u"=DestSheet.J2"_ustr);
+ m_pDoc->SetString(9, 103, srcSheet, u"=DestSheet.J3"_ustr);
+ m_pDoc->SetString(9, 104, srcSheet, u"=DestSheet.J4"_ustr);
+ m_pDoc->SetString(9, 105, srcSheet, u"=DestSheet.J5"_ustr);
+ m_pDoc->SetString(9, 106, srcSheet, u"=DestSheet.J6"_ustr);
+ m_pDoc->SetString(9, 107, srcSheet, u"=DestSheet.J7"_ustr);
// Check precondition
checkCopyPasteSpecialInitial(srcSheet);
@@ -2385,42 +2393,42 @@ void TestCopyPaste::checkCopyPasteSpecialInitial(const SCTAB srcSheet)
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(1, 5, srcSheet));
// col 2, formulas
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(2, 2, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=B3+10"), m_pDoc->GetFormula(2, 2, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=B4+20"), m_pDoc->GetFormula(2, 3, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=B3+10"_ustr, m_pDoc->GetFormula(2, 2, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=B4+20"_ustr, m_pDoc->GetFormula(2, 3, srcSheet));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(2, 3, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 4, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=E5+30"), m_pDoc->GetFormula(2, 4, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=E5+30"_ustr, m_pDoc->GetFormula(2, 4, srcSheet));
CPPUNIT_ASSERT_EQUAL(42.0, m_pDoc->GetValue(2, 5, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=B4+40"), m_pDoc->GetFormula(2, 5, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=B4+40"_ustr, m_pDoc->GetFormula(2, 5, srcSheet));
// col 3, strings
- CPPUNIT_ASSERT_EQUAL(OUString("a"), m_pDoc->GetString(3, 2, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("b"), m_pDoc->GetString(3, 3, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("c"), m_pDoc->GetString(3, 4, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("d"), m_pDoc->GetString(3, 5, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, m_pDoc->GetString(3, 2, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"b"_ustr, m_pDoc->GetString(3, 3, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"c"_ustr, m_pDoc->GetString(3, 4, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"d"_ustr, m_pDoc->GetString(3, 5, srcSheet));
// col 4, rich text
pEditObj = m_pDoc->GetEditText(ScAddress(4, 2, srcSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pEditObj->GetText(0));
pEditObj = m_pDoc->GetEditText(ScAddress(4, 3, srcSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R2"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R2"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(4, 4, srcSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(4, 5, srcSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R4"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R4"_ustr, pEditObj->GetText(0));
// col 5, formulas
- CPPUNIT_ASSERT_EQUAL(OUString("=B3+B5+60"), m_pDoc->GetFormula(5, 2, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=B3+B5+60"_ustr, m_pDoc->GetFormula(5, 2, srcSheet));
CPPUNIT_ASSERT_EQUAL(64.0, m_pDoc->GetValue(5, 2, srcSheet));
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetString(5, 3, srcSheet));
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetString(5, 4, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=B3+B5+70"), m_pDoc->GetFormula(5, 5, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=B3+B5+70"_ustr, m_pDoc->GetFormula(5, 5, srcSheet));
CPPUNIT_ASSERT_EQUAL(74.0, m_pDoc->GetValue(5, 5, srcSheet));
// col 6, formulas
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMIF(B3:B6;\"<4\")"), m_pDoc->GetFormula(6, 2, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUMIF(B3:B6;\"<4\")"_ustr, m_pDoc->GetFormula(6, 2, srcSheet));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(6, 2, srcSheet));
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetString(6, 3, srcSheet));
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetString(6, 4, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$3+$B$5+80"), m_pDoc->GetFormula(6, 5, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$3+$B$5+80"_ustr, m_pDoc->GetFormula(6, 5, srcSheet));
CPPUNIT_ASSERT_EQUAL(94.0, m_pDoc->GetValue(6, 5, srcSheet));
// check patterns
@@ -2511,31 +2519,31 @@ void TestCopyPaste::checkCopyPasteSpecialInitial(const SCTAB srcSheet)
CPPUNIT_ASSERT(!m_pDoc->HasNote(7, 6, srcSheet));
// check values of notes
- CPPUNIT_ASSERT_EQUAL(OUString("Note A1"), getNote(1, 2, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A2"), getNote(1, 3, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A3"), getNote(1, 4, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B1"), getNote(2, 2, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B3"), getNote(2, 4, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note C2"), getNote(3, 3, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note C3"), getNote(3, 4, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D1"), getNote(4, 2, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D2"), getNote(4, 3, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D3"), getNote(4, 4, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(5, 4, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note E4"), getNote(5, 5, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note F2"), getNote(6, 3, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note F4"), getNote(6, 5, srcSheet));
-
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$5"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C5"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$5"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C5:C5)"), m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$5:$C$5)"), m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C5:$C5)"), m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C$5:C$5)"), m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$6)"), m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A1"_ustr, getNote(1, 2, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A2"_ustr, getNote(1, 3, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A3"_ustr, getNote(1, 4, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B1"_ustr, getNote(2, 2, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B3"_ustr, getNote(2, 4, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note C2"_ustr, getNote(3, 3, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note C3"_ustr, getNote(3, 4, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D1"_ustr, getNote(4, 2, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D2"_ustr, getNote(4, 3, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D3"_ustr, getNote(4, 4, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(5, 4, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E4"_ustr, getNote(5, 5, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note F2"_ustr, getNote(6, 3, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note F4"_ustr, getNote(6, 5, srcSheet));
+
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$5"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C5"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$5"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C5:C5)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$5:$C$5)"_ustr, m_pDoc->GetFormula(6, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C5:$C5)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C$5:C$5)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$6)"_ustr, m_pDoc->GetFormula(9, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -2548,16 +2556,16 @@ void TestCopyPaste::checkCopyPasteSpecialInitial(const SCTAB srcSheet)
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"), m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"), m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"), m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -2571,55 +2579,55 @@ void TestCopyPaste::checkCopyPasteSpecialInitial(const SCTAB srcSheet)
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 17, srcSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
}
// Base check, nothing filtered, nothing transposed
@@ -2659,44 +2667,44 @@ void TestCopyPaste::checkCopyPasteSpecial(bool bSkipEmpty, bool bCut)
// col 4, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+10"), m_pDoc->GetFormula(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D3+20"), m_pDoc->GetFormula(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+10"_ustr, m_pDoc->GetFormula(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D3+20"_ustr, m_pDoc->GetFormula(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=G4+30"), m_pDoc->GetFormula(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=G4+30"_ustr, m_pDoc->GetFormula(4, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(42.0, m_pDoc->GetValue(4, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D3+40"), m_pDoc->GetFormula(4, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D3+40"_ustr, m_pDoc->GetFormula(4, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 5, destSheet));
// col 5, strings
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(5, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), m_pDoc->GetString(5, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("b"), m_pDoc->GetString(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("c"), m_pDoc->GetString(5, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("d"), m_pDoc->GetString(5, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(5, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, m_pDoc->GetString(5, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"b"_ustr, m_pDoc->GetString(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"c"_ustr, m_pDoc->GetString(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"d"_ustr, m_pDoc->GetString(5, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(5, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(5, 5, destSheet));
// col 6, rich text
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 0, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 0, destSheet));
CPPUNIT_ASSERT(pEditObj == nullptr);
pEditObj = m_pDoc->GetEditText(ScAddress(6, 1, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pEditObj->GetText(0));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 2, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R2"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R2"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(6, 3, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 4, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R4"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R4"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 5, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 5, destSheet));
CPPUNIT_ASSERT(pEditObj == nullptr);
// col 7, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+D4+60"), m_pDoc->GetFormula(7, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+D4+60"_ustr, m_pDoc->GetFormula(7, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(64.0, m_pDoc->GetValue(7, 1, destSheet));
if (!bSkipEmpty)
{
@@ -2708,14 +2716,14 @@ void TestCopyPaste::checkCopyPasteSpecial(bool bSkipEmpty, bool bCut)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 3, destSheet));
}
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+D4+70"), m_pDoc->GetFormula(7, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+D4+70"_ustr, m_pDoc->GetFormula(7, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(74.0, m_pDoc->GetValue(7, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 5, destSheet));
// col 8, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(8, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMIF(D2:D5;\"<4\")"), m_pDoc->GetFormula(8, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(8, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUMIF(D2:D5;\"<4\")"_ustr, m_pDoc->GetFormula(8, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(8, 1, destSheet));
if (!bSkipEmpty)
{
@@ -2731,16 +2739,16 @@ void TestCopyPaste::checkCopyPasteSpecial(bool bSkipEmpty, bool bCut)
OUString aStr = m_pDoc->GetFormula(8, 4, destSheet);
if (!bCut)
{
- CPPUNIT_ASSERT_EQUAL(OUString("=E$3+$B$5+80"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"=E$3+$B$5+80"_ustr, aStr);
CPPUNIT_ASSERT_EQUAL(1102.0, fValue);
}
else
{
- CPPUNIT_ASSERT_EQUAL(OUString("=E$2+$D$4+80"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"=E$2+$D$4+80"_ustr, aStr);
CPPUNIT_ASSERT_EQUAL(94.0, fValue);
}
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(8, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(8, 5, destSheet));
// col 9, numbers
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(9, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(9, 1, destSheet));
@@ -2851,87 +2859,87 @@ void TestCopyPaste::checkCopyPasteSpecial(bool bSkipEmpty, bool bCut)
CPPUNIT_ASSERT(!m_pDoc->HasNote(9, 5, destSheet));
// check values of notes
- CPPUNIT_ASSERT_EQUAL(OUString("Note A1"), getNote(3, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A2"), getNote(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A3"), getNote(3, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B1"), getNote(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B3"), getNote(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note C2"), getNote(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note C3"), getNote(5, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D1"), getNote(6, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D2"), getNote(6, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D3"), getNote(6, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A1"_ustr, getNote(3, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A2"_ustr, getNote(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A3"_ustr, getNote(3, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B1"_ustr, getNote(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B3"_ustr, getNote(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note C2"_ustr, getNote(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note C3"_ustr, getNote(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D1"_ustr, getNote(6, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D2"_ustr, getNote(6, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D3"_ustr, getNote(6, 3, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(7, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note E4"), getNote(7, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(7, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E4"_ustr, getNote(7, 4, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note F2"), getNote(8, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note F4"), getNote(8, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note F2"_ustr, getNote(8, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note F4"_ustr, getNote(8, 4, destSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
// row 14 on src sheet, refs to copied/cut range
if (!bCut)
{
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$5"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C5"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$5"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C5:C5)"), m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$5:$C$5)"), m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C5:$C5)"), m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C$5:C$5)"), m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$6)"), m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$5"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C5"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$5"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C5:C5)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$5:$C$5)"_ustr, m_pDoc->GetFormula(6, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C5:$C5)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C$5:C$5)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$6)"_ustr, m_pDoc->GetFormula(9, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -2944,19 +2952,16 @@ void TestCopyPaste::checkCopyPasteSpecial(bool bSkipEmpty, bool bCut)
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"),
- m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"),
- m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"),
- m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -2974,21 +2979,18 @@ void TestCopyPaste::checkCopyPasteSpecial(bool bSkipEmpty, bool bCut)
}
else
{
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.$E$4"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.$E4"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E$4"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(DestSheet.E4:E4)"),
- m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(DestSheet.$E$4:$E$4)"),
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.$E$4"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.$E4"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E$4"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(DestSheet.E4:E4)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(DestSheet.$E$4:$E$4)"_ustr,
m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(DestSheet.$E4:$E4)"),
- m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(DestSheet.E$4:E$4)"),
- m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(DestSheet.$D$2:$D$5)"),
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(DestSheet.$E4:$E4)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(DestSheet.E$4:E$4)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(DestSheet.$D$2:$D$5)"_ustr,
m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -3001,19 +3003,16 @@ void TestCopyPaste::checkCopyPasteSpecial(bool bSkipEmpty, bool bCut)
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-27.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"),
- m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"),
- m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"),
- m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -3066,21 +3065,21 @@ void TestCopyPaste::checkCopyPasteSpecialFiltered(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(4, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+10"), m_pDoc->GetFormula(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=G3+30"), m_pDoc->GetFormula(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+10"_ustr, m_pDoc->GetFormula(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=G3+30"_ustr, m_pDoc->GetFormula(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+40"), m_pDoc->GetFormula(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+40"_ustr, m_pDoc->GetFormula(4, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(41.0, m_pDoc->GetValue(4, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(4, 4, destSheet)); // repeated row 1
- CPPUNIT_ASSERT_EQUAL(OUString("=D5+10"), m_pDoc->GetFormula(4, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D5+10"_ustr, m_pDoc->GetFormula(4, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(4, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 5, destSheet));
// col 5, strings
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), m_pDoc->GetString(5, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("c"), m_pDoc->GetString(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("d"), m_pDoc->GetString(5, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), m_pDoc->GetString(5, 4, destSheet)); // repeated row 1
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, m_pDoc->GetString(5, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"c"_ustr, m_pDoc->GetString(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"d"_ustr, m_pDoc->GetString(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, m_pDoc->GetString(5, 4, destSheet)); // repeated row 1
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(4, 5, destSheet));
// col 6, rich text
@@ -3089,50 +3088,49 @@ void TestCopyPaste::checkCopyPasteSpecialFiltered(bool bSkipEmpty)
CPPUNIT_ASSERT(pEditObj == nullptr);
pEditObj = m_pDoc->GetEditText(ScAddress(6, 1, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(6, 2, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 3, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R4"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R4"_ustr, pEditObj->GetText(0));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 4, destSheet)); // repeated row 1
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 5, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 5, destSheet));
CPPUNIT_ASSERT(pEditObj == nullptr);
// col 7, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+D4+60"), m_pDoc->GetFormula(7, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+D4+60"_ustr, m_pDoc->GetFormula(7, 1, destSheet));
// formula is not adjusted due to filter row
CPPUNIT_ASSERT_EQUAL(65.0, m_pDoc->GetValue(7, 1, destSheet));
if (!bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetString(7, 2, destSheet));
else
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D1+D3+70"), m_pDoc->GetFormula(7, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D1+D3+70"_ustr, m_pDoc->GetFormula(7, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(1073.0, m_pDoc->GetValue(7, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D5+D7+60"),
- m_pDoc->GetFormula(7, 4, destSheet)); // repeated row 1
+ CPPUNIT_ASSERT_EQUAL(u"=D5+D7+60"_ustr, m_pDoc->GetFormula(7, 4, destSheet)); // repeated row 1
// formula is not adjusted due to filter row
CPPUNIT_ASSERT_EQUAL(1061.0, m_pDoc->GetValue(7, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 5, destSheet));
// col 8, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(8, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMIF(D2:D5;\"<4\")"), m_pDoc->GetFormula(8, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(8, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUMIF(D2:D5;\"<4\")"_ustr, m_pDoc->GetFormula(8, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(8, 1, destSheet));
if (!bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetString(8, 2, destSheet));
else
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(1115.0, m_pDoc->GetValue(8, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=E$3+$B$5+80"), m_pDoc->GetFormula(8, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMIF(D5:D8;\"<4\")"), m_pDoc->GetFormula(8, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=E$3+$B$5+80"_ustr, m_pDoc->GetFormula(8, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUMIF(D5:D8;\"<4\")"_ustr, m_pDoc->GetFormula(8, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(8, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(8, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(8, 5, destSheet));
// col 9, numbers
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(9, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(9, 1, destSheet));
@@ -3238,17 +3236,17 @@ void TestCopyPaste::checkCopyPasteSpecialFiltered(bool bSkipEmpty)
CPPUNIT_ASSERT(!m_pDoc->HasNote(9, 5, destSheet));
// check values of notes
- CPPUNIT_ASSERT_EQUAL(OUString("Note A1"), getNote(3, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A3"), getNote(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B1"), getNote(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B3"), getNote(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note C3"), getNote(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D1"), getNote(6, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D3"), getNote(6, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A1"_ustr, getNote(3, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A3"_ustr, getNote(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B1"_ustr, getNote(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B3"_ustr, getNote(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note C3"_ustr, getNote(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D1"_ustr, getNote(6, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D3"_ustr, getNote(6, 2, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(7, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note E4"), getNote(7, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note F4"), getNote(8, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(7, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E4"_ustr, getNote(7, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note F4"_ustr, getNote(8, 3, destSheet));
m_pDoc->DeleteTab(destSheet);
m_pDoc->DeleteTab(srcSheet);
@@ -3294,52 +3292,51 @@ void TestCopyPaste::checkCopyPasteSpecialTranspose(bool bSkipEmpty, bool bCut)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 1, destSheet));
// row 2, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D3", OUString("=D2+10"),
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D3", u"=D2+10"_ustr,
m_pDoc->GetFormula(3, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D3", 11.0, m_pDoc->GetValue(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed E3", OUString("=E2+20"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed E3", u"=E2+20"_ustr,
m_pDoc->GetFormula(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed E3", 22.0, m_pDoc->GetValue(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F3", OUString("=F5+30"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F3", u"=F5+30"_ustr,
m_pDoc->GetFormula(5, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F3", 35.0, m_pDoc->GetValue(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G3", OUString("=E2+40"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G3", u"=E2+40"_ustr,
m_pDoc->GetFormula(6, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G3", 42.0, m_pDoc->GetValue(6, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 2, destSheet));
// row 3, strings
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D4", OUString("a"), m_pDoc->GetString(3, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", OUString("b"), m_pDoc->GetString(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", OUString("c"), m_pDoc->GetString(5, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G4", OUString("d"), m_pDoc->GetString(6, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D4", u"a"_ustr, m_pDoc->GetString(3, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", u"b"_ustr, m_pDoc->GetString(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", u"c"_ustr, m_pDoc->GetString(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G4", u"d"_ustr, m_pDoc->GetString(6, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 3, destSheet));
// row 4, rich text
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 4, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(2, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be no edit cell in C5.", pEditObj == nullptr);
pEditObj = m_pDoc->GetEditText(ScAddress(3, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell in D5.", pEditObj);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong in D5 ", OUString("R1"),
- pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong in D5 ", u"R1"_ustr, pEditObj->GetText(0));
pEditObj = m_pDoc->GetEditText(ScAddress(4, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell in E5.", pEditObj);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong E5.", OUString("R2"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong E5.", u"R2"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed cell F5", 5.0, m_pDoc->GetValue(5, 4, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell in G5.", pEditObj);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong G5.", OUString("R4"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong G5.", u"R4"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 4, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(7, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be no edit cell in H5.", pEditObj == nullptr);
// row 5, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D6", OUString("=D2+F2+60"),
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D6", u"=D2+F2+60"_ustr,
m_pDoc->GetFormula(3, 5, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D6", 64.0, m_pDoc->GetValue(3, 5, destSheet));
if (!bSkipEmpty)
@@ -3352,15 +3349,15 @@ void TestCopyPaste::checkCopyPasteSpecialTranspose(bool bSkipEmpty, bool bCut)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 5, destSheet));
}
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G6", OUString("=D2+F2+70"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G6", u"=D2+F2+70"_ustr,
m_pDoc->GetFormula(6, 5, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G6", 74.0, m_pDoc->GetValue(6, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 5, destSheet));
// row 6, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D7", OUString("=SUMIF(D2:G2;\"<4\")"),
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D7", u"=SUMIF(D2:G2;\"<4\")"_ustr,
m_pDoc->GetFormula(3, 6, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D7", 6.0, m_pDoc->GetValue(3, 6, destSheet));
if (!bSkipEmpty)
@@ -3377,16 +3374,16 @@ void TestCopyPaste::checkCopyPasteSpecialTranspose(bool bSkipEmpty, bool bCut)
OUString aStr = m_pDoc->GetFormula(6, 6, destSheet); // G7
if (!bCut)
{
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G7", OUString("=C$3+$B$5+80"), aStr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G7", u"=C$3+$B$5+80"_ustr, aStr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G7", 2080.0, fValue);
}
else
{
- CPPUNIT_ASSERT_EQUAL(OUString("=D$3+$F$2+80"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"=D$3+$F$2+80"_ustr, aStr);
CPPUNIT_ASSERT_EQUAL(94.0, fValue);
}
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 6, destSheet));
// row 7
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 7, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(3, 7, destSheet));
@@ -3524,39 +3521,39 @@ void TestCopyPaste::checkCopyPasteSpecialTranspose(bool bSkipEmpty, bool bCut)
CPPUNIT_ASSERT_MESSAGE("H8: no note", !m_pDoc->HasNote(7, 7, destSheet));
// check values of notes
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", OUString("Note A1"), getNote(3, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", OUString("Note A2"), getNote(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F2", OUString("Note A3"), getNote(5, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", u"Note A1"_ustr, getNote(3, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", u"Note A2"_ustr, getNote(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F2", u"Note A3"_ustr, getNote(5, 1, destSheet));
// G2 has no note
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D3", OUString("Note B1"), getNote(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D3", u"Note B1"_ustr, getNote(3, 2, destSheet));
// E3 has no note
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F3", OUString("Note B3"), getNote(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F3", u"Note B3"_ustr, getNote(5, 2, destSheet));
// D4 has no note
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", OUString("Note C2"), getNote(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", OUString("Note C3"), getNote(5, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D5", OUString("Note D1"), getNote(3, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E5", OUString("Note D2"), getNote(4, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F5", OUString("Note D3"), getNote(5, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", u"Note C2"_ustr, getNote(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", u"Note C3"_ustr, getNote(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D5", u"Note D1"_ustr, getNote(3, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E5", u"Note D2"_ustr, getNote(4, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F5", u"Note D3"_ustr, getNote(5, 4, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(5, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G6", OUString("Note E4"), getNote(6, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(5, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G6", u"Note E4"_ustr, getNote(6, 5, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E7", OUString("Note F2"), getNote(4, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G7", OUString("Note F4"), getNote(6, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E7", u"Note F2"_ustr, getNote(4, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G7", u"Note F4"_ustr, getNote(6, 6, destSheet));
// row 14 on src sheet, refs to copied/cut range
if (!bCut)
{
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$5"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C5"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$5"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C5:C5)"), m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$5:$C$5)"), m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C5:$C5)"), m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C$5:C$5)"), m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$6)"), m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$5"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C5"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$5"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C5:C5)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$5:$C$5)"_ustr, m_pDoc->GetFormula(6, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C5:$C5)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C$5:C$5)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$6)"_ustr, m_pDoc->GetFormula(9, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -3569,19 +3566,16 @@ void TestCopyPaste::checkCopyPasteSpecialTranspose(bool bSkipEmpty, bool bCut)
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"),
- m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"),
- m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"),
- m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -3595,76 +3589,73 @@ void TestCopyPaste::checkCopyPasteSpecialTranspose(bool bSkipEmpty, bool bCut)
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 17, srcSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
m_pDoc->DeleteTab(destSheet);
m_pDoc->DeleteTab(srcSheet);
}
else
{
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.$F$3"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.$F3"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F$3"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(DestSheet.F3:F3)"),
- m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(DestSheet.$F$3:$F$3)"),
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.$F$3"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.$F3"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F$3"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(DestSheet.F3:F3)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(DestSheet.$F$3:$F$3)"_ustr,
m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(DestSheet.$F3:$F3)"),
- m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(DestSheet.F$3:F$3)"),
- m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(DestSheet.$D$2:$G$2)"),
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(DestSheet.$F3:$F3)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(DestSheet.F$3:F$3)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(DestSheet.$D$2:$G$2)"_ustr,
m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -3677,19 +3668,16 @@ void TestCopyPaste::checkCopyPasteSpecialTranspose(bool bSkipEmpty, bool bCut)
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-27.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"),
- m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"),
- m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"),
- m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -3703,55 +3691,55 @@ void TestCopyPaste::checkCopyPasteSpecialTranspose(bool bSkipEmpty, bool bCut)
CPPUNIT_ASSERT_EQUAL(-27.0, m_pDoc->GetValue(10, 17, srcSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
}
}
@@ -3789,64 +3777,63 @@ void TestCopyPaste::checkCopyPasteSpecialFilteredTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 0, destSheet));
// row 1, numbers
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 1, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed cell D2", 1.0, m_pDoc->GetValue(3, 1, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed cell E2", 3.0, m_pDoc->GetValue(4, 1, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed cell F2", 4.0, m_pDoc->GetValue(5, 1, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed cell G2 (repetition of D2)", 1.0,
m_pDoc->GetValue(6, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 1, destSheet));
// row 2, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D3", 11.0, m_pDoc->GetValue(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D3", OUString("=D2+10"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D3", u"=D2+10"_ustr,
m_pDoc->GetFormula(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed E3", OUString("=E5+30"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed E3", u"=E5+30"_ustr,
m_pDoc->GetFormula(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed E3", 35.0, m_pDoc->GetValue(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F3", OUString("=D2+40"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F3", u"=D2+40"_ustr,
m_pDoc->GetFormula(5, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F3", 41.0, m_pDoc->GetValue(5, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F3", 11.0, m_pDoc->GetValue(6, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G3 (repetition of D3)", OUString("=G2+10"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G3 (repetition of D3)", u"=G2+10"_ustr,
m_pDoc->GetFormula(6, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 2, destSheet));
// row 3, strings
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D4", OUString("a"), m_pDoc->GetString(3, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", OUString("c"), m_pDoc->GetString(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", OUString("d"), m_pDoc->GetString(5, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G4 (repetition of D4)", OUString("a"),
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D4", u"a"_ustr, m_pDoc->GetString(3, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", u"c"_ustr, m_pDoc->GetString(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", u"d"_ustr, m_pDoc->GetString(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G4 (repetition of D4)", u"a"_ustr,
m_pDoc->GetString(6, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 3, destSheet));
// row 4, rich text
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 4, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(2, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be no edit cell in C5.", pEditObj == nullptr);
pEditObj = m_pDoc->GetEditText(ScAddress(3, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell in D5.", pEditObj);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong in D5 ", OUString("R1"),
- pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong in D5 ", u"R1"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed cell E5", 5.0, m_pDoc->GetValue(4, 4, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(5, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell in F5.", pEditObj);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong F5.", OUString("R4"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong F5.", u"R4"_ustr, pEditObj->GetText(0));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell in G5. (repetition of D5)", pEditObj);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong G5. (repetition of D5)", OUString("R1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong G5. (repetition of D5)", u"R1"_ustr,
pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 4, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(7, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be no edit cell in H5.", pEditObj == nullptr);
// row 5, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D6", OUString("=D2+F2+60"),
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D6", u"=D2+F2+60"_ustr,
m_pDoc->GetFormula(3, 5, destSheet));
// formulas over filtered rows are not adjusted
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D6", 65.0,
@@ -3855,37 +3842,36 @@ void TestCopyPaste::checkCopyPasteSpecialFilteredTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E6", OUString(), m_pDoc->GetString(4, 5, destSheet));
else
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F6", OUString("=C2+E2+70"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F6", u"=C2+E2+70"_ustr,
m_pDoc->GetFormula(5, 5, destSheet));
// F6, formulas over filtered rows are not adjusted
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F6", 1073.0,
m_pDoc->GetValue(ScAddress(5, 5, destSheet)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G6 (repetition of D6)", OUString("=G2+I2+60"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G6 (repetition of D6)", u"=G2+I2+60"_ustr,
m_pDoc->GetFormula(6, 5, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G6 (repetition of D6)", 1061.0,
m_pDoc->GetValue(6, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 5, destSheet));
// row 6, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D7", OUString("=SUMIF(D2:G2;\"<4\")"),
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D7", u"=SUMIF(D2:G2;\"<4\")"_ustr,
m_pDoc->GetFormula(3, 6, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D7", 5.0, m_pDoc->GetValue(3, 6, destSheet));
if (!bSkipEmpty)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E6", OUString(), m_pDoc->GetString(4, 6, destSheet));
else
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F7", OUString("=B$3+$B$5+80"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F7", u"=B$3+$B$5+80"_ustr,
m_pDoc->GetFormula(5, 6, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F6", 2080.0, m_pDoc->GetValue(5, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G7 (repetition of D7)",
- OUString("=SUMIF(G2:J2;\"<4\")"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G7 (repetition of D7)", u"=SUMIF(G2:J2;\"<4\")"_ustr,
m_pDoc->GetFormula(6, 6, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed G7 (repetition of D7)", 1061.0,
m_pDoc->GetValue(6, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 6, destSheet));
// row
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 7, destSheet));
@@ -4020,38 +4006,38 @@ void TestCopyPaste::checkCopyPasteSpecialFilteredTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_MESSAGE("H8: no note", !m_pDoc->HasNote(7, 7, destSheet));
// check values of notes
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", OUString("Note A1"), getNote(3, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", OUString("Note A3"), getNote(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", u"Note A1"_ustr, getNote(3, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", u"Note A3"_ustr, getNote(4, 1, destSheet));
// F2 has no note
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G2", OUString("Note A1"), getNote(6, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D3", OUString("Note B1"), getNote(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E3", OUString("Note B3"), getNote(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F3", OUString("Note B4"), getNote(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G3", OUString("Note B1"), getNote(6, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G2", u"Note A1"_ustr, getNote(6, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D3", u"Note B1"_ustr, getNote(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E3", u"Note B3"_ustr, getNote(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F3", u"Note B4"_ustr, getNote(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G3", u"Note B1"_ustr, getNote(6, 2, destSheet));
// D4 has no note
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", OUString("Note C3"), getNote(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", OUString("Note C4"), getNote(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", u"Note C3"_ustr, getNote(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", u"Note C4"_ustr, getNote(5, 3, destSheet));
// G4 has no note
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D5", OUString("Note D1"), getNote(3, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E5", OUString("Note D3"), getNote(4, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F5", OUString("Note D4"), getNote(5, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G5", OUString("Note D1"), getNote(6, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D5", u"Note D1"_ustr, getNote(3, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E5", u"Note D3"_ustr, getNote(4, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F5", u"Note D4"_ustr, getNote(5, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G5", u"Note D1"_ustr, getNote(6, 4, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(4, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F6", OUString("Note E4"), getNote(5, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F7", OUString("Note F4"), getNote(5, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(4, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F6", u"Note E4"_ustr, getNote(5, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F7", u"Note F4"_ustr, getNote(5, 6, destSheet));
// check row 16 on src sheet, refs to copied/cut range
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$5"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C5"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$5"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C5:C5)"), m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$5:$C$5)"), m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C5:$C5)"), m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C$5:C$5)"), m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$6)"), m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$5"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C5"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$5"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C5:C5)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$5:$C$5)"_ustr, m_pDoc->GetFormula(6, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C5:$C5)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C$5:C$5)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$6)"_ustr, m_pDoc->GetFormula(9, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -4064,16 +4050,16 @@ void TestCopyPaste::checkCopyPasteSpecialFilteredTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"), m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"), m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"), m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -4087,55 +4073,55 @@ void TestCopyPaste::checkCopyPasteSpecialFilteredTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 17, srcSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
m_pDoc->DeleteTab(destSheet);
m_pDoc->DeleteTab(srcSheet);
@@ -4179,18 +4165,18 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeCol(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(3, 5, destSheet));
// col 4, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(4, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(4, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+10"), m_pDoc->GetFormula(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D3+20"), m_pDoc->GetFormula(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+10"_ustr, m_pDoc->GetFormula(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D3+20"_ustr, m_pDoc->GetFormula(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=G4+30"), m_pDoc->GetFormula(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=G4+30"_ustr, m_pDoc->GetFormula(4, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(bSkipEmpty ? 1030.0 : 30.0,
m_pDoc->GetValue(4, 3, destSheet)); // It was 35
- CPPUNIT_ASSERT_EQUAL(OUString("=D3+40"), m_pDoc->GetFormula(4, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D3+40"_ustr, m_pDoc->GetFormula(4, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(42.0, m_pDoc->GetValue(4, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(4, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(4, 5, destSheet));
// col 5, strings are not selected
// col 5, rich text
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 0, destSheet));
@@ -4198,21 +4184,21 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeCol(bool bSkipEmpty)
CPPUNIT_ASSERT(pEditObj == nullptr);
pEditObj = m_pDoc->GetEditText(ScAddress(5, 1, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pEditObj->GetText(0));
pEditObj = m_pDoc->GetEditText(ScAddress(5, 2, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R2"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R2"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(5, 3, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(5, 4, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R4"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R4"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 5, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(5, 5, destSheet));
CPPUNIT_ASSERT(pEditObj == nullptr);
// col 6, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(6, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C2+C4+60"), m_pDoc->GetFormula(6, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(6, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C2+C4+60"_ustr, m_pDoc->GetFormula(6, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(2060.0, m_pDoc->GetValue(6, 1, destSheet)); // It was 64
if (!bSkipEmpty)
{
@@ -4224,14 +4210,14 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeCol(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 3, destSheet));
}
- CPPUNIT_ASSERT_EQUAL(OUString("=C2+C4+70"), m_pDoc->GetFormula(6, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C2+C4+70"_ustr, m_pDoc->GetFormula(6, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(2070.0, m_pDoc->GetValue(6, 4, destSheet)); // It was 74
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(6, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(6, 5, destSheet));
// col 7, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMIF(C2:C5;\"<4\")"), m_pDoc->GetFormula(7, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUMIF(C2:C5;\"<4\")"_ustr, m_pDoc->GetFormula(7, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(7, 1, destSheet)); // It was 6
if (!bSkipEmpty)
{
@@ -4244,9 +4230,9 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeCol(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 3, destSheet));
}
CPPUNIT_ASSERT_EQUAL(1082.0, m_pDoc->GetValue(7, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D$3+$B$5+80"), m_pDoc->GetFormula(7, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D$3+$B$5+80"_ustr, m_pDoc->GetFormula(7, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 5, destSheet));
// col 8, numbers
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(121.0, m_pDoc->GetValue(8, 1, destSheet));
@@ -4358,32 +4344,32 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeCol(bool bSkipEmpty)
CPPUNIT_ASSERT(!m_pDoc->HasNote(8, 5, destSheet));
// check values of notes
- CPPUNIT_ASSERT_EQUAL(OUString("Note A1"), getNote(3, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A2"), getNote(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A3"), getNote(3, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B1"), getNote(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B3"), getNote(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D1"), getNote(5, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D2"), getNote(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D3"), getNote(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A1"_ustr, getNote(3, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A2"_ustr, getNote(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A3"_ustr, getNote(3, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B1"_ustr, getNote(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B3"_ustr, getNote(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D1"_ustr, getNote(5, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D2"_ustr, getNote(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D3"_ustr, getNote(5, 3, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(6, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note E4"), getNote(6, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(6, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E4"_ustr, getNote(6, 4, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note F2"), getNote(7, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note F4"), getNote(7, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note F2"_ustr, getNote(7, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note F4"_ustr, getNote(7, 4, destSheet));
// check row 16 on src sheet, refs to copied/cut range
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$5"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C5"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$5"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C5:C5)"), m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$5:$C$5)"), m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C5:$C5)"), m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C$5:C$5)"), m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$6)"), m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$5"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C5"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$5"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C5:C5)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$5:$C$5)"_ustr, m_pDoc->GetFormula(6, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C5:$C5)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C$5:C$5)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$6)"_ustr, m_pDoc->GetFormula(9, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -4396,16 +4382,16 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeCol(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"), m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"), m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"), m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -4419,55 +4405,55 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeCol(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 17, srcSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
m_pDoc->DeleteTab(destSheet);
m_pDoc->DeleteTab(srcSheet);
@@ -4511,12 +4497,12 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColFiltered(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(4, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+10"), m_pDoc->GetFormula(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+10"_ustr, m_pDoc->GetFormula(4, 1, destSheet));
// references over selection gaps are not adjusted
- CPPUNIT_ASSERT_EQUAL(OUString("=G3+30"), m_pDoc->GetFormula(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=G3+30"_ustr, m_pDoc->GetFormula(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(bSkipEmpty ? 1030.0 : 30.0,
m_pDoc->GetValue(4, 2, destSheet)); // It was 35
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+40"), m_pDoc->GetFormula(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+40"_ustr, m_pDoc->GetFormula(4, 3, destSheet));
// was originally 42, not adjusted by filtering
CPPUNIT_ASSERT_EQUAL(41.0, m_pDoc->GetValue(4, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 4, destSheet));
@@ -4528,38 +4514,38 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColFiltered(bool bSkipEmpty)
CPPUNIT_ASSERT(pEditObj == nullptr);
pEditObj = m_pDoc->GetEditText(ScAddress(5, 1, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(5, 2, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(5, 3, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R4"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R4"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 4, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(5, 4, destSheet));
CPPUNIT_ASSERT(pEditObj == nullptr);
// col 6, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(6, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C2+C4+60"), m_pDoc->GetFormula(6, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C2+C4+60"_ustr, m_pDoc->GetFormula(6, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(2060.0, m_pDoc->GetValue(6, 1, destSheet)); // It was 64
if (!bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetString(6, 2, destSheet));
else
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C1+C3+70"), m_pDoc->GetFormula(6, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C1+C3+70"_ustr, m_pDoc->GetFormula(6, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(2070.0, m_pDoc->GetValue(6, 3, destSheet)); // It was 74
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(6, 4, destSheet));
// col 7, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(7, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMIF(C2:C5;\"<4\")"), m_pDoc->GetFormula(7, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUMIF(C2:C5;\"<4\")"_ustr, m_pDoc->GetFormula(7, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(7, 1, destSheet)); // It was 6
if (!bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetString(7, 2, destSheet));
else
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(1083.0, m_pDoc->GetValue(7, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D$3+$B$5+80"), m_pDoc->GetFormula(7, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D$3+$B$5+80"_ustr, m_pDoc->GetFormula(7, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(7, 4, destSheet));
// col 8, numbers
@@ -4656,28 +4642,28 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColFiltered(bool bSkipEmpty)
CPPUNIT_ASSERT(!m_pDoc->HasNote(8, 4, destSheet));
// check values of notes
- CPPUNIT_ASSERT_EQUAL(OUString("Note A1"), getNote(3, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A3"), getNote(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B1"), getNote(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B3"), getNote(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D1"), getNote(5, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D3"), getNote(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A1"_ustr, getNote(3, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A3"_ustr, getNote(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B1"_ustr, getNote(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B3"_ustr, getNote(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D1"_ustr, getNote(5, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D3"_ustr, getNote(5, 2, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(6, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note E4"), getNote(6, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note F4"), getNote(7, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(6, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E4"_ustr, getNote(6, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note F4"_ustr, getNote(7, 3, destSheet));
// check row 16 on src sheet, refs to copied/cut range
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$5"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C5"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$5"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C5:C5)"), m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$5:$C$5)"), m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C5:$C5)"), m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C$5:C$5)"), m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$6)"), m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$5"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C5"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$5"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C5:C5)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$5:$C$5)"_ustr, m_pDoc->GetFormula(6, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C5:$C5)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C$5:C$5)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$6)"_ustr, m_pDoc->GetFormula(9, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -4690,16 +4676,16 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColFiltered(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"), m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"), m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"), m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -4713,55 +4699,55 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColFiltered(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 17, srcSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
m_pDoc->DeleteTab(destSheet);
m_pDoc->DeleteTab(srcSheet);
@@ -4806,18 +4792,18 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 1, destSheet));
// row 2, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+10"), m_pDoc->GetFormula(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=E2+20"), m_pDoc->GetFormula(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+10"_ustr, m_pDoc->GetFormula(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=E2+20"_ustr, m_pDoc->GetFormula(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=F5+30"), m_pDoc->GetFormula(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=F5+30"_ustr, m_pDoc->GetFormula(5, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(bSkipEmpty ? 1030.0 : 30.0,
m_pDoc->GetValue(5, 2, destSheet)); // It was 35
- CPPUNIT_ASSERT_EQUAL(OUString("=E2+40"), m_pDoc->GetFormula(6, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=E2+40"_ustr, m_pDoc->GetFormula(6, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(42.0, m_pDoc->GetValue(6, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 2, destSheet));
// row 3, strings was not selected in multi range selection
// row 3, rich text
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 3, destSheet));
@@ -4825,21 +4811,21 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT(pEditObj == nullptr);
pEditObj = m_pDoc->GetEditText(ScAddress(3, 3, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pEditObj->GetText(0));
pEditObj = m_pDoc->GetEditText(ScAddress(4, 3, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R2"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R2"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(5, 3, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 3, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R4"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R4"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 3, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(7, 3, destSheet));
CPPUNIT_ASSERT(pEditObj == nullptr);
// row 4, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D1+F1+60"), m_pDoc->GetFormula(3, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D1+F1+60"_ustr, m_pDoc->GetFormula(3, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(2060.0, m_pDoc->GetValue(3, 4, destSheet)); // It was 64
if (!bSkipEmpty)
{
@@ -4851,14 +4837,14 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 4, destSheet));
}
- CPPUNIT_ASSERT_EQUAL(OUString("=D1+F1+70"), m_pDoc->GetFormula(6, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D1+F1+70"_ustr, m_pDoc->GetFormula(6, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(2070.0, m_pDoc->GetValue(6, 4, destSheet)); // It was 74
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 4, destSheet));
// row 5, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMIF(D1:G1;\"<4\")"), m_pDoc->GetFormula(3, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUMIF(D1:G1;\"<4\")"_ustr, m_pDoc->GetFormula(3, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(3, 5, destSheet)); // It was 6
if (!bSkipEmpty)
{
@@ -4871,10 +4857,10 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 5, destSheet));
}
- CPPUNIT_ASSERT_EQUAL(OUString("=C$3+$B$5+80"), m_pDoc->GetFormula(6, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$3+$B$5+80"_ustr, m_pDoc->GetFormula(6, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(2080.0, m_pDoc->GetValue(6, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 5, destSheet));
// row 6, numbers
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 6, destSheet));
CPPUNIT_ASSERT_EQUAL(121.0, m_pDoc->GetValue(3, 6, destSheet));
@@ -4991,32 +4977,32 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT(!m_pDoc->HasNote(6, 6, destSheet));
CPPUNIT_ASSERT(!m_pDoc->HasNote(7, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A1"), getNote(3, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A2"), getNote(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A3"), getNote(5, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B1"), getNote(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B3"), getNote(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D1"), getNote(3, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D2"), getNote(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D3"), getNote(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A1"_ustr, getNote(3, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A2"_ustr, getNote(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A3"_ustr, getNote(5, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B1"_ustr, getNote(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B3"_ustr, getNote(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D1"_ustr, getNote(3, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D2"_ustr, getNote(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D3"_ustr, getNote(5, 3, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(5, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note E4"), getNote(6, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(5, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E4"_ustr, getNote(6, 4, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note F2"), getNote(4, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note F4"), getNote(6, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note F2"_ustr, getNote(4, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note F4"_ustr, getNote(6, 5, destSheet));
// check row 16 on src sheet, refs to copied/cut range
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$5"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C5"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$5"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C5:C5)"), m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$5:$C$5)"), m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C5:$C5)"), m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C$5:C$5)"), m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$6)"), m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$5"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C5"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$5"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C5:C5)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$5:$C$5)"_ustr, m_pDoc->GetFormula(6, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C5:$C5)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C$5:C$5)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$6)"_ustr, m_pDoc->GetFormula(9, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -5029,16 +5015,16 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"), m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"), m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"), m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -5052,55 +5038,55 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 17, srcSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
m_pDoc->DeleteTab(destSheet);
m_pDoc->DeleteTab(srcSheet);
@@ -5148,17 +5134,17 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColFilteredTranspose(bool bSk
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 1, destSheet));
// row 2, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+10"), m_pDoc->GetFormula(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=E5+30"), m_pDoc->GetFormula(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+10"_ustr, m_pDoc->GetFormula(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=E5+30"_ustr, m_pDoc->GetFormula(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(bSkipEmpty ? 1030.0 : 30.0,
m_pDoc->GetValue(4, 2, destSheet)); // It was 35
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+40"), m_pDoc->GetFormula(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+40"_ustr, m_pDoc->GetFormula(5, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(
41.0, m_pDoc->GetValue(5, 2, destSheet)); // was originally 42, not adjusted by filtering
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(6, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(6, 2, destSheet));
// row 3, strings was not selected in multi range selection
// row 3, rich text
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 3, destSheet));
@@ -5166,42 +5152,42 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColFilteredTranspose(bool bSk
CPPUNIT_ASSERT(pEditObj == nullptr);
pEditObj = m_pDoc->GetEditText(ScAddress(3, 3, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(4, 3, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(5, 3, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R4"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R4"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 3, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 3, destSheet));
CPPUNIT_ASSERT(pEditObj == nullptr);
// row 4, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 4, destSheet));
// formulas over filtered rows are not adjusted
- CPPUNIT_ASSERT_EQUAL(OUString("=D1+F1+60"), m_pDoc->GetFormula(3, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D1+F1+60"_ustr, m_pDoc->GetFormula(3, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(2060.0, m_pDoc->GetValue(3, 4, destSheet)); // It was 64
if (!bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetString(4, 4, destSheet));
else
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C1+E1+70"), m_pDoc->GetFormula(5, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C1+E1+70"_ustr, m_pDoc->GetFormula(5, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(2070.0, m_pDoc->GetValue(5, 4, destSheet)); // It was 74
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(6, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(6, 4, destSheet));
// row 5, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 5, destSheet));
// formulas over filtered rows are not adjusted
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMIF(D1:G1;\"<4\")"), m_pDoc->GetFormula(3, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUMIF(D1:G1;\"<4\")"_ustr, m_pDoc->GetFormula(3, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(3, 5, destSheet)); // It was 6
if (!bSkipEmpty)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E6", OUString(), m_pDoc->GetString(4, 5, destSheet));
else
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=B$3+$B$5+80"), m_pDoc->GetFormula(5, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=B$3+$B$5+80"_ustr, m_pDoc->GetFormula(5, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(2080.0, m_pDoc->GetValue(5, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(6, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(6, 5, destSheet));
// row 6, numbers
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 6, destSheet));
CPPUNIT_ASSERT_EQUAL(121.0, m_pDoc->GetValue(3, 6, destSheet));
@@ -5308,28 +5294,28 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColFilteredTranspose(bool bSk
CPPUNIT_ASSERT(!m_pDoc->HasNote(5, 6, destSheet));
CPPUNIT_ASSERT(!m_pDoc->HasNote(6, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A1"), getNote(3, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A3"), getNote(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B1"), getNote(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B3"), getNote(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D1"), getNote(3, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D3"), getNote(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A1"_ustr, getNote(3, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A3"_ustr, getNote(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B1"_ustr, getNote(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B3"_ustr, getNote(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D1"_ustr, getNote(3, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D3"_ustr, getNote(4, 3, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(4, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note E4"), getNote(5, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note F4"), getNote(5, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(4, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E4"_ustr, getNote(5, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note F4"_ustr, getNote(5, 5, destSheet));
// check row 16 on src sheet, refs to copied/cut range
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$5"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C5"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$5"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C5:C5)"), m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$5:$C$5)"), m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C5:$C5)"), m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C$5:C$5)"), m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$6)"), m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$5"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C5"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$5"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C5:C5)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$5:$C$5)"_ustr, m_pDoc->GetFormula(6, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C5:$C5)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C$5:C$5)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$6)"_ustr, m_pDoc->GetFormula(9, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -5342,16 +5328,16 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColFilteredTranspose(bool bSk
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"), m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"), m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"), m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -5365,55 +5351,55 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeColFilteredTranspose(bool bSk
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 17, srcSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
m_pDoc->DeleteTab(destSheet);
m_pDoc->DeleteTab(srcSheet);
@@ -5457,47 +5443,47 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRow(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(3, 6, destSheet));
// col 4, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(4, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(4, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+10"), m_pDoc->GetFormula(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D3+20"), m_pDoc->GetFormula(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+10"_ustr, m_pDoc->GetFormula(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D3+20"_ustr, m_pDoc->GetFormula(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=G4+30"), m_pDoc->GetFormula(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=G4+30"_ustr, m_pDoc->GetFormula(4, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("q"), m_pDoc->GetString(4, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"q"_ustr, m_pDoc->GetString(4, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(-12.0, m_pDoc->GetValue(4, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(4, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(4, 6, destSheet));
// col 5, strings
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(5, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), m_pDoc->GetString(5, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("b"), m_pDoc->GetString(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("c"), m_pDoc->GetString(5, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("r"), m_pDoc->GetString(5, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(5, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, m_pDoc->GetString(5, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"b"_ustr, m_pDoc->GetString(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"c"_ustr, m_pDoc->GetString(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"r"_ustr, m_pDoc->GetString(5, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(-13.0, m_pDoc->GetValue(5, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(5, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(5, 6, destSheet));
// col 6, rich text
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 0, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 0, destSheet));
CPPUNIT_ASSERT(pEditObj == nullptr);
pEditObj = m_pDoc->GetEditText(ScAddress(6, 1, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pEditObj->GetText(0));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 2, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R2"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R2"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(6, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("s"), m_pDoc->GetString(6, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"s"_ustr, m_pDoc->GetString(6, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(-14.0, m_pDoc->GetValue(6, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 6, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 6, destSheet));
CPPUNIT_ASSERT(pEditObj == nullptr);
// col 7, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+D4+60"), m_pDoc->GetFormula(7, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+D4+60"_ustr, m_pDoc->GetFormula(7, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(64.0, m_pDoc->GetValue(7, 1, destSheet));
if (!bSkipEmpty)
{
@@ -5509,14 +5495,14 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRow(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 3, destSheet));
}
- CPPUNIT_ASSERT_EQUAL(OUString("t"), m_pDoc->GetString(7, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"t"_ustr, m_pDoc->GetString(7, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(-15.0, m_pDoc->GetValue(7, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 6, destSheet));
// col 8, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMIF(D2:D5;\"<4\")"), m_pDoc->GetFormula(8, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUMIF(D2:D5;\"<4\")"_ustr, m_pDoc->GetFormula(8, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(8, 1, destSheet));
if (!bSkipEmpty)
{
@@ -5528,10 +5514,10 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRow(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 3, destSheet));
}
- CPPUNIT_ASSERT_EQUAL(OUString("u"), m_pDoc->GetString(8, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"u"_ustr, m_pDoc->GetString(8, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(-16.0, m_pDoc->GetValue(8, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(8, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(8, 6, destSheet));
// col 9
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(9, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(9, 1, destSheet));
@@ -5683,33 +5669,33 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRow(bool bSkipEmpty)
CPPUNIT_ASSERT(!m_pDoc->HasNote(9, 5, destSheet));
// check values of notes
- CPPUNIT_ASSERT_EQUAL(OUString("Note A1"), getNote(3, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A2"), getNote(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A3"), getNote(3, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B1"), getNote(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B3"), getNote(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note C2"), getNote(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note C3"), getNote(5, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D1"), getNote(6, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D2"), getNote(6, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D3"), getNote(6, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A1"_ustr, getNote(3, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A2"_ustr, getNote(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A3"_ustr, getNote(3, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B1"_ustr, getNote(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B3"_ustr, getNote(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note C2"_ustr, getNote(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note C3"_ustr, getNote(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D1"_ustr, getNote(6, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D2"_ustr, getNote(6, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D3"_ustr, getNote(6, 3, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(7, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(7, 3, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note F2"), getNote(8, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note C5"), getNote(5, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note F2"_ustr, getNote(8, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note C5"_ustr, getNote(5, 4, destSheet));
// check row 16 on src sheet, refs to copied/cut range
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$5"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C5"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$5"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C5:C5)"), m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$5:$C$5)"), m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C5:$C5)"), m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C$5:C$5)"), m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$6)"), m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$5"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C5"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$5"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C5:C5)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$5:$C$5)"_ustr, m_pDoc->GetFormula(6, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C5:$C5)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C$5:C$5)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$6)"_ustr, m_pDoc->GetFormula(9, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -5722,16 +5708,16 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRow(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"), m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"), m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"), m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -5745,55 +5731,55 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRow(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 17, srcSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
m_pDoc->DeleteTab(destSheet);
m_pDoc->DeleteTab(srcSheet);
@@ -5835,63 +5821,63 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowFiltered(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(3, 5, destSheet));
// col 4, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(4, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(4, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+10"), m_pDoc->GetFormula(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=G3+30"), m_pDoc->GetFormula(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+10"_ustr, m_pDoc->GetFormula(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=G3+30"_ustr, m_pDoc->GetFormula(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("q"), m_pDoc->GetString(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"q"_ustr, m_pDoc->GetString(4, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(-12.0, m_pDoc->GetValue(4, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(4, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(4, 5, destSheet));
// col 5, strings
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(5, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), m_pDoc->GetString(5, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("c"), m_pDoc->GetString(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("r"), m_pDoc->GetString(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(5, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, m_pDoc->GetString(5, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"c"_ustr, m_pDoc->GetString(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"r"_ustr, m_pDoc->GetString(5, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(-13.0, m_pDoc->GetValue(5, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(5, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(5, 5, destSheet));
// col 6, rich text
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 0, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 0, destSheet));
CPPUNIT_ASSERT(pEditObj == nullptr);
pEditObj = m_pDoc->GetEditText(ScAddress(6, 1, destSheet));
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("R1"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"R1"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(6, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("s"), m_pDoc->GetString(6, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"s"_ustr, m_pDoc->GetString(6, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(-14.0, m_pDoc->GetValue(6, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(6, 5, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(6, 5, destSheet));
CPPUNIT_ASSERT(pEditObj == nullptr);
// col 7, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=D2+D4+60"), m_pDoc->GetFormula(7, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=D2+D4+60"_ustr, m_pDoc->GetFormula(7, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(67.0, m_pDoc->GetValue(7, 1, destSheet));
if (!bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetString(7, 2, destSheet));
else
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("t"), m_pDoc->GetString(7, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"t"_ustr, m_pDoc->GetString(7, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(-15.0, m_pDoc->GetValue(7, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 5, destSheet));
// col 8, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(8, 0, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMIF(D2:D5;\"<4\")"), m_pDoc->GetFormula(8, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(8, 0, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUMIF(D2:D5;\"<4\")"_ustr, m_pDoc->GetFormula(8, 1, destSheet));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(8, 1, destSheet));
if (!bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetString(8, 2, destSheet));
else
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("u"), m_pDoc->GetString(8, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"u"_ustr, m_pDoc->GetString(8, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(-16.0, m_pDoc->GetValue(8, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(8, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(8, 5, destSheet));
// col 9
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(9, 0, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(9, 1, destSheet));
@@ -6026,28 +6012,28 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowFiltered(bool bSkipEmpty)
CPPUNIT_ASSERT(!m_pDoc->HasNote(9, 4, destSheet));
// check values of notes
- CPPUNIT_ASSERT_EQUAL(OUString("Note A1"), getNote(3, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note A3"), getNote(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B1"), getNote(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note B3"), getNote(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note C3"), getNote(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D1"), getNote(6, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note D3"), getNote(6, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A1"_ustr, getNote(3, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note A3"_ustr, getNote(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B1"_ustr, getNote(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note B3"_ustr, getNote(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note C3"_ustr, getNote(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D1"_ustr, getNote(6, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note D3"_ustr, getNote(6, 2, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(7, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note C5"), getNote(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(7, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note C5"_ustr, getNote(5, 3, destSheet));
// check row 16 on src sheet, refs to copied/cut range
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$5"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C5"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$5"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C5:C5)"), m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$5:$C$5)"), m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C5:$C5)"), m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C$5:C$5)"), m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$6)"), m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$5"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C5"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$5"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C5:C5)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$5:$C$5)"_ustr, m_pDoc->GetFormula(6, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C5:$C5)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C$5:C$5)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$6)"_ustr, m_pDoc->GetFormula(9, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -6060,16 +6046,16 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowFiltered(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"), m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"), m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"), m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -6083,55 +6069,55 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowFiltered(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 17, srcSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
m_pDoc->DeleteTab(destSheet);
m_pDoc->DeleteTab(srcSheet);
@@ -6178,51 +6164,50 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed cell I2", 1000.0, m_pDoc->GetValue(8, 1, destSheet));
// row 2, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D3", 11.0, m_pDoc->GetValue(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D3", OUString("=D2+10"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D3", u"=D2+10"_ustr,
m_pDoc->GetFormula(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed E3", OUString("=E2+20"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed E3", u"=E2+20"_ustr,
m_pDoc->GetFormula(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed E3", 22.0, m_pDoc->GetValue(4, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F3", 35.0, m_pDoc->GetValue(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F3", OUString("=F5+30"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed F3", u"=F5+30"_ustr,
m_pDoc->GetFormula(5, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G4", OUString("q"), m_pDoc->GetString(6, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G4", u"q"_ustr, m_pDoc->GetString(6, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(-12.0, m_pDoc->GetValue(7, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(8, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(8, 2, destSheet));
// row 3, strings
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D4", OUString("a"), m_pDoc->GetString(3, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", OUString("b"), m_pDoc->GetString(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", OUString("c"), m_pDoc->GetString(5, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G4", OUString("r"), m_pDoc->GetString(6, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D4", u"a"_ustr, m_pDoc->GetString(3, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", u"b"_ustr, m_pDoc->GetString(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", u"c"_ustr, m_pDoc->GetString(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G4", u"r"_ustr, m_pDoc->GetString(6, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(-13.0, m_pDoc->GetValue(7, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(8, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(8, 3, destSheet));
// row 4, rich text
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 4, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(2, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be no edit cell in C5.", pEditObj == nullptr);
pEditObj = m_pDoc->GetEditText(ScAddress(3, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell in D5.", pEditObj);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong in D5 ", OUString("R1"),
- pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong in D5 ", u"R1"_ustr, pEditObj->GetText(0));
pEditObj = m_pDoc->GetEditText(ScAddress(4, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell in E5.", pEditObj);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong E5.", OUString("R2"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong E5.", u"R2"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed cell F5", 5.0, m_pDoc->GetValue(5, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G5", OUString("s"), m_pDoc->GetString(6, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G5", u"s"_ustr, m_pDoc->GetString(6, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(-14.0, m_pDoc->GetValue(7, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 4, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(8, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be no edit cell in I5.", pEditObj == nullptr);
// row 5, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D6", OUString("=D2+F2+60"),
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D6", u"=D2+F2+60"_ustr,
m_pDoc->GetFormula(3, 5, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D6", 64.0, m_pDoc->GetValue(3, 5, destSheet));
if (!bSkipEmpty)
@@ -6235,14 +6220,14 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 5, destSheet));
}
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G6", OUString("t"), m_pDoc->GetString(6, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G6", u"t"_ustr, m_pDoc->GetString(6, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(-15.0, m_pDoc->GetValue(7, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(8, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(8, 5, destSheet));
// row 6, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D7", OUString("=SUMIF(D2:G2;\"<4\")"),
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D7", u"=SUMIF(D2:G2;\"<4\")"_ustr,
m_pDoc->GetFormula(3, 6, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D7", 6.0, m_pDoc->GetValue(3, 6, destSheet));
if (!bSkipEmpty)
@@ -6255,10 +6240,10 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 6, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(5, 6, destSheet));
}
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G7", OUString("u"), m_pDoc->GetString(6, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell G7", u"u"_ustr, m_pDoc->GetString(6, 6, destSheet));
CPPUNIT_ASSERT_EQUAL(-16.0, m_pDoc->GetValue(7, 6, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(8, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(8, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(8, 6, destSheet));
// row 7
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 7, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(3, 7, destSheet));
@@ -6395,36 +6380,36 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_MESSAGE("H8: no note", !m_pDoc->HasNote(7, 7, destSheet));
// check values of notes
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", OUString("Note A1"), getNote(3, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", OUString("Note A2"), getNote(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F2", OUString("Note A3"), getNote(5, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", u"Note A1"_ustr, getNote(3, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", u"Note A2"_ustr, getNote(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F2", u"Note A3"_ustr, getNote(5, 1, destSheet));
// G2 has no note
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D3", OUString("Note B1"), getNote(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D3", u"Note B1"_ustr, getNote(3, 2, destSheet));
// E3 has no note
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F3", OUString("Note B3"), getNote(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F3", u"Note B3"_ustr, getNote(5, 2, destSheet));
// D4 has no note
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", OUString("Note C2"), getNote(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", OUString("Note C3"), getNote(5, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D5", OUString("Note D1"), getNote(3, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E5", OUString("Note D2"), getNote(4, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F5", OUString("Note D3"), getNote(5, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", u"Note C2"_ustr, getNote(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", u"Note C3"_ustr, getNote(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D5", u"Note D1"_ustr, getNote(3, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E5", u"Note D2"_ustr, getNote(4, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F5", u"Note D3"_ustr, getNote(5, 4, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(5, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(5, 5, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E7", OUString("Note F2"), getNote(4, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note C5"), getNote(6, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E7", u"Note F2"_ustr, getNote(4, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note C5"_ustr, getNote(6, 3, destSheet));
// check row 16 on src sheet, refs to copied/cut range
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$5"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C5"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$5"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C5:C5)"), m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$5:$C$5)"), m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C5:$C5)"), m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C$5:C$5)"), m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$6)"), m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$5"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C5"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$5"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C5:C5)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$5:$C$5)"_ustr, m_pDoc->GetFormula(6, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C5:$C5)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C$5:C$5)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$6)"_ustr, m_pDoc->GetFormula(9, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -6437,16 +6422,16 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"), m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"), m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"), m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -6460,55 +6445,55 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowTranspose(bool bSkipEmpty)
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 17, srcSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
m_pDoc->DeleteTab(destSheet);
m_pDoc->DeleteTab(srcSheet);
@@ -6554,44 +6539,43 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowFilteredTranspose(bool bSk
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed cell H2", 1000.0, m_pDoc->GetValue(7, 1, destSheet));
// row 2, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D3", 11.0, m_pDoc->GetValue(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D3", OUString("=D2+10"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D3", u"=D2+10"_ustr,
m_pDoc->GetFormula(3, 2, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed E3", 35.0, m_pDoc->GetValue(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed E3", OUString("=E5+30"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed E3", u"=E5+30"_ustr,
m_pDoc->GetFormula(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", OUString("q"), m_pDoc->GetString(5, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", u"q"_ustr, m_pDoc->GetString(5, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(-12.0, m_pDoc->GetValue(6, 2, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 2, destSheet));
// row 3, strings
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D4", OUString("a"), m_pDoc->GetString(3, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", OUString("c"), m_pDoc->GetString(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", OUString("r"), m_pDoc->GetString(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D4", u"a"_ustr, m_pDoc->GetString(3, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", u"c"_ustr, m_pDoc->GetString(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F4", u"r"_ustr, m_pDoc->GetString(5, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(-13.0, m_pDoc->GetValue(6, 3, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 3, destSheet));
// row 4, rich text
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 4, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(2, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be no edit cell in C5.", pEditObj == nullptr);
pEditObj = m_pDoc->GetEditText(ScAddress(3, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be an edit cell in D5.", pEditObj);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong in D5 ", OUString("R1"),
- pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Edit cell value wrong in D5 ", u"R1"_ustr, pEditObj->GetText(0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed cell E5", 5.0, m_pDoc->GetValue(4, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F5", OUString("s"), m_pDoc->GetString(5, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F5", u"s"_ustr, m_pDoc->GetString(5, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(-14.0, m_pDoc->GetValue(6, 4, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 4, destSheet));
pEditObj = m_pDoc->GetEditText(ScAddress(7, 4, destSheet));
CPPUNIT_ASSERT_MESSAGE("There should be no edit cell in H5.", pEditObj == nullptr);
// row 5, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D6", OUString("=D2+F2+60"),
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D6", u"=D2+F2+60"_ustr,
m_pDoc->GetFormula(3, 5, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D6", 67.0, m_pDoc->GetValue(3, 5, destSheet));
if (!bSkipEmpty)
@@ -6600,24 +6584,24 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowFilteredTranspose(bool bSk
}
else
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F6", OUString("t"), m_pDoc->GetString(5, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F6", u"t"_ustr, m_pDoc->GetString(5, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(-15.0, m_pDoc->GetValue(6, 5, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 5, destSheet));
// row 6, formulas
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(2, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D7", OUString("=SUMIF(D2:G2;\"<4\")"),
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(2, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D7", u"=SUMIF(D2:G2;\"<4\")"_ustr,
m_pDoc->GetFormula(3, 6, destSheet));
CPPUNIT_ASSERT_EQUAL_MESSAGE("transposed D7", -7.0, m_pDoc->GetValue(3, 6, destSheet));
if (!bSkipEmpty)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E7", OUString(), m_pDoc->GetString(4, 6, destSheet));
else
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(4, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F7", OUString("u"), m_pDoc->GetString(5, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell F7", u"u"_ustr, m_pDoc->GetString(5, 6, destSheet));
CPPUNIT_ASSERT_EQUAL(-16.0, m_pDoc->GetValue(6, 6, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(7, 6, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("1000"), m_pDoc->GetString(7, 6, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"1000"_ustr, m_pDoc->GetString(7, 6, destSheet));
// row 7
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(2, 7, destSheet));
CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(3, 7, destSheet));
@@ -6756,28 +6740,28 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowFilteredTranspose(bool bSk
CPPUNIT_ASSERT_MESSAGE("G8: no note", !m_pDoc->HasNote(6, 7, destSheet));
// check values of notes
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", OUString("Note A1"), getNote(3, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", OUString("Note A3"), getNote(4, 1, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D3", OUString("Note B1"), getNote(3, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E3", OUString("Note B3"), getNote(4, 2, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", OUString("Note C3"), getNote(4, 3, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D5", OUString("Note D1"), getNote(3, 4, destSheet));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E5", OUString("Note D3"), getNote(4, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D2", u"Note A1"_ustr, getNote(3, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E2", u"Note A3"_ustr, getNote(4, 1, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D3", u"Note B1"_ustr, getNote(3, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E3", u"Note B3"_ustr, getNote(4, 2, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E4", u"Note C3"_ustr, getNote(4, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D5", u"Note D1"_ustr, getNote(3, 4, destSheet));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell E5", u"Note D3"_ustr, getNote(4, 4, destSheet));
if (!bSkipEmpty)
- CPPUNIT_ASSERT_EQUAL(OUString("Note E2"), getNote(4, 5, destSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("Note C5"), getNote(5, 3, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note E2"_ustr, getNote(4, 5, destSheet));
+ CPPUNIT_ASSERT_EQUAL(u"Note C5"_ustr, getNote(5, 3, destSheet));
// check row 16 on src sheet, refs to copied/cut range
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(1, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$5"), m_pDoc->GetFormula(2, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C5"), m_pDoc->GetFormula(3, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=C$5"), m_pDoc->GetFormula(4, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C5:C5)"), m_pDoc->GetFormula(5, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$5:$C$5)"), m_pDoc->GetFormula(6, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C5:$C5)"), m_pDoc->GetFormula(7, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C$5:C$5)"), m_pDoc->GetFormula(8, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$6)"), m_pDoc->GetFormula(9, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$B$10)"), m_pDoc->GetFormula(10, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(1, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$5"_ustr, m_pDoc->GetFormula(2, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=$C5"_ustr, m_pDoc->GetFormula(3, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=C$5"_ustr, m_pDoc->GetFormula(4, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C5:C5)"_ustr, m_pDoc->GetFormula(5, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$5:$C$5)"_ustr, m_pDoc->GetFormula(6, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C5:$C5)"_ustr, m_pDoc->GetFormula(7, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C$5:C$5)"_ustr, m_pDoc->GetFormula(8, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$6)"_ustr, m_pDoc->GetFormula(9, 16, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$B$10)"_ustr, m_pDoc->GetFormula(10, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 16, srcSheet));
@@ -6790,16 +6774,16 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowFilteredTranspose(bool bSk
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(9, 16, srcSheet));
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 16, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C5"), m_pDoc->GetFormula(1, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aCa5"), m_pDoc->GetFormula(2, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_aC5"), m_pDoc->GetFormula(3, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_Ca5"), m_pDoc->GetFormula(4, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C5_C5)"), m_pDoc->GetFormula(5, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa5)"), m_pDoc->GetFormula(6, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aC5_aC5)"), m_pDoc->GetFormula(7, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_Ca5_Ca5)"), m_pDoc->GetFormula(8, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa8)"), m_pDoc->GetFormula(9, 17, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_aCa5_aCa10)"), m_pDoc->GetFormula(10, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C5"_ustr, m_pDoc->GetFormula(1, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aCa5"_ustr, m_pDoc->GetFormula(2, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_aC5"_ustr, m_pDoc->GetFormula(3, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=Range_Ca5"_ustr, m_pDoc->GetFormula(4, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C5_C5)"_ustr, m_pDoc->GetFormula(5, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa5)"_ustr, m_pDoc->GetFormula(6, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aC5_aC5)"_ustr, m_pDoc->GetFormula(7, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_Ca5_Ca5)"_ustr, m_pDoc->GetFormula(8, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa8)"_ustr, m_pDoc->GetFormula(9, 17, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_aCa5_aCa10)"_ustr, m_pDoc->GetFormula(10, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(1, 17, srcSheet));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(2, 17, srcSheet));
@@ -6813,55 +6797,55 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowFilteredTranspose(bool bSk
CPPUNIT_ASSERT_EQUAL(-17.0, m_pDoc->GetValue(10, 17, srcSheet));
// Existing references to the destination range must not change
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D1"), m_pDoc->GetFormula(3, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D2"), m_pDoc->GetFormula(3, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D3"), m_pDoc->GetFormula(3, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D4"), m_pDoc->GetFormula(3, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D5"), m_pDoc->GetFormula(3, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D6"), m_pDoc->GetFormula(3, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.D7"), m_pDoc->GetFormula(3, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E1"), m_pDoc->GetFormula(4, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E2"), m_pDoc->GetFormula(4, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E3"), m_pDoc->GetFormula(4, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E4"), m_pDoc->GetFormula(4, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E5"), m_pDoc->GetFormula(4, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E6"), m_pDoc->GetFormula(4, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.E7"), m_pDoc->GetFormula(4, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F1"), m_pDoc->GetFormula(5, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F2"), m_pDoc->GetFormula(5, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F3"), m_pDoc->GetFormula(5, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F4"), m_pDoc->GetFormula(5, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F5"), m_pDoc->GetFormula(5, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F6"), m_pDoc->GetFormula(5, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.F7"), m_pDoc->GetFormula(5, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G1"), m_pDoc->GetFormula(6, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G2"), m_pDoc->GetFormula(6, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G3"), m_pDoc->GetFormula(6, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G4"), m_pDoc->GetFormula(6, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G5"), m_pDoc->GetFormula(6, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G6"), m_pDoc->GetFormula(6, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.G7"), m_pDoc->GetFormula(6, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H1"), m_pDoc->GetFormula(7, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H2"), m_pDoc->GetFormula(7, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H3"), m_pDoc->GetFormula(7, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H4"), m_pDoc->GetFormula(7, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H5"), m_pDoc->GetFormula(7, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H6"), m_pDoc->GetFormula(7, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.H7"), m_pDoc->GetFormula(7, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I1"), m_pDoc->GetFormula(8, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I2"), m_pDoc->GetFormula(8, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I3"), m_pDoc->GetFormula(8, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I4"), m_pDoc->GetFormula(8, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I5"), m_pDoc->GetFormula(8, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I6"), m_pDoc->GetFormula(8, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.I7"), m_pDoc->GetFormula(8, 107, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J1"), m_pDoc->GetFormula(9, 101, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J2"), m_pDoc->GetFormula(9, 102, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J3"), m_pDoc->GetFormula(9, 103, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J4"), m_pDoc->GetFormula(9, 104, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J5"), m_pDoc->GetFormula(9, 105, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J6"), m_pDoc->GetFormula(9, 106, srcSheet));
- CPPUNIT_ASSERT_EQUAL(OUString("=DestSheet.J7"), m_pDoc->GetFormula(9, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D1"_ustr, m_pDoc->GetFormula(3, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D2"_ustr, m_pDoc->GetFormula(3, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D3"_ustr, m_pDoc->GetFormula(3, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D4"_ustr, m_pDoc->GetFormula(3, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D5"_ustr, m_pDoc->GetFormula(3, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D6"_ustr, m_pDoc->GetFormula(3, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.D7"_ustr, m_pDoc->GetFormula(3, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E1"_ustr, m_pDoc->GetFormula(4, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E2"_ustr, m_pDoc->GetFormula(4, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E3"_ustr, m_pDoc->GetFormula(4, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E4"_ustr, m_pDoc->GetFormula(4, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E5"_ustr, m_pDoc->GetFormula(4, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E6"_ustr, m_pDoc->GetFormula(4, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.E7"_ustr, m_pDoc->GetFormula(4, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F1"_ustr, m_pDoc->GetFormula(5, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F2"_ustr, m_pDoc->GetFormula(5, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F3"_ustr, m_pDoc->GetFormula(5, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F4"_ustr, m_pDoc->GetFormula(5, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F5"_ustr, m_pDoc->GetFormula(5, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F6"_ustr, m_pDoc->GetFormula(5, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.F7"_ustr, m_pDoc->GetFormula(5, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G1"_ustr, m_pDoc->GetFormula(6, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G2"_ustr, m_pDoc->GetFormula(6, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G3"_ustr, m_pDoc->GetFormula(6, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G4"_ustr, m_pDoc->GetFormula(6, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G5"_ustr, m_pDoc->GetFormula(6, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G6"_ustr, m_pDoc->GetFormula(6, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.G7"_ustr, m_pDoc->GetFormula(6, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H1"_ustr, m_pDoc->GetFormula(7, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H2"_ustr, m_pDoc->GetFormula(7, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H3"_ustr, m_pDoc->GetFormula(7, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H4"_ustr, m_pDoc->GetFormula(7, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H5"_ustr, m_pDoc->GetFormula(7, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H6"_ustr, m_pDoc->GetFormula(7, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.H7"_ustr, m_pDoc->GetFormula(7, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I1"_ustr, m_pDoc->GetFormula(8, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I2"_ustr, m_pDoc->GetFormula(8, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I3"_ustr, m_pDoc->GetFormula(8, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I4"_ustr, m_pDoc->GetFormula(8, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I5"_ustr, m_pDoc->GetFormula(8, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I6"_ustr, m_pDoc->GetFormula(8, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.I7"_ustr, m_pDoc->GetFormula(8, 107, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J1"_ustr, m_pDoc->GetFormula(9, 101, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J2"_ustr, m_pDoc->GetFormula(9, 102, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J3"_ustr, m_pDoc->GetFormula(9, 103, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J4"_ustr, m_pDoc->GetFormula(9, 104, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J5"_ustr, m_pDoc->GetFormula(9, 105, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J6"_ustr, m_pDoc->GetFormula(9, 106, srcSheet));
+ CPPUNIT_ASSERT_EQUAL(u"=DestSheet.J7"_ustr, m_pDoc->GetFormula(9, 107, srcSheet));
m_pDoc->DeleteTab(destSheet);
m_pDoc->DeleteTab(srcSheet);
@@ -6870,17 +6854,17 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowFilteredTranspose(bool bSk
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142201Row)
{
const SCTAB nTab = 0;
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
m_pDoc->SetValue(0, 0, nTab, 1.0); // A1
m_pDoc->SetValue(0, 1, nTab, 2.0); // A2
m_pDoc->SetValue(1, 0, nTab, 11.0); // B1
m_pDoc->SetValue(1, 1, nTab, 12.0); // B2
- m_pDoc->SetString(0, 3, nTab, "=A1"); // A4
- m_pDoc->SetString(0, 4, nTab, "=A2"); // A5
- m_pDoc->SetString(1, 3, nTab, "=B1"); // B4
- m_pDoc->SetString(1, 4, nTab, "=B2"); // B5
+ m_pDoc->SetString(0, 3, nTab, u"=A1"_ustr); // A4
+ m_pDoc->SetString(0, 4, nTab, u"=A2"_ustr); // A5
+ m_pDoc->SetString(1, 3, nTab, u"=B1"_ustr); // B4
+ m_pDoc->SetString(1, 4, nTab, u"=B2"_ustr); // B5
// Check precondition
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(0, 3, nTab));
@@ -6936,26 +6920,26 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142201Row)
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 3, nTab));
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 4, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=B7"), m_pDoc->GetFormula(0, 3, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=C7"), m_pDoc->GetFormula(0, 4, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=B1"), m_pDoc->GetFormula(1, 3, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=B2"), m_pDoc->GetFormula(1, 4, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=B7"_ustr, m_pDoc->GetFormula(0, 3, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=C7"_ustr, m_pDoc->GetFormula(0, 4, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=B1"_ustr, m_pDoc->GetFormula(1, 3, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=B2"_ustr, m_pDoc->GetFormula(1, 4, nTab));
}
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142201ColRel)
{
const SCTAB nTab = 0;
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
m_pDoc->SetValue(0, 0, nTab, 1.0); // A1
m_pDoc->SetValue(0, 1, nTab, 2.0); // A2
m_pDoc->SetValue(1, 0, nTab, 11.0); // B1
m_pDoc->SetValue(1, 1, nTab, 12.0); // B2
- m_pDoc->SetString(0, 3, nTab, "=A1"); // A4
- m_pDoc->SetString(0, 4, nTab, "=A2"); // A5
- m_pDoc->SetString(1, 3, nTab, "=B1"); // B4
- m_pDoc->SetString(1, 4, nTab, "=B2"); // B5
+ m_pDoc->SetString(0, 3, nTab, u"=A1"_ustr); // A4
+ m_pDoc->SetString(0, 4, nTab, u"=A2"_ustr); // A5
+ m_pDoc->SetString(1, 3, nTab, u"=B1"_ustr); // B4
+ m_pDoc->SetString(1, 4, nTab, u"=B2"_ustr); // B5
// Check precondition
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(0, 3, nTab));
@@ -7011,26 +6995,26 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142201ColRel)
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 3, nTab));
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 4, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=B7"), m_pDoc->GetFormula(0, 3, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=A2"), m_pDoc->GetFormula(0, 4, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=B8"), m_pDoc->GetFormula(1, 3, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=B2"), m_pDoc->GetFormula(1, 4, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=B7"_ustr, m_pDoc->GetFormula(0, 3, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=A2"_ustr, m_pDoc->GetFormula(0, 4, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=B8"_ustr, m_pDoc->GetFormula(1, 3, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=B2"_ustr, m_pDoc->GetFormula(1, 4, nTab));
}
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142201ColAbs)
{
const SCTAB nTab = 0;
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
m_pDoc->SetValue(0, 0, nTab, 1.0); // A1
m_pDoc->SetValue(0, 1, nTab, 2.0); // A2
m_pDoc->SetValue(1, 0, nTab, 11.0); // B1
m_pDoc->SetValue(1, 1, nTab, 12.0); // B2
- m_pDoc->SetString(0, 3, nTab, "=$A$1"); // A4
- m_pDoc->SetString(0, 4, nTab, "=$A$2"); // A5
- m_pDoc->SetString(1, 3, nTab, "=$B$1"); // B4
- m_pDoc->SetString(1, 4, nTab, "=$B$2"); // B5
+ m_pDoc->SetString(0, 3, nTab, u"=$A$1"_ustr); // A4
+ m_pDoc->SetString(0, 4, nTab, u"=$A$2"_ustr); // A5
+ m_pDoc->SetString(1, 3, nTab, u"=$B$1"_ustr); // B4
+ m_pDoc->SetString(1, 4, nTab, u"=$B$2"_ustr); // B5
// Check precondition
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(0, 3, nTab));
@@ -7086,10 +7070,10 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142201ColAbs)
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 3, nTab));
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 4, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=$B$7"), m_pDoc->GetFormula(0, 3, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=$A$2"), m_pDoc->GetFormula(0, 4, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=$B$8"), m_pDoc->GetFormula(1, 3, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=$B$2"), m_pDoc->GetFormula(1, 4, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=$B$7"_ustr, m_pDoc->GetFormula(0, 3, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=$A$2"_ustr, m_pDoc->GetFormula(0, 4, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=$B$8"_ustr, m_pDoc->GetFormula(1, 3, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=$B$2"_ustr, m_pDoc->GetFormula(1, 4, nTab));
}
void TestCopyPaste::checkReferencedCutRangesRowIntitial(const SCTAB nSrcTab, const OUString& rDesc)
@@ -7131,20 +7115,20 @@ void TestCopyPaste::checkReferencedCutRangesRowIntitial(const SCTAB nSrcTab, con
CPPUNIT_ASSERT_EQUAL(1032.0, m_pDoc->GetValue(22, 3, nSrcTab)); // W4
CPPUNIT_ASSERT_EQUAL(1033.0, m_pDoc->GetValue(23, 3, nSrcTab)); // X4
CPPUNIT_ASSERT_EQUAL(1034.0, m_pDoc->GetValue(24, 3, nSrcTab)); // Y4
- CPPUNIT_ASSERT_EQUAL(OUString("=A1"), m_pDoc->GetFormula(20, 0, nSrcTab)); // U1
- CPPUNIT_ASSERT_EQUAL(OUString("=B1"), m_pDoc->GetFormula(21, 0, nSrcTab)); // V1
- CPPUNIT_ASSERT_EQUAL(OUString("=C1"), m_pDoc->GetFormula(22, 0, nSrcTab)); // W1
- CPPUNIT_ASSERT_EQUAL(OUString("=D1"), m_pDoc->GetFormula(23, 0, nSrcTab)); // X1
- CPPUNIT_ASSERT_EQUAL(OUString("=E1"), m_pDoc->GetFormula(24, 0, nSrcTab)); // Y1
- CPPUNIT_ASSERT_EQUAL(OUString("=A2"), m_pDoc->GetFormula(20, 1, nSrcTab)); // U2
- CPPUNIT_ASSERT_EQUAL(OUString("=E2"), m_pDoc->GetFormula(24, 1, nSrcTab)); // Y2
- CPPUNIT_ASSERT_EQUAL(OUString("=A3"), m_pDoc->GetFormula(20, 2, nSrcTab)); // U3
- CPPUNIT_ASSERT_EQUAL(OUString("=E3"), m_pDoc->GetFormula(24, 2, nSrcTab)); // Y3
- CPPUNIT_ASSERT_EQUAL(OUString("=A4"), m_pDoc->GetFormula(20, 3, nSrcTab)); // U4
- CPPUNIT_ASSERT_EQUAL(OUString("=B4"), m_pDoc->GetFormula(21, 3, nSrcTab)); // B4
- CPPUNIT_ASSERT_EQUAL(OUString("=C4"), m_pDoc->GetFormula(22, 3, nSrcTab)); // W4
- CPPUNIT_ASSERT_EQUAL(OUString("=D4"), m_pDoc->GetFormula(23, 3, nSrcTab)); // X4
- CPPUNIT_ASSERT_EQUAL(OUString("=E4"), m_pDoc->GetFormula(24, 3, nSrcTab)); // Y4
+ CPPUNIT_ASSERT_EQUAL(u"=A1"_ustr, m_pDoc->GetFormula(20, 0, nSrcTab)); // U1
+ CPPUNIT_ASSERT_EQUAL(u"=B1"_ustr, m_pDoc->GetFormula(21, 0, nSrcTab)); // V1
+ CPPUNIT_ASSERT_EQUAL(u"=C1"_ustr, m_pDoc->GetFormula(22, 0, nSrcTab)); // W1
+ CPPUNIT_ASSERT_EQUAL(u"=D1"_ustr, m_pDoc->GetFormula(23, 0, nSrcTab)); // X1
+ CPPUNIT_ASSERT_EQUAL(u"=E1"_ustr, m_pDoc->GetFormula(24, 0, nSrcTab)); // Y1
+ CPPUNIT_ASSERT_EQUAL(u"=A2"_ustr, m_pDoc->GetFormula(20, 1, nSrcTab)); // U2
+ CPPUNIT_ASSERT_EQUAL(u"=E2"_ustr, m_pDoc->GetFormula(24, 1, nSrcTab)); // Y2
+ CPPUNIT_ASSERT_EQUAL(u"=A3"_ustr, m_pDoc->GetFormula(20, 2, nSrcTab)); // U3
+ CPPUNIT_ASSERT_EQUAL(u"=E3"_ustr, m_pDoc->GetFormula(24, 2, nSrcTab)); // Y3
+ CPPUNIT_ASSERT_EQUAL(u"=A4"_ustr, m_pDoc->GetFormula(20, 3, nSrcTab)); // U4
+ CPPUNIT_ASSERT_EQUAL(u"=B4"_ustr, m_pDoc->GetFormula(21, 3, nSrcTab)); // B4
+ CPPUNIT_ASSERT_EQUAL(u"=C4"_ustr, m_pDoc->GetFormula(22, 3, nSrcTab)); // W4
+ CPPUNIT_ASSERT_EQUAL(u"=D4"_ustr, m_pDoc->GetFormula(23, 3, nSrcTab)); // X4
+ CPPUNIT_ASSERT_EQUAL(u"=E4"_ustr, m_pDoc->GetFormula(24, 3, nSrcTab)); // Y4
for (int i = 10; i < 20; ++i)
for (int j = 0; j < 10; ++j)
@@ -7155,12 +7139,12 @@ void TestCopyPaste::checkReferencedCutRangesRowIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 20, nSrcTab, 2, 21, nSrcTab),
rDesc.toUtf8() + ": Relative references");
- CPPUNIT_ASSERT_EQUAL(OUString("=B2"), m_pDoc->GetFormula(0, 20, nSrcTab)); // A21
- CPPUNIT_ASSERT_EQUAL(OUString("=C2"), m_pDoc->GetFormula(1, 20, nSrcTab)); // B21
- CPPUNIT_ASSERT_EQUAL(OUString("=D2"), m_pDoc->GetFormula(2, 20, nSrcTab)); // C21
- CPPUNIT_ASSERT_EQUAL(OUString("=B3"), m_pDoc->GetFormula(0, 21, nSrcTab)); // A22
- CPPUNIT_ASSERT_EQUAL(OUString("=C3"), m_pDoc->GetFormula(1, 21, nSrcTab)); // B22
- CPPUNIT_ASSERT_EQUAL(OUString("=D3"), m_pDoc->GetFormula(2, 21, nSrcTab)); // C22
+ CPPUNIT_ASSERT_EQUAL(u"=B2"_ustr, m_pDoc->GetFormula(0, 20, nSrcTab)); // A21
+ CPPUNIT_ASSERT_EQUAL(u"=C2"_ustr, m_pDoc->GetFormula(1, 20, nSrcTab)); // B21
+ CPPUNIT_ASSERT_EQUAL(u"=D2"_ustr, m_pDoc->GetFormula(2, 20, nSrcTab)); // C21
+ CPPUNIT_ASSERT_EQUAL(u"=B3"_ustr, m_pDoc->GetFormula(0, 21, nSrcTab)); // A22
+ CPPUNIT_ASSERT_EQUAL(u"=C3"_ustr, m_pDoc->GetFormula(1, 21, nSrcTab)); // B22
+ CPPUNIT_ASSERT_EQUAL(u"=D3"_ustr, m_pDoc->GetFormula(2, 21, nSrcTab)); // C22
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 20, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 20, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(2, 20, nSrcTab));
@@ -7170,12 +7154,12 @@ void TestCopyPaste::checkReferencedCutRangesRowIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 30, nSrcTab, 2, 31, nSrcTab),
rDesc.toUtf8() + ": Absolute references");
- CPPUNIT_ASSERT_EQUAL(OUString("=$B$2"), m_pDoc->GetFormula(0, 30, nSrcTab)); // A31
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$2"), m_pDoc->GetFormula(1, 30, nSrcTab)); // B31
- CPPUNIT_ASSERT_EQUAL(OUString("=$D$2"), m_pDoc->GetFormula(2, 30, nSrcTab)); // C31
- CPPUNIT_ASSERT_EQUAL(OUString("=$B$3"), m_pDoc->GetFormula(0, 31, nSrcTab)); // A32
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$3"), m_pDoc->GetFormula(1, 31, nSrcTab)); // B32
- CPPUNIT_ASSERT_EQUAL(OUString("=$D$3"), m_pDoc->GetFormula(2, 31, nSrcTab)); // C32
+ CPPUNIT_ASSERT_EQUAL(u"=$B$2"_ustr, m_pDoc->GetFormula(0, 30, nSrcTab)); // A31
+ CPPUNIT_ASSERT_EQUAL(u"=$C$2"_ustr, m_pDoc->GetFormula(1, 30, nSrcTab)); // B31
+ CPPUNIT_ASSERT_EQUAL(u"=$D$2"_ustr, m_pDoc->GetFormula(2, 30, nSrcTab)); // C31
+ CPPUNIT_ASSERT_EQUAL(u"=$B$3"_ustr, m_pDoc->GetFormula(0, 31, nSrcTab)); // A32
+ CPPUNIT_ASSERT_EQUAL(u"=$C$3"_ustr, m_pDoc->GetFormula(1, 31, nSrcTab)); // B32
+ CPPUNIT_ASSERT_EQUAL(u"=$D$3"_ustr, m_pDoc->GetFormula(2, 31, nSrcTab)); // C32
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 30, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 30, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(2, 30, nSrcTab));
@@ -7183,25 +7167,25 @@ void TestCopyPaste::checkReferencedCutRangesRowIntitial(const SCTAB nSrcTab, con
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 31, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(2, 31, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$2"), getRangeByName("Range_B2"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$2"), getRangeByName("Range_C2"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$D$2"), getRangeByName("Range_D2"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$3"), getRangeByName("Range_B3"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$3"), getRangeByName("Range_C3"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$D$3"), getRangeByName("Range_D3"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$2:$D$2"), getRangeByName("Range_B2_D2"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$3:$D$3"), getRangeByName("Range_B3_D3"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$2:$D$3"), getRangeByName("Range_B2_D3"));
- CPPUNIT_ASSERT_EQUAL(OUString("B2"), getRangeByName("RelRange_Cm20_R0"));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$2"_ustr, getRangeByName(u"Range_B2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$2"_ustr, getRangeByName(u"Range_C2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$D$2"_ustr, getRangeByName(u"Range_D2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$3"_ustr, getRangeByName(u"Range_B3"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$3"_ustr, getRangeByName(u"Range_C3"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$D$3"_ustr, getRangeByName(u"Range_D3"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$2:$D$2"_ustr, getRangeByName(u"Range_B2_D2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$3:$D$3"_ustr, getRangeByName(u"Range_B3_D3"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$2:$D$3"_ustr, getRangeByName(u"Range_B2_D3"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"B2"_ustr, getRangeByName(u"RelRange_Cm20_R0"_ustr));
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 40, nSrcTab, 2, 41, nSrcTab),
rDesc.toUtf8() + ": Absolute ranges");
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B2"), m_pDoc->GetFormula(0, 40, nSrcTab)); // A41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C2"), m_pDoc->GetFormula(1, 40, nSrcTab)); // B41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_D2"), m_pDoc->GetFormula(2, 40, nSrcTab)); // C41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B3"), m_pDoc->GetFormula(0, 41, nSrcTab)); // A42
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C3"), m_pDoc->GetFormula(1, 41, nSrcTab)); // B42
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_D3"), m_pDoc->GetFormula(2, 41, nSrcTab)); // C42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B2"_ustr, m_pDoc->GetFormula(0, 40, nSrcTab)); // A41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C2"_ustr, m_pDoc->GetFormula(1, 40, nSrcTab)); // B41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_D2"_ustr, m_pDoc->GetFormula(2, 40, nSrcTab)); // C41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B3"_ustr, m_pDoc->GetFormula(0, 41, nSrcTab)); // A42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C3"_ustr, m_pDoc->GetFormula(1, 41, nSrcTab)); // B42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_D3"_ustr, m_pDoc->GetFormula(2, 41, nSrcTab)); // C42
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 40, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 40, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(2, 40, nSrcTab));
@@ -7211,12 +7195,12 @@ void TestCopyPaste::checkReferencedCutRangesRowIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 50, nSrcTab, 2, 51, nSrcTab),
rDesc.toUtf8() + ": Relative ranges");
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 50, nSrcTab)); // A51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 50, nSrcTab)); // B51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(2, 50, nSrcTab)); // C51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 51, nSrcTab)); // A52
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 51, nSrcTab)); // B52
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(2, 51, nSrcTab)); // C52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 50, nSrcTab)); // A51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 50, nSrcTab)); // B51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(2, 50, nSrcTab)); // C51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 51, nSrcTab)); // A52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 51, nSrcTab)); // B52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(2, 51, nSrcTab)); // C52
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 50, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 50, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(2, 50, nSrcTab));
@@ -7226,12 +7210,12 @@ void TestCopyPaste::checkReferencedCutRangesRowIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 60, nSrcTab, 2, 61, nSrcTab),
rDesc.toUtf8() + ": Relative sum");
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B2:D2)"), m_pDoc->GetFormula(0, 60, nSrcTab)); // A61
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B2:D2)"), m_pDoc->GetFormula(1, 60, nSrcTab)); // B61
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B2:D2)"), m_pDoc->GetFormula(2, 60, nSrcTab)); // C61
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B3:D3)"), m_pDoc->GetFormula(0, 61, nSrcTab)); // A62
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B3:D3)"), m_pDoc->GetFormula(1, 61, nSrcTab)); // B62
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B3:D3)"), m_pDoc->GetFormula(2, 61, nSrcTab)); // C62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B2:D2)"_ustr, m_pDoc->GetFormula(0, 60, nSrcTab)); // A61
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B2:D2)"_ustr, m_pDoc->GetFormula(1, 60, nSrcTab)); // B61
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B2:D2)"_ustr, m_pDoc->GetFormula(2, 60, nSrcTab)); // C61
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B3:D3)"_ustr, m_pDoc->GetFormula(0, 61, nSrcTab)); // A62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B3:D3)"_ustr, m_pDoc->GetFormula(1, 61, nSrcTab)); // B62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B3:D3)"_ustr, m_pDoc->GetFormula(2, 61, nSrcTab)); // C62
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 60, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(1, 60, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(2, 60, nSrcTab));
@@ -7241,12 +7225,12 @@ void TestCopyPaste::checkReferencedCutRangesRowIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 70, nSrcTab, 2, 71, nSrcTab),
rDesc.toUtf8() + ": Absolute sum");
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$2)"), m_pDoc->GetFormula(0, 70, nSrcTab)); // A71
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$2)"), m_pDoc->GetFormula(1, 70, nSrcTab)); // B71
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$2)"), m_pDoc->GetFormula(2, 70, nSrcTab)); // C71
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$D$3)"), m_pDoc->GetFormula(0, 71, nSrcTab)); // A72
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$D$3)"), m_pDoc->GetFormula(1, 71, nSrcTab)); // B72
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$D$3)"), m_pDoc->GetFormula(2, 71, nSrcTab)); // C72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$2)"_ustr, m_pDoc->GetFormula(0, 70, nSrcTab)); // A71
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$2)"_ustr, m_pDoc->GetFormula(1, 70, nSrcTab)); // B71
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$2)"_ustr, m_pDoc->GetFormula(2, 70, nSrcTab)); // C71
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$D$3)"_ustr, m_pDoc->GetFormula(0, 71, nSrcTab)); // A72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$D$3)"_ustr, m_pDoc->GetFormula(1, 71, nSrcTab)); // B72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$D$3)"_ustr, m_pDoc->GetFormula(2, 71, nSrcTab)); // C72
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 70, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(1, 70, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(2, 70, nSrcTab));
@@ -7256,12 +7240,12 @@ void TestCopyPaste::checkReferencedCutRangesRowIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 80, nSrcTab, 2, 81, nSrcTab),
rDesc.toUtf8() + ": Relative range sum");
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D2)"), m_pDoc->GetFormula(0, 80, nSrcTab)); // A81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D2)"), m_pDoc->GetFormula(1, 80, nSrcTab)); // B81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D2)"), m_pDoc->GetFormula(2, 80, nSrcTab)); // C81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B3_D3)"), m_pDoc->GetFormula(0, 81, nSrcTab)); // A82
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B3_D3)"), m_pDoc->GetFormula(1, 81, nSrcTab)); // B82
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B3_D3)"), m_pDoc->GetFormula(2, 81, nSrcTab)); // C82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D2)"_ustr, m_pDoc->GetFormula(0, 80, nSrcTab)); // A81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D2)"_ustr, m_pDoc->GetFormula(1, 80, nSrcTab)); // B81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D2)"_ustr, m_pDoc->GetFormula(2, 80, nSrcTab)); // C81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B3_D3)"_ustr, m_pDoc->GetFormula(0, 81, nSrcTab)); // A82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B3_D3)"_ustr, m_pDoc->GetFormula(1, 81, nSrcTab)); // B82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B3_D3)"_ustr, m_pDoc->GetFormula(2, 81, nSrcTab)); // C82
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 80, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(1, 80, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(2, 80, nSrcTab));
@@ -7271,12 +7255,12 @@ void TestCopyPaste::checkReferencedCutRangesRowIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 90, nSrcTab, 2, 91, nSrcTab),
rDesc.toUtf8() + ": Absolute sum");
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(0, 90, nSrcTab)); // A91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(1, 90, nSrcTab)); // B91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(2, 90, nSrcTab)); // C91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(0, 91, nSrcTab)); // A92
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(1, 91, nSrcTab)); // B92
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(2, 91, nSrcTab)); // C92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(0, 90, nSrcTab)); // A91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(1, 90, nSrcTab)); // B91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(2, 90, nSrcTab)); // C91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(0, 91, nSrcTab)); // A92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(1, 91, nSrcTab)); // B92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(2, 91, nSrcTab)); // C92
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(0, 90, nSrcTab));
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(1, 90, nSrcTab));
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(2, 90, nSrcTab));
@@ -7286,18 +7270,12 @@ void TestCopyPaste::checkReferencedCutRangesRowIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 100, nSrcTab, 2, 101, nSrcTab),
rDesc.toUtf8() + ": Relative range sum");
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(0, 100, nSrcTab)); // A101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(1, 100, nSrcTab)); // B101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(2, 100, nSrcTab)); // C101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(0, 101, nSrcTab)); // A102
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(1, 101, nSrcTab)); // B102
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(2, 101, nSrcTab)); // C102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(0, 100, nSrcTab)); // A101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(1, 100, nSrcTab)); // B101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(2, 100, nSrcTab)); // C101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(0, 101, nSrcTab)); // A102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(1, 101, nSrcTab)); // B102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(2, 101, nSrcTab)); // C102
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(0, 100, nSrcTab));
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(1, 100, nSrcTab));
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(2, 100, nSrcTab));
@@ -7315,7 +7293,7 @@ void TestCopyPaste::executeReferencedCutRangesRow(const bool bTransposed, const
for (int i = 0; i < nSrcTab; ++i)
m_pDoc->InsertTab(i, "Empty Tab " + OUString::number(i));
- m_pDoc->InsertTab(nSrcTab, "Test");
+ m_pDoc->InsertTab(nSrcTab, u"Test"_ustr);
m_pDoc->SetValue(1, 1, nSrcTab, 01.0); // B2 \.
m_pDoc->SetValue(2, 1, nSrcTab, 11.0); // C2 | cut
@@ -7341,99 +7319,103 @@ void TestCopyPaste::executeReferencedCutRangesRow(const bool bTransposed, const
m_pDoc->SetValue(3, 3, nSrcTab, 1033.0); // D4
m_pDoc->SetValue(4, 3, nSrcTab, 1034.0); // E4
- m_pDoc->SetString(20, 0, nSrcTab, "=A1"); // U1
- m_pDoc->SetString(21, 0, nSrcTab, "=B1"); // V1
- m_pDoc->SetString(22, 0, nSrcTab, "=C1"); // W1
- m_pDoc->SetString(23, 0, nSrcTab, "=D1"); // X1
- m_pDoc->SetString(24, 0, nSrcTab, "=E1"); // Y1
- m_pDoc->SetString(20, 1, nSrcTab, "=A2"); // U2
- m_pDoc->SetString(24, 1, nSrcTab, "=E2"); // Y2
- m_pDoc->SetString(20, 2, nSrcTab, "=A3"); // U3
- m_pDoc->SetString(24, 2, nSrcTab, "=E3"); // Y3
- m_pDoc->SetString(20, 3, nSrcTab, "=A4"); // U4
- m_pDoc->SetString(21, 3, nSrcTab, "=B4"); // B4
- m_pDoc->SetString(22, 3, nSrcTab, "=C4"); // W4
- m_pDoc->SetString(23, 3, nSrcTab, "=D4"); // X4
- m_pDoc->SetString(24, 3, nSrcTab, "=E4"); // Y4
+ m_pDoc->SetString(20, 0, nSrcTab, u"=A1"_ustr); // U1
+ m_pDoc->SetString(21, 0, nSrcTab, u"=B1"_ustr); // V1
+ m_pDoc->SetString(22, 0, nSrcTab, u"=C1"_ustr); // W1
+ m_pDoc->SetString(23, 0, nSrcTab, u"=D1"_ustr); // X1
+ m_pDoc->SetString(24, 0, nSrcTab, u"=E1"_ustr); // Y1
+ m_pDoc->SetString(20, 1, nSrcTab, u"=A2"_ustr); // U2
+ m_pDoc->SetString(24, 1, nSrcTab, u"=E2"_ustr); // Y2
+ m_pDoc->SetString(20, 2, nSrcTab, u"=A3"_ustr); // U3
+ m_pDoc->SetString(24, 2, nSrcTab, u"=E3"_ustr); // Y3
+ m_pDoc->SetString(20, 3, nSrcTab, u"=A4"_ustr); // U4
+ m_pDoc->SetString(21, 3, nSrcTab, u"=B4"_ustr); // B4
+ m_pDoc->SetString(22, 3, nSrcTab, u"=C4"_ustr); // W4
+ m_pDoc->SetString(23, 3, nSrcTab, u"=D4"_ustr); // X4
+ m_pDoc->SetString(24, 3, nSrcTab, u"=E4"_ustr); // Y4
// Cell position is used for ranges relative to current position
ScAddress cellA1(0, 0, nSrcTab);
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_B2", cellA1, "$Test.$B$2"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_C2", cellA1, "$Test.$C$2"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_D2", cellA1, "$Test.$D$2"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_B3", cellA1, "$Test.$B$3"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_C3", cellA1, "$Test.$C$3"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_D3", cellA1, "$Test.$D$3"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_B2_D2", cellA1, "$Test.$B$2:$D$2"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_B3_D3", cellA1, "$Test.$B$3:$D$3"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_B2_D3", cellA1, "$Test.$B$2:$D$3"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("RelRange_Cm20_R0", ScAddress(1, 21, nSrcTab), "B2"));
-
- m_pDoc->SetString(0, 20, nSrcTab, "=B2"); // A21
- m_pDoc->SetString(1, 20, nSrcTab, "=C2"); // B21
- m_pDoc->SetString(2, 20, nSrcTab, "=D2"); // C21
- m_pDoc->SetString(0, 21, nSrcTab, "=B3"); // A22
- m_pDoc->SetString(1, 21, nSrcTab, "=C3"); // B22
- m_pDoc->SetString(2, 21, nSrcTab, "=D3"); // C22
-
- m_pDoc->SetString(0, 30, nSrcTab, "=$B$2"); // A31
- m_pDoc->SetString(1, 30, nSrcTab, "=$C$2"); // B31
- m_pDoc->SetString(2, 30, nSrcTab, "=$D$2"); // C31
- m_pDoc->SetString(0, 31, nSrcTab, "=$B$3"); // A32
- m_pDoc->SetString(1, 31, nSrcTab, "=$C$3"); // B32
- m_pDoc->SetString(2, 31, nSrcTab, "=$D$3"); // C32
-
- m_pDoc->SetString(0, 40, nSrcTab, "=Range_B2"); // A41
- m_pDoc->SetString(1, 40, nSrcTab, "=Range_C2"); // B41
- m_pDoc->SetString(2, 40, nSrcTab, "=Range_D2"); // C41
- m_pDoc->SetString(0, 41, nSrcTab, "=Range_B3"); // A42
- m_pDoc->SetString(1, 41, nSrcTab, "=Range_C3"); // B42
- m_pDoc->SetString(2, 41, nSrcTab, "=Range_D3"); // C42
-
- m_pDoc->SetString(0, 50, nSrcTab, "=RelRange_Cm20_R0"); // A51
- m_pDoc->SetString(1, 50, nSrcTab, "=RelRange_Cm20_R0"); // B51
- m_pDoc->SetString(2, 50, nSrcTab, "=RelRange_Cm20_R0"); // C51
- m_pDoc->SetString(0, 51, nSrcTab, "=RelRange_Cm20_R0"); // A52
- m_pDoc->SetString(1, 51, nSrcTab, "=RelRange_Cm20_R0"); // B52
- m_pDoc->SetString(2, 51, nSrcTab, "=RelRange_Cm20_R0"); // C52
-
- m_pDoc->SetString(0, 60, nSrcTab, "=SUM(B2:D2)"); // A61
- m_pDoc->SetString(1, 60, nSrcTab, "=SUM(B2:D2)"); // B61
- m_pDoc->SetString(2, 60, nSrcTab, "=SUM(B2:D2)"); // C61
- m_pDoc->SetString(0, 61, nSrcTab, "=SUM(B3:D3)"); // A62
- m_pDoc->SetString(1, 61, nSrcTab, "=SUM(B3:D3)"); // B62
- m_pDoc->SetString(2, 61, nSrcTab, "=SUM(B3:D3)"); // C62
-
- m_pDoc->SetString(0, 70, nSrcTab, "=SUM($B$2:$D$2)"); // A71
- m_pDoc->SetString(1, 70, nSrcTab, "=SUM($B$2:$D$2)"); // B71
- m_pDoc->SetString(2, 70, nSrcTab, "=SUM($B$2:$D$2)"); // C71
- m_pDoc->SetString(0, 71, nSrcTab, "=SUM($B$3:$D$3)"); // A72
- m_pDoc->SetString(1, 71, nSrcTab, "=SUM($B$3:$D$3)"); // B72
- m_pDoc->SetString(2, 71, nSrcTab, "=SUM($B$3:$D$3)"); // C72
-
- m_pDoc->SetString(0, 80, nSrcTab, "=SUM(Range_B2_D2)"); // A81
- m_pDoc->SetString(1, 80, nSrcTab, "=SUM(Range_B2_D2)"); // B81
- m_pDoc->SetString(2, 80, nSrcTab, "=SUM(Range_B2_D2)"); // C81
- m_pDoc->SetString(0, 81, nSrcTab, "=SUM(Range_B3_D3)"); // A82
- m_pDoc->SetString(1, 81, nSrcTab, "=SUM(Range_B3_D3)"); // B82
- m_pDoc->SetString(2, 81, nSrcTab, "=SUM(Range_B3_D3)"); // C82
-
- m_pDoc->SetString(0, 90, nSrcTab, "=SUM($B$2:$D$3)"); // A91
- m_pDoc->SetString(1, 90, nSrcTab, "=SUM($B$2:$D$3)"); // B91
- m_pDoc->SetString(2, 90, nSrcTab, "=SUM($B$2:$D$3)"); // C91
- m_pDoc->SetString(0, 91, nSrcTab, "=SUM($B$2:$D$3)"); // A92
- m_pDoc->SetString(1, 91, nSrcTab, "=SUM($B$2:$D$3)"); // B92
- m_pDoc->SetString(2, 91, nSrcTab, "=SUM($B$2:$D$3)"); // C92
-
- m_pDoc->SetString(0, 100, nSrcTab, "=SUM(Range_B2_D3)"); // A101
- m_pDoc->SetString(1, 100, nSrcTab, "=SUM(Range_B2_D3)"); // B101
- m_pDoc->SetString(2, 100, nSrcTab, "=SUM(Range_B2_D3)"); // C101
- m_pDoc->SetString(0, 101, nSrcTab, "=SUM(Range_B2_D3)"); // A102
- m_pDoc->SetString(1, 101, nSrcTab, "=SUM(Range_B2_D3)"); // B102
- m_pDoc->SetString(2, 101, nSrcTab, "=SUM(Range_B2_D3)"); // C102
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_B2"_ustr, cellA1, u"$Test.$B$2"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_C2"_ustr, cellA1, u"$Test.$C$2"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_D2"_ustr, cellA1, u"$Test.$D$2"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_B3"_ustr, cellA1, u"$Test.$B$3"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_C3"_ustr, cellA1, u"$Test.$C$3"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_D3"_ustr, cellA1, u"$Test.$D$3"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_B2_D2"_ustr, cellA1, u"$Test.$B$2:$D$2"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_B3_D3"_ustr, cellA1, u"$Test.$B$3:$D$3"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_B2_D3"_ustr, cellA1, u"$Test.$B$2:$D$3"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"RelRange_Cm20_R0"_ustr, ScAddress(1, 21, nSrcTab),
+ u"B2"_ustr));
+
+ m_pDoc->SetString(0, 20, nSrcTab, u"=B2"_ustr); // A21
+ m_pDoc->SetString(1, 20, nSrcTab, u"=C2"_ustr); // B21
+ m_pDoc->SetString(2, 20, nSrcTab, u"=D2"_ustr); // C21
+ m_pDoc->SetString(0, 21, nSrcTab, u"=B3"_ustr); // A22
+ m_pDoc->SetString(1, 21, nSrcTab, u"=C3"_ustr); // B22
+ m_pDoc->SetString(2, 21, nSrcTab, u"=D3"_ustr); // C22
+
+ m_pDoc->SetString(0, 30, nSrcTab, u"=$B$2"_ustr); // A31
+ m_pDoc->SetString(1, 30, nSrcTab, u"=$C$2"_ustr); // B31
+ m_pDoc->SetString(2, 30, nSrcTab, u"=$D$2"_ustr); // C31
+ m_pDoc->SetString(0, 31, nSrcTab, u"=$B$3"_ustr); // A32
+ m_pDoc->SetString(1, 31, nSrcTab, u"=$C$3"_ustr); // B32
+ m_pDoc->SetString(2, 31, nSrcTab, u"=$D$3"_ustr); // C32
+
+ m_pDoc->SetString(0, 40, nSrcTab, u"=Range_B2"_ustr); // A41
+ m_pDoc->SetString(1, 40, nSrcTab, u"=Range_C2"_ustr); // B41
+ m_pDoc->SetString(2, 40, nSrcTab, u"=Range_D2"_ustr); // C41
+ m_pDoc->SetString(0, 41, nSrcTab, u"=Range_B3"_ustr); // A42
+ m_pDoc->SetString(1, 41, nSrcTab, u"=Range_C3"_ustr); // B42
+ m_pDoc->SetString(2, 41, nSrcTab, u"=Range_D3"_ustr); // C42
+
+ m_pDoc->SetString(0, 50, nSrcTab, u"=RelRange_Cm20_R0"_ustr); // A51
+ m_pDoc->SetString(1, 50, nSrcTab, u"=RelRange_Cm20_R0"_ustr); // B51
+ m_pDoc->SetString(2, 50, nSrcTab, u"=RelRange_Cm20_R0"_ustr); // C51
+ m_pDoc->SetString(0, 51, nSrcTab, u"=RelRange_Cm20_R0"_ustr); // A52
+ m_pDoc->SetString(1, 51, nSrcTab, u"=RelRange_Cm20_R0"_ustr); // B52
+ m_pDoc->SetString(2, 51, nSrcTab, u"=RelRange_Cm20_R0"_ustr); // C52
+
+ m_pDoc->SetString(0, 60, nSrcTab, u"=SUM(B2:D2)"_ustr); // A61
+ m_pDoc->SetString(1, 60, nSrcTab, u"=SUM(B2:D2)"_ustr); // B61
+ m_pDoc->SetString(2, 60, nSrcTab, u"=SUM(B2:D2)"_ustr); // C61
+ m_pDoc->SetString(0, 61, nSrcTab, u"=SUM(B3:D3)"_ustr); // A62
+ m_pDoc->SetString(1, 61, nSrcTab, u"=SUM(B3:D3)"_ustr); // B62
+ m_pDoc->SetString(2, 61, nSrcTab, u"=SUM(B3:D3)"_ustr); // C62
+
+ m_pDoc->SetString(0, 70, nSrcTab, u"=SUM($B$2:$D$2)"_ustr); // A71
+ m_pDoc->SetString(1, 70, nSrcTab, u"=SUM($B$2:$D$2)"_ustr); // B71
+ m_pDoc->SetString(2, 70, nSrcTab, u"=SUM($B$2:$D$2)"_ustr); // C71
+ m_pDoc->SetString(0, 71, nSrcTab, u"=SUM($B$3:$D$3)"_ustr); // A72
+ m_pDoc->SetString(1, 71, nSrcTab, u"=SUM($B$3:$D$3)"_ustr); // B72
+ m_pDoc->SetString(2, 71, nSrcTab, u"=SUM($B$3:$D$3)"_ustr); // C72
+
+ m_pDoc->SetString(0, 80, nSrcTab, u"=SUM(Range_B2_D2)"_ustr); // A81
+ m_pDoc->SetString(1, 80, nSrcTab, u"=SUM(Range_B2_D2)"_ustr); // B81
+ m_pDoc->SetString(2, 80, nSrcTab, u"=SUM(Range_B2_D2)"_ustr); // C81
+ m_pDoc->SetString(0, 81, nSrcTab, u"=SUM(Range_B3_D3)"_ustr); // A82
+ m_pDoc->SetString(1, 81, nSrcTab, u"=SUM(Range_B3_D3)"_ustr); // B82
+ m_pDoc->SetString(2, 81, nSrcTab, u"=SUM(Range_B3_D3)"_ustr); // C82
+
+ m_pDoc->SetString(0, 90, nSrcTab, u"=SUM($B$2:$D$3)"_ustr); // A91
+ m_pDoc->SetString(1, 90, nSrcTab, u"=SUM($B$2:$D$3)"_ustr); // B91
+ m_pDoc->SetString(2, 90, nSrcTab, u"=SUM($B$2:$D$3)"_ustr); // C91
+ m_pDoc->SetString(0, 91, nSrcTab, u"=SUM($B$2:$D$3)"_ustr); // A92
+ m_pDoc->SetString(1, 91, nSrcTab, u"=SUM($B$2:$D$3)"_ustr); // B92
+ m_pDoc->SetString(2, 91, nSrcTab, u"=SUM($B$2:$D$3)"_ustr); // C92
+
+ m_pDoc->SetString(0, 100, nSrcTab, u"=SUM(Range_B2_D3)"_ustr); // A101
+ m_pDoc->SetString(1, 100, nSrcTab, u"=SUM(Range_B2_D3)"_ustr); // B101
+ m_pDoc->SetString(2, 100, nSrcTab, u"=SUM(Range_B2_D3)"_ustr); // C101
+ m_pDoc->SetString(0, 101, nSrcTab, u"=SUM(Range_B2_D3)"_ustr); // A102
+ m_pDoc->SetString(1, 101, nSrcTab, u"=SUM(Range_B2_D3)"_ustr); // B102
+ m_pDoc->SetString(2, 101, nSrcTab, u"=SUM(Range_B2_D3)"_ustr); // C102
// Check precondition
- checkReferencedCutRangesRowIntitial(nSrcTab, "Initial");
+ checkReferencedCutRangesRowIntitial(nSrcTab, u"Initial"_ustr);
// Cut values B2:D2 to the clip document.
ScDocument aClipDoc(SCDOCMODE_CLIP);
@@ -7447,9 +7429,9 @@ void TestCopyPaste::executeReferencedCutRangesRow(const bool bTransposed, const
m_pDoc->InsertTab(i, "Empty Tab " + OUString::number(i));
if (nSrcTab < nDestTab)
- m_pDoc->InsertTab(nDestTab, "Dest");
+ m_pDoc->InsertTab(nDestTab, u"Dest"_ustr);
else if (nSrcTab > nDestTab)
- m_pDoc->RenameTab(nDestTab, "Dest");
+ m_pDoc->RenameTab(nDestTab, u"Dest"_ustr);
int nTabCount = m_pDoc->GetTableCount();
for (int i = nTabCount; i < nTabCount + 2; ++i)
@@ -7514,7 +7496,7 @@ void TestCopyPaste::checkReferencedCutRangesRow(const SCTAB nSrcTab, const SCTAB
{
// Cut B2:D2 and pasted to C12:E12
- OUString aFBase("=");
+ OUString aFBase(u"="_ustr);
if (nSrcTab != nDestTab)
aFBase += "Dest.";
@@ -7555,29 +7537,29 @@ void TestCopyPaste::checkReferencedCutRangesRow(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(1032.0, m_pDoc->GetValue(22, 3, nSrcTab)); // W4
CPPUNIT_ASSERT_EQUAL(1033.0, m_pDoc->GetValue(23, 3, nSrcTab)); // X4
CPPUNIT_ASSERT_EQUAL(1034.0, m_pDoc->GetValue(24, 3, nSrcTab)); // Y4
- CPPUNIT_ASSERT_EQUAL(OUString("=A1"), m_pDoc->GetFormula(20, 0, nSrcTab)); // U1
- CPPUNIT_ASSERT_EQUAL(OUString("=B1"), m_pDoc->GetFormula(21, 0, nSrcTab)); // V1
- CPPUNIT_ASSERT_EQUAL(OUString("=C1"), m_pDoc->GetFormula(22, 0, nSrcTab)); // W1
- CPPUNIT_ASSERT_EQUAL(OUString("=D1"), m_pDoc->GetFormula(23, 0, nSrcTab)); // X1
- CPPUNIT_ASSERT_EQUAL(OUString("=E1"), m_pDoc->GetFormula(24, 0, nSrcTab)); // Y1
- CPPUNIT_ASSERT_EQUAL(OUString("=A2"), m_pDoc->GetFormula(20, 1, nSrcTab)); // U2
- CPPUNIT_ASSERT_EQUAL(OUString("=E2"), m_pDoc->GetFormula(24, 1, nSrcTab)); // Y2
- CPPUNIT_ASSERT_EQUAL(OUString("=A3"), m_pDoc->GetFormula(20, 2, nSrcTab)); // U3
- CPPUNIT_ASSERT_EQUAL(OUString("=E3"), m_pDoc->GetFormula(24, 2, nSrcTab)); // Y3
- CPPUNIT_ASSERT_EQUAL(OUString("=A4"), m_pDoc->GetFormula(20, 3, nSrcTab)); // U4
- CPPUNIT_ASSERT_EQUAL(OUString("=B4"), m_pDoc->GetFormula(21, 3, nSrcTab)); // B4
- CPPUNIT_ASSERT_EQUAL(OUString("=C4"), m_pDoc->GetFormula(22, 3, nSrcTab)); // W4
- CPPUNIT_ASSERT_EQUAL(OUString("=D4"), m_pDoc->GetFormula(23, 3, nSrcTab)); // X4
- CPPUNIT_ASSERT_EQUAL(OUString("=E4"), m_pDoc->GetFormula(24, 3, nSrcTab)); // Y4
+ CPPUNIT_ASSERT_EQUAL(u"=A1"_ustr, m_pDoc->GetFormula(20, 0, nSrcTab)); // U1
+ CPPUNIT_ASSERT_EQUAL(u"=B1"_ustr, m_pDoc->GetFormula(21, 0, nSrcTab)); // V1
+ CPPUNIT_ASSERT_EQUAL(u"=C1"_ustr, m_pDoc->GetFormula(22, 0, nSrcTab)); // W1
+ CPPUNIT_ASSERT_EQUAL(u"=D1"_ustr, m_pDoc->GetFormula(23, 0, nSrcTab)); // X1
+ CPPUNIT_ASSERT_EQUAL(u"=E1"_ustr, m_pDoc->GetFormula(24, 0, nSrcTab)); // Y1
+ CPPUNIT_ASSERT_EQUAL(u"=A2"_ustr, m_pDoc->GetFormula(20, 1, nSrcTab)); // U2
+ CPPUNIT_ASSERT_EQUAL(u"=E2"_ustr, m_pDoc->GetFormula(24, 1, nSrcTab)); // Y2
+ CPPUNIT_ASSERT_EQUAL(u"=A3"_ustr, m_pDoc->GetFormula(20, 2, nSrcTab)); // U3
+ CPPUNIT_ASSERT_EQUAL(u"=E3"_ustr, m_pDoc->GetFormula(24, 2, nSrcTab)); // Y3
+ CPPUNIT_ASSERT_EQUAL(u"=A4"_ustr, m_pDoc->GetFormula(20, 3, nSrcTab)); // U4
+ CPPUNIT_ASSERT_EQUAL(u"=B4"_ustr, m_pDoc->GetFormula(21, 3, nSrcTab)); // B4
+ CPPUNIT_ASSERT_EQUAL(u"=C4"_ustr, m_pDoc->GetFormula(22, 3, nSrcTab)); // W4
+ CPPUNIT_ASSERT_EQUAL(u"=D4"_ustr, m_pDoc->GetFormula(23, 3, nSrcTab)); // X4
+ CPPUNIT_ASSERT_EQUAL(u"=E4"_ustr, m_pDoc->GetFormula(24, 3, nSrcTab)); // Y4
// Note: Values (mostly) remain the same
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "C12"), m_pDoc->GetFormula(0, 20, nSrcTab)); // A21
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "D12"), m_pDoc->GetFormula(1, 20, nSrcTab)); // B21
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "E12"), m_pDoc->GetFormula(2, 20, nSrcTab)); // C21
- CPPUNIT_ASSERT_EQUAL(OUString("=B3"), m_pDoc->GetFormula(0, 21, nSrcTab)); // A22
- CPPUNIT_ASSERT_EQUAL(OUString("=C3"), m_pDoc->GetFormula(1, 21, nSrcTab)); // B22
- CPPUNIT_ASSERT_EQUAL(OUString("=D3"), m_pDoc->GetFormula(2, 21, nSrcTab)); // C22
+ CPPUNIT_ASSERT_EQUAL(u"=B3"_ustr, m_pDoc->GetFormula(0, 21, nSrcTab)); // A22
+ CPPUNIT_ASSERT_EQUAL(u"=C3"_ustr, m_pDoc->GetFormula(1, 21, nSrcTab)); // B22
+ CPPUNIT_ASSERT_EQUAL(u"=D3"_ustr, m_pDoc->GetFormula(2, 21, nSrcTab)); // C22
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 20, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 20, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(2, 20, nSrcTab));
@@ -7588,9 +7570,9 @@ void TestCopyPaste::checkReferencedCutRangesRow(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "$C$12"), m_pDoc->GetFormula(0, 30, nSrcTab)); // A31
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "$D$12"), m_pDoc->GetFormula(1, 30, nSrcTab)); // B31
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "$E$12"), m_pDoc->GetFormula(2, 30, nSrcTab)); // C31
- CPPUNIT_ASSERT_EQUAL(OUString("=$B$3"), m_pDoc->GetFormula(0, 31, nSrcTab)); // A32
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$3"), m_pDoc->GetFormula(1, 31, nSrcTab)); // B32
- CPPUNIT_ASSERT_EQUAL(OUString("=$D$3"), m_pDoc->GetFormula(2, 31, nSrcTab)); // C32
+ CPPUNIT_ASSERT_EQUAL(u"=$B$3"_ustr, m_pDoc->GetFormula(0, 31, nSrcTab)); // A32
+ CPPUNIT_ASSERT_EQUAL(u"=$C$3"_ustr, m_pDoc->GetFormula(1, 31, nSrcTab)); // B32
+ CPPUNIT_ASSERT_EQUAL(u"=$D$3"_ustr, m_pDoc->GetFormula(2, 31, nSrcTab)); // C32
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 30, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 30, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(2, 30, nSrcTab));
@@ -7598,28 +7580,28 @@ void TestCopyPaste::checkReferencedCutRangesRow(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 31, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(2, 31, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$C$12") : OUString("$Test.$C$12"),
- getRangeByName("Range_B2"));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$D$12") : OUString("$Test.$D$12"),
- getRangeByName("Range_C2"));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$E$12") : OUString("$Test.$E$12"),
- getRangeByName("Range_D2"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$3"), getRangeByName("Range_B3")); // no change
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$3"), getRangeByName("Range_C3")); // no change
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$D$3"), getRangeByName("Range_D3")); // no change
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$C$12:$E$12")
- : OUString("$Test.$C$12:$E$12"),
- getRangeByName("Range_B2_D2"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$3:$D$3"), getRangeByName("Range_B3_D3")); // no change
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$2:$D$3"), getRangeByName("Range_B2_D3")); // no change
- CPPUNIT_ASSERT_EQUAL(OUString("B2"), getRangeByName("RelRange_Cm20_R0")); // no change
-
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B2"), m_pDoc->GetFormula(0, 40, nSrcTab)); // A41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C2"), m_pDoc->GetFormula(1, 40, nSrcTab)); // B41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_D2"), m_pDoc->GetFormula(2, 40, nSrcTab)); // C41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B3"), m_pDoc->GetFormula(0, 41, nSrcTab)); // A42
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C3"), m_pDoc->GetFormula(1, 41, nSrcTab)); // B42
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_D3"), m_pDoc->GetFormula(2, 41, nSrcTab)); // C42
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$C$12"_ustr : u"$Test.$C$12"_ustr,
+ getRangeByName(u"Range_B2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$D$12"_ustr : u"$Test.$D$12"_ustr,
+ getRangeByName(u"Range_C2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$E$12"_ustr : u"$Test.$E$12"_ustr,
+ getRangeByName(u"Range_D2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$3"_ustr, getRangeByName(u"Range_B3"_ustr)); // no change
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$3"_ustr, getRangeByName(u"Range_C3"_ustr)); // no change
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$D$3"_ustr, getRangeByName(u"Range_D3"_ustr)); // no change
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$C$12:$E$12"_ustr
+ : u"$Test.$C$12:$E$12"_ustr,
+ getRangeByName(u"Range_B2_D2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$3:$D$3"_ustr, getRangeByName(u"Range_B3_D3"_ustr)); // no change
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$2:$D$3"_ustr, getRangeByName(u"Range_B2_D3"_ustr)); // no change
+ CPPUNIT_ASSERT_EQUAL(u"B2"_ustr, getRangeByName(u"RelRange_Cm20_R0"_ustr)); // no change
+
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B2"_ustr, m_pDoc->GetFormula(0, 40, nSrcTab)); // A41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C2"_ustr, m_pDoc->GetFormula(1, 40, nSrcTab)); // B41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_D2"_ustr, m_pDoc->GetFormula(2, 40, nSrcTab)); // C41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B3"_ustr, m_pDoc->GetFormula(0, 41, nSrcTab)); // A42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C3"_ustr, m_pDoc->GetFormula(1, 41, nSrcTab)); // B42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_D3"_ustr, m_pDoc->GetFormula(2, 41, nSrcTab)); // C42
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 40, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 40, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(2, 40, nSrcTab));
@@ -7627,12 +7609,12 @@ void TestCopyPaste::checkReferencedCutRangesRow(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 41, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(2, 41, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 50, nSrcTab)); // A51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 50, nSrcTab)); // B51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(2, 50, nSrcTab)); // C51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 51, nSrcTab)); // A52
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 51, nSrcTab)); // B52
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(2, 51, nSrcTab)); // C52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 50, nSrcTab)); // A51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 50, nSrcTab)); // B51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(2, 50, nSrcTab)); // C51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 51, nSrcTab)); // A52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 51, nSrcTab)); // B52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(2, 51, nSrcTab)); // C52
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 50, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 50, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(2, 50, nSrcTab));
@@ -7640,18 +7622,15 @@ void TestCopyPaste::checkReferencedCutRangesRow(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 51, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(2, 51, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.C12:E12)")
- : OUString("=SUM(C12:E12)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.C12:E12)"_ustr : u"=SUM(C12:E12)"_ustr,
m_pDoc->GetFormula(0, 60, nSrcTab)); // A61
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.C12:E12)")
- : OUString("=SUM(C12:E12)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.C12:E12)"_ustr : u"=SUM(C12:E12)"_ustr,
m_pDoc->GetFormula(1, 60, nSrcTab)); // B61
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.C12:E12)")
- : OUString("=SUM(C12:E12)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.C12:E12)"_ustr : u"=SUM(C12:E12)"_ustr,
m_pDoc->GetFormula(2, 60, nSrcTab)); // C61
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B3:D3)"), m_pDoc->GetFormula(0, 61, nSrcTab)); // A62
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B3:D3)"), m_pDoc->GetFormula(1, 61, nSrcTab)); // B62
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B3:D3)"), m_pDoc->GetFormula(2, 61, nSrcTab)); // C62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B3:D3)"_ustr, m_pDoc->GetFormula(0, 61, nSrcTab)); // A62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B3:D3)"_ustr, m_pDoc->GetFormula(1, 61, nSrcTab)); // B62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B3:D3)"_ustr, m_pDoc->GetFormula(2, 61, nSrcTab)); // C62
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 60, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(1, 60, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(2, 60, nSrcTab));
@@ -7659,18 +7638,18 @@ void TestCopyPaste::checkReferencedCutRangesRow(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 61, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 61, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.$C$12:$E$12)")
- : OUString("=SUM($C$12:$E$12)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.$C$12:$E$12)"_ustr
+ : u"=SUM($C$12:$E$12)"_ustr,
m_pDoc->GetFormula(0, 70, nSrcTab)); // A71
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.$C$12:$E$12)")
- : OUString("=SUM($C$12:$E$12)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.$C$12:$E$12)"_ustr
+ : u"=SUM($C$12:$E$12)"_ustr,
m_pDoc->GetFormula(1, 70, nSrcTab)); // B71
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.$C$12:$E$12)")
- : OUString("=SUM($C$12:$E$12)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.$C$12:$E$12)"_ustr
+ : u"=SUM($C$12:$E$12)"_ustr,
m_pDoc->GetFormula(2, 70, nSrcTab)); // C71
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$D$3)"), m_pDoc->GetFormula(0, 71, nSrcTab)); // A72
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$D$3)"), m_pDoc->GetFormula(1, 71, nSrcTab)); // B72
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$D$3)"), m_pDoc->GetFormula(2, 71, nSrcTab)); // C72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$D$3)"_ustr, m_pDoc->GetFormula(0, 71, nSrcTab)); // A72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$D$3)"_ustr, m_pDoc->GetFormula(1, 71, nSrcTab)); // B72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$D$3)"_ustr, m_pDoc->GetFormula(2, 71, nSrcTab)); // C72
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 70, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(1, 70, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(2, 70, nSrcTab));
@@ -7678,12 +7657,12 @@ void TestCopyPaste::checkReferencedCutRangesRow(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 71, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 71, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D2)"), m_pDoc->GetFormula(0, 80, nSrcTab)); // A81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D2)"), m_pDoc->GetFormula(1, 80, nSrcTab)); // B81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D2)"), m_pDoc->GetFormula(2, 80, nSrcTab)); // C81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B3_D3)"), m_pDoc->GetFormula(0, 81, nSrcTab)); // A82
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B3_D3)"), m_pDoc->GetFormula(1, 81, nSrcTab)); // B82
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B3_D3)"), m_pDoc->GetFormula(2, 81, nSrcTab)); // C82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D2)"_ustr, m_pDoc->GetFormula(0, 80, nSrcTab)); // A81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D2)"_ustr, m_pDoc->GetFormula(1, 80, nSrcTab)); // B81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D2)"_ustr, m_pDoc->GetFormula(2, 80, nSrcTab)); // C81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B3_D3)"_ustr, m_pDoc->GetFormula(0, 81, nSrcTab)); // A82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B3_D3)"_ustr, m_pDoc->GetFormula(1, 81, nSrcTab)); // B82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B3_D3)"_ustr, m_pDoc->GetFormula(2, 81, nSrcTab)); // C82
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 80, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(1, 80, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(2, 80, nSrcTab));
@@ -7692,12 +7671,12 @@ void TestCopyPaste::checkReferencedCutRangesRow(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 81, nSrcTab));
// no change in formula after cut
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(0, 90, nSrcTab)); // A91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(1, 90, nSrcTab)); // B91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(2, 90, nSrcTab)); // C91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(0, 91, nSrcTab)); // A92
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(1, 91, nSrcTab)); // B92
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(2, 91, nSrcTab)); // C92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(0, 90, nSrcTab)); // A91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(1, 90, nSrcTab)); // B91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(2, 90, nSrcTab)); // C91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(0, 91, nSrcTab)); // A92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(1, 91, nSrcTab)); // B92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(2, 91, nSrcTab)); // C92
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 90, nSrcTab)); // only 2nd row
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 90, nSrcTab)); // only 2nd row
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 90, nSrcTab)); // only 2nd row
@@ -7705,18 +7684,12 @@ void TestCopyPaste::checkReferencedCutRangesRow(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 91, nSrcTab)); // only 2nd row
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 91, nSrcTab)); // only 2nd row
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(0, 100, nSrcTab)); // A101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(1, 100, nSrcTab)); // B101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(2, 100, nSrcTab)); // C101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(0, 101, nSrcTab)); // A102
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(1, 101, nSrcTab)); // B102
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(2, 101, nSrcTab)); // C102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(0, 100, nSrcTab)); // A101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(1, 100, nSrcTab)); // B101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(2, 100, nSrcTab)); // C101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(0, 101, nSrcTab)); // A102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(1, 101, nSrcTab)); // B102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(2, 101, nSrcTab)); // C102
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 100, nSrcTab)); // only 2nd row
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 100, nSrcTab)); // only 2nd row
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 100, nSrcTab)); // only 2nd row
@@ -7729,7 +7702,7 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRow(const SCTAB nSrcTab, c
{
// Cut B2:D2 and pasted transposed to C12:C14
- OUString aFBase("=");
+ OUString aFBase(u"="_ustr);
if (nSrcTab != nDestTab)
aFBase += "Dest.";
@@ -7770,20 +7743,20 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRow(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(1032.0, m_pDoc->GetValue(22, 3, nSrcTab)); // W4
CPPUNIT_ASSERT_EQUAL(1033.0, m_pDoc->GetValue(23, 3, nSrcTab)); // X4
CPPUNIT_ASSERT_EQUAL(1034.0, m_pDoc->GetValue(24, 3, nSrcTab)); // Y4
- CPPUNIT_ASSERT_EQUAL(OUString("=A1"), m_pDoc->GetFormula(20, 0, nSrcTab)); // U1
- CPPUNIT_ASSERT_EQUAL(OUString("=B1"), m_pDoc->GetFormula(21, 0, nSrcTab)); // V1
- CPPUNIT_ASSERT_EQUAL(OUString("=C1"), m_pDoc->GetFormula(22, 0, nSrcTab)); // W1
- CPPUNIT_ASSERT_EQUAL(OUString("=D1"), m_pDoc->GetFormula(23, 0, nSrcTab)); // X1
- CPPUNIT_ASSERT_EQUAL(OUString("=E1"), m_pDoc->GetFormula(24, 0, nSrcTab)); // Y1
- CPPUNIT_ASSERT_EQUAL(OUString("=A2"), m_pDoc->GetFormula(20, 1, nSrcTab)); // U2
- CPPUNIT_ASSERT_EQUAL(OUString("=E2"), m_pDoc->GetFormula(24, 1, nSrcTab)); // Y2
- CPPUNIT_ASSERT_EQUAL(OUString("=A3"), m_pDoc->GetFormula(20, 2, nSrcTab)); // U3
- CPPUNIT_ASSERT_EQUAL(OUString("=E3"), m_pDoc->GetFormula(24, 2, nSrcTab)); // Y3
- CPPUNIT_ASSERT_EQUAL(OUString("=A4"), m_pDoc->GetFormula(20, 3, nSrcTab)); // U4
- CPPUNIT_ASSERT_EQUAL(OUString("=B4"), m_pDoc->GetFormula(21, 3, nSrcTab)); // B4
- CPPUNIT_ASSERT_EQUAL(OUString("=C4"), m_pDoc->GetFormula(22, 3, nSrcTab)); // W4
- CPPUNIT_ASSERT_EQUAL(OUString("=D4"), m_pDoc->GetFormula(23, 3, nSrcTab)); // X4
- CPPUNIT_ASSERT_EQUAL(OUString("=E4"), m_pDoc->GetFormula(24, 3, nSrcTab)); // Y4
+ CPPUNIT_ASSERT_EQUAL(u"=A1"_ustr, m_pDoc->GetFormula(20, 0, nSrcTab)); // U1
+ CPPUNIT_ASSERT_EQUAL(u"=B1"_ustr, m_pDoc->GetFormula(21, 0, nSrcTab)); // V1
+ CPPUNIT_ASSERT_EQUAL(u"=C1"_ustr, m_pDoc->GetFormula(22, 0, nSrcTab)); // W1
+ CPPUNIT_ASSERT_EQUAL(u"=D1"_ustr, m_pDoc->GetFormula(23, 0, nSrcTab)); // X1
+ CPPUNIT_ASSERT_EQUAL(u"=E1"_ustr, m_pDoc->GetFormula(24, 0, nSrcTab)); // Y1
+ CPPUNIT_ASSERT_EQUAL(u"=A2"_ustr, m_pDoc->GetFormula(20, 1, nSrcTab)); // U2
+ CPPUNIT_ASSERT_EQUAL(u"=E2"_ustr, m_pDoc->GetFormula(24, 1, nSrcTab)); // Y2
+ CPPUNIT_ASSERT_EQUAL(u"=A3"_ustr, m_pDoc->GetFormula(20, 2, nSrcTab)); // U3
+ CPPUNIT_ASSERT_EQUAL(u"=E3"_ustr, m_pDoc->GetFormula(24, 2, nSrcTab)); // Y3
+ CPPUNIT_ASSERT_EQUAL(u"=A4"_ustr, m_pDoc->GetFormula(20, 3, nSrcTab)); // U4
+ CPPUNIT_ASSERT_EQUAL(u"=B4"_ustr, m_pDoc->GetFormula(21, 3, nSrcTab)); // B4
+ CPPUNIT_ASSERT_EQUAL(u"=C4"_ustr, m_pDoc->GetFormula(22, 3, nSrcTab)); // W4
+ CPPUNIT_ASSERT_EQUAL(u"=D4"_ustr, m_pDoc->GetFormula(23, 3, nSrcTab)); // X4
+ CPPUNIT_ASSERT_EQUAL(u"=E4"_ustr, m_pDoc->GetFormula(24, 3, nSrcTab)); // Y4
// Note: Values (mostly) remain the same
@@ -7798,9 +7771,9 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRow(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "C12"), m_pDoc->GetFormula(0, 20, nSrcTab));
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "C13"), m_pDoc->GetFormula(1, 20, nSrcTab));
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "C14"), m_pDoc->GetFormula(2, 20, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=B3"), m_pDoc->GetFormula(0, 21, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=C3"), m_pDoc->GetFormula(1, 21, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=D3"), m_pDoc->GetFormula(2, 21, nSrcTab));
+ CPPUNIT_ASSERT_EQUAL(u"=B3"_ustr, m_pDoc->GetFormula(0, 21, nSrcTab));
+ CPPUNIT_ASSERT_EQUAL(u"=C3"_ustr, m_pDoc->GetFormula(1, 21, nSrcTab));
+ CPPUNIT_ASSERT_EQUAL(u"=D3"_ustr, m_pDoc->GetFormula(2, 21, nSrcTab));
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 30, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 30, nSrcTab));
@@ -7812,32 +7785,32 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRow(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "$C$12"), m_pDoc->GetFormula(0, 30, nSrcTab));
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "$C$13"), m_pDoc->GetFormula(1, 30, nSrcTab));
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "$C$14"), m_pDoc->GetFormula(2, 30, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=$B$3"), m_pDoc->GetFormula(0, 31, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$3"), m_pDoc->GetFormula(1, 31, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=$D$3"), m_pDoc->GetFormula(2, 31, nSrcTab));
-
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$C$12") : OUString("$Test.$C$12"),
- getRangeByName("Range_B2"));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$C$13") : OUString("$Test.$C$13"),
- getRangeByName("Range_C2"));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$C$14") : OUString("$Test.$C$14"),
- getRangeByName("Range_D2"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$3"), getRangeByName("Range_B3")); // no change
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$3"), getRangeByName("Range_C3")); // no change
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$D$3"), getRangeByName("Range_D3")); // no change
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$C$12:$C$14")
- : OUString("$Test.$C$12:$C$14"),
- getRangeByName("Range_B2_D2"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$3:$D$3"), getRangeByName("Range_B3_D3")); // no change
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$2:$D$3"), getRangeByName("Range_B2_D3")); // no change
- CPPUNIT_ASSERT_EQUAL(OUString("B2"), getRangeByName("RelRange_Cm20_R0")); // no change
-
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B2"), m_pDoc->GetFormula(0, 40, nSrcTab)); // A41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C2"), m_pDoc->GetFormula(1, 40, nSrcTab)); // B41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_D2"), m_pDoc->GetFormula(2, 40, nSrcTab)); // C41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B3"), m_pDoc->GetFormula(0, 41, nSrcTab)); // A42
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C3"), m_pDoc->GetFormula(1, 41, nSrcTab)); // B42
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_D3"), m_pDoc->GetFormula(2, 41, nSrcTab)); // C42
+ CPPUNIT_ASSERT_EQUAL(u"=$B$3"_ustr, m_pDoc->GetFormula(0, 31, nSrcTab));
+ CPPUNIT_ASSERT_EQUAL(u"=$C$3"_ustr, m_pDoc->GetFormula(1, 31, nSrcTab));
+ CPPUNIT_ASSERT_EQUAL(u"=$D$3"_ustr, m_pDoc->GetFormula(2, 31, nSrcTab));
+
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$C$12"_ustr : u"$Test.$C$12"_ustr,
+ getRangeByName(u"Range_B2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$C$13"_ustr : u"$Test.$C$13"_ustr,
+ getRangeByName(u"Range_C2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$C$14"_ustr : u"$Test.$C$14"_ustr,
+ getRangeByName(u"Range_D2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$3"_ustr, getRangeByName(u"Range_B3"_ustr)); // no change
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$3"_ustr, getRangeByName(u"Range_C3"_ustr)); // no change
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$D$3"_ustr, getRangeByName(u"Range_D3"_ustr)); // no change
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$C$12:$C$14"_ustr
+ : u"$Test.$C$12:$C$14"_ustr,
+ getRangeByName(u"Range_B2_D2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$3:$D$3"_ustr, getRangeByName(u"Range_B3_D3"_ustr)); // no change
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$2:$D$3"_ustr, getRangeByName(u"Range_B2_D3"_ustr)); // no change
+ CPPUNIT_ASSERT_EQUAL(u"B2"_ustr, getRangeByName(u"RelRange_Cm20_R0"_ustr)); // no change
+
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B2"_ustr, m_pDoc->GetFormula(0, 40, nSrcTab)); // A41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C2"_ustr, m_pDoc->GetFormula(1, 40, nSrcTab)); // B41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_D2"_ustr, m_pDoc->GetFormula(2, 40, nSrcTab)); // C41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B3"_ustr, m_pDoc->GetFormula(0, 41, nSrcTab)); // A42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C3"_ustr, m_pDoc->GetFormula(1, 41, nSrcTab)); // B42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_D3"_ustr, m_pDoc->GetFormula(2, 41, nSrcTab)); // C42
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 40, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 40, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(2, 40, nSrcTab));
@@ -7845,12 +7818,12 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRow(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 41, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(2, 41, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 50, nSrcTab)); // A51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 50, nSrcTab)); // B51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(2, 50, nSrcTab)); // C51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 51, nSrcTab)); // A52
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 51, nSrcTab)); // B52
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(2, 51, nSrcTab)); // C52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 50, nSrcTab)); // A51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 50, nSrcTab)); // B51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(2, 50, nSrcTab)); // C51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 51, nSrcTab)); // A52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 51, nSrcTab)); // B52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(2, 51, nSrcTab)); // C52
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 50, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(1, 50, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(2, 50, nSrcTab));
@@ -7858,18 +7831,15 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRow(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 51, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(2, 51, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.C12:C14)")
- : OUString("=SUM(C12:C14)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.C12:C14)"_ustr : u"=SUM(C12:C14)"_ustr,
m_pDoc->GetFormula(0, 60, nSrcTab)); // A61
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.C12:C14)")
- : OUString("=SUM(C12:C14)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.C12:C14)"_ustr : u"=SUM(C12:C14)"_ustr,
m_pDoc->GetFormula(1, 60, nSrcTab)); // B61
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.C12:C14)")
- : OUString("=SUM(C12:C14)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.C12:C14)"_ustr : u"=SUM(C12:C14)"_ustr,
m_pDoc->GetFormula(2, 60, nSrcTab)); // C61
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B3:D3)"), m_pDoc->GetFormula(0, 61, nSrcTab)); // A62
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B3:D3)"), m_pDoc->GetFormula(1, 61, nSrcTab)); // B62
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B3:D3)"), m_pDoc->GetFormula(2, 61, nSrcTab)); // C62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B3:D3)"_ustr, m_pDoc->GetFormula(0, 61, nSrcTab)); // A62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B3:D3)"_ustr, m_pDoc->GetFormula(1, 61, nSrcTab)); // B62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B3:D3)"_ustr, m_pDoc->GetFormula(2, 61, nSrcTab)); // C62
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 60, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(1, 60, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(2, 60, nSrcTab));
@@ -7877,18 +7847,18 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRow(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 61, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 61, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.$C$12:$C$14)")
- : OUString("=SUM($C$12:$C$14)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.$C$12:$C$14)"_ustr
+ : u"=SUM($C$12:$C$14)"_ustr,
m_pDoc->GetFormula(0, 70, nSrcTab)); // A71
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.$C$12:$C$14)")
- : OUString("=SUM($C$12:$C$14)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.$C$12:$C$14)"_ustr
+ : u"=SUM($C$12:$C$14)"_ustr,
m_pDoc->GetFormula(1, 70, nSrcTab)); // B71
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.$C$12:$C$14)")
- : OUString("=SUM($C$12:$C$14)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.$C$12:$C$14)"_ustr
+ : u"=SUM($C$12:$C$14)"_ustr,
m_pDoc->GetFormula(2, 70, nSrcTab)); // C71
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$D$3)"), m_pDoc->GetFormula(0, 71, nSrcTab)); // A72
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$D$3)"), m_pDoc->GetFormula(1, 71, nSrcTab)); // B72
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$3:$D$3)"), m_pDoc->GetFormula(2, 71, nSrcTab)); // C72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$D$3)"_ustr, m_pDoc->GetFormula(0, 71, nSrcTab)); // A72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$D$3)"_ustr, m_pDoc->GetFormula(1, 71, nSrcTab)); // B72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$3:$D$3)"_ustr, m_pDoc->GetFormula(2, 71, nSrcTab)); // C72
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 70, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(1, 70, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(2, 70, nSrcTab));
@@ -7896,12 +7866,12 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRow(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 71, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 71, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D2)"), m_pDoc->GetFormula(0, 80, nSrcTab)); // A81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D2)"), m_pDoc->GetFormula(1, 80, nSrcTab)); // B81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D2)"), m_pDoc->GetFormula(2, 80, nSrcTab)); // C81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B3_D3)"), m_pDoc->GetFormula(0, 81, nSrcTab)); // A82
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B3_D3)"), m_pDoc->GetFormula(1, 81, nSrcTab)); // B82
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B3_D3)"), m_pDoc->GetFormula(2, 81, nSrcTab)); // C82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D2)"_ustr, m_pDoc->GetFormula(0, 80, nSrcTab)); // A81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D2)"_ustr, m_pDoc->GetFormula(1, 80, nSrcTab)); // B81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D2)"_ustr, m_pDoc->GetFormula(2, 80, nSrcTab)); // C81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B3_D3)"_ustr, m_pDoc->GetFormula(0, 81, nSrcTab)); // A82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B3_D3)"_ustr, m_pDoc->GetFormula(1, 81, nSrcTab)); // B82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B3_D3)"_ustr, m_pDoc->GetFormula(2, 81, nSrcTab)); // C82
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 80, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(1, 80, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(2, 80, nSrcTab));
@@ -7910,12 +7880,12 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRow(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 81, nSrcTab));
// no change in formula after cut
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(0, 90, nSrcTab)); // A91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(1, 90, nSrcTab)); // B91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(2, 90, nSrcTab)); // C91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(0, 91, nSrcTab)); // A92
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(1, 91, nSrcTab)); // B92
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$D$3)"), m_pDoc->GetFormula(2, 91, nSrcTab)); // C92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(0, 90, nSrcTab)); // A91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(1, 90, nSrcTab)); // B91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(2, 90, nSrcTab)); // C91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(0, 91, nSrcTab)); // A92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(1, 91, nSrcTab)); // B92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$D$3)"_ustr, m_pDoc->GetFormula(2, 91, nSrcTab)); // C92
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 90, nSrcTab)); // only 2nd row
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 90, nSrcTab)); // only 2nd row
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 90, nSrcTab)); // only 2nd row
@@ -7923,18 +7893,12 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRow(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 91, nSrcTab)); // only 2nd row
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 91, nSrcTab)); // only 2nd row
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(0, 100, nSrcTab)); // A101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(1, 100, nSrcTab)); // B101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(2, 100, nSrcTab)); // C101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(0, 101, nSrcTab)); // A102
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(1, 101, nSrcTab)); // B102
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_D3)"),
- m_pDoc->GetFormula(2, 101, nSrcTab)); // C102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(0, 100, nSrcTab)); // A101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(1, 100, nSrcTab)); // B101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(2, 100, nSrcTab)); // C101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(0, 101, nSrcTab)); // A102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(1, 101, nSrcTab)); // B102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_D3)"_ustr, m_pDoc->GetFormula(2, 101, nSrcTab)); // C102
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 100, nSrcTab)); // only 2nd row
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 100, nSrcTab)); // only 2nd row
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 100, nSrcTab)); // only 2nd row
@@ -7954,7 +7918,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutRangesRow)
pUndoPaste->Undo();
pUndoCut->Undo();
- checkReferencedCutRangesRowIntitial(nSrcTab, "After undo");
+ checkReferencedCutRangesRowIntitial(nSrcTab, u"After undo"_ustr);
pUndoCut->Redo();
pUndoPaste->Redo();
@@ -7962,7 +7926,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutRangesRow)
pUndoPaste->Undo();
pUndoCut->Undo();
- checkReferencedCutRangesRowIntitial(nSrcTab, "After undo");
+ checkReferencedCutRangesRowIntitial(nSrcTab, u"After undo"_ustr);
pUndoPaste.reset();
pUndoCut.reset();
@@ -8006,7 +7970,7 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRowUndo(const SCTAB nSrcTa
pUndoPaste->Undo();
pUndoCut->Undo();
- checkReferencedCutRangesRowIntitial(nSrcTab, "After undo");
+ checkReferencedCutRangesRowIntitial(nSrcTab, u"After undo"_ustr);
pUndoCut->Redo();
pUndoPaste->Redo();
@@ -8014,7 +7978,7 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRowUndo(const SCTAB nSrcTa
pUndoPaste->Undo();
pUndoCut->Undo();
- checkReferencedCutRangesRowIntitial(nSrcTab, "After undo");
+ checkReferencedCutRangesRowIntitial(nSrcTab, u"After undo"_ustr);
pUndoPaste.reset();
pUndoCut.reset();
@@ -8063,20 +8027,20 @@ void TestCopyPaste::checkReferencedCutRangesColIntitial(const SCTAB nSrcTab, con
CPPUNIT_ASSERT_EQUAL(1032.0, m_pDoc->GetValue(23, 2, nSrcTab)); // X3
CPPUNIT_ASSERT_EQUAL(1033.0, m_pDoc->GetValue(23, 3, nSrcTab)); // X4
CPPUNIT_ASSERT_EQUAL(1034.0, m_pDoc->GetValue(23, 4, nSrcTab)); // X5
- CPPUNIT_ASSERT_EQUAL(OUString("=A1"), m_pDoc->GetFormula(20, 0, nSrcTab)); // U1
- CPPUNIT_ASSERT_EQUAL(OUString("=A2"), m_pDoc->GetFormula(20, 1, nSrcTab)); // U2
- CPPUNIT_ASSERT_EQUAL(OUString("=A3"), m_pDoc->GetFormula(20, 2, nSrcTab)); // U3
- CPPUNIT_ASSERT_EQUAL(OUString("=A4"), m_pDoc->GetFormula(20, 3, nSrcTab)); // U4
- CPPUNIT_ASSERT_EQUAL(OUString("=A5"), m_pDoc->GetFormula(20, 4, nSrcTab)); // U5
- CPPUNIT_ASSERT_EQUAL(OUString("=B1"), m_pDoc->GetFormula(21, 0, nSrcTab)); // V1
- CPPUNIT_ASSERT_EQUAL(OUString("=B5"), m_pDoc->GetFormula(21, 4, nSrcTab)); // V5
- CPPUNIT_ASSERT_EQUAL(OUString("=C1"), m_pDoc->GetFormula(22, 0, nSrcTab)); // W1
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(22, 4, nSrcTab)); // W5
- CPPUNIT_ASSERT_EQUAL(OUString("=D1"), m_pDoc->GetFormula(23, 0, nSrcTab)); // X1
- CPPUNIT_ASSERT_EQUAL(OUString("=D2"), m_pDoc->GetFormula(23, 1, nSrcTab)); // X2
- CPPUNIT_ASSERT_EQUAL(OUString("=D3"), m_pDoc->GetFormula(23, 2, nSrcTab)); // X3
- CPPUNIT_ASSERT_EQUAL(OUString("=D4"), m_pDoc->GetFormula(23, 3, nSrcTab)); // X4
- CPPUNIT_ASSERT_EQUAL(OUString("=D5"), m_pDoc->GetFormula(23, 4, nSrcTab)); // X5
+ CPPUNIT_ASSERT_EQUAL(u"=A1"_ustr, m_pDoc->GetFormula(20, 0, nSrcTab)); // U1
+ CPPUNIT_ASSERT_EQUAL(u"=A2"_ustr, m_pDoc->GetFormula(20, 1, nSrcTab)); // U2
+ CPPUNIT_ASSERT_EQUAL(u"=A3"_ustr, m_pDoc->GetFormula(20, 2, nSrcTab)); // U3
+ CPPUNIT_ASSERT_EQUAL(u"=A4"_ustr, m_pDoc->GetFormula(20, 3, nSrcTab)); // U4
+ CPPUNIT_ASSERT_EQUAL(u"=A5"_ustr, m_pDoc->GetFormula(20, 4, nSrcTab)); // U5
+ CPPUNIT_ASSERT_EQUAL(u"=B1"_ustr, m_pDoc->GetFormula(21, 0, nSrcTab)); // V1
+ CPPUNIT_ASSERT_EQUAL(u"=B5"_ustr, m_pDoc->GetFormula(21, 4, nSrcTab)); // V5
+ CPPUNIT_ASSERT_EQUAL(u"=C1"_ustr, m_pDoc->GetFormula(22, 0, nSrcTab)); // W1
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(22, 4, nSrcTab)); // W5
+ CPPUNIT_ASSERT_EQUAL(u"=D1"_ustr, m_pDoc->GetFormula(23, 0, nSrcTab)); // X1
+ CPPUNIT_ASSERT_EQUAL(u"=D2"_ustr, m_pDoc->GetFormula(23, 1, nSrcTab)); // X2
+ CPPUNIT_ASSERT_EQUAL(u"=D3"_ustr, m_pDoc->GetFormula(23, 2, nSrcTab)); // X3
+ CPPUNIT_ASSERT_EQUAL(u"=D4"_ustr, m_pDoc->GetFormula(23, 3, nSrcTab)); // X4
+ CPPUNIT_ASSERT_EQUAL(u"=D5"_ustr, m_pDoc->GetFormula(23, 4, nSrcTab)); // X5
for (int i = 10; i < 20; ++i)
for (int j = 0; j < 10; ++j)
@@ -8087,12 +8051,12 @@ void TestCopyPaste::checkReferencedCutRangesColIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 20, nSrcTab, 1, 22, nSrcTab),
rDesc.toUtf8() + ": Relative references");
- CPPUNIT_ASSERT_EQUAL(OUString("=B2"), m_pDoc->GetFormula(0, 20, nSrcTab)); // A21
- CPPUNIT_ASSERT_EQUAL(OUString("=B3"), m_pDoc->GetFormula(0, 21, nSrcTab)); // A22
- CPPUNIT_ASSERT_EQUAL(OUString("=B4"), m_pDoc->GetFormula(0, 22, nSrcTab)); // A23
- CPPUNIT_ASSERT_EQUAL(OUString("=C2"), m_pDoc->GetFormula(1, 20, nSrcTab)); // B21
- CPPUNIT_ASSERT_EQUAL(OUString("=C3"), m_pDoc->GetFormula(1, 21, nSrcTab)); // B22
- CPPUNIT_ASSERT_EQUAL(OUString("=C4"), m_pDoc->GetFormula(1, 22, nSrcTab)); // B23
+ CPPUNIT_ASSERT_EQUAL(u"=B2"_ustr, m_pDoc->GetFormula(0, 20, nSrcTab)); // A21
+ CPPUNIT_ASSERT_EQUAL(u"=B3"_ustr, m_pDoc->GetFormula(0, 21, nSrcTab)); // A22
+ CPPUNIT_ASSERT_EQUAL(u"=B4"_ustr, m_pDoc->GetFormula(0, 22, nSrcTab)); // A23
+ CPPUNIT_ASSERT_EQUAL(u"=C2"_ustr, m_pDoc->GetFormula(1, 20, nSrcTab)); // B21
+ CPPUNIT_ASSERT_EQUAL(u"=C3"_ustr, m_pDoc->GetFormula(1, 21, nSrcTab)); // B22
+ CPPUNIT_ASSERT_EQUAL(u"=C4"_ustr, m_pDoc->GetFormula(1, 22, nSrcTab)); // B23
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 20, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(0, 21, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(0, 22, nSrcTab));
@@ -8102,12 +8066,12 @@ void TestCopyPaste::checkReferencedCutRangesColIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 30, nSrcTab, 1, 32, nSrcTab),
rDesc.toUtf8() + ": Absolute references");
- CPPUNIT_ASSERT_EQUAL(OUString("=$B$2"), m_pDoc->GetFormula(0, 30, nSrcTab)); // A31
- CPPUNIT_ASSERT_EQUAL(OUString("=$B$3"), m_pDoc->GetFormula(0, 31, nSrcTab)); // A32
- CPPUNIT_ASSERT_EQUAL(OUString("=$B$4"), m_pDoc->GetFormula(0, 32, nSrcTab)); // A33
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$2"), m_pDoc->GetFormula(1, 30, nSrcTab)); // B31
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$3"), m_pDoc->GetFormula(1, 31, nSrcTab)); // B32
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$4"), m_pDoc->GetFormula(1, 32, nSrcTab)); // B33
+ CPPUNIT_ASSERT_EQUAL(u"=$B$2"_ustr, m_pDoc->GetFormula(0, 30, nSrcTab)); // A31
+ CPPUNIT_ASSERT_EQUAL(u"=$B$3"_ustr, m_pDoc->GetFormula(0, 31, nSrcTab)); // A32
+ CPPUNIT_ASSERT_EQUAL(u"=$B$4"_ustr, m_pDoc->GetFormula(0, 32, nSrcTab)); // A33
+ CPPUNIT_ASSERT_EQUAL(u"=$C$2"_ustr, m_pDoc->GetFormula(1, 30, nSrcTab)); // B31
+ CPPUNIT_ASSERT_EQUAL(u"=$C$3"_ustr, m_pDoc->GetFormula(1, 31, nSrcTab)); // B32
+ CPPUNIT_ASSERT_EQUAL(u"=$C$4"_ustr, m_pDoc->GetFormula(1, 32, nSrcTab)); // B33
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 30, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(0, 31, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(0, 32, nSrcTab));
@@ -8115,25 +8079,25 @@ void TestCopyPaste::checkReferencedCutRangesColIntitial(const SCTAB nSrcTab, con
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 31, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(1, 32, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$2"), getRangeByName("Range_B2"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$3"), getRangeByName("Range_B3"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$4"), getRangeByName("Range_B4"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$2"), getRangeByName("Range_C2"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$3"), getRangeByName("Range_C3"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$4"), getRangeByName("Range_C4"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$2:$B$4"), getRangeByName("Range_B2_B4"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$2:$C$4"), getRangeByName("Range_C2_C4"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$2:$C$4"), getRangeByName("Range_B2_C4"));
- CPPUNIT_ASSERT_EQUAL(OUString("B2"), getRangeByName("RelRange_Cm20_R0"));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$2"_ustr, getRangeByName(u"Range_B2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$3"_ustr, getRangeByName(u"Range_B3"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$4"_ustr, getRangeByName(u"Range_B4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$2"_ustr, getRangeByName(u"Range_C2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$3"_ustr, getRangeByName(u"Range_C3"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$4"_ustr, getRangeByName(u"Range_C4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$2:$B$4"_ustr, getRangeByName(u"Range_B2_B4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$2:$C$4"_ustr, getRangeByName(u"Range_C2_C4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$2:$C$4"_ustr, getRangeByName(u"Range_B2_C4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"B2"_ustr, getRangeByName(u"RelRange_Cm20_R0"_ustr));
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 40, nSrcTab, 1, 42, nSrcTab),
rDesc.toUtf8() + ": Absolute ranges");
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B2"), m_pDoc->GetFormula(0, 40, nSrcTab)); // A41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B3"), m_pDoc->GetFormula(0, 41, nSrcTab)); // A42
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B4"), m_pDoc->GetFormula(0, 42, nSrcTab)); // A43
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C2"), m_pDoc->GetFormula(1, 40, nSrcTab)); // B41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C3"), m_pDoc->GetFormula(1, 41, nSrcTab)); // B42
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C4"), m_pDoc->GetFormula(1, 42, nSrcTab)); // B43
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B2"_ustr, m_pDoc->GetFormula(0, 40, nSrcTab)); // A41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B3"_ustr, m_pDoc->GetFormula(0, 41, nSrcTab)); // A42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B4"_ustr, m_pDoc->GetFormula(0, 42, nSrcTab)); // A43
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C2"_ustr, m_pDoc->GetFormula(1, 40, nSrcTab)); // B41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C3"_ustr, m_pDoc->GetFormula(1, 41, nSrcTab)); // B42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C4"_ustr, m_pDoc->GetFormula(1, 42, nSrcTab)); // B43
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 40, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(0, 41, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(0, 42, nSrcTab));
@@ -8143,12 +8107,12 @@ void TestCopyPaste::checkReferencedCutRangesColIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 50, nSrcTab, 1, 52, nSrcTab),
rDesc.toUtf8() + ": Relative ranges");
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 50, nSrcTab)); // A51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 51, nSrcTab)); // A52
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 52, nSrcTab)); // A53
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 50, nSrcTab)); // B51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 51, nSrcTab)); // B52
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 52, nSrcTab)); // B53
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 50, nSrcTab)); // A51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 51, nSrcTab)); // A52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 52, nSrcTab)); // A53
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 50, nSrcTab)); // B51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 51, nSrcTab)); // B52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 52, nSrcTab)); // B53
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 50, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(0, 51, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(0, 52, nSrcTab));
@@ -8158,12 +8122,12 @@ void TestCopyPaste::checkReferencedCutRangesColIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 60, nSrcTab, 1, 62, nSrcTab),
rDesc.toUtf8() + ": Relative sum");
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B2:B4)"), m_pDoc->GetFormula(0, 60, nSrcTab)); // A61
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B2:B4)"), m_pDoc->GetFormula(0, 61, nSrcTab)); // A62
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B2:B4)"), m_pDoc->GetFormula(0, 62, nSrcTab)); // A63
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C2:C4)"), m_pDoc->GetFormula(1, 60, nSrcTab)); // B61
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C2:C4)"), m_pDoc->GetFormula(1, 61, nSrcTab)); // B62
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C2:C4)"), m_pDoc->GetFormula(1, 62, nSrcTab)); // B63
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B2:B4)"_ustr, m_pDoc->GetFormula(0, 60, nSrcTab)); // A61
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B2:B4)"_ustr, m_pDoc->GetFormula(0, 61, nSrcTab)); // A62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B2:B4)"_ustr, m_pDoc->GetFormula(0, 62, nSrcTab)); // A63
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C2:C4)"_ustr, m_pDoc->GetFormula(1, 60, nSrcTab)); // B61
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C2:C4)"_ustr, m_pDoc->GetFormula(1, 61, nSrcTab)); // B62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C2:C4)"_ustr, m_pDoc->GetFormula(1, 62, nSrcTab)); // B63
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 60, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 61, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 62, nSrcTab));
@@ -8173,12 +8137,12 @@ void TestCopyPaste::checkReferencedCutRangesColIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 70, nSrcTab, 1, 72, nSrcTab),
rDesc.toUtf8() + ": Absolute sum");
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$B$4)"), m_pDoc->GetFormula(0, 70, nSrcTab)); // A71
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$B$4)"), m_pDoc->GetFormula(0, 71, nSrcTab)); // A72
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$B$4)"), m_pDoc->GetFormula(0, 72, nSrcTab)); // A73
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$2:$C$4)"), m_pDoc->GetFormula(1, 70, nSrcTab)); // B71
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$2:$C$4)"), m_pDoc->GetFormula(1, 71, nSrcTab)); // B72
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$2:$C$4)"), m_pDoc->GetFormula(1, 72, nSrcTab)); // B73
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$B$4)"_ustr, m_pDoc->GetFormula(0, 70, nSrcTab)); // A71
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$B$4)"_ustr, m_pDoc->GetFormula(0, 71, nSrcTab)); // A72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$B$4)"_ustr, m_pDoc->GetFormula(0, 72, nSrcTab)); // A73
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 70, nSrcTab)); // B71
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 71, nSrcTab)); // B72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 72, nSrcTab)); // B73
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 70, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 71, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 72, nSrcTab));
@@ -8188,12 +8152,12 @@ void TestCopyPaste::checkReferencedCutRangesColIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 80, nSrcTab, 1, 82, nSrcTab),
rDesc.toUtf8() + ": Relative range sum");
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_B4)"), m_pDoc->GetFormula(0, 80, nSrcTab)); // A81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_B4)"), m_pDoc->GetFormula(0, 81, nSrcTab)); // A82
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_B4)"), m_pDoc->GetFormula(0, 82, nSrcTab)); // A83
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C2_C4)"), m_pDoc->GetFormula(1, 80, nSrcTab)); // B81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C2_C4)"), m_pDoc->GetFormula(1, 81, nSrcTab)); // B82
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C2_C4)"), m_pDoc->GetFormula(1, 82, nSrcTab)); // B83
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_B4)"_ustr, m_pDoc->GetFormula(0, 80, nSrcTab)); // A81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_B4)"_ustr, m_pDoc->GetFormula(0, 81, nSrcTab)); // A82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_B4)"_ustr, m_pDoc->GetFormula(0, 82, nSrcTab)); // A83
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C2_C4)"_ustr, m_pDoc->GetFormula(1, 80, nSrcTab)); // B81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C2_C4)"_ustr, m_pDoc->GetFormula(1, 81, nSrcTab)); // B82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C2_C4)"_ustr, m_pDoc->GetFormula(1, 82, nSrcTab)); // B83
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 80, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 81, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 82, nSrcTab));
@@ -8203,12 +8167,12 @@ void TestCopyPaste::checkReferencedCutRangesColIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 90, nSrcTab, 1, 92, nSrcTab),
rDesc.toUtf8() + ": Absolute sum");
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(0, 90, nSrcTab)); // A91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(0, 91, nSrcTab)); // A92
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(0, 92, nSrcTab)); // A93
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(1, 90, nSrcTab)); // B91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(1, 91, nSrcTab)); // B92
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(1, 92, nSrcTab)); // B93
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(0, 90, nSrcTab)); // A91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(0, 91, nSrcTab)); // A92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(0, 92, nSrcTab)); // A93
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 90, nSrcTab)); // B91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 91, nSrcTab)); // B92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 92, nSrcTab)); // B93
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(0, 90, nSrcTab));
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(0, 91, nSrcTab));
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(0, 92, nSrcTab));
@@ -8218,18 +8182,12 @@ void TestCopyPaste::checkReferencedCutRangesColIntitial(const SCTAB nSrcTab, con
printValuesAndFormulasInRange(m_pDoc, ScRange(0, 100, nSrcTab, 1, 102, nSrcTab),
rDesc.toUtf8() + ": Relative range sum");
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(0, 100, nSrcTab)); // A101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(0, 101, nSrcTab)); // A102
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(0, 102, nSrcTab)); // A103
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(1, 100, nSrcTab)); // B101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(1, 101, nSrcTab)); // B102
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(1, 102, nSrcTab)); // B103
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(0, 100, nSrcTab)); // A101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(0, 101, nSrcTab)); // A102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(0, 102, nSrcTab)); // A103
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(1, 100, nSrcTab)); // B101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(1, 101, nSrcTab)); // B102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(1, 102, nSrcTab)); // B103
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(0, 100, nSrcTab));
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(0, 101, nSrcTab));
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(0, 102, nSrcTab));
@@ -8238,7 +8196,7 @@ void TestCopyPaste::checkReferencedCutRangesColIntitial(const SCTAB nSrcTab, con
CPPUNIT_ASSERT_EQUAL(69.0, m_pDoc->GetValue(1, 102, nSrcTab));
// References to the dest range
- OUString aFBase("=");
+ OUString aFBase(u"="_ustr);
if (nSrcTab != nDestTab)
aFBase += "Dest.";
@@ -8263,7 +8221,7 @@ void TestCopyPaste::executeReferencedCutRangesCol(const bool bTransposed, const
for (int i = 0; i < nSrcTab; ++i)
m_pDoc->InsertTab(i, "Empty Tab " + OUString::number(i));
- m_pDoc->InsertTab(nSrcTab, "Test");
+ m_pDoc->InsertTab(nSrcTab, u"Test"_ustr);
m_pDoc->SetValue(1, 1, nSrcTab, 01.0); // B2 \.
m_pDoc->SetValue(1, 2, nSrcTab, 11.0); // B3 | cut
@@ -8289,104 +8247,108 @@ void TestCopyPaste::executeReferencedCutRangesCol(const bool bTransposed, const
m_pDoc->SetValue(3, 3, nSrcTab, 1033.0); // D4
m_pDoc->SetValue(3, 4, nSrcTab, 1034.0); // D5
- m_pDoc->SetString(20, 0, nSrcTab, "=A1"); // U1
- m_pDoc->SetString(20, 1, nSrcTab, "=A2"); // U2
- m_pDoc->SetString(20, 2, nSrcTab, "=A3"); // U3
- m_pDoc->SetString(20, 3, nSrcTab, "=A4"); // U4
- m_pDoc->SetString(20, 4, nSrcTab, "=A5"); // U5
- m_pDoc->SetString(21, 0, nSrcTab, "=B1"); // V1
- m_pDoc->SetString(21, 4, nSrcTab, "=B5"); // V5
- m_pDoc->SetString(22, 0, nSrcTab, "=C1"); // W1
- m_pDoc->SetString(22, 4, nSrcTab, "=C5"); // W5
- m_pDoc->SetString(23, 0, nSrcTab, "=D1"); // X1
- m_pDoc->SetString(23, 1, nSrcTab, "=D2"); // X2
- m_pDoc->SetString(23, 2, nSrcTab, "=D3"); // X3
- m_pDoc->SetString(23, 3, nSrcTab, "=D4"); // X4
- m_pDoc->SetString(23, 4, nSrcTab, "=D5"); // X5
+ m_pDoc->SetString(20, 0, nSrcTab, u"=A1"_ustr); // U1
+ m_pDoc->SetString(20, 1, nSrcTab, u"=A2"_ustr); // U2
+ m_pDoc->SetString(20, 2, nSrcTab, u"=A3"_ustr); // U3
+ m_pDoc->SetString(20, 3, nSrcTab, u"=A4"_ustr); // U4
+ m_pDoc->SetString(20, 4, nSrcTab, u"=A5"_ustr); // U5
+ m_pDoc->SetString(21, 0, nSrcTab, u"=B1"_ustr); // V1
+ m_pDoc->SetString(21, 4, nSrcTab, u"=B5"_ustr); // V5
+ m_pDoc->SetString(22, 0, nSrcTab, u"=C1"_ustr); // W1
+ m_pDoc->SetString(22, 4, nSrcTab, u"=C5"_ustr); // W5
+ m_pDoc->SetString(23, 0, nSrcTab, u"=D1"_ustr); // X1
+ m_pDoc->SetString(23, 1, nSrcTab, u"=D2"_ustr); // X2
+ m_pDoc->SetString(23, 2, nSrcTab, u"=D3"_ustr); // X3
+ m_pDoc->SetString(23, 3, nSrcTab, u"=D4"_ustr); // X4
+ m_pDoc->SetString(23, 4, nSrcTab, u"=D5"_ustr); // X5
// Cell position is used for ranges relative to current position
ScAddress cellA1(0, 0, nSrcTab);
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_B2", cellA1, "$Test.$B$2"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_B3", cellA1, "$Test.$B$3"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_B4", cellA1, "$Test.$B$4"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_C2", cellA1, "$Test.$C$2"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_C3", cellA1, "$Test.$C$3"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_C4", cellA1, "$Test.$C$4"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_B2_B4", cellA1, "$Test.$B$2:$B$4"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_C2_C4", cellA1, "$Test.$C$2:$C$4"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("Range_B2_C4", cellA1, "$Test.$B$2:$C$4"));
- CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName("RelRange_Cm20_R0", ScAddress(1, 21, nSrcTab), "B2"));
-
- m_pDoc->SetString(0, 20, nSrcTab, "=B2"); // A21
- m_pDoc->SetString(0, 21, nSrcTab, "=B3"); // A22
- m_pDoc->SetString(0, 22, nSrcTab, "=B4"); // A23
- m_pDoc->SetString(1, 20, nSrcTab, "=C2"); // B21
- m_pDoc->SetString(1, 21, nSrcTab, "=C3"); // B22
- m_pDoc->SetString(1, 22, nSrcTab, "=C4"); // B23
-
- m_pDoc->SetString(0, 30, nSrcTab, "=$B$2"); // A31
- m_pDoc->SetString(0, 31, nSrcTab, "=$B$3"); // A32
- m_pDoc->SetString(0, 32, nSrcTab, "=$B$4"); // A33
- m_pDoc->SetString(1, 30, nSrcTab, "=$C$2"); // B31
- m_pDoc->SetString(1, 31, nSrcTab, "=$C$3"); // B32
- m_pDoc->SetString(1, 32, nSrcTab, "=$C$4"); // B33
-
- m_pDoc->SetString(0, 40, nSrcTab, "=Range_B2"); // A41
- m_pDoc->SetString(0, 41, nSrcTab, "=Range_B3"); // A42
- m_pDoc->SetString(0, 42, nSrcTab, "=Range_B4"); // A43
- m_pDoc->SetString(1, 40, nSrcTab, "=Range_C2"); // B41
- m_pDoc->SetString(1, 41, nSrcTab, "=Range_C3"); // B42
- m_pDoc->SetString(1, 42, nSrcTab, "=Range_C4"); // B43
-
- m_pDoc->SetString(0, 50, nSrcTab, "=RelRange_Cm20_R0"); // A51
- m_pDoc->SetString(0, 51, nSrcTab, "=RelRange_Cm20_R0"); // A52
- m_pDoc->SetString(0, 52, nSrcTab, "=RelRange_Cm20_R0"); // A53
- m_pDoc->SetString(1, 50, nSrcTab, "=RelRange_Cm20_R0"); // B51
- m_pDoc->SetString(1, 51, nSrcTab, "=RelRange_Cm20_R0"); // B52
- m_pDoc->SetString(1, 52, nSrcTab, "=RelRange_Cm20_R0"); // B53
-
- m_pDoc->SetString(0, 60, nSrcTab, "=SUM(B2:B4"); // A61
- m_pDoc->SetString(0, 61, nSrcTab, "=SUM(B2:B4"); // A62
- m_pDoc->SetString(0, 62, nSrcTab, "=SUM(B2:B4"); // A63
- m_pDoc->SetString(1, 60, nSrcTab, "=SUM(C2:C4"); // B61
- m_pDoc->SetString(1, 61, nSrcTab, "=SUM(C2:C4"); // B62
- m_pDoc->SetString(1, 62, nSrcTab, "=SUM(C2:C4"); // B63
-
- m_pDoc->SetString(0, 70, nSrcTab, "=SUM($B$2:$B$4"); // A71
- m_pDoc->SetString(0, 71, nSrcTab, "=SUM($B$2:$B$4"); // A72
- m_pDoc->SetString(0, 72, nSrcTab, "=SUM($B$2:$B$4"); // A73
- m_pDoc->SetString(1, 70, nSrcTab, "=SUM($C$2:$C$4"); // B71
- m_pDoc->SetString(1, 71, nSrcTab, "=SUM($C$2:$C$4"); // B72
- m_pDoc->SetString(1, 72, nSrcTab, "=SUM($C$2:$C$4"); // B73
-
- m_pDoc->SetString(0, 80, nSrcTab, "=SUM(Range_B2_B4)"); // A81
- m_pDoc->SetString(0, 81, nSrcTab, "=SUM(Range_B2_B4)"); // A82
- m_pDoc->SetString(0, 82, nSrcTab, "=SUM(Range_B2_B4)"); // A83
- m_pDoc->SetString(1, 80, nSrcTab, "=SUM(Range_C2_C4)"); // B81
- m_pDoc->SetString(1, 81, nSrcTab, "=SUM(Range_C2_C4)"); // B82
- m_pDoc->SetString(1, 82, nSrcTab, "=SUM(Range_C2_C4)"); // B83
-
- m_pDoc->SetString(0, 90, nSrcTab, "=SUM($B$2:$C$4"); // A91
- m_pDoc->SetString(0, 91, nSrcTab, "=SUM($B$2:$C$4"); // A92
- m_pDoc->SetString(0, 92, nSrcTab, "=SUM($B$2:$C$4"); // A93
- m_pDoc->SetString(1, 90, nSrcTab, "=SUM($B$2:$C$4"); // B91
- m_pDoc->SetString(1, 91, nSrcTab, "=SUM($B$2:$C$4"); // B92
- m_pDoc->SetString(1, 92, nSrcTab, "=SUM($B$2:$C$4"); // B93
-
- m_pDoc->SetString(0, 100, nSrcTab, "=SUM(Range_B2_C4"); // A101
- m_pDoc->SetString(0, 101, nSrcTab, "=SUM(Range_B2_C4"); // A102
- m_pDoc->SetString(0, 102, nSrcTab, "=SUM(Range_B2_C4"); // A103
- m_pDoc->SetString(1, 100, nSrcTab, "=SUM(Range_B2_C4"); // B101
- m_pDoc->SetString(1, 101, nSrcTab, "=SUM(Range_B2_C4"); // B102
- m_pDoc->SetString(1, 102, nSrcTab, "=SUM(Range_B2_C4"); // B103
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_B2"_ustr, cellA1, u"$Test.$B$2"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_B3"_ustr, cellA1, u"$Test.$B$3"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_B4"_ustr, cellA1, u"$Test.$B$4"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_C2"_ustr, cellA1, u"$Test.$C$2"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_C3"_ustr, cellA1, u"$Test.$C$3"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"Range_C4"_ustr, cellA1, u"$Test.$C$4"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_B2_B4"_ustr, cellA1, u"$Test.$B$2:$B$4"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_C2_C4"_ustr, cellA1, u"$Test.$C$2:$C$4"_ustr));
+ CPPUNIT_ASSERT(
+ m_pDoc->InsertNewRangeName(u"Range_B2_C4"_ustr, cellA1, u"$Test.$B$2:$C$4"_ustr));
+ CPPUNIT_ASSERT(m_pDoc->InsertNewRangeName(u"RelRange_Cm20_R0"_ustr, ScAddress(1, 21, nSrcTab),
+ u"B2"_ustr));
+
+ m_pDoc->SetString(0, 20, nSrcTab, u"=B2"_ustr); // A21
+ m_pDoc->SetString(0, 21, nSrcTab, u"=B3"_ustr); // A22
+ m_pDoc->SetString(0, 22, nSrcTab, u"=B4"_ustr); // A23
+ m_pDoc->SetString(1, 20, nSrcTab, u"=C2"_ustr); // B21
+ m_pDoc->SetString(1, 21, nSrcTab, u"=C3"_ustr); // B22
+ m_pDoc->SetString(1, 22, nSrcTab, u"=C4"_ustr); // B23
+
+ m_pDoc->SetString(0, 30, nSrcTab, u"=$B$2"_ustr); // A31
+ m_pDoc->SetString(0, 31, nSrcTab, u"=$B$3"_ustr); // A32
+ m_pDoc->SetString(0, 32, nSrcTab, u"=$B$4"_ustr); // A33
+ m_pDoc->SetString(1, 30, nSrcTab, u"=$C$2"_ustr); // B31
+ m_pDoc->SetString(1, 31, nSrcTab, u"=$C$3"_ustr); // B32
+ m_pDoc->SetString(1, 32, nSrcTab, u"=$C$4"_ustr); // B33
+
+ m_pDoc->SetString(0, 40, nSrcTab, u"=Range_B2"_ustr); // A41
+ m_pDoc->SetString(0, 41, nSrcTab, u"=Range_B3"_ustr); // A42
+ m_pDoc->SetString(0, 42, nSrcTab, u"=Range_B4"_ustr); // A43
+ m_pDoc->SetString(1, 40, nSrcTab, u"=Range_C2"_ustr); // B41
+ m_pDoc->SetString(1, 41, nSrcTab, u"=Range_C3"_ustr); // B42
+ m_pDoc->SetString(1, 42, nSrcTab, u"=Range_C4"_ustr); // B43
+
+ m_pDoc->SetString(0, 50, nSrcTab, u"=RelRange_Cm20_R0"_ustr); // A51
+ m_pDoc->SetString(0, 51, nSrcTab, u"=RelRange_Cm20_R0"_ustr); // A52
+ m_pDoc->SetString(0, 52, nSrcTab, u"=RelRange_Cm20_R0"_ustr); // A53
+ m_pDoc->SetString(1, 50, nSrcTab, u"=RelRange_Cm20_R0"_ustr); // B51
+ m_pDoc->SetString(1, 51, nSrcTab, u"=RelRange_Cm20_R0"_ustr); // B52
+ m_pDoc->SetString(1, 52, nSrcTab, u"=RelRange_Cm20_R0"_ustr); // B53
+
+ m_pDoc->SetString(0, 60, nSrcTab, u"=SUM(B2:B4"_ustr); // A61
+ m_pDoc->SetString(0, 61, nSrcTab, u"=SUM(B2:B4"_ustr); // A62
+ m_pDoc->SetString(0, 62, nSrcTab, u"=SUM(B2:B4"_ustr); // A63
+ m_pDoc->SetString(1, 60, nSrcTab, u"=SUM(C2:C4"_ustr); // B61
+ m_pDoc->SetString(1, 61, nSrcTab, u"=SUM(C2:C4"_ustr); // B62
+ m_pDoc->SetString(1, 62, nSrcTab, u"=SUM(C2:C4"_ustr); // B63
+
+ m_pDoc->SetString(0, 70, nSrcTab, u"=SUM($B$2:$B$4"_ustr); // A71
+ m_pDoc->SetString(0, 71, nSrcTab, u"=SUM($B$2:$B$4"_ustr); // A72
+ m_pDoc->SetString(0, 72, nSrcTab, u"=SUM($B$2:$B$4"_ustr); // A73
+ m_pDoc->SetString(1, 70, nSrcTab, u"=SUM($C$2:$C$4"_ustr); // B71
+ m_pDoc->SetString(1, 71, nSrcTab, u"=SUM($C$2:$C$4"_ustr); // B72
+ m_pDoc->SetString(1, 72, nSrcTab, u"=SUM($C$2:$C$4"_ustr); // B73
+
+ m_pDoc->SetString(0, 80, nSrcTab, u"=SUM(Range_B2_B4)"_ustr); // A81
+ m_pDoc->SetString(0, 81, nSrcTab, u"=SUM(Range_B2_B4)"_ustr); // A82
+ m_pDoc->SetString(0, 82, nSrcTab, u"=SUM(Range_B2_B4)"_ustr); // A83
+ m_pDoc->SetString(1, 80, nSrcTab, u"=SUM(Range_C2_C4)"_ustr); // B81
+ m_pDoc->SetString(1, 81, nSrcTab, u"=SUM(Range_C2_C4)"_ustr); // B82
+ m_pDoc->SetString(1, 82, nSrcTab, u"=SUM(Range_C2_C4)"_ustr); // B83
+
+ m_pDoc->SetString(0, 90, nSrcTab, u"=SUM($B$2:$C$4"_ustr); // A91
+ m_pDoc->SetString(0, 91, nSrcTab, u"=SUM($B$2:$C$4"_ustr); // A92
+ m_pDoc->SetString(0, 92, nSrcTab, u"=SUM($B$2:$C$4"_ustr); // A93
+ m_pDoc->SetString(1, 90, nSrcTab, u"=SUM($B$2:$C$4"_ustr); // B91
+ m_pDoc->SetString(1, 91, nSrcTab, u"=SUM($B$2:$C$4"_ustr); // B92
+ m_pDoc->SetString(1, 92, nSrcTab, u"=SUM($B$2:$C$4"_ustr); // B93
+
+ m_pDoc->SetString(0, 100, nSrcTab, u"=SUM(Range_B2_C4"_ustr); // A101
+ m_pDoc->SetString(0, 101, nSrcTab, u"=SUM(Range_B2_C4"_ustr); // A102
+ m_pDoc->SetString(0, 102, nSrcTab, u"=SUM(Range_B2_C4"_ustr); // A103
+ m_pDoc->SetString(1, 100, nSrcTab, u"=SUM(Range_B2_C4"_ustr); // B101
+ m_pDoc->SetString(1, 101, nSrcTab, u"=SUM(Range_B2_C4"_ustr); // B102
+ m_pDoc->SetString(1, 102, nSrcTab, u"=SUM(Range_B2_C4"_ustr); // B103
for (int i = nSrcTab + 1; i < nDestTab; ++i)
m_pDoc->InsertTab(i, "Empty Tab " + OUString::number(i));
if (nSrcTab < nDestTab)
- m_pDoc->InsertTab(nDestTab, "Dest");
+ m_pDoc->InsertTab(nDestTab, u"Dest"_ustr);
else if (nSrcTab > nDestTab)
- m_pDoc->RenameTab(nDestTab, "Dest");
+ m_pDoc->RenameTab(nDestTab, u"Dest"_ustr);
int nTabCount = m_pDoc->GetTableCount();
for (int i = nTabCount; i < nTabCount + 2; ++i)
@@ -8394,7 +8356,7 @@ void TestCopyPaste::executeReferencedCutRangesCol(const bool bTransposed, const
nTabCount = m_pDoc->GetTableCount();
// References to the dest range
- OUString aFBase("=");
+ OUString aFBase(u"="_ustr);
if (nSrcTab != nDestTab)
aFBase += "Dest.";
@@ -8409,7 +8371,7 @@ void TestCopyPaste::executeReferencedCutRangesCol(const bool bTransposed, const
m_pDoc->SetString(2, 114, nSrcTab, OUString(aFBase + "E14"));
// Check precondition
- checkReferencedCutRangesColIntitial(nSrcTab, nDestTab, "Initial");
+ checkReferencedCutRangesColIntitial(nSrcTab, nDestTab, u"Initial"_ustr);
// Cut values B2:B4 to the clip document.
ScDocument aClipDoc(SCDOCMODE_CLIP);
@@ -8478,7 +8440,7 @@ void TestCopyPaste::checkReferencedCutRangesCol(const SCTAB nSrcTab, const SCTAB
{
// Cut B2:B4 and pasted to C12:C14
- OUString aFBase("=");
+ OUString aFBase(u"="_ustr);
if (nSrcTab != nDestTab)
aFBase += "Dest.";
@@ -8519,29 +8481,29 @@ void TestCopyPaste::checkReferencedCutRangesCol(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(1032.0, m_pDoc->GetValue(23, 2, nSrcTab)); // X3
CPPUNIT_ASSERT_EQUAL(1033.0, m_pDoc->GetValue(23, 3, nSrcTab)); // X4
CPPUNIT_ASSERT_EQUAL(1034.0, m_pDoc->GetValue(23, 4, nSrcTab)); // X5
- CPPUNIT_ASSERT_EQUAL(OUString("=A1"), m_pDoc->GetFormula(20, 0, nSrcTab)); // U1
- CPPUNIT_ASSERT_EQUAL(OUString("=A2"), m_pDoc->GetFormula(20, 1, nSrcTab)); // U2
- CPPUNIT_ASSERT_EQUAL(OUString("=A3"), m_pDoc->GetFormula(20, 2, nSrcTab)); // U3
- CPPUNIT_ASSERT_EQUAL(OUString("=A4"), m_pDoc->GetFormula(20, 3, nSrcTab)); // U4
- CPPUNIT_ASSERT_EQUAL(OUString("=A5"), m_pDoc->GetFormula(20, 4, nSrcTab)); // U5
- CPPUNIT_ASSERT_EQUAL(OUString("=B1"), m_pDoc->GetFormula(21, 0, nSrcTab)); // V1
- CPPUNIT_ASSERT_EQUAL(OUString("=B5"), m_pDoc->GetFormula(21, 4, nSrcTab)); // V5
- CPPUNIT_ASSERT_EQUAL(OUString("=C1"), m_pDoc->GetFormula(22, 0, nSrcTab)); // W1
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(22, 4, nSrcTab)); // W5
- CPPUNIT_ASSERT_EQUAL(OUString("=D1"), m_pDoc->GetFormula(23, 0, nSrcTab)); // X1
- CPPUNIT_ASSERT_EQUAL(OUString("=D2"), m_pDoc->GetFormula(23, 1, nSrcTab)); // X2
- CPPUNIT_ASSERT_EQUAL(OUString("=D3"), m_pDoc->GetFormula(23, 2, nSrcTab)); // X3
- CPPUNIT_ASSERT_EQUAL(OUString("=D4"), m_pDoc->GetFormula(23, 3, nSrcTab)); // X4
- CPPUNIT_ASSERT_EQUAL(OUString("=D5"), m_pDoc->GetFormula(23, 4, nSrcTab)); // X5
+ CPPUNIT_ASSERT_EQUAL(u"=A1"_ustr, m_pDoc->GetFormula(20, 0, nSrcTab)); // U1
+ CPPUNIT_ASSERT_EQUAL(u"=A2"_ustr, m_pDoc->GetFormula(20, 1, nSrcTab)); // U2
+ CPPUNIT_ASSERT_EQUAL(u"=A3"_ustr, m_pDoc->GetFormula(20, 2, nSrcTab)); // U3
+ CPPUNIT_ASSERT_EQUAL(u"=A4"_ustr, m_pDoc->GetFormula(20, 3, nSrcTab)); // U4
+ CPPUNIT_ASSERT_EQUAL(u"=A5"_ustr, m_pDoc->GetFormula(20, 4, nSrcTab)); // U5
+ CPPUNIT_ASSERT_EQUAL(u"=B1"_ustr, m_pDoc->GetFormula(21, 0, nSrcTab)); // V1
+ CPPUNIT_ASSERT_EQUAL(u"=B5"_ustr, m_pDoc->GetFormula(21, 4, nSrcTab)); // V5
+ CPPUNIT_ASSERT_EQUAL(u"=C1"_ustr, m_pDoc->GetFormula(22, 0, nSrcTab)); // W1
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(22, 4, nSrcTab)); // W5
+ CPPUNIT_ASSERT_EQUAL(u"=D1"_ustr, m_pDoc->GetFormula(23, 0, nSrcTab)); // X1
+ CPPUNIT_ASSERT_EQUAL(u"=D2"_ustr, m_pDoc->GetFormula(23, 1, nSrcTab)); // X2
+ CPPUNIT_ASSERT_EQUAL(u"=D3"_ustr, m_pDoc->GetFormula(23, 2, nSrcTab)); // X3
+ CPPUNIT_ASSERT_EQUAL(u"=D4"_ustr, m_pDoc->GetFormula(23, 3, nSrcTab)); // X4
+ CPPUNIT_ASSERT_EQUAL(u"=D5"_ustr, m_pDoc->GetFormula(23, 4, nSrcTab)); // X5
// Note: Values (mostly) remain the same
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "C12"), m_pDoc->GetFormula(0, 20, nSrcTab)); // A21
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "C13"), m_pDoc->GetFormula(0, 21, nSrcTab)); // A22
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "C14"), m_pDoc->GetFormula(0, 22, nSrcTab)); // A23
- CPPUNIT_ASSERT_EQUAL(OUString("=C2"), m_pDoc->GetFormula(1, 20, nSrcTab)); // B21
- CPPUNIT_ASSERT_EQUAL(OUString("=C3"), m_pDoc->GetFormula(1, 21, nSrcTab)); // B22
- CPPUNIT_ASSERT_EQUAL(OUString("=C4"), m_pDoc->GetFormula(1, 22, nSrcTab)); // B23
+ CPPUNIT_ASSERT_EQUAL(u"=C2"_ustr, m_pDoc->GetFormula(1, 20, nSrcTab)); // B21
+ CPPUNIT_ASSERT_EQUAL(u"=C3"_ustr, m_pDoc->GetFormula(1, 21, nSrcTab)); // B22
+ CPPUNIT_ASSERT_EQUAL(u"=C4"_ustr, m_pDoc->GetFormula(1, 22, nSrcTab)); // B23
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 20, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(0, 21, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(0, 22, nSrcTab));
@@ -8552,9 +8514,9 @@ void TestCopyPaste::checkReferencedCutRangesCol(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "$C$12"), m_pDoc->GetFormula(0, 30, nSrcTab)); // A31
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "$C$13"), m_pDoc->GetFormula(0, 31, nSrcTab)); // A32
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "$C$14"), m_pDoc->GetFormula(0, 32, nSrcTab)); // A33
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$2"), m_pDoc->GetFormula(1, 30, nSrcTab)); // B31
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$3"), m_pDoc->GetFormula(1, 31, nSrcTab)); // B32
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$4"), m_pDoc->GetFormula(1, 32, nSrcTab)); // B33
+ CPPUNIT_ASSERT_EQUAL(u"=$C$2"_ustr, m_pDoc->GetFormula(1, 30, nSrcTab)); // B31
+ CPPUNIT_ASSERT_EQUAL(u"=$C$3"_ustr, m_pDoc->GetFormula(1, 31, nSrcTab)); // B32
+ CPPUNIT_ASSERT_EQUAL(u"=$C$4"_ustr, m_pDoc->GetFormula(1, 32, nSrcTab)); // B33
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 30, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(0, 31, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(0, 32, nSrcTab));
@@ -8562,28 +8524,28 @@ void TestCopyPaste::checkReferencedCutRangesCol(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 31, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(1, 32, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$C$12") : OUString("$Test.$C$12"),
- getRangeByName("Range_B2"));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$C$13") : OUString("$Test.$C$13"),
- getRangeByName("Range_B3"));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$C$14") : OUString("$Test.$C$14"),
- getRangeByName("Range_B4"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$2"), getRangeByName("Range_C2"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$3"), getRangeByName("Range_C3"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$4"), getRangeByName("Range_C4"));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$C$12:$C$14")
- : OUString("$Test.$C$12:$C$14"),
- getRangeByName("Range_B2_B4"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$2:$C$4"), getRangeByName("Range_C2_C4"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$2:$C$4"), getRangeByName("Range_B2_C4"));
- CPPUNIT_ASSERT_EQUAL(OUString("B2"), getRangeByName("RelRange_Cm20_R0"));
-
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B2"), m_pDoc->GetFormula(0, 40, nSrcTab)); // A41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B3"), m_pDoc->GetFormula(0, 41, nSrcTab)); // A42
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B4"), m_pDoc->GetFormula(0, 42, nSrcTab)); // A43
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C2"), m_pDoc->GetFormula(1, 40, nSrcTab)); // B41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C3"), m_pDoc->GetFormula(1, 41, nSrcTab)); // B42
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C4"), m_pDoc->GetFormula(1, 42, nSrcTab)); // B43
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$C$12"_ustr : u"$Test.$C$12"_ustr,
+ getRangeByName(u"Range_B2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$C$13"_ustr : u"$Test.$C$13"_ustr,
+ getRangeByName(u"Range_B3"_ustr));
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$C$14"_ustr : u"$Test.$C$14"_ustr,
+ getRangeByName(u"Range_B4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$2"_ustr, getRangeByName(u"Range_C2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$3"_ustr, getRangeByName(u"Range_C3"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$4"_ustr, getRangeByName(u"Range_C4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$C$12:$C$14"_ustr
+ : u"$Test.$C$12:$C$14"_ustr,
+ getRangeByName(u"Range_B2_B4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$2:$C$4"_ustr, getRangeByName(u"Range_C2_C4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$2:$C$4"_ustr, getRangeByName(u"Range_B2_C4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"B2"_ustr, getRangeByName(u"RelRange_Cm20_R0"_ustr));
+
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B2"_ustr, m_pDoc->GetFormula(0, 40, nSrcTab)); // A41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B3"_ustr, m_pDoc->GetFormula(0, 41, nSrcTab)); // A42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B4"_ustr, m_pDoc->GetFormula(0, 42, nSrcTab)); // A43
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C2"_ustr, m_pDoc->GetFormula(1, 40, nSrcTab)); // B41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C3"_ustr, m_pDoc->GetFormula(1, 41, nSrcTab)); // B42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C4"_ustr, m_pDoc->GetFormula(1, 42, nSrcTab)); // B43
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 40, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(0, 41, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(0, 42, nSrcTab));
@@ -8591,12 +8553,12 @@ void TestCopyPaste::checkReferencedCutRangesCol(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 41, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(1, 42, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 50, nSrcTab)); // A51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 51, nSrcTab)); // A52
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 52, nSrcTab)); // A53
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 50, nSrcTab)); // B51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 51, nSrcTab)); // B52
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 52, nSrcTab)); // B53
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 50, nSrcTab)); // A51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 51, nSrcTab)); // A52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 52, nSrcTab)); // A53
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 50, nSrcTab)); // B51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 51, nSrcTab)); // B52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 52, nSrcTab)); // B53
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 50, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(0, 51, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(0, 52, nSrcTab));
@@ -8604,18 +8566,15 @@ void TestCopyPaste::checkReferencedCutRangesCol(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 51, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(1, 52, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.C12:C14)")
- : OUString("=SUM(C12:C14)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.C12:C14)"_ustr : u"=SUM(C12:C14)"_ustr,
m_pDoc->GetFormula(0, 60, nSrcTab)); // A61
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.C12:C14)")
- : OUString("=SUM(C12:C14)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.C12:C14)"_ustr : u"=SUM(C12:C14)"_ustr,
m_pDoc->GetFormula(0, 61, nSrcTab)); // A62
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.C12:C14)")
- : OUString("=SUM(C12:C14)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.C12:C14)"_ustr : u"=SUM(C12:C14)"_ustr,
m_pDoc->GetFormula(0, 62, nSrcTab)); // A63
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C2:C4)"), m_pDoc->GetFormula(1, 60, nSrcTab)); // B61
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C2:C4)"), m_pDoc->GetFormula(1, 61, nSrcTab)); // B62
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C2:C4)"), m_pDoc->GetFormula(1, 62, nSrcTab)); // B63
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C2:C4)"_ustr, m_pDoc->GetFormula(1, 60, nSrcTab)); // B61
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C2:C4)"_ustr, m_pDoc->GetFormula(1, 61, nSrcTab)); // B62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C2:C4)"_ustr, m_pDoc->GetFormula(1, 62, nSrcTab)); // B63
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 60, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 61, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 62, nSrcTab));
@@ -8623,18 +8582,18 @@ void TestCopyPaste::checkReferencedCutRangesCol(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 61, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 62, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.$C$12:$C$14)")
- : OUString("=SUM($C$12:$C$14)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.$C$12:$C$14)"_ustr
+ : u"=SUM($C$12:$C$14)"_ustr,
m_pDoc->GetFormula(0, 70, nSrcTab)); // A71
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.$C$12:$C$14)")
- : OUString("=SUM($C$12:$C$14)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.$C$12:$C$14)"_ustr
+ : u"=SUM($C$12:$C$14)"_ustr,
m_pDoc->GetFormula(0, 71, nSrcTab)); // A72
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.$C$12:$C$14)")
- : OUString("=SUM($C$12:$C$14)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.$C$12:$C$14)"_ustr
+ : u"=SUM($C$12:$C$14)"_ustr,
m_pDoc->GetFormula(0, 72, nSrcTab)); // A73
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$2:$C$4)"), m_pDoc->GetFormula(1, 70, nSrcTab)); // B71
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$2:$C$4)"), m_pDoc->GetFormula(1, 71, nSrcTab)); // B72
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$2:$C$4)"), m_pDoc->GetFormula(1, 72, nSrcTab)); // B73
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 70, nSrcTab)); // B71
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 71, nSrcTab)); // B72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 72, nSrcTab)); // B73
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 70, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 71, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 72, nSrcTab));
@@ -8642,12 +8601,12 @@ void TestCopyPaste::checkReferencedCutRangesCol(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 71, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 72, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_B4)"), m_pDoc->GetFormula(0, 80, nSrcTab)); // A81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_B4)"), m_pDoc->GetFormula(0, 81, nSrcTab)); // A82
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_B4)"), m_pDoc->GetFormula(0, 82, nSrcTab)); // A83
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C2_C4)"), m_pDoc->GetFormula(1, 80, nSrcTab)); // B81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C2_C4)"), m_pDoc->GetFormula(1, 81, nSrcTab)); // B82
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C2_C4)"), m_pDoc->GetFormula(1, 82, nSrcTab)); // B83
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_B4)"_ustr, m_pDoc->GetFormula(0, 80, nSrcTab)); // A81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_B4)"_ustr, m_pDoc->GetFormula(0, 81, nSrcTab)); // A82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_B4)"_ustr, m_pDoc->GetFormula(0, 82, nSrcTab)); // A83
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C2_C4)"_ustr, m_pDoc->GetFormula(1, 80, nSrcTab)); // B81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C2_C4)"_ustr, m_pDoc->GetFormula(1, 81, nSrcTab)); // B82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C2_C4)"_ustr, m_pDoc->GetFormula(1, 82, nSrcTab)); // B83
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 80, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 81, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 82, nSrcTab));
@@ -8655,12 +8614,12 @@ void TestCopyPaste::checkReferencedCutRangesCol(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 81, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 82, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(0, 90, nSrcTab)); // A91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(0, 91, nSrcTab)); // A92
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(0, 92, nSrcTab)); // A93
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(1, 90, nSrcTab)); // B91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(1, 91, nSrcTab)); // B92
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(1, 92, nSrcTab)); // B93
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(0, 90, nSrcTab)); // A91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(0, 91, nSrcTab)); // A92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(0, 92, nSrcTab)); // A93
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 90, nSrcTab)); // B91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 91, nSrcTab)); // B92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 92, nSrcTab)); // B93
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 90, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 91, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 92, nSrcTab));
@@ -8668,18 +8627,12 @@ void TestCopyPaste::checkReferencedCutRangesCol(const SCTAB nSrcTab, const SCTAB
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 91, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 92, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(0, 100, nSrcTab)); // A101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(0, 101, nSrcTab)); // A102
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(0, 102, nSrcTab)); // A103
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(1, 100, nSrcTab)); // B101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(1, 101, nSrcTab)); // B102
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(1, 102, nSrcTab)); // B103
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(0, 100, nSrcTab)); // A101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(0, 101, nSrcTab)); // A102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(0, 102, nSrcTab)); // A103
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(1, 100, nSrcTab)); // B101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(1, 101, nSrcTab)); // B102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(1, 102, nSrcTab)); // B103
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 100, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 101, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 102, nSrcTab));
@@ -8703,7 +8656,7 @@ void TestCopyPaste::checkReferencedCutTransposedRangesCol(const SCTAB nSrcTab, c
{
// Cut B2:D2 and pasted transposed to C12:E12
- OUString aFBase("=");
+ OUString aFBase(u"="_ustr);
if (nSrcTab != nDestTab)
aFBase += "Dest.";
@@ -8744,27 +8697,27 @@ void TestCopyPaste::checkReferencedCutTransposedRangesCol(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(1032.0, m_pDoc->GetValue(23, 2, nSrcTab)); // X3
CPPUNIT_ASSERT_EQUAL(1033.0, m_pDoc->GetValue(23, 3, nSrcTab)); // X4
CPPUNIT_ASSERT_EQUAL(1034.0, m_pDoc->GetValue(23, 4, nSrcTab)); // X5
- CPPUNIT_ASSERT_EQUAL(OUString("=A1"), m_pDoc->GetFormula(20, 0, nSrcTab)); // U1
- CPPUNIT_ASSERT_EQUAL(OUString("=A2"), m_pDoc->GetFormula(20, 1, nSrcTab)); // U2
- CPPUNIT_ASSERT_EQUAL(OUString("=A3"), m_pDoc->GetFormula(20, 2, nSrcTab)); // U3
- CPPUNIT_ASSERT_EQUAL(OUString("=A4"), m_pDoc->GetFormula(20, 3, nSrcTab)); // U4
- CPPUNIT_ASSERT_EQUAL(OUString("=A5"), m_pDoc->GetFormula(20, 4, nSrcTab)); // U5
- CPPUNIT_ASSERT_EQUAL(OUString("=B1"), m_pDoc->GetFormula(21, 0, nSrcTab)); // V1
- CPPUNIT_ASSERT_EQUAL(OUString("=B5"), m_pDoc->GetFormula(21, 4, nSrcTab)); // V5
- CPPUNIT_ASSERT_EQUAL(OUString("=C1"), m_pDoc->GetFormula(22, 0, nSrcTab)); // W1
- CPPUNIT_ASSERT_EQUAL(OUString("=C5"), m_pDoc->GetFormula(22, 4, nSrcTab)); // W5
- CPPUNIT_ASSERT_EQUAL(OUString("=D1"), m_pDoc->GetFormula(23, 0, nSrcTab)); // X1
- CPPUNIT_ASSERT_EQUAL(OUString("=D2"), m_pDoc->GetFormula(23, 1, nSrcTab)); // X2
- CPPUNIT_ASSERT_EQUAL(OUString("=D3"), m_pDoc->GetFormula(23, 2, nSrcTab)); // X3
- CPPUNIT_ASSERT_EQUAL(OUString("=D4"), m_pDoc->GetFormula(23, 3, nSrcTab)); // X4
- CPPUNIT_ASSERT_EQUAL(OUString("=D5"), m_pDoc->GetFormula(23, 4, nSrcTab)); // X5
+ CPPUNIT_ASSERT_EQUAL(u"=A1"_ustr, m_pDoc->GetFormula(20, 0, nSrcTab)); // U1
+ CPPUNIT_ASSERT_EQUAL(u"=A2"_ustr, m_pDoc->GetFormula(20, 1, nSrcTab)); // U2
+ CPPUNIT_ASSERT_EQUAL(u"=A3"_ustr, m_pDoc->GetFormula(20, 2, nSrcTab)); // U3
+ CPPUNIT_ASSERT_EQUAL(u"=A4"_ustr, m_pDoc->GetFormula(20, 3, nSrcTab)); // U4
+ CPPUNIT_ASSERT_EQUAL(u"=A5"_ustr, m_pDoc->GetFormula(20, 4, nSrcTab)); // U5
+ CPPUNIT_ASSERT_EQUAL(u"=B1"_ustr, m_pDoc->GetFormula(21, 0, nSrcTab)); // V1
+ CPPUNIT_ASSERT_EQUAL(u"=B5"_ustr, m_pDoc->GetFormula(21, 4, nSrcTab)); // V5
+ CPPUNIT_ASSERT_EQUAL(u"=C1"_ustr, m_pDoc->GetFormula(22, 0, nSrcTab)); // W1
+ CPPUNIT_ASSERT_EQUAL(u"=C5"_ustr, m_pDoc->GetFormula(22, 4, nSrcTab)); // W5
+ CPPUNIT_ASSERT_EQUAL(u"=D1"_ustr, m_pDoc->GetFormula(23, 0, nSrcTab)); // X1
+ CPPUNIT_ASSERT_EQUAL(u"=D2"_ustr, m_pDoc->GetFormula(23, 1, nSrcTab)); // X2
+ CPPUNIT_ASSERT_EQUAL(u"=D3"_ustr, m_pDoc->GetFormula(23, 2, nSrcTab)); // X3
+ CPPUNIT_ASSERT_EQUAL(u"=D4"_ustr, m_pDoc->GetFormula(23, 3, nSrcTab)); // X4
+ CPPUNIT_ASSERT_EQUAL(u"=D5"_ustr, m_pDoc->GetFormula(23, 4, nSrcTab)); // X5
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "C12"), m_pDoc->GetFormula(0, 20, nSrcTab)); // A21
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "D12"), m_pDoc->GetFormula(0, 21, nSrcTab)); // A22
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "E12"), m_pDoc->GetFormula(0, 22, nSrcTab)); // A23
- CPPUNIT_ASSERT_EQUAL(OUString("=C2"), m_pDoc->GetFormula(1, 20, nSrcTab)); // B21
- CPPUNIT_ASSERT_EQUAL(OUString("=C3"), m_pDoc->GetFormula(1, 21, nSrcTab)); // B22
- CPPUNIT_ASSERT_EQUAL(OUString("=C4"), m_pDoc->GetFormula(1, 22, nSrcTab)); // B23
+ CPPUNIT_ASSERT_EQUAL(u"=C2"_ustr, m_pDoc->GetFormula(1, 20, nSrcTab)); // B21
+ CPPUNIT_ASSERT_EQUAL(u"=C3"_ustr, m_pDoc->GetFormula(1, 21, nSrcTab)); // B22
+ CPPUNIT_ASSERT_EQUAL(u"=C4"_ustr, m_pDoc->GetFormula(1, 22, nSrcTab)); // B23
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 20, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(0, 21, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(0, 22, nSrcTab));
@@ -8775,9 +8728,9 @@ void TestCopyPaste::checkReferencedCutTransposedRangesCol(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "$C$12"), m_pDoc->GetFormula(0, 30, nSrcTab)); // A31
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "$D$12"), m_pDoc->GetFormula(0, 31, nSrcTab)); // A32
CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "$E$12"), m_pDoc->GetFormula(0, 32, nSrcTab)); // A33
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$2"), m_pDoc->GetFormula(1, 30, nSrcTab)); // B31
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$3"), m_pDoc->GetFormula(1, 31, nSrcTab)); // B32
- CPPUNIT_ASSERT_EQUAL(OUString("=$C$4"), m_pDoc->GetFormula(1, 32, nSrcTab)); // B33
+ CPPUNIT_ASSERT_EQUAL(u"=$C$2"_ustr, m_pDoc->GetFormula(1, 30, nSrcTab)); // B31
+ CPPUNIT_ASSERT_EQUAL(u"=$C$3"_ustr, m_pDoc->GetFormula(1, 31, nSrcTab)); // B32
+ CPPUNIT_ASSERT_EQUAL(u"=$C$4"_ustr, m_pDoc->GetFormula(1, 32, nSrcTab)); // B33
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 30, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(0, 31, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(0, 32, nSrcTab));
@@ -8785,28 +8738,28 @@ void TestCopyPaste::checkReferencedCutTransposedRangesCol(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 31, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(1, 32, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$C$12") : OUString("$Test.$C$12"),
- getRangeByName("Range_B2"));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$D$12") : OUString("$Test.$D$12"),
- getRangeByName("Range_B3"));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$E$12") : OUString("$Test.$E$12"),
- getRangeByName("Range_B4"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$2"), getRangeByName("Range_C2"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$3"), getRangeByName("Range_C3"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$4"), getRangeByName("Range_C4"));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("$Dest.$C$12:$E$12")
- : OUString("$Test.$C$12:$E$12"),
- getRangeByName("Range_B2_B4"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$C$2:$C$4"), getRangeByName("Range_C2_C4"));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$2:$C$4"), getRangeByName("Range_B2_C4"));
- CPPUNIT_ASSERT_EQUAL(OUString("B2"), getRangeByName("RelRange_Cm20_R0"));
-
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B2"), m_pDoc->GetFormula(0, 40, nSrcTab)); // A41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B3"), m_pDoc->GetFormula(0, 41, nSrcTab)); // A42
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_B4"), m_pDoc->GetFormula(0, 42, nSrcTab)); // A43
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C2"), m_pDoc->GetFormula(1, 40, nSrcTab)); // B41
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C3"), m_pDoc->GetFormula(1, 41, nSrcTab)); // B42
- CPPUNIT_ASSERT_EQUAL(OUString("=Range_C4"), m_pDoc->GetFormula(1, 42, nSrcTab)); // B43
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$C$12"_ustr : u"$Test.$C$12"_ustr,
+ getRangeByName(u"Range_B2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$D$12"_ustr : u"$Test.$D$12"_ustr,
+ getRangeByName(u"Range_B3"_ustr));
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$E$12"_ustr : u"$Test.$E$12"_ustr,
+ getRangeByName(u"Range_B4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$2"_ustr, getRangeByName(u"Range_C2"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$3"_ustr, getRangeByName(u"Range_C3"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$4"_ustr, getRangeByName(u"Range_C4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"$Dest.$C$12:$E$12"_ustr
+ : u"$Test.$C$12:$E$12"_ustr,
+ getRangeByName(u"Range_B2_B4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$C$2:$C$4"_ustr, getRangeByName(u"Range_C2_C4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$2:$C$4"_ustr, getRangeByName(u"Range_B2_C4"_ustr));
+ CPPUNIT_ASSERT_EQUAL(u"B2"_ustr, getRangeByName(u"RelRange_Cm20_R0"_ustr));
+
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B2"_ustr, m_pDoc->GetFormula(0, 40, nSrcTab)); // A41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B3"_ustr, m_pDoc->GetFormula(0, 41, nSrcTab)); // A42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_B4"_ustr, m_pDoc->GetFormula(0, 42, nSrcTab)); // A43
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C2"_ustr, m_pDoc->GetFormula(1, 40, nSrcTab)); // B41
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C3"_ustr, m_pDoc->GetFormula(1, 41, nSrcTab)); // B42
+ CPPUNIT_ASSERT_EQUAL(u"=Range_C4"_ustr, m_pDoc->GetFormula(1, 42, nSrcTab)); // B43
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 40, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(0, 41, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(0, 42, nSrcTab));
@@ -8814,12 +8767,12 @@ void TestCopyPaste::checkReferencedCutTransposedRangesCol(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 41, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(1, 42, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 50, nSrcTab)); // A51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 51, nSrcTab)); // A52
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(0, 52, nSrcTab)); // A53
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 50, nSrcTab)); // B51
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 51, nSrcTab)); // B52
- CPPUNIT_ASSERT_EQUAL(OUString("=RelRange_Cm20_R0"), m_pDoc->GetFormula(1, 52, nSrcTab)); // B53
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 50, nSrcTab)); // A51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 51, nSrcTab)); // A52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(0, 52, nSrcTab)); // A53
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 50, nSrcTab)); // B51
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 51, nSrcTab)); // B52
+ CPPUNIT_ASSERT_EQUAL(u"=RelRange_Cm20_R0"_ustr, m_pDoc->GetFormula(1, 52, nSrcTab)); // B53
CPPUNIT_ASSERT_EQUAL(01.0, m_pDoc->GetValue(0, 50, nSrcTab));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(0, 51, nSrcTab));
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(0, 52, nSrcTab));
@@ -8827,18 +8780,15 @@ void TestCopyPaste::checkReferencedCutTransposedRangesCol(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(1, 51, nSrcTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(1, 52, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.C12:E12)")
- : OUString("=SUM(C12:E12)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.C12:E12)"_ustr : u"=SUM(C12:E12)"_ustr,
m_pDoc->GetFormula(0, 60, nSrcTab)); // A61
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.C12:E12)")
- : OUString("=SUM(C12:E12)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.C12:E12)"_ustr : u"=SUM(C12:E12)"_ustr,
m_pDoc->GetFormula(0, 61, nSrcTab)); // A62
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.C12:E12)")
- : OUString("=SUM(C12:E12)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.C12:E12)"_ustr : u"=SUM(C12:E12)"_ustr,
m_pDoc->GetFormula(0, 62, nSrcTab)); // A63
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C2:C4)"), m_pDoc->GetFormula(1, 60, nSrcTab)); // B61
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C2:C4)"), m_pDoc->GetFormula(1, 61, nSrcTab)); // B62
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C2:C4)"), m_pDoc->GetFormula(1, 62, nSrcTab)); // B63
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C2:C4)"_ustr, m_pDoc->GetFormula(1, 60, nSrcTab)); // B61
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C2:C4)"_ustr, m_pDoc->GetFormula(1, 61, nSrcTab)); // B62
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C2:C4)"_ustr, m_pDoc->GetFormula(1, 62, nSrcTab)); // B63
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 60, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 61, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 62, nSrcTab));
@@ -8846,18 +8796,18 @@ void TestCopyPaste::checkReferencedCutTransposedRangesCol(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 61, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 62, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.$C$12:$E$12)")
- : OUString("=SUM($C$12:$E$12)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.$C$12:$E$12)"_ustr
+ : u"=SUM($C$12:$E$12)"_ustr,
m_pDoc->GetFormula(0, 70, nSrcTab)); // A71
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.$C$12:$E$12)")
- : OUString("=SUM($C$12:$E$12)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.$C$12:$E$12)"_ustr
+ : u"=SUM($C$12:$E$12)"_ustr,
m_pDoc->GetFormula(0, 71, nSrcTab)); // A72
- CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? OUString("=SUM(Dest.$C$12:$E$12)")
- : OUString("=SUM($C$12:$E$12)"),
+ CPPUNIT_ASSERT_EQUAL(nSrcTab != nDestTab ? u"=SUM(Dest.$C$12:$E$12)"_ustr
+ : u"=SUM($C$12:$E$12)"_ustr,
m_pDoc->GetFormula(0, 72, nSrcTab)); // A73
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$2:$C$4)"), m_pDoc->GetFormula(1, 70, nSrcTab)); // B71
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$2:$C$4)"), m_pDoc->GetFormula(1, 71, nSrcTab)); // B72
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($C$2:$C$4)"), m_pDoc->GetFormula(1, 72, nSrcTab)); // B73
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 70, nSrcTab)); // B71
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 71, nSrcTab)); // B72
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($C$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 72, nSrcTab)); // B73
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 70, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 71, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 72, nSrcTab));
@@ -8865,12 +8815,12 @@ void TestCopyPaste::checkReferencedCutTransposedRangesCol(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 71, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 72, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_B4)"), m_pDoc->GetFormula(0, 80, nSrcTab)); // A81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_B4)"), m_pDoc->GetFormula(0, 81, nSrcTab)); // A82
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_B4)"), m_pDoc->GetFormula(0, 82, nSrcTab)); // A83
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C2_C4)"), m_pDoc->GetFormula(1, 80, nSrcTab)); // B81
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C2_C4)"), m_pDoc->GetFormula(1, 81, nSrcTab)); // B82
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_C2_C4)"), m_pDoc->GetFormula(1, 82, nSrcTab)); // B83
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_B4)"_ustr, m_pDoc->GetFormula(0, 80, nSrcTab)); // A81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_B4)"_ustr, m_pDoc->GetFormula(0, 81, nSrcTab)); // A82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_B4)"_ustr, m_pDoc->GetFormula(0, 82, nSrcTab)); // A83
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C2_C4)"_ustr, m_pDoc->GetFormula(1, 80, nSrcTab)); // B81
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C2_C4)"_ustr, m_pDoc->GetFormula(1, 81, nSrcTab)); // B82
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_C2_C4)"_ustr, m_pDoc->GetFormula(1, 82, nSrcTab)); // B83
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 80, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 81, nSrcTab));
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(0, 82, nSrcTab));
@@ -8878,12 +8828,12 @@ void TestCopyPaste::checkReferencedCutTransposedRangesCol(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 81, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 82, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(0, 90, nSrcTab)); // A91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(0, 91, nSrcTab)); // A92
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(0, 92, nSrcTab)); // A93
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(1, 90, nSrcTab)); // B91
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(1, 91, nSrcTab)); // B92
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(1, 92, nSrcTab)); // B93
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(0, 90, nSrcTab)); // A91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(0, 91, nSrcTab)); // A92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(0, 92, nSrcTab)); // A93
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 90, nSrcTab)); // B91
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 91, nSrcTab)); // B92
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(1, 92, nSrcTab)); // B93
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 90, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 91, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 92, nSrcTab));
@@ -8891,18 +8841,12 @@ void TestCopyPaste::checkReferencedCutTransposedRangesCol(const SCTAB nSrcTab, c
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 91, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(1, 92, nSrcTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(0, 100, nSrcTab)); // A101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(0, 101, nSrcTab)); // A102
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(0, 102, nSrcTab)); // A103
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(1, 100, nSrcTab)); // B101
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(1, 101, nSrcTab)); // B102
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(Range_B2_C4)"),
- m_pDoc->GetFormula(1, 102, nSrcTab)); // B103
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(0, 100, nSrcTab)); // A101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(0, 101, nSrcTab)); // A102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(0, 102, nSrcTab)); // A103
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(1, 100, nSrcTab)); // B101
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(1, 101, nSrcTab)); // B102
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(Range_B2_C4)"_ustr, m_pDoc->GetFormula(1, 102, nSrcTab)); // B103
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 100, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 101, nSrcTab));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(0, 102, nSrcTab));
@@ -8933,7 +8877,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutRangesCol)
pUndoPaste->Undo();
pUndoCut->Undo();
- checkReferencedCutRangesColIntitial(nSrcTab, nDestTab, "After undo");
+ checkReferencedCutRangesColIntitial(nSrcTab, nDestTab, u"After undo"_ustr);
pUndoCut->Redo();
pUndoPaste->Redo();
@@ -8941,7 +8885,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutRangesCol)
pUndoPaste->Undo();
pUndoCut->Undo();
- checkReferencedCutRangesColIntitial(nSrcTab, nDestTab, "After undo");
+ checkReferencedCutRangesColIntitial(nSrcTab, nDestTab, u"After undo"_ustr);
pUndoPaste.reset();
pUndoCut.reset();
@@ -8985,7 +8929,7 @@ void TestCopyPaste::checkReferencedCutTransposedRangesColUndo(const SCTAB nSrcTa
pUndoPaste->Undo();
pUndoCut->Undo();
- checkReferencedCutRangesColIntitial(nSrcTab, nDestTab, "After undo");
+ checkReferencedCutRangesColIntitial(nSrcTab, nDestTab, u"After undo"_ustr);
pUndoCut->Redo();
pUndoPaste->Redo();
@@ -8993,7 +8937,7 @@ void TestCopyPaste::checkReferencedCutTransposedRangesColUndo(const SCTAB nSrcTa
pUndoPaste->Undo();
pUndoCut->Undo();
- checkReferencedCutRangesColIntitial(nSrcTab, nDestTab, "After undo");
+ checkReferencedCutRangesColIntitial(nSrcTab, nDestTab, u"After undo"_ustr);
pUndoPaste.reset();
pUndoCut.reset();
@@ -9005,17 +8949,17 @@ void TestCopyPaste::checkReferencedCutTransposedRangesColUndo(const SCTAB nSrcTa
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutTransposedFormulas)
{
const SCTAB nTab = 0;
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
m_pDoc->SetValue(0, 0, nTab, 1.0); // A1
m_pDoc->SetValue(1, 0, nTab, 2.0); // B1
- m_pDoc->SetString(1, 1, nTab, "=A1"); // B2
- m_pDoc->SetString(2, 1, nTab, "=B1"); // C2
- m_pDoc->SetString(3, 1, nTab, "=SUM(A1:B1)"); // D2
- m_pDoc->SetString(4, 1, nTab, "=$B$1"); // E2
- m_pDoc->SetString(5, 1, nTab, "=$B1"); // F2
- m_pDoc->SetString(6, 1, nTab, "=B$1"); // G2
+ m_pDoc->SetString(1, 1, nTab, u"=A1"_ustr); // B2
+ m_pDoc->SetString(2, 1, nTab, u"=B1"_ustr); // C2
+ m_pDoc->SetString(3, 1, nTab, u"=SUM(A1:B1)"_ustr); // D2
+ m_pDoc->SetString(4, 1, nTab, u"=$B$1"_ustr); // E2
+ m_pDoc->SetString(5, 1, nTab, u"=$B1"_ustr); // F2
+ m_pDoc->SetString(6, 1, nTab, u"=B$1"_ustr); // G2
// Check precondition
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(3, 1, nTab));
@@ -9040,29 +8984,29 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutTransposedFormulas)
m_pDoc->UpdateTranspose(aDestRange.aStart, pOrigClipDoc, aDestMark, nullptr);
pTransClip.reset();
- CPPUNIT_ASSERT_EQUAL(OUString("=A1"), m_pDoc->GetFormula(2, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=A1"_ustr, m_pDoc->GetFormula(2, 2, nTab));
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(2, 2, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=B1"), m_pDoc->GetFormula(2, 3, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=B1"_ustr, m_pDoc->GetFormula(2, 3, nTab));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(2, 3, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A1:B1)"), m_pDoc->GetFormula(2, 4, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A1:B1)"_ustr, m_pDoc->GetFormula(2, 4, nTab));
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(2, 4, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=$B$1"), m_pDoc->GetFormula(2, 5, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=$B$1"_ustr, m_pDoc->GetFormula(2, 5, nTab));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(2, 5, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=$B1"), m_pDoc->GetFormula(2, 6, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=$B1"_ustr, m_pDoc->GetFormula(2, 6, nTab));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(2, 6, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=B$1"), m_pDoc->GetFormula(2, 7, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=B$1"_ustr, m_pDoc->GetFormula(2, 7, nTab));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(2, 7, nTab));
}
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutTransposedFormulasSquare)
{
const SCTAB nTab = 0;
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
m_pDoc->SetValue(0, 0, nTab, 1.0); // A1
m_pDoc->SetValue(0, 1, nTab, 2.0); // A2
@@ -9071,12 +9015,12 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutTransposedFormulasSquare)
m_pDoc->SetValue(2, 0, nTab, 21.0); // C1
m_pDoc->SetValue(2, 1, nTab, 22.0); // C2
- m_pDoc->SetString(0, 3, nTab, "=A1"); // A4
- m_pDoc->SetString(0, 4, nTab, "=A2"); // A5
- m_pDoc->SetString(1, 3, nTab, "=B1"); // B4
- m_pDoc->SetString(1, 4, nTab, "=B2"); // B5
- m_pDoc->SetString(2, 3, nTab, "=C1"); // C4
- m_pDoc->SetString(2, 4, nTab, "=C2"); // C5
+ m_pDoc->SetString(0, 3, nTab, u"=A1"_ustr); // A4
+ m_pDoc->SetString(0, 4, nTab, u"=A2"_ustr); // A5
+ m_pDoc->SetString(1, 3, nTab, u"=B1"_ustr); // B4
+ m_pDoc->SetString(1, 4, nTab, u"=B2"_ustr); // B5
+ m_pDoc->SetString(2, 3, nTab, u"=C1"_ustr); // C4
+ m_pDoc->SetString(2, 4, nTab, u"=C2"_ustr); // C5
// Check precondition
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(0, 3, nTab));
@@ -9121,25 +9065,25 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutTransposedFormulasSquare)
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(1, 8, nTab));
CPPUNIT_ASSERT_EQUAL(22.0, m_pDoc->GetValue(2, 8, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=A1"), m_pDoc->GetFormula(1, 6, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=A2"), m_pDoc->GetFormula(2, 6, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=B1"), m_pDoc->GetFormula(1, 7, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=B2"), m_pDoc->GetFormula(2, 7, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=C1"), m_pDoc->GetFormula(1, 8, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=C2"), m_pDoc->GetFormula(2, 8, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=A1"_ustr, m_pDoc->GetFormula(1, 6, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=A2"_ustr, m_pDoc->GetFormula(2, 6, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=B1"_ustr, m_pDoc->GetFormula(1, 7, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=B2"_ustr, m_pDoc->GetFormula(2, 7, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=C1"_ustr, m_pDoc->GetFormula(1, 8, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=C2"_ustr, m_pDoc->GetFormula(2, 8, nTab));
}
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142065)
{
const SCTAB nTab = 0;
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
m_pDoc->SetValue(0, 0, nTab, 1.0); // A1
- m_pDoc->SetString(1, 0, nTab, "=A1"); // B1
- m_pDoc->SetString(2, 0, nTab, "=SUM(A1:B1)"); // C1
- m_pDoc->SetString(3, 0, nTab, "=$A$1"); // D1
- m_pDoc->SetString(4, 0, nTab, "=$A1"); // E1
- m_pDoc->SetString(5, 0, nTab, "=A$1"); // F1
+ m_pDoc->SetString(1, 0, nTab, u"=A1"_ustr); // B1
+ m_pDoc->SetString(2, 0, nTab, u"=SUM(A1:B1)"_ustr); // C1
+ m_pDoc->SetString(3, 0, nTab, u"=$A$1"_ustr); // D1
+ m_pDoc->SetString(4, 0, nTab, u"=$A1"_ustr); // E1
+ m_pDoc->SetString(5, 0, nTab, u"=A$1"_ustr); // F1
// Check precondition
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(2, 0, nTab));
@@ -9183,7 +9127,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142065)
// Without the fix in place, this would have failed with
// - Expected: =A3
// - Actual : =#REF!#REF!
- CPPUNIT_ASSERT_EQUAL(OUString("=A3"), m_pDoc->GetFormula(0, 3, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=A3"_ustr, m_pDoc->GetFormula(0, 3, nTab));
// Without the fix in place, this would have failed with
// - Expected: 1
// - Actual : #REF!
@@ -9191,25 +9135,25 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142065)
// Without the fix in place, this would have failed with
// - Expected: =SUM(A3:A4)
// - Actual : =SUM(#REF!#REF!:#REF!#REF!)
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A3:A4)"), m_pDoc->GetFormula(0, 4, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A3:A4)"_ustr, m_pDoc->GetFormula(0, 4, nTab));
// Without the fix in place, this would have failed with
// - Expected: 2
// - Actual : #REF!
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(0, 4, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=$A$3"), m_pDoc->GetFormula(0, 5, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=$A$3"_ustr, m_pDoc->GetFormula(0, 5, nTab));
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(0, 5, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=$A3"), m_pDoc->GetFormula(0, 6, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=$A3"_ustr, m_pDoc->GetFormula(0, 6, nTab));
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(0, 6, nTab));
- CPPUNIT_ASSERT_EQUAL(OUString("=A$3"), m_pDoc->GetFormula(0, 7, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=A$3"_ustr, m_pDoc->GetFormula(0, 7, nTab));
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(0, 7, nTab));
}
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteMultiRange)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Fill A2:B6 with numbers.
for (SCROW nRow = 1; nRow <= 5; ++nRow)
@@ -9327,7 +9271,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty)
} aTest(m_pDoc);
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
m_pDoc->InitDrawLayer(m_xDocShell.get()); // for cell note objects.
ScRange aSrcRange(0, 0, 0, 0, 4, 0);
@@ -9337,11 +9281,11 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty)
aMark.SetMarkArea(aDestRange);
// Put some texts in B1:B5.
- m_pDoc->SetString(ScAddress(1, 0, 0), "A");
- m_pDoc->SetString(ScAddress(1, 1, 0), "B");
- m_pDoc->SetString(ScAddress(1, 2, 0), "C");
- m_pDoc->SetString(ScAddress(1, 3, 0), "D");
- m_pDoc->SetString(ScAddress(1, 4, 0), "E");
+ m_pDoc->SetString(ScAddress(1, 0, 0), u"A"_ustr);
+ m_pDoc->SetString(ScAddress(1, 1, 0), u"B"_ustr);
+ m_pDoc->SetString(ScAddress(1, 2, 0), u"C"_ustr);
+ m_pDoc->SetString(ScAddress(1, 3, 0), u"D"_ustr);
+ m_pDoc->SetString(ScAddress(1, 4, 0), u"E"_ustr);
// Set the background color of B1:B5 to blue.
ScPatternAttr aCellBackColor(m_pDoc->getCellAttributeHelper());
@@ -9360,9 +9304,9 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty)
aClipDoc.ResetClip(m_pDoc, &aMark);
ScClipParam aParam(aSrcRange, false);
aClipDoc.SetClipParam(aParam);
- aClipDoc.SetString(ScAddress(0, 0, 0), "Clip1");
- aClipDoc.SetString(ScAddress(0, 2, 0), "Clip2");
- aClipDoc.SetString(ScAddress(0, 4, 0), "Clip3");
+ aClipDoc.SetString(ScAddress(0, 0, 0), u"Clip1"_ustr);
+ aClipDoc.SetString(ScAddress(0, 2, 0), u"Clip2"_ustr);
+ aClipDoc.SetString(ScAddress(0, 4, 0), u"Clip3"_ustr);
// Set the background color of A1:A5 to yellow.
aCellBackColor.GetItemSet().Put(SvxBrushItem(COL_YELLOW, ATTR_BACKGROUND));
@@ -9452,10 +9396,10 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty2)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(ScAddress(0, 0, 0), "A");
- m_pDoc->SetString(ScAddress(2, 0, 0), "C");
+ m_pDoc->SetString(ScAddress(0, 0, 0), u"A"_ustr);
+ m_pDoc->SetString(ScAddress(2, 0, 0), u"C"_ustr);
// Copy A1:C1 to clipboard.
ScDocument aClipDoc(SCDOCMODE_CLIP);
@@ -9469,10 +9413,10 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty2)
m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::ALL, nullptr, &aClipDoc, false,
false, true, true);
- CPPUNIT_ASSERT_EQUAL(OUString("A"), m_pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A"_ustr, m_pDoc->GetString(ScAddress(0, 2, 0)));
CPPUNIT_ASSERT_EQUAL_MESSAGE("B3 should be empty.", CELLTYPE_NONE,
m_pDoc->GetCellType(ScAddress(1, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("C"), m_pDoc->GetString(ScAddress(2, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"C"_ustr, m_pDoc->GetString(ScAddress(2, 2, 0)));
m_pDoc->DeleteTab(0);
}
@@ -9485,10 +9429,10 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutPasteRefUndo)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// A2 references B2.
- m_pDoc->SetString(ScAddress(0, 1, 0), "=B2");
+ m_pDoc->SetString(ScAddress(0, 1, 0), u"=B2"_ustr);
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
@@ -9509,19 +9453,19 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutPasteRefUndo)
&aClipDoc);
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(0, 1, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("A2 should be referencing C2.", OUString("=C2"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("A2 should be referencing C2.", u"=C2"_ustr,
m_pDoc->GetFormula(0, 1, 0));
// At this point, the ref undo document should contain a formula cell at A2 that references B2.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("A2 in the undo document should be referencing B2.",
- OUString("=B2"), pUndoDoc->GetFormula(0, 1, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("A2 in the undo document should be referencing B2.", u"=B2"_ustr,
+ pUndoDoc->GetFormula(0, 1, 0));
ScUndoPaste aUndo(m_xDocShell.get(), ScRange(2, 1, 0), aMark, std::move(pUndoDoc), nullptr,
InsertDeleteFlags::CONTENTS, nullptr, false, nullptr);
aUndo.Undo();
// Now A2 should be referencing B2 once again.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("A2 should be referencing B2 after undo.", OUString("=B2"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("A2 should be referencing B2 after undo.", u"=B2"_ustr,
m_pDoc->GetFormula(0, 1, 0));
m_pDoc->DeleteTab(0);
@@ -9534,7 +9478,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutPasteGroupRefUndo)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Formula data in A1:A9
std::vector<std::vector<const char*>> aData
@@ -9638,22 +9582,22 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMoveRefBetweenSheets)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test1");
- m_pDoc->InsertTab(1, "Test2");
+ m_pDoc->InsertTab(0, u"Test1"_ustr);
+ m_pDoc->InsertTab(1, u"Test2"_ustr);
m_pDoc->SetValue(ScAddress(0, 0, 0), 12.0);
m_pDoc->SetValue(ScAddress(1, 0, 0), 10.0);
m_pDoc->SetValue(ScAddress(2, 0, 0), 8.0);
- m_pDoc->SetString(ScAddress(0, 1, 0), "=A1");
- m_pDoc->SetString(ScAddress(0, 2, 0), "=SUM(A1:C1)");
+ m_pDoc->SetString(ScAddress(0, 1, 0), u"=A1"_ustr);
+ m_pDoc->SetString(ScAddress(0, 2, 0), u"=SUM(A1:C1)"_ustr);
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(ScAddress(0, 1, 0)));
CPPUNIT_ASSERT_EQUAL(30.0, m_pDoc->GetValue(ScAddress(0, 2, 0)));
// These formulas should not display the sheet name.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=A1"), m_pDoc->GetFormula(0, 1, 0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A1:C1)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=A1"_ustr, m_pDoc->GetFormula(0, 1, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A1:C1)"_ustr,
m_pDoc->GetFormula(0, 2, 0));
// Move Test1.A2:A3 to Test2.A2:A3.
@@ -9668,9 +9612,8 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMoveRefBetweenSheets)
ASSERT_DOUBLES_EQUAL(30.0, m_pDoc->GetValue(ScAddress(0, 2, 1)));
// The reference in the pasted formula should display sheet name after the move.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=Test1.A1"),
- m_pDoc->GetFormula(0, 1, 1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(Test1.A1:C1)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=Test1.A1"_ustr, m_pDoc->GetFormula(0, 1, 1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(Test1.A1:C1)"_ustr,
m_pDoc->GetFormula(0, 2, 1));
m_pDoc->DeleteTab(1);
@@ -9679,7 +9622,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMoveRefBetweenSheets)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testUndoCut)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
@@ -9689,7 +9632,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testUndoCut)
m_pDoc->SetValue(ScAddress(0, 2, 0), 100.0);
// SUM in A4.
- m_pDoc->SetString(ScAddress(0, 3, 0), "=SUM(A1:A3)");
+ m_pDoc->SetString(ScAddress(0, 3, 0), u"=SUM(A1:A3)"_ustr);
CPPUNIT_ASSERT_EQUAL(111.0, m_pDoc->GetValue(0, 3, 0));
// Select A1:A3.
@@ -9732,19 +9675,19 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testUndoCut)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMoveBlock)
{
- m_pDoc->InsertTab(0, "SheetNotes");
+ m_pDoc->InsertTab(0, u"SheetNotes"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
m_pDoc->SetValue(0, 0, 0, 1);
- m_pDoc->SetString(1, 0, 0, "=A1+1");
- m_pDoc->SetString(2, 0, 0, "test");
+ m_pDoc->SetString(1, 0, 0, u"=A1+1"_ustr);
+ m_pDoc->SetString(2, 0, 0, u"test"_ustr);
// add notes to A1:C1
- ScAddress aAddrA1 = setNote(0, 0, 0, "Hello world in A1");
- ScAddress aAddrB1 = setNote(1, 0, 0, "Hello world in B1");
- ScAddress aAddrC1 = setNote(2, 0, 0, "Hello world in C1");
+ ScAddress aAddrA1 = setNote(0, 0, 0, u"Hello world in A1"_ustr);
+ ScAddress aAddrB1 = setNote(1, 0, 0, u"Hello world in B1"_ustr);
+ ScAddress aAddrC1 = setNote(2, 0, 0, u"Hello world in C1"_ustr);
ScAddress aAddrD1(3, 0, 0);
// previous tests on cell note content are ok. this one fails !!! :(
@@ -9759,9 +9702,9 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMoveBlock)
//check cell content
OUString aString = m_pDoc->GetString(3, 0, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D1 should contain: test", OUString("test"), aString);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell D1 should contain: test", u"test"_ustr, aString);
aString = m_pDoc->GetFormula(2, 0, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C1 should contain an updated formula", OUString("=B1+1"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell C1 should contain an updated formula", u"=B1+1"_ustr,
aString);
double fValue = m_pDoc->GetValue(aAddrB1);
ASSERT_DOUBLES_EQUAL_MESSAGE("Cell B1 should contain 1", 1, fValue);
@@ -9786,7 +9729,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMoveBlock)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteRelativeFormula)
{
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true);
@@ -9795,7 +9738,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteRelativeFormula)
m_pDoc->SetValue(ScAddress(0, 3, 0), 2);
// Insert formula to B4.
- m_pDoc->SetString(ScAddress(1, 3, 0), "=A4");
+ m_pDoc->SetString(ScAddress(1, 3, 0), u"=A4"_ustr);
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(1, 3, 0)));
// Select and copy B3:B4 to the clipboard.
@@ -9820,7 +9763,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteRelativeFormula)
clearSheet(&aClipDoc, 0);
// Insert a single formula cell in A1.
- m_pDoc->SetString(ScAddress(0, 0, 0), "=ROW()");
+ m_pDoc->SetString(ScAddress(0, 0, 0), u"=ROW()"_ustr);
const ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(0, 0, 0));
CPPUNIT_ASSERT(pFC);
CPPUNIT_ASSERT(!pFC->IsShared()); // single formula cell is never shared.
@@ -9853,7 +9796,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteRepeatOneFormula)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true);
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScDocument aClipDoc(SCDOCMODE_CLIP);
ScMarkData aMark(m_pDoc->GetSheetLimits());
@@ -9867,7 +9810,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteRepeatOneFormula)
// Insert a formula in C1.
ScAddress aPos(2, 0, 0); // C1
- m_pDoc->SetString(aPos, "=SUM(A1:B1)");
+ m_pDoc->SetString(aPos, u"=SUM(A1:B1)"_ustr);
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(aPos));
// This check makes only sense if group listeners are activated.
@@ -9974,15 +9917,14 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteRepeatOneFormula)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteMixedReferenceFormula)
{
sc::AutoCalcSwitch aAC(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Insert value to C3
m_pDoc->SetValue(2, 2, 0, 1.0);
// Insert formula to A1 with mixed relative/absolute addressing.
- m_pDoc->SetString(0, 0, 0, "=SUM(B:$C)");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(B:$C)"),
- m_pDoc->GetFormula(0, 0, 0));
+ m_pDoc->SetString(0, 0, 0, u"=SUM(B:$C)"_ustr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(B:$C)"_ustr, m_pDoc->GetFormula(0, 0, 0));
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(0, 0, 0));
// Copy formula in A1 to clipboard.
@@ -9993,33 +9935,32 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteMixedReferenceFormula)
// Paste formula to B1.
aRange = ScAddress(1, 0, 0);
pasteFromClip(m_pDoc, aRange, &aClipDoc);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(C:$C)"),
- m_pDoc->GetFormula(1, 0, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(C:$C)"_ustr, m_pDoc->GetFormula(1, 0, 0));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(0, 0, 0));
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(1, 0, 0));
// Paste formula to C1. All three results now must be circular reference.
aRange = ScAddress(2, 0, 0);
pasteFromClip(m_pDoc, aRange, &aClipDoc);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM($C:D)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM($C:D)"_ustr,
m_pDoc->GetFormula(2, 0, 0)); // reference put in order
- CPPUNIT_ASSERT_EQUAL(OUString("Err:522"), m_pDoc->GetString(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Err:522"), m_pDoc->GetString(1, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Err:522"), m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Err:522"_ustr, m_pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Err:522"_ustr, m_pDoc->GetString(1, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Err:522"_ustr, m_pDoc->GetString(2, 0, 0));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteFormulas)
{
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
- m_pDoc->SetString(0, 0, 0, "=COLUMN($A$1)");
- m_pDoc->SetString(0, 1, 0, "=$A$1+B2");
- m_pDoc->SetString(0, 2, 0, "=$Sheet2.A1");
- m_pDoc->SetString(0, 3, 0, "=$Sheet2.$A$1");
- m_pDoc->SetString(0, 4, 0, "=$Sheet2.A$1");
+ m_pDoc->SetString(0, 0, 0, u"=COLUMN($A$1)"_ustr);
+ m_pDoc->SetString(0, 1, 0, u"=$A$1+B2"_ustr);
+ m_pDoc->SetString(0, 2, 0, u"=$Sheet2.A1"_ustr);
+ m_pDoc->SetString(0, 3, 0, u"=$Sheet2.$A$1"_ustr);
+ m_pDoc->SetString(0, 4, 0, u"=$Sheet2.A$1"_ustr);
// to prevent ScEditableTester in ScDocFunc::MoveBlock
ASSERT_DOUBLES_EQUAL(1.0, m_pDoc->GetValue(0, 0, 0));
@@ -10032,16 +9973,16 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteFormulas)
CPPUNIT_ASSERT(bMoveDone);
ASSERT_DOUBLES_EQUAL(1.0, m_pDoc->GetValue(10, 10, 0));
ASSERT_DOUBLES_EQUAL(1.0, m_pDoc->GetValue(10, 11, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("=COLUMN($A$1)"), m_pDoc->GetFormula(10, 10, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("=$A$1+L12"), m_pDoc->GetFormula(10, 11, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("=$Sheet2.K11"), m_pDoc->GetFormula(10, 12, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("=$Sheet2.$A$1"), m_pDoc->GetFormula(10, 13, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("=$Sheet2.K$1"), m_pDoc->GetFormula(10, 14, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=COLUMN($A$1)"_ustr, m_pDoc->GetFormula(10, 10, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=$A$1+L12"_ustr, m_pDoc->GetFormula(10, 11, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=$Sheet2.K11"_ustr, m_pDoc->GetFormula(10, 12, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=$Sheet2.$A$1"_ustr, m_pDoc->GetFormula(10, 13, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=$Sheet2.K$1"_ustr, m_pDoc->GetFormula(10, 14, 0));
}
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteFormulasExternalDoc)
{
- SfxMedium* pMedium = new SfxMedium("file:///source.fake", StreamMode::STD_READWRITE);
+ SfxMedium* pMedium = new SfxMedium(u"file:///source.fake"_ustr, StreamMode::STD_READWRITE);
m_xDocShell->DoLoad(pMedium);
ScDocShellRef xExtDocSh = new ScDocShell;
@@ -10052,18 +9993,18 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteFormulasExternalDoc)
findLoadedDocShellByName(aExtDocName) != nullptr);
ScDocument& rExtDoc = xExtDocSh->GetDocument();
- rExtDoc.InsertTab(0, "ExtSheet1");
- rExtDoc.InsertTab(1, "ExtSheet2");
+ rExtDoc.InsertTab(0, u"ExtSheet1"_ustr);
+ rExtDoc.InsertTab(1, u"ExtSheet2"_ustr);
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
- m_pDoc->SetString(0, 0, 0, "=COLUMN($A$1)");
- m_pDoc->SetString(0, 1, 0, "=$A$1+B2");
- m_pDoc->SetString(0, 2, 0, "=$Sheet2.A1");
- m_pDoc->SetString(0, 3, 0, "=$Sheet2.$A$1");
- m_pDoc->SetString(0, 4, 0, "=$Sheet2.A$1");
- m_pDoc->SetString(0, 5, 0, "=$Sheet1.$A$1");
+ m_pDoc->SetString(0, 0, 0, u"=COLUMN($A$1)"_ustr);
+ m_pDoc->SetString(0, 1, 0, u"=$A$1+B2"_ustr);
+ m_pDoc->SetString(0, 2, 0, u"=$Sheet2.A1"_ustr);
+ m_pDoc->SetString(0, 3, 0, u"=$Sheet2.$A$1"_ustr);
+ m_pDoc->SetString(0, 4, 0, u"=$Sheet2.A$1"_ustr);
+ m_pDoc->SetString(0, 5, 0, u"=$Sheet1.$A$1"_ustr);
ScRange aRange(0, 0, 0, 0, 5, 0);
ScClipParam aClipParam(aRange, false);
@@ -10079,41 +10020,41 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteFormulasExternalDoc)
OUString aFormula = rExtDoc.GetFormula(1, 1, 1);
//adjust absolute refs pointing to the copy area
- CPPUNIT_ASSERT_EQUAL(OUString("=COLUMN($B$2)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=COLUMN($B$2)"_ustr, aFormula);
aFormula = rExtDoc.GetFormula(1, 2, 1);
//adjust absolute refs and keep relative refs
- CPPUNIT_ASSERT_EQUAL(OUString("=$B$2+C3"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=$B$2+C3"_ustr, aFormula);
aFormula = rExtDoc.GetFormula(1, 3, 1);
// make absolute sheet refs external refs
- CPPUNIT_ASSERT_EQUAL(OUString("='file:///source.fake'#$Sheet2.B2"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"='file:///source.fake'#$Sheet2.B2"_ustr, aFormula);
aFormula = rExtDoc.GetFormula(1, 4, 1);
- CPPUNIT_ASSERT_EQUAL(OUString("='file:///source.fake'#$Sheet2.$A$1"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"='file:///source.fake'#$Sheet2.$A$1"_ustr, aFormula);
aFormula = rExtDoc.GetFormula(1, 5, 1);
- CPPUNIT_ASSERT_EQUAL(OUString("='file:///source.fake'#$Sheet2.B$1"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"='file:///source.fake'#$Sheet2.B$1"_ustr, aFormula);
aFormula = rExtDoc.GetFormula(1, 6, 1);
- CPPUNIT_ASSERT_EQUAL(OUString("=$ExtSheet2.$B$2"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=$ExtSheet2.$B$2"_ustr, aFormula);
xExtDocSh->DoClose();
}
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteReferencesExternalDoc)
{
- SfxMedium* pMedium = new SfxMedium("file:///source.fake", StreamMode::STD_READWRITE);
+ SfxMedium* pMedium = new SfxMedium(u"file:///source.fake"_ustr, StreamMode::STD_READWRITE);
m_xDocShell->DoLoad(pMedium);
ScDocShellRef xExtDocSh = new ScDocShell;
- OUString aExtDocName("file:///extdata.fake");
+ OUString aExtDocName(u"file:///extdata.fake"_ustr);
SfxMedium* pMed = new SfxMedium(aExtDocName, StreamMode::STD_READWRITE);
xExtDocSh->DoLoad(pMed);
CPPUNIT_ASSERT_MESSAGE("external document instance not loaded.",
findLoadedDocShellByName(aExtDocName) != nullptr);
ScDocument& rExtDoc = xExtDocSh->GetDocument();
- rExtDoc.InsertTab(0, "ExtSheet1");
+ rExtDoc.InsertTab(0, u"ExtSheet1"_ustr);
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
- m_pDoc->SetString(0, 5, 0, "=SUM($Sheet1.A1:A5)");
+ m_pDoc->SetString(0, 5, 0, u"=SUM($Sheet1.A1:A5)"_ustr);
ScRange aRange(0, 2, 0, 0, 5, 0);
ScClipParam aClipParam(aRange, false);
@@ -10129,7 +10070,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteReferencesExternalDoc)
OUString aFormula = rExtDoc.GetFormula(0, 3, 0);
//adjust absolute refs pointing to the copy area
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM('file:///source.fake'#$Sheet1.A#REF!:A3)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM('file:///source.fake'#$Sheet1.A#REF!:A3)"_ustr, aFormula);
xExtDocSh->DoClose();
}
@@ -10137,10 +10078,10 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteReferencesExternalDoc)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf68976)
{
const SCTAB nTab = 0;
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
m_pDoc->SetValue(0, 0, nTab, 1.0); // A1
- m_pDoc->SetString(0, 1, nTab, "=$A$1"); // A2
+ m_pDoc->SetString(0, 1, nTab, u"=$A$1"_ustr); // A2
m_pDoc->SetValue(0, 2, nTab, 1000.0); // A3
// Cut A3 to the clip document.
@@ -10167,8 +10108,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf68976)
// Without the fix in place, this would have failed with
// - Expected: =$A$1
// - Actual : =$B$4
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=$A$1"),
- m_pDoc->GetFormula(0, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=$A$1"_ustr, m_pDoc->GetFormula(0, 1, nTab));
// Without the fix in place, this would have failed with
// - Expected: 1
// - Actual : 1000
@@ -10180,10 +10120,10 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf68976)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf71058)
{
const SCTAB nTab = 0;
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
- m_pDoc->SetString(2, 2, nTab, "=C4"); // C3
- m_pDoc->SetString(3, 2, nTab, "=D4"); // D3
+ m_pDoc->SetString(2, 2, nTab, u"=C4"_ustr); // C3
+ m_pDoc->SetString(3, 2, nTab, u"=D4"_ustr); // D3
m_pDoc->SetValue(2, 3, nTab, 1.0); // C4
m_pDoc->SetValue(3, 3, nTab, 2.0); // D4
@@ -10215,7 +10155,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf71058)
// Without the fix in place, this would have failed with
// - Expected: =E6
// - Actual : =C4
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=E6"), m_pDoc->GetFormula(2, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=E6"_ustr, m_pDoc->GetFormula(2, 2, nTab));
// Without the fix in place, this would have failed with
// - Expected: 1
// - Actual : 0
@@ -10224,7 +10164,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf71058)
// Without the fix in place, this would have failed with
// - Expected: =E7
// - Actual : =D4
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=E7"), m_pDoc->GetFormula(3, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=E7"_ustr, m_pDoc->GetFormula(3, 2, nTab));
// Without the fix in place, this would have failed with
// - Expected: 2
// - Actual : 0
@@ -10234,7 +10174,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf71058)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf149554)
{
const SCTAB nTab = 0;
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
// Cut C4:C5 to the clip document.
ScDocument aClipDoc(SCDOCMODE_CLIP);
@@ -10261,7 +10201,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf149554)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixData)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
m_pDoc->SetValue(ScAddress(1, 0, 0), 2.0); // B1
m_pDoc->SetValue(ScAddress(0, 1, 0), 3.0); // A2
@@ -10320,7 +10260,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataAsLinkTdf116413)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
const SCTAB nTab = 0;
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
// Scenario 1: Past "As Link" and "Add" operation (as described in tdf#116413)
m_pDoc->SetValue(0, 0, nTab, 1.0); // A1
@@ -10344,7 +10284,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataAsLinkTdf116413)
// Test precondition
CPPUNIT_ASSERT_EQUAL(1001.0, m_pDoc->GetValue(0, 1, nTab)); // A2
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$A$1)"), m_pDoc->GetFormula(0, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$A$1)"_ustr, m_pDoc->GetFormula(0, 1, nTab));
// Change A1 from 1.0 to 2.0 (auto calculation is triggered)
m_pDoc->SetValue(0, 0, nTab, 2.0); // A1
@@ -10353,7 +10293,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataAsLinkTdf116413)
// - Expected: =1002
// - Actual : =1001
CPPUNIT_ASSERT_EQUAL(1002.0, m_pDoc->GetValue(0, 1, nTab)); // A2
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$A$1)"), m_pDoc->GetFormula(0, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$A$1)"_ustr, m_pDoc->GetFormula(0, 1, nTab));
// Clear everything and start over.
clearSheet(m_pDoc, nTab);
@@ -10361,7 +10301,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataAsLinkTdf116413)
clearSheet(&aMixDoc, nTab);
// Scenario 2: Like Scenario 1, but with a range (3 columns)
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
m_pDoc->SetValue(0, 0, nTab, 1.0); // A1
m_pDoc->SetValue(0, 1, nTab, 1000.0); // A2
@@ -10386,13 +10326,13 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataAsLinkTdf116413)
// Test precondition
CPPUNIT_ASSERT_EQUAL(1001.0, m_pDoc->GetValue(0, 1, nTab)); // A2
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$A$1)"), m_pDoc->GetFormula(0, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$A$1)"_ustr, m_pDoc->GetFormula(0, 1, nTab));
CPPUNIT_ASSERT_EQUAL(1001.0, m_pDoc->GetValue(1, 1, nTab)); // B2
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$B$1)"), m_pDoc->GetFormula(1, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$B$1)"_ustr, m_pDoc->GetFormula(1, 1, nTab));
CPPUNIT_ASSERT_EQUAL(1001.0, m_pDoc->GetValue(2, 1, nTab)); // C2
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$C$1)"), m_pDoc->GetFormula(2, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$C$1)"_ustr, m_pDoc->GetFormula(2, 1, nTab));
// Change A1:C1 from 1.0 to 2.0 (auto calculation is triggered)
m_pDoc->SetValue(0, 0, nTab, 2.0); // A1
@@ -10403,16 +10343,16 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataAsLinkTdf116413)
// - Expected: =1002
// - Actual : =1001
CPPUNIT_ASSERT_EQUAL(1002.0, m_pDoc->GetValue(0, 1, nTab)); // A2
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$A$1)"), m_pDoc->GetFormula(0, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$A$1)"_ustr, m_pDoc->GetFormula(0, 1, nTab));
CPPUNIT_ASSERT_EQUAL(1002.0, m_pDoc->GetValue(1, 1, nTab)); // B2
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$B$1)"), m_pDoc->GetFormula(1, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$B$1)"_ustr, m_pDoc->GetFormula(1, 1, nTab));
CPPUNIT_ASSERT_EQUAL(1002.0, m_pDoc->GetValue(2, 1, nTab)); // C2
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$C$1)"), m_pDoc->GetFormula(2, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$C$1)"_ustr, m_pDoc->GetFormula(2, 1, nTab));
// Scenario 3: Like Scenario 2, but transposed
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
m_pDoc->SetValue(0, 0, nTab, 1.0); // A1
m_pDoc->SetValue(1, 0, nTab, 1000.0); // B1
@@ -10437,13 +10377,13 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataAsLinkTdf116413)
// Test precondition
CPPUNIT_ASSERT_EQUAL(1001.0, m_pDoc->GetValue(1, 0, nTab)); // B1
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$A$1)"), m_pDoc->GetFormula(1, 0, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$A$1)"_ustr, m_pDoc->GetFormula(1, 0, nTab));
CPPUNIT_ASSERT_EQUAL(1001.0, m_pDoc->GetValue(1, 1, nTab)); // B2
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$A$2)"), m_pDoc->GetFormula(1, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$A$2)"_ustr, m_pDoc->GetFormula(1, 1, nTab));
CPPUNIT_ASSERT_EQUAL(1001.0, m_pDoc->GetValue(1, 2, nTab)); // B3
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$A$3)"), m_pDoc->GetFormula(1, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$A$3)"_ustr, m_pDoc->GetFormula(1, 2, nTab));
// Change A1:C1 from 1.0 to 2.0 (auto calculation is triggered)
m_pDoc->SetValue(0, 0, nTab, 2.0); // A1
@@ -10454,13 +10394,13 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataAsLinkTdf116413)
// - Expected: =1002
// - Actual : =1001
CPPUNIT_ASSERT_EQUAL(1002.0, m_pDoc->GetValue(1, 0, nTab)); // B1
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$A$1)"), m_pDoc->GetFormula(1, 0, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$A$1)"_ustr, m_pDoc->GetFormula(1, 0, nTab));
CPPUNIT_ASSERT_EQUAL(1002.0, m_pDoc->GetValue(1, 1, nTab)); // B2
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$A$2)"), m_pDoc->GetFormula(1, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$A$2)"_ustr, m_pDoc->GetFormula(1, 1, nTab));
CPPUNIT_ASSERT_EQUAL(1002.0, m_pDoc->GetValue(1, 2, nTab)); // B3
- CPPUNIT_ASSERT_EQUAL(OUString("=1000+($Test.$A$3)"), m_pDoc->GetFormula(1, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=1000+($Test.$A$3)"_ustr, m_pDoc->GetFormula(1, 2, nTab));
m_pDoc->DeleteTab(nTab);
}
@@ -10470,14 +10410,14 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataWithFormulaTdf116413)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
const SCTAB nTab = 0;
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
// Scenario 1: There is already a reference in destination cell
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
m_pDoc->SetValue(0, 0, nTab, 100.0); // A1
m_pDoc->SetValue(0, 1, nTab, 1.0); // A2
- m_pDoc->SetString(0, 2, nTab, "=A2"); // A3
+ m_pDoc->SetString(0, 2, nTab, u"=A2"_ustr); // A3
// Copy A1 to the clip document.
ScDocument aClipDoc(SCDOCMODE_CLIP);
@@ -10494,7 +10434,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataWithFormulaTdf116413)
// Test precondition
CPPUNIT_ASSERT_EQUAL(101.0, m_pDoc->GetValue(0, 2, nTab)); // A3
- CPPUNIT_ASSERT_EQUAL(OUString("=(A2)+100"), m_pDoc->GetFormula(0, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=(A2)+100"_ustr, m_pDoc->GetFormula(0, 2, nTab));
// Change A2 from 1.0 to 2.0 (auto calculation is triggered)
m_pDoc->SetValue(0, 1, nTab, 2.0); // A2
@@ -10503,7 +10443,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataWithFormulaTdf116413)
// - Expected: =102
// - Actual : =101
CPPUNIT_ASSERT_EQUAL(102.0, m_pDoc->GetValue(0, 2, nTab)); // A3
- CPPUNIT_ASSERT_EQUAL(OUString("=(A2)+100"), m_pDoc->GetFormula(0, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=(A2)+100"_ustr, m_pDoc->GetFormula(0, 2, nTab));
// Clear everything and start over.
clearSheet(m_pDoc, nTab);
@@ -10511,7 +10451,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataWithFormulaTdf116413)
clearSheet(&aMixDoc, nTab);
// Scenario 2: Similar to scenario 1, but a range of 4 cells and 2 of them have references
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
m_pDoc->SetValue(0, 0, nTab, 100.0); // A1
m_pDoc->SetValue(0, 1, nTab, 1.0); // A2
@@ -10519,11 +10459,11 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataWithFormulaTdf116413)
m_pDoc->SetValue(1, 0, nTab, 100.0); // B1
m_pDoc->SetValue(1, 1, nTab, 1.0); // B2
- m_pDoc->SetString(1, 2, nTab, "=B2"); // B3
+ m_pDoc->SetString(1, 2, nTab, u"=B2"_ustr); // B3
m_pDoc->SetValue(2, 0, nTab, 100.0); // C1
m_pDoc->SetValue(2, 1, nTab, 1.0); // C2
- m_pDoc->SetString(2, 2, nTab, "=C2"); // C3
+ m_pDoc->SetString(2, 2, nTab, u"=C2"_ustr); // C3
m_pDoc->SetValue(3, 0, nTab, 100.0); // D1
m_pDoc->SetValue(3, 1, nTab, 1.0); // D2
@@ -10545,10 +10485,10 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataWithFormulaTdf116413)
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(0, 2, nTab));
CPPUNIT_ASSERT_EQUAL(101.0, m_pDoc->GetValue(1, 2, nTab)); // B3
- CPPUNIT_ASSERT_EQUAL(OUString("=(B2)+100"), m_pDoc->GetFormula(1, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=(B2)+100"_ustr, m_pDoc->GetFormula(1, 2, nTab));
CPPUNIT_ASSERT_EQUAL(101.0, m_pDoc->GetValue(2, 2, nTab)); // C3
- CPPUNIT_ASSERT_EQUAL(OUString("=(C2)+100"), m_pDoc->GetFormula(2, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=(C2)+100"_ustr, m_pDoc->GetFormula(2, 2, nTab));
CPPUNIT_ASSERT_EQUAL(1100.0, m_pDoc->GetValue(3, 2, nTab)); // D3
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(3, 2, nTab));
@@ -10566,16 +10506,16 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataWithFormulaTdf116413)
// - Expected: =102
// - Actual : =101
CPPUNIT_ASSERT_EQUAL(102.0, m_pDoc->GetValue(1, 2, nTab)); // B3
- CPPUNIT_ASSERT_EQUAL(OUString("=(B2)+100"), m_pDoc->GetFormula(1, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=(B2)+100"_ustr, m_pDoc->GetFormula(1, 2, nTab));
CPPUNIT_ASSERT_EQUAL(102.0, m_pDoc->GetValue(2, 2, nTab)); // C3
- CPPUNIT_ASSERT_EQUAL(OUString("=(C2)+100"), m_pDoc->GetFormula(2, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=(C2)+100"_ustr, m_pDoc->GetFormula(2, 2, nTab));
CPPUNIT_ASSERT_EQUAL(1100.0, m_pDoc->GetValue(3, 2, nTab)); // D3
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(3, 2, nTab));
// Scenario 3: Similar to scenario 2, but transposed
- m_pDoc->InsertTab(nTab, "Test");
+ m_pDoc->InsertTab(nTab, u"Test"_ustr);
m_pDoc->SetValue(0, 0, nTab, 100.0); // A1
m_pDoc->SetValue(1, 0, nTab, 1.0); // B1
@@ -10583,11 +10523,11 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataWithFormulaTdf116413)
m_pDoc->SetValue(0, 1, nTab, 100.0); // A2
m_pDoc->SetValue(1, 1, nTab, 1.0); // B2
- m_pDoc->SetString(2, 1, nTab, "=B2"); // C2
+ m_pDoc->SetString(2, 1, nTab, u"=B2"_ustr); // C2
m_pDoc->SetValue(0, 2, nTab, 100.0); // A3
m_pDoc->SetValue(1, 2, nTab, 1.0); // B3
- m_pDoc->SetString(2, 2, nTab, "=B3"); // C3
+ m_pDoc->SetString(2, 2, nTab, u"=B3"_ustr); // C3
m_pDoc->SetValue(0, 3, nTab, 100.0); // A4
m_pDoc->SetValue(1, 3, nTab, 1.0); // B4
@@ -10609,10 +10549,10 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataWithFormulaTdf116413)
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(2, 0, nTab));
CPPUNIT_ASSERT_EQUAL(101.0, m_pDoc->GetValue(2, 1, nTab)); // C2
- CPPUNIT_ASSERT_EQUAL(OUString("=(B2)+100"), m_pDoc->GetFormula(2, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=(B2)+100"_ustr, m_pDoc->GetFormula(2, 1, nTab));
CPPUNIT_ASSERT_EQUAL(101.0, m_pDoc->GetValue(2, 2, nTab)); // C3
- CPPUNIT_ASSERT_EQUAL(OUString("=(B3)+100"), m_pDoc->GetFormula(2, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=(B3)+100"_ustr, m_pDoc->GetFormula(2, 2, nTab));
CPPUNIT_ASSERT_EQUAL(1100.0, m_pDoc->GetValue(2, 3, nTab)); // C4
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(2, 3, nTab));
@@ -10630,10 +10570,10 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataWithFormulaTdf116413)
// - Expected: =102
// - Actual : =101
CPPUNIT_ASSERT_EQUAL(102.0, m_pDoc->GetValue(2, 1, nTab)); // C2
- CPPUNIT_ASSERT_EQUAL(OUString("=(B2)+100"), m_pDoc->GetFormula(2, 1, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=(B2)+100"_ustr, m_pDoc->GetFormula(2, 1, nTab));
CPPUNIT_ASSERT_EQUAL(102.0, m_pDoc->GetValue(2, 2, nTab)); // C3
- CPPUNIT_ASSERT_EQUAL(OUString("=(B3)+100"), m_pDoc->GetFormula(2, 2, nTab));
+ CPPUNIT_ASSERT_EQUAL(u"=(B3)+100"_ustr, m_pDoc->GetFormula(2, 2, nTab));
CPPUNIT_ASSERT_EQUAL(1100.0, m_pDoc->GetValue(2, 3, nTab)); // C4
CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetFormula(2, 3, nTab));
@@ -10644,7 +10584,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataWithFormulaTdf116413)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteMatrixFormula)
{
// tdf#80137
- m_pDoc->InsertTab(0, "hcv");
+ m_pDoc->InsertTab(0, u"hcv"_ustr);
// Set Values to B1, C1, D1
m_pDoc->SetValue(ScAddress(1, 0, 0), 2.0); // B1
@@ -10652,9 +10592,9 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteMatrixFormula)
m_pDoc->SetValue(ScAddress(3, 0, 0), 3.0); // D1
// Set Values to B2, C2
- m_pDoc->SetString(ScAddress(1, 1, 0), "B2"); // B2
+ m_pDoc->SetString(ScAddress(1, 1, 0), u"B2"_ustr); // B2
//m_pDoc->SetString(ScAddress(2,1,0), "C2"); // C2
- m_pDoc->SetString(ScAddress(3, 1, 0), "D2"); // D2
+ m_pDoc->SetString(ScAddress(3, 1, 0), u"D2"_ustr); // D2
// Set Values to D3
//m_pDoc->SetValue(ScAddress(1,2,0), 9.0); // B3
@@ -10664,7 +10604,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteMatrixFormula)
// Insert matrix formula to A1
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(0, 0, 0, 0, aMark, "=COUNTIF(ISBLANK(B1:D1);TRUE())");
+ m_pDoc->InsertMatrixFormula(0, 0, 0, 0, aMark, u"=COUNTIF(ISBLANK(B1:D1);TRUE())"_ustr);
m_pDoc->CalcAll();
// A1 should contain 0
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(0, 0, 0))); // A1
@@ -10711,7 +10651,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteMatrixFormula)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testUndoBackgroundColor)
{
- m_pDoc->InsertTab(0, "Table1");
+ m_pDoc->InsertTab(0, u"Table1"_ustr);
ScDocument aClipDoc(SCDOCMODE_CLIP);
ScMarkData aMark(m_pDoc->GetSheetLimits());
@@ -10753,11 +10693,11 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testUndoBackgroundColor)
CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMergedHyperlink)
{
- m_pDoc->InsertTab(0, "Table1");
+ m_pDoc->InsertTab(0, u"Table1"_ustr);
m_pDoc->InitDrawLayer(m_xDocShell.get());
ScFieldEditEngine& pEE = m_pDoc->GetEditEngine();
- pEE.SetTextCurrentDefaults("https://libreoffice.org/");
+ pEE.SetTextCurrentDefaults(u"https://libreoffice.org/"_ustr);
m_pDoc->SetEditText(ScAddress(1, 0, 0), pEE.CreateTextObject()); // B1
m_pDoc->DoMergeContents(0, 0, 1, 0, 0); // A1:B1
@@ -10765,7 +10705,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMergedHyperlink)
CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, m_pDoc->GetCellType(ScAddress(0, 0, 0))); // A1
const EditTextObject* pEditObj = m_pDoc->GetEditText(ScAddress(0, 0, 0)); // A1
CPPUNIT_ASSERT(pEditObj);
- CPPUNIT_ASSERT_EQUAL(OUString("https://libreoffice.org/"), pEditObj->GetText(0));
+ CPPUNIT_ASSERT_EQUAL(u"https://libreoffice.org/"_ustr, pEditObj->GetText(0));
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/qa/unit/ucalc_datatransformation.cxx b/sc/qa/unit/ucalc_datatransformation.cxx
index 64fa91c399a5..bc3b9dc7cfc7 100644
--- a/sc/qa/unit/ucalc_datatransformation.cxx
+++ b/sc/qa/unit/ucalc_datatransformation.cxx
@@ -53,47 +53,47 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testColumnRemove)
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testColumnSplit)
{
- m_pDoc->SetString(2, 0, 0, "Test1,Test2");
- m_pDoc->SetString(2, 1, 0, "Test1,");
- m_pDoc->SetString(2, 2, 0, ",Test1");
- m_pDoc->SetString(2, 3, 0, "Test1,Test2,Test3");
- m_pDoc->SetString(3, 0, 0, "AnotherString");
+ m_pDoc->SetString(2, 0, 0, u"Test1,Test2"_ustr);
+ m_pDoc->SetString(2, 1, 0, u"Test1,"_ustr);
+ m_pDoc->SetString(2, 2, 0, u",Test1"_ustr);
+ m_pDoc->SetString(2, 3, 0, u"Test1,Test2,Test3"_ustr);
+ m_pDoc->SetString(3, 0, 0, u"AnotherString"_ustr);
sc::SplitColumnTransformation aTransform(2, ',');
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("AnotherString"), m_pDoc->GetString(4, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"AnotherString"_ustr, m_pDoc->GetString(4, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Test1"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Test1"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString(""), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Test1"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Test1"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Test1"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Test1"_ustr, m_pDoc->GetString(2, 3, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Test2"), m_pDoc->GetString(3, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString(""), m_pDoc->GetString(3, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Test1"), m_pDoc->GetString(3, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Test2,Test3"), m_pDoc->GetString(3, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Test2"_ustr, m_pDoc->GetString(3, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, m_pDoc->GetString(3, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Test1"_ustr, m_pDoc->GetString(3, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Test2,Test3"_ustr, m_pDoc->GetString(3, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testColumnMerge)
{
- m_pDoc->SetString(2, 0, 0, "Berlin");
- m_pDoc->SetString(2, 1, 0, "Brussels");
- m_pDoc->SetString(2, 2, 0, "Paris");
- m_pDoc->SetString(2, 3, 0, "Peking");
+ m_pDoc->SetString(2, 0, 0, u"Berlin"_ustr);
+ m_pDoc->SetString(2, 1, 0, u"Brussels"_ustr);
+ m_pDoc->SetString(2, 2, 0, u"Paris"_ustr);
+ m_pDoc->SetString(2, 3, 0, u"Peking"_ustr);
- m_pDoc->SetString(4, 0, 0, "Germany");
- m_pDoc->SetString(4, 1, 0, "Belgium");
- m_pDoc->SetString(4, 2, 0, "France");
- m_pDoc->SetString(4, 3, 0, "China");
+ m_pDoc->SetString(4, 0, 0, u"Germany"_ustr);
+ m_pDoc->SetString(4, 1, 0, u"Belgium"_ustr);
+ m_pDoc->SetString(4, 2, 0, u"France"_ustr);
+ m_pDoc->SetString(4, 3, 0, u"China"_ustr);
- sc::MergeColumnTransformation aTransform({2, 4}, ", ");
+ sc::MergeColumnTransformation aTransform({2, 4}, u", "_ustr);
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("Berlin, Germany"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Brussels, Belgium"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Paris, France"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Peking, China"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Berlin, Germany"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Brussels, Belgium"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Paris, France"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Peking, China"_ustr, m_pDoc->GetString(2, 3, 0));
for (SCROW nRow = 0; nRow <= 3; ++nRow)
{
@@ -103,64 +103,64 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testColumnMerge)
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testTextToLower)
{
- m_pDoc->SetString(2, 0, 0, "Berlin");
- m_pDoc->SetString(2, 1, 0, "Brussels");
- m_pDoc->SetString(2, 2, 0, "Paris");
- m_pDoc->SetString(2, 3, 0, "Peking");
+ m_pDoc->SetString(2, 0, 0, u"Berlin"_ustr);
+ m_pDoc->SetString(2, 1, 0, u"Brussels"_ustr);
+ m_pDoc->SetString(2, 2, 0, u"Paris"_ustr);
+ m_pDoc->SetString(2, 3, 0, u"Peking"_ustr);
sc::TextTransformation aTransform({2}, sc::TEXT_TRANSFORM_TYPE::TO_LOWER);
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("berlin"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("brussels"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("paris"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("peking"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"berlin"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"brussels"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"paris"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"peking"_ustr, m_pDoc->GetString(2, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testTextToUpper)
{
- m_pDoc->SetString(2, 0, 0, "Berlin");
- m_pDoc->SetString(2, 1, 0, "Brussels");
- m_pDoc->SetString(2, 2, 0, "Paris");
- m_pDoc->SetString(2, 3, 0, "Peking");
+ m_pDoc->SetString(2, 0, 0, u"Berlin"_ustr);
+ m_pDoc->SetString(2, 1, 0, u"Brussels"_ustr);
+ m_pDoc->SetString(2, 2, 0, u"Paris"_ustr);
+ m_pDoc->SetString(2, 3, 0, u"Peking"_ustr);
sc::TextTransformation aTransform({2}, sc::TEXT_TRANSFORM_TYPE::TO_UPPER);
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("BERLIN"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("BRUSSELS"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("PARIS"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("PEKING"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"BERLIN"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"BRUSSELS"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"PARIS"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"PEKING"_ustr, m_pDoc->GetString(2, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testTextCapitalize)
{
- m_pDoc->SetString(2, 0, 0, "hello woRlD");
- m_pDoc->SetString(2, 1, 0, "qUe vA");
- m_pDoc->SetString(2, 2, 0, "si tu la ves");
- m_pDoc->SetString(2, 3, 0, "cUaNdO mE EnAmOro");
+ m_pDoc->SetString(2, 0, 0, u"hello woRlD"_ustr);
+ m_pDoc->SetString(2, 1, 0, u"qUe vA"_ustr);
+ m_pDoc->SetString(2, 2, 0, u"si tu la ves"_ustr);
+ m_pDoc->SetString(2, 3, 0, u"cUaNdO mE EnAmOro"_ustr);
sc::TextTransformation aTransform({2}, sc::TEXT_TRANSFORM_TYPE::CAPITALIZE);
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("Hello World"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Que Va"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Si Tu La Ves"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Cuando Me Enamoro"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Hello World"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Que Va"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Si Tu La Ves"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Cuando Me Enamoro"_ustr, m_pDoc->GetString(2, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testTextTrim)
{
- m_pDoc->SetString(2, 0, 0, " Berlin");
- m_pDoc->SetString(2, 1, 0, "Brussels ");
- m_pDoc->SetString(2, 2, 0, " Paris ");
+ m_pDoc->SetString(2, 0, 0, u" Berlin"_ustr);
+ m_pDoc->SetString(2, 1, 0, u"Brussels "_ustr);
+ m_pDoc->SetString(2, 2, 0, u" Paris "_ustr);
sc::TextTransformation aTransform({2}, sc::TEXT_TRANSFORM_TYPE::TRIM);
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("Berlin"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Brussels"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Paris"), m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Berlin"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Brussels"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Paris"_ustr, m_pDoc->GetString(2, 2, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testAggregateSum)
@@ -310,7 +310,7 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberLogE)
CPPUNIT_ASSERT_DOUBLES_EQUAL(0, m_pDoc->GetValue(2, 0, 0), 1e-10);
CPPUNIT_ASSERT_DOUBLES_EQUAL(1.60943791243, m_pDoc->GetValue(2, 1, 0), 1e-10);
- CPPUNIT_ASSERT_EQUAL(OUString(""), m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, m_pDoc->GetString(2, 2, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(6.21460809842, m_pDoc->GetValue(2, 3, 0), 1e-10);
}
@@ -426,18 +426,18 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberSign)
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testReplaceNull)
{
- m_pDoc->SetString(2, 0, 0, "Berlin");
- m_pDoc->SetString(2, 1, 0, "");
- m_pDoc->SetString(2, 2, 0, "");
- m_pDoc->SetString(2, 3, 0, "Peking");
+ m_pDoc->SetString(2, 0, 0, u"Berlin"_ustr);
+ m_pDoc->SetString(2, 1, 0, u""_ustr);
+ m_pDoc->SetString(2, 2, 0, u""_ustr);
+ m_pDoc->SetString(2, 3, 0, u"Peking"_ustr);
- sc::ReplaceNullTransformation aTransform({2}, "Empty");
+ sc::ReplaceNullTransformation aTransform({2}, u"Empty"_ustr);
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("Berlin"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Empty"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Empty"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("Peking"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Berlin"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Empty"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Empty"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"Peking"_ustr, m_pDoc->GetString(2, 3, 0));
}
@@ -462,10 +462,10 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetDateString)
sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::DATE_STRING );
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("01/25/11"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("10/12/94"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("09/23/96"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("08/15/47"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"01/25/11"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"10/12/94"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"09/23/96"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"08/15/47"_ustr, m_pDoc->GetString(2, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetYear)
@@ -516,10 +516,10 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetStartOfYear)
sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::START_OF_YEAR );
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("01/01/11"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("01/01/94"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("01/01/96"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("01/01/47"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"01/01/11"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"01/01/94"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"01/01/96"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"01/01/47"_ustr, m_pDoc->GetString(2, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetEndOfYear)
@@ -543,10 +543,10 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetEndOfYear)
sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::END_OF_YEAR );
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("12/31/11"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("12/31/94"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("12/31/96"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("12/31/47"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"12/31/11"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"12/31/94"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"12/31/96"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"12/31/47"_ustr, m_pDoc->GetString(2, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetMonth)
@@ -597,10 +597,10 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetMonthName)
sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::MONTH_NAME);
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("January"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("October"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("September"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("August"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"January"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"October"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"September"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"August"_ustr, m_pDoc->GetString(2, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetStartOfMonth)
@@ -624,10 +624,10 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetStartOfMonth)
sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::START_OF_MONTH );
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("01/01/11"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("10/01/94"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("09/01/96"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("08/01/47"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"01/01/11"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"10/01/94"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"09/01/96"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"08/01/47"_ustr, m_pDoc->GetString(2, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetEndOfMonth)
@@ -651,10 +651,10 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetEndOfMonth)
sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::END_OF_MONTH );
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("01/31/11"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("10/31/94"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("09/30/96"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("08/31/47"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"01/31/11"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"10/31/94"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"09/30/96"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"08/31/47"_ustr, m_pDoc->GetString(2, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetDay)
@@ -786,10 +786,10 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetStartOfQuarter)
sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::START_OF_QUARTER );
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("01/01/11"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("10/01/94"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("07/01/96"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("07/01/47"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"01/01/11"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"10/01/94"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"07/01/96"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"07/01/47"_ustr, m_pDoc->GetString(2, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetEndOfQuarter)
@@ -813,10 +813,10 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetEndOfQuarter)
sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::END_OF_QUARTER );
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("03/31/11"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("12/31/94"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("09/30/96"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("09/30/47"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"03/31/11"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"12/31/94"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"09/30/96"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"09/30/47"_ustr, m_pDoc->GetString(2, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetTime)
@@ -834,10 +834,10 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetTime)
sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::TIME );
aTransform.Transform(*m_pDoc);
- CPPUNIT_ASSERT_EQUAL(OUString("05:30:12 AM"), m_pDoc->GetString(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("07:23:09 AM"), m_pDoc->GetString(2, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("09:34:40 AM"), m_pDoc->GetString(2, 2, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("10:09:49 PM"), m_pDoc->GetString(2, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"05:30:12 AM"_ustr, m_pDoc->GetString(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"07:23:09 AM"_ustr, m_pDoc->GetString(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"09:34:40 AM"_ustr, m_pDoc->GetString(2, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"10:09:49 PM"_ustr, m_pDoc->GetString(2, 3, 0));
}
CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetHour)
@@ -906,7 +906,7 @@ CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetSecond)
void ScDataTransformationTest::setUp()
{
ScUcalcTestBase::setUp();
- m_pDoc->InsertTab(0, "Tab");
+ m_pDoc->InsertTab(0, u"Tab"_ustr);
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 105c7e4a772d..dabd9c3808ad 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -47,25 +47,25 @@ void testFormulaRefUpdateNameCopySheetCheckTab( const ScDocument* pDoc, SCTAB nT
if (bCheckNames)
{
const ScRangeData* pName;
- pName = pDoc->GetRangeName(nTab)->findByUpperName("GLOBAL");
+ pName = pDoc->GetRangeName(nTab)->findByUpperName(u"GLOBAL"_ustr);
CPPUNIT_ASSERT_MESSAGE("Sheet-local name GLOBAL should exist", pName);
- pName = pDoc->GetRangeName(nTab)->findByUpperName("LOCAL");
+ pName = pDoc->GetRangeName(nTab)->findByUpperName(u"LOCAL"_ustr);
CPPUNIT_ASSERT_MESSAGE("Sheet-local name LOCAL should exist", pName);
- pName = pDoc->GetRangeName(nTab)->findByUpperName("GLOBAL_GLOBAL");
+ pName = pDoc->GetRangeName(nTab)->findByUpperName(u"GLOBAL_GLOBAL"_ustr);
CPPUNIT_ASSERT_MESSAGE("Sheet-local name GLOBAL_GLOBAL should exist", pName);
- pName = pDoc->GetRangeName(nTab)->findByUpperName("GLOBAL_LOCAL");
+ pName = pDoc->GetRangeName(nTab)->findByUpperName(u"GLOBAL_LOCAL"_ustr);
CPPUNIT_ASSERT_MESSAGE("Sheet-local name GLOBAL_LOCAL should exist", pName);
- pName = pDoc->GetRangeName(nTab)->findByUpperName("GLOBAL_UNUSED");
+ pName = pDoc->GetRangeName(nTab)->findByUpperName(u"GLOBAL_UNUSED"_ustr);
CPPUNIT_ASSERT_MESSAGE("Sheet-local name GLOBAL_UNUSED should exist", pName);
- pName = pDoc->GetRangeName(nTab)->findByUpperName("GLOBAL_UNUSED_NOREF");
+ pName = pDoc->GetRangeName(nTab)->findByUpperName(u"GLOBAL_UNUSED_NOREF"_ustr);
CPPUNIT_ASSERT_MESSAGE("Sheet-local name GLOBAL_UNUSED_NOREF should not exist", !pName);
- pName = pDoc->GetRangeName(nTab)->findByUpperName("LOCAL_GLOBAL");
+ pName = pDoc->GetRangeName(nTab)->findByUpperName(u"LOCAL_GLOBAL"_ustr);
CPPUNIT_ASSERT_MESSAGE("Sheet-local name LOCAL_GLOBAL should exist", pName);
- pName = pDoc->GetRangeName(nTab)->findByUpperName("LOCAL_LOCAL");
+ pName = pDoc->GetRangeName(nTab)->findByUpperName(u"LOCAL_LOCAL"_ustr);
CPPUNIT_ASSERT_MESSAGE("Sheet-local name LOCAL_LOCAL should exist", pName);
- pName = pDoc->GetRangeName(nTab)->findByUpperName("LOCAL_UNUSED");
+ pName = pDoc->GetRangeName(nTab)->findByUpperName(u"LOCAL_UNUSED"_ustr);
CPPUNIT_ASSERT_MESSAGE("Sheet-local name LOCAL_UNUSED should exist", pName);
- pName = pDoc->GetRangeName(nTab)->findByUpperName("LOCAL_UNUSED_NOREF");
+ pName = pDoc->GetRangeName(nTab)->findByUpperName(u"LOCAL_UNUSED_NOREF"_ustr);
CPPUNIT_ASSERT_MESSAGE("Sheet-local name LOCAL_UNUSED_NOREF should exist", pName);
}
@@ -96,10 +96,10 @@ class TestFormula : public ScUcalcTestBase
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCreateStringFromTokens)
{
// Insert sheets.
- m_pDoc->InsertTab(0, "Test");
- m_pDoc->InsertTab(1, "Kevin's Data");
- m_pDoc->InsertTab(2, "Past Data");
- m_pDoc->InsertTab(3, "2013");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
+ m_pDoc->InsertTab(1, u"Kevin's Data"_ustr);
+ m_pDoc->InsertTab(2, u"Past Data"_ustr);
+ m_pDoc->InsertTab(3, u"2013"_ustr);
// Insert named ranges.
static const struct {
@@ -256,8 +256,8 @@ bool equals( const formula::VectorRefArray& rArray, size_t nPos, const OUString&
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaParseReference)
{
- OUString aTab1("90's Music"), aTab2("90's and 70's"), aTab3("All Others"), aTab4("NoQuote");
- m_pDoc->InsertTab(0, "Dummy"); // just to shift the sheet indices...
+ OUString aTab1(u"90's Music"_ustr), aTab2(u"90's and 70's"_ustr), aTab3(u"All Others"_ustr), aTab4(u"NoQuote"_ustr);
+ m_pDoc->InsertTab(0, u"Dummy"_ustr); // just to shift the sheet indices...
m_pDoc->InsertTab(1, aTab1); // name with a single quote.
m_pDoc->InsertTab(2, aTab2); // name with 2 single quotes.
m_pDoc->InsertTab(3, aTab3); // name without single quotes.
@@ -292,28 +292,28 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaParseReference)
ScAddress aPos;
ScAddress::ExternalInfo aExtInfo;
- ScRefFlags nRes = aPos.Parse("'90''s Music'.D10", *m_pDoc, formula::FormulaGrammar::CONV_OOO, &aExtInfo);
+ ScRefFlags nRes = aPos.Parse(u"'90''s Music'.D10"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO, &aExtInfo);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(1), aPos.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(3), aPos.Col());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(9), aPos.Row());
CPPUNIT_ASSERT_MESSAGE("This is not an external address.", !aExtInfo.mbExternal);
- nRes = aPos.Parse("'90''s and 70''s'.C100", *m_pDoc, formula::FormulaGrammar::CONV_OOO, &aExtInfo);
+ nRes = aPos.Parse(u"'90''s and 70''s'.C100"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO, &aExtInfo);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(2), aPos.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(2), aPos.Col());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(99), aPos.Row());
CPPUNIT_ASSERT_MESSAGE("This is not an external address.", !aExtInfo.mbExternal);
- nRes = aPos.Parse("'All Others'.B3", *m_pDoc, formula::FormulaGrammar::CONV_OOO, &aExtInfo);
+ nRes = aPos.Parse(u"'All Others'.B3"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO, &aExtInfo);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(3), aPos.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aPos.Col());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(2), aPos.Row());
CPPUNIT_ASSERT_MESSAGE("This is not an external address.", !aExtInfo.mbExternal);
- nRes = aPos.Parse("NoQuote.E13", *m_pDoc, formula::FormulaGrammar::CONV_OOO, &aExtInfo);
+ nRes = aPos.Parse(u"NoQuote.E13"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO, &aExtInfo);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(4), aPos.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(4), aPos.Col());
@@ -323,47 +323,47 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaParseReference)
ScRange aRange;
aRange.aStart.SetTab(0);
- nRes = aRange.Parse(":B", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u":B"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("B:", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u"B:"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse(":B2", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u":B2"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("B2:", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u"B2:"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse(":2", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u":2"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("2:", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u"2:"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse(":2B", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u":2B"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("2B:", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u"2B:"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("abc_foo:abc_bar", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u"abc_foo:abc_bar"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("B1:B2~C1", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u"B1:B2~C1"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("B:B", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u"B:B"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aStart.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aRange.aStart.Col());
@@ -381,7 +381,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaParseReference)
static_cast<sal_uInt16>(nRes & (ScRefFlags::ROW_ABS | ScRefFlags::ROW2_ABS)));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("2:2", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u"2:2"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aStart.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(0), aRange.aStart.Col());
@@ -398,7 +398,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaParseReference)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(ScRefFlags::COL_ABS | ScRefFlags::COL2_ABS),
static_cast<sal_uInt16>(nRes & (ScRefFlags::COL_ABS | ScRefFlags::COL2_ABS)));
- nRes = aRange.Parse("NoQuote.B:C", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(u"NoQuote.B:C"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(4), aRange.aStart.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aRange.aStart.Col());
@@ -417,8 +417,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaParseReference)
// Both rows at sheet bounds and relative => convert to absolute => entire column reference.
aRange.aStart.SetTab(0);
- nRes = aRange.Parse(m_pDoc->MaxRow() == MAXROW ? OUString("B1:B1048576")
- : OUString("B1:B16777216"),
+ nRes = aRange.Parse(m_pDoc->MaxRow() == MAXROW ? u"B1:B1048576"_ustr
+ : u"B1:B16777216"_ustr,
*m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aStart.Tab());
@@ -532,7 +532,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaParseReference)
CPPUNIT_TEST_FIXTURE(TestFormula, testFetchVectorRefArray)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// All numeric cells in Column A.
m_pDoc->SetValue(ScAddress(0,0,0), 1);
@@ -561,32 +561,32 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFetchVectorRefArray)
// only to be compared case-insensitively. Right now, we use upper cased
// strings to achieve case-insensitive-ness, but that may change. So,
// don't count on that.
- m_pDoc->SetString(ScAddress(1,0,0), "Andy");
- m_pDoc->SetString(ScAddress(1,1,0), "Bruce");
- m_pDoc->SetString(ScAddress(1,2,0), "Charlie");
- m_pDoc->SetString(ScAddress(1,3,0), "David");
+ m_pDoc->SetString(ScAddress(1,0,0), u"Andy"_ustr);
+ m_pDoc->SetString(ScAddress(1,1,0), u"Bruce"_ustr);
+ m_pDoc->SetString(ScAddress(1,2,0), u"Charlie"_ustr);
+ m_pDoc->SetString(ScAddress(1,3,0), u"David"_ustr);
aArray = m_pDoc->FetchVectorRefArray(ScAddress(1,0,0), 5);
CPPUNIT_ASSERT_MESSAGE("Failed to fetch vector ref array.", aArray.isValid());
CPPUNIT_ASSERT_MESSAGE("Array is expected to be string cells only.", !aArray.mpNumericArray);
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 0, "Andy"));
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 1, "Bruce"));
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 2, "Charlie"));
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 3, "David"));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 0, u"Andy"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 1, u"Bruce"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 2, u"Charlie"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 3, u"David"_ustr));
CPPUNIT_ASSERT_MESSAGE("This should be empty.", isEmpty(aArray, 4));
// Mixture of numeric, string, and empty cells in Column C.
- m_pDoc->SetString(ScAddress(2,0,0), "Header");
+ m_pDoc->SetString(ScAddress(2,0,0), u"Header"_ustr);
m_pDoc->SetValue(ScAddress(2,1,0), 11);
m_pDoc->SetValue(ScAddress(2,2,0), 12);
m_pDoc->SetValue(ScAddress(2,3,0), 13);
- m_pDoc->SetString(ScAddress(2,5,0), "=SUM(C2:C4)");
+ m_pDoc->SetString(ScAddress(2,5,0), u"=SUM(C2:C4)"_ustr);
m_pDoc->CalcAll();
aArray = m_pDoc->FetchVectorRefArray(ScAddress(2,0,0), 7);
CPPUNIT_ASSERT_MESSAGE("Failed to fetch vector ref array.", aArray.isValid());
CPPUNIT_ASSERT_MESSAGE("Array should have both numeric and string arrays.", aArray.mpNumericArray);
CPPUNIT_ASSERT_MESSAGE("Array should have both numeric and string arrays.", aArray.mpStringArray);
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 0, "Header"));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 0, u"Header"_ustr));
CPPUNIT_ASSERT_MESSAGE("Unexpected numeric cell.", equals(aArray, 1, 11));
CPPUNIT_ASSERT_MESSAGE("Unexpected numeric cell.", equals(aArray, 2, 12));
CPPUNIT_ASSERT_MESSAGE("Unexpected numeric cell.", equals(aArray, 3, 13));
@@ -596,12 +596,12 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFetchVectorRefArray)
// Mixed type again in Column D, but it starts with a numeric cell.
m_pDoc->SetValue(ScAddress(3,0,0), 10);
- m_pDoc->SetString(ScAddress(3,1,0), "Below 10");
+ m_pDoc->SetString(ScAddress(3,1,0), u"Below 10"_ustr);
// Leave 2 empty cells.
m_pDoc->SetValue(ScAddress(3,4,0), 11);
- m_pDoc->SetString(ScAddress(3,5,0), "=12");
- m_pDoc->SetString(ScAddress(3,6,0), "=13");
- m_pDoc->SetString(ScAddress(3,7,0), "=CONCATENATE(\"A\";\"B\";\"C\")");
+ m_pDoc->SetString(ScAddress(3,5,0), u"=12"_ustr);
+ m_pDoc->SetString(ScAddress(3,6,0), u"=13"_ustr);
+ m_pDoc->SetString(ScAddress(3,7,0), u"=CONCATENATE(\"A\";\"B\";\"C\")"_ustr);
m_pDoc->CalcAll();
aArray = m_pDoc->FetchVectorRefArray(ScAddress(3,0,0), 8);
@@ -609,21 +609,21 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFetchVectorRefArray)
CPPUNIT_ASSERT_MESSAGE("Array should have both numeric and string arrays.", aArray.mpNumericArray);
CPPUNIT_ASSERT_MESSAGE("Array should have both numeric and string arrays.", aArray.mpStringArray);
CPPUNIT_ASSERT_MESSAGE("Unexpected numeric cell.", equals(aArray, 0, 10));
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 1, "Below 10"));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 1, u"Below 10"_ustr));
CPPUNIT_ASSERT_MESSAGE("This should be empty.", isEmpty(aArray, 2));
CPPUNIT_ASSERT_MESSAGE("This should be empty.", isEmpty(aArray, 3));
CPPUNIT_ASSERT_MESSAGE("Unexpected numeric cell.", equals(aArray, 4, 11));
CPPUNIT_ASSERT_MESSAGE("Unexpected numeric cell.", equals(aArray, 5, 12));
CPPUNIT_ASSERT_MESSAGE("Unexpected numeric cell.", equals(aArray, 6, 13));
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 7, "ABC"));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 7, u"ABC"_ustr));
// Column E consists of formula cells whose results are all numeric.
for (SCROW i = 0; i <= 6; ++i)
- m_pDoc->SetString(ScAddress(4,i,0), "=ROW()");
+ m_pDoc->SetString(ScAddress(4,i,0), u"=ROW()"_ustr);
m_pDoc->CalcAll();
// Leave row 7 empty.
- m_pDoc->SetString(ScAddress(4,8,0), "Andy");
+ m_pDoc->SetString(ScAddress(4,8,0), u"Andy"_ustr);
m_pDoc->SetValue(ScAddress(4,9,0), 123);
// This array fits within a single formula block.
@@ -650,7 +650,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFetchVectorRefArray)
CPPUNIT_ASSERT_MESSAGE("Unexpected numeric cell.", equals(aArray, 5, 6));
CPPUNIT_ASSERT_MESSAGE("Unexpected numeric cell.", equals(aArray, 6, 7));
CPPUNIT_ASSERT_MESSAGE("This should be empty.", isEmpty(aArray, 7));
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 8, "Andy"));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 8, u"Andy"_ustr));
CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 9, 123));
CPPUNIT_ASSERT_MESSAGE("This should be empty.", isEmpty(aArray, 10));
@@ -665,7 +665,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFetchVectorRefArray)
// Column F begins with empty rows at the top.
m_pDoc->SetValue(ScAddress(5,2,0), 1.1);
m_pDoc->SetValue(ScAddress(5,3,0), 1.2);
- m_pDoc->SetString(ScAddress(5,4,0), "=2*8");
+ m_pDoc->SetString(ScAddress(5,4,0), u"=2*8"_ustr);
m_pDoc->CalcAll();
aArray = m_pDoc->FetchVectorRefArray(ScAddress(5,2,0), 4);
@@ -704,36 +704,36 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFetchVectorRefArray)
CPPUNIT_ASSERT_MESSAGE("Array should NOT have a string array.", !aArray.mpStringArray);
// Column G consists only of strings.
- m_pDoc->SetString(ScAddress(6,0,0), "Title");
- m_pDoc->SetString(ScAddress(6,1,0), "foo");
- m_pDoc->SetString(ScAddress(6,2,0), "bar");
- m_pDoc->SetString(ScAddress(6,3,0), "foo");
- m_pDoc->SetString(ScAddress(6,4,0), "baz");
- m_pDoc->SetString(ScAddress(6,5,0), "quack");
- m_pDoc->SetString(ScAddress(6,6,0), "beep");
- m_pDoc->SetString(ScAddress(6,7,0), "kerker");
+ m_pDoc->SetString(ScAddress(6,0,0), u"Title"_ustr);
+ m_pDoc->SetString(ScAddress(6,1,0), u"foo"_ustr);
+ m_pDoc->SetString(ScAddress(6,2,0), u"bar"_ustr);
+ m_pDoc->SetString(ScAddress(6,3,0), u"foo"_ustr);
+ m_pDoc->SetString(ScAddress(6,4,0), u"baz"_ustr);
+ m_pDoc->SetString(ScAddress(6,5,0), u"quack"_ustr);
+ m_pDoc->SetString(ScAddress(6,6,0), u"beep"_ustr);
+ m_pDoc->SetString(ScAddress(6,7,0), u"kerker"_ustr);
aArray = m_pDoc->FetchVectorRefArray(ScAddress(6,1,0), 4); // G2:G5
CPPUNIT_ASSERT_MESSAGE("Failed to fetch vector ref array.", aArray.isValid());
CPPUNIT_ASSERT_MESSAGE("Array should NOT have a numeric array.", !aArray.mpNumericArray);
CPPUNIT_ASSERT_MESSAGE("Array should have a string array.", aArray.mpStringArray);
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 0, "foo"));
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 1, "bar"));
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 2, "foo"));
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 3, "baz"));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 0, u"foo"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 1, u"bar"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 2, u"foo"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 3, u"baz"_ustr));
aArray = m_pDoc->FetchVectorRefArray(ScAddress(6,2,0), 4); // G3:G6
CPPUNIT_ASSERT_MESSAGE("Failed to fetch vector ref array.", aArray.isValid());
CPPUNIT_ASSERT_MESSAGE("Array should NOT have a numeric array.", !aArray.mpNumericArray);
CPPUNIT_ASSERT_MESSAGE("Array should have a string array.", aArray.mpStringArray);
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 0, "bar"));
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 1, "foo"));
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 2, "baz"));
- CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 3, "quack"));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 0, u"bar"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 1, u"foo"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 2, u"baz"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 3, u"quack"_ustr));
// Column H starts with formula cells.
for (SCROW i = 0; i < 10; ++i)
- m_pDoc->SetString(ScAddress(7,i,0), "=ROW()");
+ m_pDoc->SetString(ScAddress(7,i,0), u"=ROW()"_ustr);
m_pDoc->CalcAll();
aArray = m_pDoc->FetchVectorRefArray(ScAddress(7,3,0), 3); // H4:H6
@@ -763,7 +763,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFetchVectorRefArray)
CPPUNIT_ASSERT(std::isnan(aArray.mpNumericArray[2]));
// Totally empty range in a non-empty column (Column B).
- m_pDoc->SetString(ScAddress(1,10,0), "Some text"); // B11
+ m_pDoc->SetString(ScAddress(1,10,0), u"Some text"_ustr); // B11
aArray = m_pDoc->FetchVectorRefArray(ScAddress(1,0,0), 3); // B1:B3
CPPUNIT_ASSERT_MESSAGE("Array should have a numeric array.", aArray.mpNumericArray);
CPPUNIT_ASSERT_MESSAGE("Array should NOT have a string array.", !aArray.mpStringArray);
@@ -787,7 +787,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFetchVectorRefArray)
CPPUNIT_ASSERT(std::isnan(aArray.mpNumericArray[2]));
// The column begins with a string header at row 1 (Column C).
- m_pDoc->SetString(ScAddress(2,0,0), "MyHeader");
+ m_pDoc->SetString(ScAddress(2,0,0), u"MyHeader"_ustr);
for (SCROW i = 1; i <= 9; ++i) // rows 2-10 are numeric.
m_pDoc->SetValue(ScAddress(2,i,0), i);
@@ -800,7 +800,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFetchVectorRefArray)
// The column begins with a number, followed by a string then followed by
// a block of numbers (Column D).
m_pDoc->SetValue(ScAddress(3,0,0), 0.0);
- m_pDoc->SetString(ScAddress(3,1,0), "Some string");
+ m_pDoc->SetString(ScAddress(3,1,0), u"Some string"_ustr);
for (SCROW i = 2; i <= 9; ++i) // rows 3-10 are numeric.
m_pDoc->SetValue(ScAddress(3,i,0), i);
@@ -812,8 +812,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFetchVectorRefArray)
// The column begins with a formula, followed by a string then followed by
// a block of numbers (Column E).
- m_pDoc->SetString(ScAddress(4,0,0), "=1*2");
- m_pDoc->SetString(ScAddress(4,1,0), "Some string");
+ m_pDoc->SetString(ScAddress(4,0,0), u"=1*2"_ustr);
+ m_pDoc->SetString(ScAddress(4,1,0), u"Some string"_ustr);
for (SCROW i = 2; i <= 9; ++i) // rows 3-10 are numeric.
m_pDoc->SetValue(ScAddress(4,i,0), i*2);
@@ -828,8 +828,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFetchVectorRefArray)
CPPUNIT_TEST_FIXTURE(TestFormula, testGroupConverter3D)
{
- m_pDoc->InsertTab(0, "Test");
- m_pDoc->InsertTab(1, "Test2");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
+ m_pDoc->InsertTab(1, u"Test2"_ustr);
m_pDoc->SetValue(1, 0, 0, 1.0);
m_pDoc->SetValue(1, 0, 1, 2.0);
@@ -981,7 +981,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerJumpReordering)
{
// Compile formula string first.
- std::unique_ptr<ScTokenArray> pCode(compileFormula(m_pDoc, "=IF(B1;12;\"text\")"));
+ std::unique_ptr<ScTokenArray> pCode(compileFormula(m_pDoc, u"=IF(B1;12;\"text\")"_ustr));
CPPUNIT_ASSERT(pCode);
// Then generate RPN tokens.
@@ -1049,7 +1049,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection2Param)
bool bEndColRel; // SumRange-EndCol
};
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
{
@@ -1059,7 +1059,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection2Param)
// Sumrange is single cell, address is abs
{
- OUString("=SUMIF($B$2:$B$10;F2;$D$5)"),
+ u"=SUMIF($B$2:$B$10;F2;$D$5)"_ustr,
ScAddress(7, 5, 0),
ScRange( ScAddress(3, 4, 0), ScAddress(3, 12, 0) ),
false,
@@ -1068,7 +1068,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection2Param)
// Sumrange is single cell, address is relative
{
- OUString("=SUMIF($B$2:$B$10;F2;D5)"),
+ u"=SUMIF($B$2:$B$10;F2;D5)"_ustr,
ScAddress(7, 5, 0),
ScRange( ScAddress(3, 4, 0), ScAddress(3, 12, 0) ),
true,
@@ -1077,7 +1077,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection2Param)
// Baserange(abs,abs), Sumrange(abs,abs)
{
- OUString("=SUMIF($B$2:$B$10;F2;$D$5:$D$10)"),
+ u"=SUMIF($B$2:$B$10;F2;$D$5:$D$10)"_ustr,
ScAddress(7, 5, 0),
ScRange( ScAddress(3, 4, 0), ScAddress(3, 12, 0) ),
false,
@@ -1086,7 +1086,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection2Param)
// Baserange(abs,rel), Sumrange(abs,abs)
{
- OUString("=SUMIF($B$2:B10;F2;$D$5:$D$10)"),
+ u"=SUMIF($B$2:B10;F2;$D$5:$D$10)"_ustr,
ScAddress(7, 5, 0),
ScRange( ScAddress(3, 4, 0), ScAddress(3, 12, 0) ),
false,
@@ -1095,7 +1095,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection2Param)
// Baserange(rel,abs), Sumrange(abs,abs)
{
- OUString("=SUMIF(B2:$B$10;F2;$D$5:$D$10)"),
+ u"=SUMIF(B2:$B$10;F2;$D$5:$D$10)"_ustr,
ScAddress(7, 5, 0),
ScRange( ScAddress(3, 4, 0), ScAddress(3, 12, 0) ),
false,
@@ -1104,7 +1104,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection2Param)
// Baserange(rel,rel), Sumrange(abs,abs)
{
- OUString("=SUMIF(B2:B10;F2;$D$5:$D$10)"),
+ u"=SUMIF(B2:B10;F2;$D$5:$D$10)"_ustr,
ScAddress(7, 5, 0),
ScRange( ScAddress(3, 4, 0), ScAddress(3, 12, 0) ),
false,
@@ -1113,7 +1113,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection2Param)
// Baserange(abs,abs), Sumrange(abs,rel)
{
- OUString("=SUMIF($B$2:$B$10;F2;$D$5:D10)"),
+ u"=SUMIF($B$2:$B$10;F2;$D$5:D10)"_ustr,
ScAddress(7, 5, 0),
ScRange( ScAddress(3, 4, 0), ScAddress(3, 12, 0) ),
false,
@@ -1122,7 +1122,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection2Param)
// Baserange(abs,abs), Sumrange(rel,abs)
{
- OUString("=SUMIF($B$2:$B$10;F2;D5:$D$10)"),
+ u"=SUMIF($B$2:$B$10;F2;D5:$D$10)"_ustr,
ScAddress(7, 5, 0),
ScRange( ScAddress(3, 4, 0), ScAddress(3, 12, 0) ),
true,
@@ -1131,7 +1131,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection2Param)
// Baserange(abs,abs), Sumrange(rel,rel)
{
- OUString("=SUMIF($B$2:$B$10;F2;D5:D10)"),
+ u"=SUMIF($B$2:$B$10;F2;D5:D10)"_ustr,
ScAddress(7, 5, 0),
ScRange( ScAddress(3, 4, 0), ScAddress(3, 12, 0) ),
true,
@@ -1174,7 +1174,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection1ParamN
bool bForcedArray;
};
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
{
@@ -1182,31 +1182,31 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection1ParamN
TestCaseFormulaNoChange aCasesNoChange[] =
{
{
- OUString("=COS(A$2:A$100)"), // No change because of abs col ref.
+ u"=COS(A$2:A$100)"_ustr, // No change because of abs col ref.
aStartAddr,
false,
false
},
{
- OUString("=COS($A7:$A100)"), // No intersection
+ u"=COS($A7:$A100)"_ustr, // No intersection
aStartAddr,
false,
false
},
{
- OUString("=COS($A5:$C7)"), // No intersection 2-D range
+ u"=COS($A5:$C7)"_ustr, // No intersection 2-D range
aStartAddr,
false,
false
},
{
- OUString("=SUMPRODUCT(COS(A6:A10))"), // COS() in forced array mode
+ u"=SUMPRODUCT(COS(A6:A10))"_ustr, // COS() in forced array mode
aStartAddr,
false,
true
},
{
- OUString("=COS(A6:A10)"), // Matrix formula
+ u"=COS(A6:A10)"_ustr, // Matrix formula
aStartAddr,
true,
false
@@ -1270,8 +1270,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection1ParamW
ScAddress aArgAddr;
};
- m_pDoc->InsertTab(0, "Formula");
- m_pDoc->InsertTab(1, "Formula1");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
+ m_pDoc->InsertTab(1, u"Formula1"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
{
@@ -1279,42 +1279,42 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection1ParamW
TestCaseFormula aCasesWithChange[] =
{
{
- OUString("=COS($A6:$A100)"), // Corner case with intersection
+ u"=COS($A6:$A100)"_ustr, // Corner case with intersection
aStartAddr,
ScAddress(0, 5, 0)
},
{
- OUString("=COS($A2:$A6)"), // Corner case with intersection
+ u"=COS($A2:$A6)"_ustr, // Corner case with intersection
aStartAddr,
ScAddress(0, 5, 0)
},
{
- OUString("=COS($A2:$A100)"), // Typical 1D case
+ u"=COS($A2:$A100)"_ustr, // Typical 1D case
aStartAddr,
ScAddress(0, 5, 0)
},
{
- OUString("=COS($Formula.$A1:$C3)"), // 2D corner case
+ u"=COS($Formula.$A1:$C3)"_ustr, // 2D corner case
ScAddress(0, 0, 1), // Formula in sheet 1
ScAddress(0, 0, 0)
},
{
- OUString("=COS($Formula.$A1:$C3)"), // 2D corner case
+ u"=COS($Formula.$A1:$C3)"_ustr, // 2D corner case
ScAddress(0, 2, 1), // Formula in sheet 1
ScAddress(0, 2, 0)
},
{
- OUString("=COS($Formula.$A1:$C3)"), // 2D corner case
+ u"=COS($Formula.$A1:$C3)"_ustr, // 2D corner case
ScAddress(2, 0, 1), // Formula in sheet 1
ScAddress(2, 0, 0)
},
{
- OUString("=COS($Formula.$A1:$C3)"), // 2D corner case
+ u"=COS($Formula.$A1:$C3)"_ustr, // 2D corner case
ScAddress(2, 2, 1), // Formula in sheet 1
ScAddress(2, 2, 0)
},
{
- OUString("=COS($Formula.$A1:$C3)"), // Typical 2D case
+ u"=COS($Formula.$A1:$C3)"_ustr, // Typical 2D case
ScAddress(1, 1, 1), // Formula in sheet 1
ScAddress(1, 1, 0)
}
@@ -1344,17 +1344,17 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection1ParamW
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersection1NoGroup)
{
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->SetString(ScAddress(1,2,0), "=COS(A1:A5)"); // B3
- m_pDoc->SetString(ScAddress(1,3,0), "=COS(A1:A5)"); // B4
+ m_pDoc->SetString(ScAddress(1,2,0), u"=COS(A1:A5)"_ustr); // B3
+ m_pDoc->SetString(ScAddress(1,3,0), u"=COS(A1:A5)"_ustr); // B4
// Implicit intersection optimization in ScCompiler::HandleIIOpCode() internally changes
// these to "=COS(A3)" and "=COS(A4)", but these shouldn't be merged into a formula group,
// otherwise B4's formula would then be "=COS(A2:A6)".
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Formula in B3 has changed.", OUString("=COS(A1:A5)"), m_pDoc->GetFormula(1,2,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Formula in B4 has changed.", OUString("=COS(A1:A5)"), m_pDoc->GetFormula(1,3,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Formula in B3 has changed.", u"=COS(A1:A5)"_ustr, m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Formula in B4 has changed.", u"=COS(A1:A5)"_ustr, m_pDoc->GetFormula(1,3,0));
m_pDoc->DeleteTab(0);
}
@@ -1367,7 +1367,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersectionOperato
double result[3];
};
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
m_pDoc->SetValue(2, 0, 0, 5); // C1
@@ -1379,8 +1379,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersectionOperato
TestCase tests[] =
{
- { OUString("=C:C/D:D"), OUString("=C:C/D:D"), OUString("=C:C/D:D"), 5, 2, 1 },
- { OUString("=C1:C2/D1:D2"), OUString("=C2:C3/D2:D3"), OUString("=C3:C4/D3:D4"), 5, 2, 1 }
+ { u"=C:C/D:D"_ustr, u"=C:C/D:D"_ustr, u"=C:C/D:D"_ustr, 5, 2, 1 },
+ { u"=C1:C2/D1:D2"_ustr, u"=C2:C3/D2:D3"_ustr, u"=C3:C4/D3:D4"_ustr, 5, 2, 1 }
};
for (const TestCase& test : tests)
@@ -1397,7 +1397,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaCompilerImplicitIntersectionOperato
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaAnnotateTrimOnDoubleRefs)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
constexpr sal_Int32 nCols = 2;
@@ -1435,35 +1435,35 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaAnnotateTrimOnDoubleRefs)
constexpr sal_Int32 nTestCases = 5;
TestCase aTestCases[nTestCases] = {
{
- "=SUM(IF($C$1=A:A;B:B)/10*D1)",
+ u"=SUM(IF($C$1=A:A;B:B)/10*D1)"_ustr,
ScRange(0, 0, 0, 0, 1048575, 0),
45.0,
true
},
{
- "=SUM(IF(A:A=5;B:B)/10*D1)",
+ u"=SUM(IF(A:A=5;B:B)/10*D1)"_ustr,
ScRange(0, 0, 0, 0, 1048575, 0),
60.0,
true
},
{
- "=SUM(IF($C$1=A:A;B:B;B:B)/10*D1)", // IF has else clause
+ u"=SUM(IF($C$1=A:A;B:B;B:B)/10*D1)"_ustr, // IF has else clause
ScRange(-1, -1, -1, -1, -1, -1), // Has no trimmable double-ref.
140.0,
true
},
{
- "=SUM(IF($C$1=A:A;B:B)/10*D1)",
+ u"=SUM(IF($C$1=A:A;B:B)/10*D1)"_ustr,
ScRange(-1, -1, -1, -1, -1, -1), // Has no trimmable double-ref.
25,
false // Not in matrix mode.
},
{
- "=SUMPRODUCT(A:A=$C$1; 1-(A:A=$C$1))",
+ u"=SUMPRODUCT(A:A=$C$1; 1-(A:A=$C$1))"_ustr,
ScRange(-1, -1, -1, -1, -1, -1), // Has no trimmable double-ref.
0.0,
false // Not in matrix mode.
@@ -1507,91 +1507,91 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaAnnotateTrimOnDoubleRefs)
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdate)
{
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
m_pDoc->SetValue(ScAddress(0,0,0), 2.0); // A1
- m_pDoc->SetString(ScAddress(2,2,0), "=A1"); // C3
- m_pDoc->SetString(ScAddress(2,3,0), "=$A$1"); // C4
+ m_pDoc->SetString(ScAddress(2,2,0), u"=A1"_ustr); // C3
+ m_pDoc->SetString(ScAddress(2,3,0), u"=$A$1"_ustr); // C4
ScAddress aPos(2,2,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", OUString("=A1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", u"=A1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(2,3,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C4.", OUString("=$A$1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C4.", u"=$A$1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Delete row 2 to push formula cells up (to C2:C3).
m_pDoc->DeleteRow(ScRange(0,1,0,m_pDoc->MaxCol(),1,0));
aPos = ScAddress(2,1,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C2.", OUString("=A1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C2.", u"=A1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(2,2,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", OUString("=$A$1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", u"=$A$1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Insert one row at row 2 to move them back.
m_pDoc->InsertRow(ScRange(0,1,0,m_pDoc->MaxCol(),1,0));
aPos = ScAddress(2,2,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", OUString("=A1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", u"=A1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(2,3,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C4.", OUString("=$A$1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C4.", u"=$A$1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Insert 2 rows at row 1 to shift all of A1 and C3:C4 down.
m_pDoc->InsertRow(ScRange(0,0,0,m_pDoc->MaxCol(),1,0));
aPos = ScAddress(2,4,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C5.", OUString("=A3"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C5.", u"=A3"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(2,5,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C6.", OUString("=$A$3"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C6.", u"=$A$3"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Delete 2 rows at row 1 to shift them back.
m_pDoc->DeleteRow(ScRange(0,0,0,m_pDoc->MaxCol(),1,0));
aPos = ScAddress(2,2,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", OUString("=A1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", u"=A1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(2,3,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C4.", OUString("=$A$1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C4.", u"=$A$1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Insert 3 columns at column B. to shift C3:C4 to F3:F4.
m_pDoc->InsertCol(ScRange(1,0,0,3,m_pDoc->MaxRow(),0));
aPos = ScAddress(5,2,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in F3.", OUString("=A1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in F3.", u"=A1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(5,3,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in F4.", OUString("=$A$1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in F4.", u"=$A$1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Delete columns B:D to shift them back.
m_pDoc->DeleteCol(ScRange(1,0,0,3,m_pDoc->MaxRow(),0));
aPos = ScAddress(2,2,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", OUString("=A1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", u"=A1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(2,3,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C4.", OUString("=$A$1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C4.", u"=$A$1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Insert cells over A1:A3 to only shift A1 down to A4.
m_pDoc->InsertRow(ScRange(0,0,0,0,2,0));
aPos = ScAddress(2,2,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", OUString("=A4"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", u"=A4"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(2,3,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C4.", OUString("=$A$4"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C4.", u"=$A$4"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// .. and back.
m_pDoc->DeleteRow(ScRange(0,0,0,0,2,0));
aPos = ScAddress(2,2,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", OUString("=A1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C3.", u"=A1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(2,3,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C4.", OUString("=$A$1"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C4.", u"=$A$1"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Delete row 1 which will delete the value cell (A1).
m_pDoc->DeleteRow(ScRange(0,0,0,m_pDoc->MaxCol(),0,0));
@@ -1616,68 +1616,68 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdate)
m_pDoc->SetValue(ScAddress(2,1,0), 3);
m_pDoc->SetValue(ScAddress(2,2,0), 4);
- m_pDoc->SetString(ScAddress(0,5,0), "=SUM(B2:C3)");
- m_pDoc->SetString(ScAddress(0,6,0), "=SUM($B$2:$C$3)");
+ m_pDoc->SetString(ScAddress(0,5,0), u"=SUM(B2:C3)"_ustr);
+ m_pDoc->SetString(ScAddress(0,6,0), u"=SUM($B$2:$C$3)"_ustr);
aPos = ScAddress(0,5,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM(B2:C3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM(B2:C3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(0,6,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", OUString("=SUM($B$2:$C$3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", u"=SUM($B$2:$C$3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Insert a row at row 1.
m_pDoc->InsertRow(ScRange(0,0,0,m_pDoc->MaxCol(),0,0));
aPos = ScAddress(0,6,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", OUString("=SUM(B3:C4)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", u"=SUM(B3:C4)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(0,7,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A8.", OUString("=SUM($B$3:$C$4)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A8.", u"=SUM($B$3:$C$4)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// ... and back.
m_pDoc->DeleteRow(ScRange(0,0,0,m_pDoc->MaxCol(),0,0));
aPos = ScAddress(0,5,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM(B2:C3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM(B2:C3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(0,6,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", OUString("=SUM($B$2:$C$3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", u"=SUM($B$2:$C$3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Insert columns B:C to shift only the value range.
m_pDoc->InsertCol(ScRange(1,0,0,2,m_pDoc->MaxRow(),0));
aPos = ScAddress(0,5,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM(D2:E3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM(D2:E3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(0,6,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", OUString("=SUM($D$2:$E$3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", u"=SUM($D$2:$E$3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// ... and back.
m_pDoc->DeleteCol(ScRange(1,0,0,2,m_pDoc->MaxRow(),0));
aPos = ScAddress(0,5,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM(B2:C3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM(B2:C3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(0,6,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", OUString("=SUM($B$2:$C$3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", u"=SUM($B$2:$C$3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Insert rows 5:6 to shift the formula cells only.
m_pDoc->InsertRow(ScRange(0,4,0,m_pDoc->MaxCol(),5,0));
aPos = ScAddress(0,7,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A8.", OUString("=SUM(B2:C3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A8.", u"=SUM(B2:C3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(0,8,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A9.", OUString("=SUM($B$2:$C$3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A9.", u"=SUM($B$2:$C$3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// ... and back.
m_pDoc->DeleteRow(ScRange(0,4,0,m_pDoc->MaxCol(),5,0));
aPos = ScAddress(0,5,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM(B2:C3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM(B2:C3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos = ScAddress(0,6,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", OUString("=SUM($B$2:$C$3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", u"=SUM($B$2:$C$3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Check the values of the formula cells in A6:A7.
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(0,5,0)));
@@ -1714,7 +1714,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdate)
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
{
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
@@ -1731,12 +1731,12 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
m_pDoc->SetValue(ScAddress(2,4,0), 8);
// Set formula cells to A7 and A8.
- m_pDoc->SetString(ScAddress(0,6,0), "=SUM(B2:C5)");
- m_pDoc->SetString(ScAddress(0,7,0), "=SUM($B$2:$C$5)");
+ m_pDoc->SetString(ScAddress(0,6,0), u"=SUM(B2:C5)"_ustr);
+ m_pDoc->SetString(ScAddress(0,7,0), u"=SUM($B$2:$C$5)"_ustr);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", OUString("=SUM(B2:C5)"), m_pDoc->GetFormula(0,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", u"=SUM(B2:C5)"_ustr, m_pDoc->GetFormula(0,6,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A8.", OUString("=SUM($B$2:$C$5)"), m_pDoc->GetFormula(0,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A8.", u"=SUM($B$2:$C$5)"_ustr, m_pDoc->GetFormula(0,7,0));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(ScAddress(0,6,0)));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(ScAddress(0,7,0)));
@@ -1744,9 +1744,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
// Delete row 3. This should shrink the range references by one row.
m_pDoc->DeleteRow(ScRange(0,2,0,m_pDoc->MaxCol(),2,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM(B2:C4)"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM(B2:C4)"_ustr, m_pDoc->GetFormula(0,5,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", OUString("=SUM($B$2:$C$4)"), m_pDoc->GetFormula(0,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", u"=SUM($B$2:$C$4)"_ustr, m_pDoc->GetFormula(0,6,0));
CPPUNIT_ASSERT_EQUAL(28.0, m_pDoc->GetValue(ScAddress(0,5,0)));
CPPUNIT_ASSERT_EQUAL(28.0, m_pDoc->GetValue(ScAddress(0,6,0)));
@@ -1754,9 +1754,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
// Delete row 4 - bottom of range
m_pDoc->DeleteRow(ScRange(0,3,0,m_pDoc->MaxCol(),3,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", OUString("=SUM(B2:C3)"), m_pDoc->GetFormula(0,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", u"=SUM(B2:C3)"_ustr, m_pDoc->GetFormula(0,4,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM($B$2:$C$3)"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM($B$2:$C$3)"_ustr, m_pDoc->GetFormula(0,5,0));
CPPUNIT_ASSERT_EQUAL(16.0, m_pDoc->GetValue(ScAddress(0,4,0)));
CPPUNIT_ASSERT_EQUAL(16.0, m_pDoc->GetValue(ScAddress(0,5,0)));
@@ -1764,9 +1764,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
// Delete row 2 - top of range
m_pDoc->DeleteRow(ScRange(0,1,0,m_pDoc->MaxCol(),1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A4.", OUString("=SUM(B2:C2)"), m_pDoc->GetFormula(0,3,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A4.", u"=SUM(B2:C2)"_ustr, m_pDoc->GetFormula(0,3,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", OUString("=SUM($B$2:$C$2)"), m_pDoc->GetFormula(0,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", u"=SUM($B$2:$C$2)"_ustr, m_pDoc->GetFormula(0,4,0));
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(0,3,0)));
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(0,4,0)));
@@ -1785,12 +1785,12 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
m_pDoc->SetValue(ScAddress(5,2,0), 8);
// Set formulas to A2 and A3.
- m_pDoc->SetString(ScAddress(0,1,0), "=SUM(C2:F3)");
- m_pDoc->SetString(ScAddress(0,2,0), "=SUM($C$2:$F$3)");
+ m_pDoc->SetString(ScAddress(0,1,0), u"=SUM(C2:F3)"_ustr);
+ m_pDoc->SetString(ScAddress(0,2,0), u"=SUM($C$2:$F$3)"_ustr);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", OUString("=SUM(C2:F3)"), m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", u"=SUM(C2:F3)"_ustr, m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", OUString("=SUM($C$2:$F$3)"), m_pDoc->GetFormula(0,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", u"=SUM($C$2:$F$3)"_ustr, m_pDoc->GetFormula(0,2,0));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(ScAddress(0,2,0)));
@@ -1798,9 +1798,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
// Delete column D.
m_pDoc->DeleteCol(ScRange(3,0,0,3,m_pDoc->MaxRow(),0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", OUString("=SUM(C2:E3)"), m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", u"=SUM(C2:E3)"_ustr, m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", OUString("=SUM($C$2:$E$3)"), m_pDoc->GetFormula(0,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", u"=SUM($C$2:$E$3)"_ustr, m_pDoc->GetFormula(0,2,0));
CPPUNIT_ASSERT_EQUAL(28.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(28.0, m_pDoc->GetValue(ScAddress(0,2,0)));
@@ -1808,9 +1808,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
// Delete column E - the right edge of reference range.
m_pDoc->DeleteCol(ScRange(4,0,0,4,m_pDoc->MaxRow(),0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", OUString("=SUM(C2:D3)"), m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", u"=SUM(C2:D3)"_ustr, m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", OUString("=SUM($C$2:$D$3)"), m_pDoc->GetFormula(0,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", u"=SUM($C$2:$D$3)"_ustr, m_pDoc->GetFormula(0,2,0));
CPPUNIT_ASSERT_EQUAL(16.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(16.0, m_pDoc->GetValue(ScAddress(0,2,0)));
@@ -1818,9 +1818,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
// Delete column C - the left edge of reference range.
m_pDoc->DeleteCol(ScRange(2,0,0,2,m_pDoc->MaxRow(),0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", OUString("=SUM(C2:C3)"), m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", u"=SUM(C2:C3)"_ustr, m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", OUString("=SUM($C$2:$C$3)"), m_pDoc->GetFormula(0,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", u"=SUM($C$2:$C$3)"_ustr, m_pDoc->GetFormula(0,2,0));
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(0,2,0)));
@@ -1838,61 +1838,61 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
m_pDoc->SetValue(ScAddress(3,2,0), 4);
// Set formulas at A5 and A6.
- m_pDoc->SetString(ScAddress(0,4,0), "=SUM(C2:D3)");
- m_pDoc->SetString(ScAddress(0,5,0), "=SUM($C$2:$D$3)");
+ m_pDoc->SetString(ScAddress(0,4,0), u"=SUM(C2:D3)"_ustr);
+ m_pDoc->SetString(ScAddress(0,5,0), u"=SUM($C$2:$D$3)"_ustr);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", OUString("=SUM(C2:D3)"), m_pDoc->GetFormula(0,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", u"=SUM(C2:D3)"_ustr, m_pDoc->GetFormula(0,4,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM($C$2:$D$3)"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM($C$2:$D$3)"_ustr, m_pDoc->GetFormula(0,5,0));
// Insert a column at column C. This should simply shift the reference without expansion.
m_pDoc->InsertCol(ScRange(2,0,0,2,m_pDoc->MaxRow(),0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", OUString("=SUM(D2:E3)"), m_pDoc->GetFormula(0,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", u"=SUM(D2:E3)"_ustr, m_pDoc->GetFormula(0,4,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM($D$2:$E$3)"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM($D$2:$E$3)"_ustr, m_pDoc->GetFormula(0,5,0));
// Shift it back.
m_pDoc->DeleteCol(ScRange(2,0,0,2,m_pDoc->MaxRow(),0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", OUString("=SUM(C2:D3)"), m_pDoc->GetFormula(0,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", u"=SUM(C2:D3)"_ustr, m_pDoc->GetFormula(0,4,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM($C$2:$D$3)"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM($C$2:$D$3)"_ustr, m_pDoc->GetFormula(0,5,0));
// Insert at column D. This should expand the reference by one column length.
m_pDoc->InsertCol(ScRange(3,0,0,3,m_pDoc->MaxRow(),0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", OUString("=SUM(C2:E3)"), m_pDoc->GetFormula(0,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", u"=SUM(C2:E3)"_ustr, m_pDoc->GetFormula(0,4,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM($C$2:$E$3)"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM($C$2:$E$3)"_ustr, m_pDoc->GetFormula(0,5,0));
// Insert at column F. No expansion should occur since the edge expansion is turned off.
m_pDoc->InsertCol(ScRange(5,0,0,5,m_pDoc->MaxRow(),0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", OUString("=SUM(C2:E3)"), m_pDoc->GetFormula(0,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", u"=SUM(C2:E3)"_ustr, m_pDoc->GetFormula(0,4,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM($C$2:$E$3)"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM($C$2:$E$3)"_ustr, m_pDoc->GetFormula(0,5,0));
// Insert at row 2. No expansion should occur with edge expansion turned off.
m_pDoc->InsertRow(ScRange(0,1,0,m_pDoc->MaxCol(),1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=SUM(C3:E4)"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=SUM(C3:E4)"_ustr, m_pDoc->GetFormula(0,5,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", OUString("=SUM($C$3:$E$4)"), m_pDoc->GetFormula(0,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", u"=SUM($C$3:$E$4)"_ustr, m_pDoc->GetFormula(0,6,0));
// Insert at row 4 to expand the reference range.
m_pDoc->InsertRow(ScRange(0,3,0,m_pDoc->MaxCol(),3,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", OUString("=SUM(C3:E5)"), m_pDoc->GetFormula(0,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A7.", u"=SUM(C3:E5)"_ustr, m_pDoc->GetFormula(0,6,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A8.", OUString("=SUM($C$3:$E$5)"), m_pDoc->GetFormula(0,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A8.", u"=SUM($C$3:$E$5)"_ustr, m_pDoc->GetFormula(0,7,0));
// Insert at row 6. No expansion with edge expansion turned off.
m_pDoc->InsertRow(ScRange(0,5,0,m_pDoc->MaxCol(),5,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A8.", OUString("=SUM(C3:E5)"), m_pDoc->GetFormula(0,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A8.", u"=SUM(C3:E5)"_ustr, m_pDoc->GetFormula(0,7,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A9.", OUString("=SUM($C$3:$E$5)"), m_pDoc->GetFormula(0,8,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A9.", u"=SUM($C$3:$E$5)"_ustr, m_pDoc->GetFormula(0,8,0));
// Clear the range and start over.
clearRange(m_pDoc, ScRange(0,0,0,20,20,0));
@@ -1907,80 +1907,80 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
m_pDoc->SetValue(ScAddress(3,6,0), 4);
// Set formulas at A2 and A3.
- m_pDoc->SetString(ScAddress(0,1,0), "=SUM(C6:D7)");
- m_pDoc->SetString(ScAddress(0,2,0), "=SUM($C$6:$D$7)");
+ m_pDoc->SetString(ScAddress(0,1,0), u"=SUM(C6:D7)"_ustr);
+ m_pDoc->SetString(ScAddress(0,2,0), u"=SUM($C$6:$D$7)"_ustr);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", OUString("=SUM(C6:D7)"), m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", u"=SUM(C6:D7)"_ustr, m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", OUString("=SUM($C$6:$D$7)"), m_pDoc->GetFormula(0,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", u"=SUM($C$6:$D$7)"_ustr, m_pDoc->GetFormula(0,2,0));
// Insert at column E. This should expand the reference range by one column.
m_pDoc->InsertCol(ScRange(4,0,0,4,m_pDoc->MaxRow(),0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", OUString("=SUM(C6:E7)"), m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", u"=SUM(C6:E7)"_ustr, m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", OUString("=SUM($C$6:$E$7)"), m_pDoc->GetFormula(0,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", u"=SUM($C$6:$E$7)"_ustr, m_pDoc->GetFormula(0,2,0));
// Insert at column C to edge-expand the reference range.
m_pDoc->InsertCol(ScRange(2,0,0,2,m_pDoc->MaxRow(),0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", OUString("=SUM(C6:F7)"), m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", u"=SUM(C6:F7)"_ustr, m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", OUString("=SUM($C$6:$F$7)"), m_pDoc->GetFormula(0,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", u"=SUM($C$6:$F$7)"_ustr, m_pDoc->GetFormula(0,2,0));
// Insert at row 8 to edge-expand.
m_pDoc->InsertRow(ScRange(0,7,0,m_pDoc->MaxCol(),7,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", OUString("=SUM(C6:F8)"), m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", u"=SUM(C6:F8)"_ustr, m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", OUString("=SUM($C$6:$F$8)"), m_pDoc->GetFormula(0,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", u"=SUM($C$6:$F$8)"_ustr, m_pDoc->GetFormula(0,2,0));
// Insert at row 6 to edge-expand.
m_pDoc->InsertRow(ScRange(0,5,0,m_pDoc->MaxCol(),5,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", OUString("=SUM(C6:F9)"), m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A2.", u"=SUM(C6:F9)"_ustr, m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", OUString("=SUM($C$6:$F$9)"), m_pDoc->GetFormula(0,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A3.", u"=SUM($C$6:$F$9)"_ustr, m_pDoc->GetFormula(0,2,0));
- m_pDoc->InsertTab(1, "StickyRange");
+ m_pDoc->InsertTab(1, u"StickyRange"_ustr);
// A3:A18 all possible combinations of relative and absolute addressing,
// leaving one row above and below unreferenced.
ScAddress aPos(0,2,1);
- m_pDoc->SetString( aPos, "=B2:B1048575");
+ m_pDoc->SetString( aPos, u"=B2:B1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=B2:B$1048575");
+ m_pDoc->SetString( aPos, u"=B2:B$1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=B2:$B1048575");
+ m_pDoc->SetString( aPos, u"=B2:$B1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=B2:$B$1048575");
+ m_pDoc->SetString( aPos, u"=B2:$B$1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=B$2:B1048575");
+ m_pDoc->SetString( aPos, u"=B$2:B1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=B$2:B$1048575");
+ m_pDoc->SetString( aPos, u"=B$2:B$1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=B$2:$B1048575");
+ m_pDoc->SetString( aPos, u"=B$2:$B1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=B$2:$B$1048575");
+ m_pDoc->SetString( aPos, u"=B$2:$B$1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=$B2:B1048575");
+ m_pDoc->SetString( aPos, u"=$B2:B1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=$B2:B$1048575");
+ m_pDoc->SetString( aPos, u"=$B2:B$1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=$B2:$B1048575");
+ m_pDoc->SetString( aPos, u"=$B2:$B1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=$B2:$B$1048575");
+ m_pDoc->SetString( aPos, u"=$B2:$B$1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=$B$2:B1048575");
+ m_pDoc->SetString( aPos, u"=$B$2:B1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=$B$2:B$1048575");
+ m_pDoc->SetString( aPos, u"=$B$2:B$1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=$B$2:$B1048575");
+ m_pDoc->SetString( aPos, u"=$B$2:$B1048575"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=$B$2:$B$1048575");
+ m_pDoc->SetString( aPos, u"=$B$2:$B$1048575"_ustr);
aPos.IncRow();
// A19 reference to two cells on one row.
- m_pDoc->SetString( aPos, "=B1048575:C1048575");
+ m_pDoc->SetString( aPos, u"=B1048575:C1048575"_ustr);
aPos.IncRow();
// Insert 2 rows in the middle to shift bottom reference down and make it
@@ -1989,43 +1989,43 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
// A3:A18 must not result in #REF! anywhere.
aPos.Set(0,2,1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A3 after insertion.", OUString("=B2:B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A3 after insertion.", u"=B2:B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A4 after insertion.", OUString("=B2:B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A4 after insertion.", u"=B2:B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A5 after insertion.", OUString("=B2:$B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A5 after insertion.", u"=B2:$B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A6 after insertion.", OUString("=B2:$B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A6 after insertion.", u"=B2:$B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A7 after insertion.", OUString("=B$2:B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A7 after insertion.", u"=B$2:B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A8 after insertion.", OUString("=B$2:B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A8 after insertion.", u"=B$2:B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A9 after insertion.", OUString("=B$2:$B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A9 after insertion.", u"=B$2:$B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A10 after insertion.", OUString("=B$2:$B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A10 after insertion.", u"=B$2:$B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A11 after insertion.", OUString("=$B2:B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A11 after insertion.", u"=$B2:B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A12 after insertion.", OUString("=$B2:B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A12 after insertion.", u"=$B2:B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A13 after insertion.", OUString("=$B2:$B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A13 after insertion.", u"=$B2:$B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A14 after insertion.", OUString("=$B2:$B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A14 after insertion.", u"=$B2:$B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A15 after insertion.", OUString("=$B$2:B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A15 after insertion.", u"=$B$2:B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A16 after insertion.", OUString("=$B$2:B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A16 after insertion.", u"=$B$2:B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A17 after insertion.", OUString("=$B$2:$B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A17 after insertion.", u"=$B$2:$B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A18 after insertion.", OUString("=$B$2:$B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A18 after insertion.", u"=$B$2:$B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
// A19 reference to one row shifted out should be #REF!
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A19 after insertion.", OUString("=B#REF!:C#REF!"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A19 after insertion.", u"=B#REF!:C#REF!"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// A19 enter reference to last row.
- m_pDoc->SetString( aPos, "=B1048576:C1048576");
+ m_pDoc->SetString( aPos, u"=B1048576:C1048576"_ustr);
aPos.IncRow();
// Delete row 1 to shift top reference up, bottom reference stays sticky.
@@ -2034,41 +2034,41 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
// Check sticky bottom references and display of entire column references,
// now in A2:A17.
aPos.Set(0,1,1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A2 after deletion.", OUString("=B:B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A2 after deletion.", u"=B:B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A3 after deletion.", OUString("=B1:B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A3 after deletion.", u"=B1:B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A4 after deletion.", OUString("=B:$B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A4 after deletion.", u"=B:$B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A5 after deletion.", OUString("=B1:$B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A5 after deletion.", u"=B1:$B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A6 after deletion.", OUString("=B$1:B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A6 after deletion.", u"=B$1:B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A7 after deletion.", OUString("=B:B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A7 after deletion.", u"=B:B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A8 after deletion.", OUString("=B$1:$B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A8 after deletion.", u"=B$1:$B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A9 after deletion.", OUString("=B:$B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A9 after deletion.", u"=B:$B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A10 after deletion.", OUString("=$B:B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A10 after deletion.", u"=$B:B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A11 after deletion.", OUString("=$B1:B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A11 after deletion.", u"=$B1:B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A12 after deletion.", OUString("=$B:$B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A12 after deletion.", u"=$B:$B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A13 after deletion.", OUString("=$B1:$B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A13 after deletion.", u"=$B1:$B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A14 after deletion.", OUString("=$B$1:B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A14 after deletion.", u"=$B$1:B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A15 after deletion.", OUString("=$B:B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A15 after deletion.", u"=$B:B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A16 after deletion.", OUString("=$B$1:$B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A16 after deletion.", u"=$B$1:$B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A17 after deletion.", OUString("=$B:$B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A17 after deletion.", u"=$B:$B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
// A18 reference to one last row should be shifted up.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A18 after deletion.", OUString("=B1048575:C1048575"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A18 after deletion.", u"=B1048575:C1048575"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
// Insert 4 rows in the middle.
@@ -2078,61 +2078,61 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
// References in A2:A17 must still be the same.
aPos.Set(0,1,1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A2 after deletion.", OUString("=B:B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A2 after deletion.", u"=B:B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A3 after deletion.", OUString("=B1:B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A3 after deletion.", u"=B1:B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A4 after deletion.", OUString("=B:$B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A4 after deletion.", u"=B:$B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A5 after deletion.", OUString("=B1:$B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A5 after deletion.", u"=B1:$B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A6 after deletion.", OUString("=B$1:B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A6 after deletion.", u"=B$1:B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A7 after deletion.", OUString("=B:B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A7 after deletion.", u"=B:B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A8 after deletion.", OUString("=B$1:$B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A8 after deletion.", u"=B$1:$B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A9 after deletion.", OUString("=B:$B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A9 after deletion.", u"=B:$B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A10 after deletion.", OUString("=$B:B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A10 after deletion.", u"=$B:B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A11 after deletion.", OUString("=$B1:B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A11 after deletion.", u"=$B1:B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A12 after deletion.", OUString("=$B:$B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A12 after deletion.", u"=$B:$B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A13 after deletion.", OUString("=$B1:$B$1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A13 after deletion.", u"=$B1:$B$1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A14 after deletion.", OUString("=$B$1:B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A14 after deletion.", u"=$B$1:B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A15 after deletion.", OUString("=$B:B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A15 after deletion.", u"=$B:B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A16 after deletion.", OUString("=$B$1:$B1048576"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A16 after deletion.", u"=$B$1:$B1048576"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A17 after deletion.", OUString("=$B:$B"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong reference in A17 after deletion.", u"=$B:$B"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
aPos.IncRow();
// Enter values in B1 and B1048576/B16777216 (last row).
m_pDoc->SetValue( 1,0,1, 1.0);
m_pDoc->SetValue( 1,m_pDoc->MaxRow(),1, 2.0);
// Sticky reference including last row.
- m_pDoc->SetString( 2,0,1, "=SUM(B:B)");
+ m_pDoc->SetString( 2,0,1, u"=SUM(B:B)"_ustr);
// Reference to last row.
CPPUNIT_ASSERT_MESSAGE("m_pDoc->MaxRow() changed, adapt unit test.",
m_pDoc->MaxRow() == 1048575 || m_pDoc->MaxRow() == 16777215);
- m_pDoc->SetString( 2,1,1, m_pDoc->MaxRow() == 1048575 ? OUString("=SUM(B1048576:C1048576)")
- : OUString("=SUM(B16777216:C16777216)"));
+ m_pDoc->SetString( 2,1,1, m_pDoc->MaxRow() == 1048575 ? u"=SUM(B1048576:C1048576)"_ustr
+ : u"=SUM(B16777216:C16777216)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong result in C1.", 3.0, m_pDoc->GetValue(2,0,1));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong result in C2.", 2.0, m_pDoc->GetValue(2,1,1));
// Delete last row.
m_pDoc->DeleteRow( ScRange( 0, m_pDoc->MaxRow(), 1, m_pDoc->MaxCol(), m_pDoc->MaxRow(), 1));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong result in C1.", 1.0, m_pDoc->GetValue(2,0,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Reference in C2 not invalidated.", OUString("#REF!"), m_pDoc->GetString(2,1,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Reference in C2 not invalidated.", u"#REF!"_ustr, m_pDoc->GetString(2,1,1));
// Enter values in A23 and AMJ23/XFD23 (last column).
m_pDoc->SetValue( 0,22,1, 1.0);
m_pDoc->SetValue( m_pDoc->MaxCol(),22,1, 2.0);
// C3 with sticky reference including last column.
- m_pDoc->SetString( 2,2,1, "=SUM(23:23)");
+ m_pDoc->SetString( 2,2,1, u"=SUM(23:23)"_ustr);
// C4 with reference to last column.
m_pDoc->SetString( 2,3,1, "=SUM(" + m_pDoc->MaxColAsString() + "22:" + m_pDoc->MaxColAsString() + "23)");
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong result in C3.", 3.0, m_pDoc->GetValue(2,2,1));
@@ -2140,7 +2140,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
// Delete last column.
m_pDoc->DeleteCol( ScRange( m_pDoc->MaxCol(), 0, 1, m_pDoc->MaxCol(), m_pDoc->MaxRow(), 1));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong result in C3.", 1.0, m_pDoc->GetValue(2,2,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Reference in C4 not invalidated.", OUString("#REF!"), m_pDoc->GetString(2,3,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Reference in C4 not invalidated.", u"#REF!"_ustr, m_pDoc->GetString(2,3,1));
m_pDoc->DeleteTab(1);
@@ -2149,14 +2149,14 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateRange)
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheets)
{
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
OUString aName;
m_pDoc->GetName(0, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet1"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet1"_ustr, aName);
m_pDoc->GetName(1, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet2"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet2"_ustr, aName);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
@@ -2167,67 +2167,67 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheets)
m_pDoc->SetValue(ScAddress(2,2,0), 4);
// Set formulas to B2 and B3 on sheet Sheet2.
- m_pDoc->SetString(ScAddress(1,1,1), "=SUM(Sheet1.B2:C3)");
- m_pDoc->SetString(ScAddress(1,2,1), "=SUM($Sheet1.$B$2:$C$3)");
+ m_pDoc->SetString(ScAddress(1,1,1), u"=SUM(Sheet1.B2:C3)"_ustr);
+ m_pDoc->SetString(ScAddress(1,2,1), u"=SUM($Sheet1.$B$2:$C$3)"_ustr);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", OUString("=SUM(Sheet1.B2:C3)"), m_pDoc->GetFormula(1,1,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", u"=SUM(Sheet1.B2:C3)"_ustr, m_pDoc->GetFormula(1,1,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", OUString("=SUM($Sheet1.$B$2:$C$3)"), m_pDoc->GetFormula(1,2,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", u"=SUM($Sheet1.$B$2:$C$3)"_ustr, m_pDoc->GetFormula(1,2,1));
// Swap the sheets.
m_pDoc->MoveTab(0, 1);
m_pDoc->GetName(0, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet2"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet2"_ustr, aName);
m_pDoc->GetName(1, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet1"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet1"_ustr, aName);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", OUString("=SUM(Sheet1.B2:C3)"), m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", u"=SUM(Sheet1.B2:C3)"_ustr, m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", OUString("=SUM($Sheet1.$B$2:$C$3)"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", u"=SUM($Sheet1.$B$2:$C$3)"_ustr, m_pDoc->GetFormula(1,2,0));
// Swap back.
m_pDoc->MoveTab(0, 1);
m_pDoc->GetName(0, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet1"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet1"_ustr, aName);
m_pDoc->GetName(1, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet2"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet2"_ustr, aName);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", OUString("=SUM(Sheet1.B2:C3)"), m_pDoc->GetFormula(1,1,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", u"=SUM(Sheet1.B2:C3)"_ustr, m_pDoc->GetFormula(1,1,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", OUString("=SUM($Sheet1.$B$2:$C$3)"), m_pDoc->GetFormula(1,2,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", u"=SUM($Sheet1.$B$2:$C$3)"_ustr, m_pDoc->GetFormula(1,2,1));
// Insert a new sheet between the two.
- m_pDoc->InsertTab(1, "Temp");
+ m_pDoc->InsertTab(1, u"Temp"_ustr);
m_pDoc->GetName(1, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Temp"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Temp"_ustr, aName);
m_pDoc->GetName(2, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet2"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet2"_ustr, aName);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", OUString("=SUM(Sheet1.B2:C3)"), m_pDoc->GetFormula(1,1,2));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", u"=SUM(Sheet1.B2:C3)"_ustr, m_pDoc->GetFormula(1,1,2));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", OUString("=SUM($Sheet1.$B$2:$C$3)"), m_pDoc->GetFormula(1,2,2));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", u"=SUM($Sheet1.$B$2:$C$3)"_ustr, m_pDoc->GetFormula(1,2,2));
// Move the last sheet (Sheet2) to the first position.
m_pDoc->MoveTab(2, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", OUString("=SUM(Sheet1.B2:C3)"), m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", u"=SUM(Sheet1.B2:C3)"_ustr, m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", OUString("=SUM($Sheet1.$B$2:$C$3)"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", u"=SUM($Sheet1.$B$2:$C$3)"_ustr, m_pDoc->GetFormula(1,2,0));
// Move back.
m_pDoc->MoveTab(0, 2);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", OUString("=SUM(Sheet1.B2:C3)"), m_pDoc->GetFormula(1,1,2));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", u"=SUM(Sheet1.B2:C3)"_ustr, m_pDoc->GetFormula(1,1,2));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", OUString("=SUM($Sheet1.$B$2:$C$3)"), m_pDoc->GetFormula(1,2,2));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", u"=SUM($Sheet1.$B$2:$C$3)"_ustr, m_pDoc->GetFormula(1,2,2));
// Move the "Temp" sheet to the last position.
m_pDoc->MoveTab(1, 2);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", OUString("=SUM(Sheet1.B2:C3)"), m_pDoc->GetFormula(1,1,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", u"=SUM(Sheet1.B2:C3)"_ustr, m_pDoc->GetFormula(1,1,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", OUString("=SUM($Sheet1.$B$2:$C$3)"), m_pDoc->GetFormula(1,2,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", u"=SUM($Sheet1.$B$2:$C$3)"_ustr, m_pDoc->GetFormula(1,2,1));
// Move back.
m_pDoc->MoveTab(2, 1);
@@ -2236,43 +2236,43 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheets)
m_pDoc->DeleteTab(1);
m_pDoc->GetName(1, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet2"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet2"_ustr, aName);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", OUString("=SUM(Sheet1.B2:C3)"), m_pDoc->GetFormula(1,1,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", u"=SUM(Sheet1.B2:C3)"_ustr, m_pDoc->GetFormula(1,1,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", OUString("=SUM($Sheet1.$B$2:$C$3)"), m_pDoc->GetFormula(1,2,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", u"=SUM($Sheet1.$B$2:$C$3)"_ustr, m_pDoc->GetFormula(1,2,1));
// Insert a new sheet before the first one.
- m_pDoc->InsertTab(0, "Temp");
+ m_pDoc->InsertTab(0, u"Temp"_ustr);
m_pDoc->GetName(1, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet1"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet1"_ustr, aName);
m_pDoc->GetName(2, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet2"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet2"_ustr, aName);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", OUString("=SUM(Sheet1.B2:C3)"), m_pDoc->GetFormula(1,1,2));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", u"=SUM(Sheet1.B2:C3)"_ustr, m_pDoc->GetFormula(1,1,2));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", OUString("=SUM($Sheet1.$B$2:$C$3)"), m_pDoc->GetFormula(1,2,2));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", u"=SUM($Sheet1.$B$2:$C$3)"_ustr, m_pDoc->GetFormula(1,2,2));
// Delete the temporary sheet.
m_pDoc->DeleteTab(0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", OUString("=SUM(Sheet1.B2:C3)"), m_pDoc->GetFormula(1,1,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", u"=SUM(Sheet1.B2:C3)"_ustr, m_pDoc->GetFormula(1,1,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", OUString("=SUM($Sheet1.$B$2:$C$3)"), m_pDoc->GetFormula(1,2,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", u"=SUM($Sheet1.$B$2:$C$3)"_ustr, m_pDoc->GetFormula(1,2,1));
// Append a bunch of sheets.
- m_pDoc->InsertTab(2, "Temp1");
- m_pDoc->InsertTab(3, "Temp2");
- m_pDoc->InsertTab(4, "Temp3");
+ m_pDoc->InsertTab(2, u"Temp1"_ustr);
+ m_pDoc->InsertTab(3, u"Temp2"_ustr);
+ m_pDoc->InsertTab(4, u"Temp3"_ustr);
// Move these tabs around. This shouldn't affects the first 2 sheets.
m_pDoc->MoveTab(2, 4);
m_pDoc->MoveTab(3, 2);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", OUString("=SUM(Sheet1.B2:C3)"), m_pDoc->GetFormula(1,1,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", u"=SUM(Sheet1.B2:C3)"_ustr, m_pDoc->GetFormula(1,1,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", OUString("=SUM($Sheet1.$B$2:$C$3)"), m_pDoc->GetFormula(1,2,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", u"=SUM($Sheet1.$B$2:$C$3)"_ustr, m_pDoc->GetFormula(1,2,1));
// Delete the temp sheets.
m_pDoc->DeleteTab(4);
@@ -2282,11 +2282,11 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheets)
// Delete Sheet1.
m_pDoc->DeleteTab(0);
m_pDoc->GetName(0, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet2"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet2"_ustr, aName);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", OUString("=SUM(#REF!.B2:C3)"), m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B2.", u"=SUM(#REF!.B2:C3)"_ustr, m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", OUString("=SUM($#REF!.$B$2:$C$3)"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in Sheet2.B3.", u"=SUM($#REF!.$B$2:$C$3)"_ustr, m_pDoc->GetFormula(1,2,0));
m_pDoc->DeleteTab(0);
}
@@ -2296,7 +2296,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateInsertRows)
setExpandRefs(false);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
// Insert raw values in B2:B4.
m_pDoc->SetValue(ScAddress(1,1,0), 1.0);
@@ -2304,7 +2304,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateInsertRows)
m_pDoc->SetValue(ScAddress(1,3,0), 3.0);
// Insert a formula in B5 to sum up B2:B4.
- m_pDoc->SetString(ScAddress(1,4,0), "=SUM(B2:B4)");
+ m_pDoc->SetString(ScAddress(1,4,0), u"=SUM(B2:B4)"_ustr);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(1,4,0)));
@@ -2319,7 +2319,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateInsertRows)
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(1,4,0)));
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(1,5,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(B4:B6)"), m_pDoc->GetFormula(1,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(B4:B6)"_ustr, m_pDoc->GetFormula(1,6,0));
// Clear and start over.
clearSheet(m_pDoc, 0);
@@ -2330,7 +2330,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateInsertRows)
m_pDoc->SetValue(ScAddress(0,5,0), 3.0);
// Set formula in A3 to reference A4:A6.
- m_pDoc->SetString(ScAddress(0,2,0), "=MAX(A4:A6)");
+ m_pDoc->SetString(ScAddress(0,2,0), u"=MAX(A4:A6)"_ustr);
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(0,2,0)));
@@ -2341,82 +2341,82 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateInsertRows)
CPPUNIT_ASSERT_EQUAL_MESSAGE("This formula cell should not be an error.", 0, static_cast<int>(pFC->GetErrCode()));
ASSERT_DOUBLES_EQUAL(3.0, m_pDoc->GetValue(ScAddress(0,5,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=MAX(A7:A9)"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=MAX(A7:A9)"_ustr, m_pDoc->GetFormula(0,5,0));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheetsDelete)
{
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
- m_pDoc->InsertTab(2, "Sheet3");
- m_pDoc->InsertTab(3, "Sheet4");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
+ m_pDoc->InsertTab(2, u"Sheet3"_ustr);
+ m_pDoc->InsertTab(3, u"Sheet4"_ustr);
- m_pDoc->SetString(ScAddress(4,1,0), "=SUM(Sheet2.A4:Sheet4.A4)");
- m_pDoc->SetString(ScAddress(4,2,0), "=SUM($Sheet2.A4:$Sheet4.A4)");
+ m_pDoc->SetString(ScAddress(4,1,0), u"=SUM(Sheet2.A4:Sheet4.A4)"_ustr);
+ m_pDoc->SetString(ScAddress(4,2,0), u"=SUM($Sheet2.A4:$Sheet4.A4)"_ustr);
m_pDoc->DeleteTab(1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM(Sheet3.A4:Sheet4.A4)"), m_pDoc->GetFormula(4,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM($Sheet3.A4:$Sheet4.A4)"), m_pDoc->GetFormula(4,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM(Sheet3.A4:Sheet4.A4)"_ustr, m_pDoc->GetFormula(4,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM($Sheet3.A4:$Sheet4.A4)"_ustr, m_pDoc->GetFormula(4,2,0));
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
- m_pDoc->SetString(ScAddress(5,1,3), "=SUM(Sheet1.A5:Sheet3.A5)");
- m_pDoc->SetString(ScAddress(5,2,3), "=SUM($Sheet1.A5:$Sheet3.A5)");
+ m_pDoc->SetString(ScAddress(5,1,3), u"=SUM(Sheet1.A5:Sheet3.A5)"_ustr);
+ m_pDoc->SetString(ScAddress(5,2,3), u"=SUM($Sheet1.A5:$Sheet3.A5)"_ustr);
m_pDoc->DeleteTab(2);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM(Sheet1.A5:Sheet2.A5)"), m_pDoc->GetFormula(5,1,2));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM($Sheet1.A5:$Sheet2.A5)"), m_pDoc->GetFormula(5,2,2));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM(Sheet1.A5:Sheet2.A5)"_ustr, m_pDoc->GetFormula(5,1,2));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM($Sheet1.A5:$Sheet2.A5)"_ustr, m_pDoc->GetFormula(5,2,2));
- m_pDoc->InsertTab(2, "Sheet3");
+ m_pDoc->InsertTab(2, u"Sheet3"_ustr);
- m_pDoc->SetString(ScAddress(6,1,3), "=SUM(Sheet1.A6:Sheet3.A6)");
- m_pDoc->SetString(ScAddress(6,2,3), "=SUM($Sheet1.A6:$Sheet3.A6)");
+ m_pDoc->SetString(ScAddress(6,1,3), u"=SUM(Sheet1.A6:Sheet3.A6)"_ustr);
+ m_pDoc->SetString(ScAddress(6,2,3), u"=SUM($Sheet1.A6:$Sheet3.A6)"_ustr);
m_pDoc->DeleteTabs(0,3);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM(#REF!.A6:#REF!.A6)"), m_pDoc->GetFormula(6,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM($#REF!.A6:$#REF!.A6)"), m_pDoc->GetFormula(6,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM(#REF!.A6:#REF!.A6)"_ustr, m_pDoc->GetFormula(6,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM($#REF!.A6:$#REF!.A6)"_ustr, m_pDoc->GetFormula(6,2,0));
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
- m_pDoc->InsertTab(2, "Sheet3");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
+ m_pDoc->InsertTab(2, u"Sheet3"_ustr);
- m_pDoc->SetString(ScAddress(1,1,1), "=SUM(Sheet1.A2:Sheet3.A2");
- m_pDoc->SetString(ScAddress(2,1,1), "=SUM(Sheet1.A1:Sheet2.A1");
- m_pDoc->SetString(ScAddress(3,1,1), "=SUM(Sheet2.A3:Sheet4.A3");
+ m_pDoc->SetString(ScAddress(1,1,1), u"=SUM(Sheet1.A2:Sheet3.A2"_ustr);
+ m_pDoc->SetString(ScAddress(2,1,1), u"=SUM(Sheet1.A1:Sheet2.A1"_ustr);
+ m_pDoc->SetString(ScAddress(3,1,1), u"=SUM(Sheet2.A3:Sheet4.A3"_ustr);
- m_pDoc->SetString(ScAddress(1,2,1), "=SUM($Sheet1.A2:$Sheet3.A2");
- m_pDoc->SetString(ScAddress(2,2,1), "=SUM($Sheet1.A1:$Sheet2.A1");
- m_pDoc->SetString(ScAddress(3,2,1), "=SUM($Sheet2.A3:$Sheet4.A3");
+ m_pDoc->SetString(ScAddress(1,2,1), u"=SUM($Sheet1.A2:$Sheet3.A2"_ustr);
+ m_pDoc->SetString(ScAddress(2,2,1), u"=SUM($Sheet1.A1:$Sheet2.A1"_ustr);
+ m_pDoc->SetString(ScAddress(3,2,1), u"=SUM($Sheet2.A3:$Sheet4.A3"_ustr);
m_pDoc->DeleteTab(2);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM(Sheet1.A2:Sheet2.A2)"), m_pDoc->GetFormula(1,1,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM(Sheet1.A2:Sheet2.A2)"_ustr, m_pDoc->GetFormula(1,1,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM(Sheet1.A1:Sheet2.A1)"), m_pDoc->GetFormula(2,1,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM(Sheet1.A1:Sheet2.A1)"_ustr, m_pDoc->GetFormula(2,1,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM(Sheet2.A3:Sheet4.A3)"), m_pDoc->GetFormula(3,1,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM(Sheet2.A3:Sheet4.A3)"_ustr, m_pDoc->GetFormula(3,1,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM($Sheet1.A2:$Sheet2.A2)"), m_pDoc->GetFormula(1,2,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM($Sheet1.A2:$Sheet2.A2)"_ustr, m_pDoc->GetFormula(1,2,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM($Sheet1.A1:$Sheet2.A1)"), m_pDoc->GetFormula(2,2,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM($Sheet1.A1:$Sheet2.A1)"_ustr, m_pDoc->GetFormula(2,2,1));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM($Sheet2.A3:$Sheet4.A3)"), m_pDoc->GetFormula(3,2,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM($Sheet2.A3:$Sheet4.A3)"_ustr, m_pDoc->GetFormula(3,2,1));
m_pDoc->DeleteTab(0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM(Sheet2.A2:Sheet2.A2)"), m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM(Sheet2.A2:Sheet2.A2)"_ustr, m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM(Sheet2.A1:Sheet2.A1)"), m_pDoc->GetFormula(2,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM(Sheet2.A1:Sheet2.A1)"_ustr, m_pDoc->GetFormula(2,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM(Sheet2.A3:Sheet4.A3)"), m_pDoc->GetFormula(3,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM(Sheet2.A3:Sheet4.A3)"_ustr, m_pDoc->GetFormula(3,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM($Sheet2.A2:$Sheet2.A2)"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM($Sheet2.A2:$Sheet2.A2)"_ustr, m_pDoc->GetFormula(1,2,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM($Sheet2.A1:$Sheet2.A1)"), m_pDoc->GetFormula(2,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM($Sheet2.A1:$Sheet2.A1)"_ustr, m_pDoc->GetFormula(2,2,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", OUString("=SUM($Sheet2.A3:$Sheet4.A3)"), m_pDoc->GetFormula(3,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong Formula", u"=SUM($Sheet2.A3:$Sheet4.A3)"_ustr, m_pDoc->GetFormula(3,2,0));
m_pDoc->DeleteTab(0);
m_pDoc->DeleteTab(0);
@@ -2427,19 +2427,19 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateInsertColumns)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
setExpandRefs(false);
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
// Set named range for B2 with absolute column and relative same row.
const ScAddress aNamePos(0,1,0);
- bool bInserted = m_pDoc->InsertNewRangeName("RowRelativeRange", aNamePos, "$Formula.$B2");
+ bool bInserted = m_pDoc->InsertNewRangeName(u"RowRelativeRange"_ustr, aNamePos, u"$Formula.$B2"_ustr);
CPPUNIT_ASSERT(bInserted);
// Set named range for entire absolute column B.
- bInserted = m_pDoc->InsertNewRangeName("EntireColumn", aNamePos, "$B:$B");
+ bInserted = m_pDoc->InsertNewRangeName(u"EntireColumn"_ustr, aNamePos, u"$B:$B"_ustr);
CPPUNIT_ASSERT(bInserted);
// Set named range for entire absolute row 2.
- bInserted = m_pDoc->InsertNewRangeName("EntireRow", aNamePos, "$2:$2");
+ bInserted = m_pDoc->InsertNewRangeName(u"EntireRow"_ustr, aNamePos, u"$2:$2"_ustr);
CPPUNIT_ASSERT(bInserted);
// Set values in B1:B3.
@@ -2448,19 +2448,19 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateInsertColumns)
m_pDoc->SetValue(ScAddress(1,2,0), 3.0);
// Reference them in B4.
- m_pDoc->SetString(ScAddress(1,3,0), "=SUM(B1:B3)");
+ m_pDoc->SetString(ScAddress(1,3,0), u"=SUM(B1:B3)"_ustr);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(1,3,0)));
// Use named range in C2 to reference B2.
- m_pDoc->SetString(ScAddress(2,1,0), "=RowRelativeRange");
+ m_pDoc->SetString(ScAddress(2,1,0), u"=RowRelativeRange"_ustr);
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(2,1,0)));
// Use named range in C3 to reference column B, values in B1,B2,B3,B4
- m_pDoc->SetString(ScAddress(2,2,0), "=SUM(EntireColumn)");
+ m_pDoc->SetString(ScAddress(2,2,0), u"=SUM(EntireColumn)"_ustr);
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(ScAddress(2,2,0)));
// Use named range in C4 to reference row 2, values in B2 and C2.
- m_pDoc->SetString(ScAddress(2,3,0), "=SUM(EntireRow)");
+ m_pDoc->SetString(ScAddress(2,3,0), u"=SUM(EntireRow)"_ustr);
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(2,3,0)));
// Insert columns over A:B.
@@ -2470,41 +2470,41 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateInsertColumns)
rFunc.InsertCells(ScRange(0,0,0,1,m_pDoc->MaxRow(),0), &aMark, INS_INSCOLS_BEFORE, false, true);
// Now, the original column B has moved to column D.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D4 after column insertion.", OUString("=SUM(D1:D3)"), m_pDoc->GetFormula(3,3,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in D4 after column insertion.", u"=SUM(D1:D3)"_ustr, m_pDoc->GetFormula(3,3,0));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(3,3,0)));
// Check that the named reference points to the moved cell, now D2.
- ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName("ROWRELATIVERANGE");
+ ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName(u"ROWRELATIVERANGE"_ustr);
CPPUNIT_ASSERT(pName);
OUString aSymbol = pName->GetSymbol(aNamePos, formula::FormulaGrammar::GRAM_ENGLISH);
- CPPUNIT_ASSERT_EQUAL(OUString("$Formula.$D2"), aSymbol);
+ CPPUNIT_ASSERT_EQUAL(u"$Formula.$D2"_ustr, aSymbol);
// Check that the formula using the name, now in E2, still has the same result.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in E2 after column insertion.", OUString("=RowRelativeRange"), m_pDoc->GetFormula(4,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in E2 after column insertion.", u"=RowRelativeRange"_ustr, m_pDoc->GetFormula(4,1,0));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(4,1,0)));
// Check that the named column reference points to the moved column, now D.
- pName = m_pDoc->GetRangeName()->findByUpperName("ENTIRECOLUMN");
+ pName = m_pDoc->GetRangeName()->findByUpperName(u"ENTIRECOLUMN"_ustr);
CPPUNIT_ASSERT(pName);
aSymbol = pName->GetSymbol(aNamePos, formula::FormulaGrammar::GRAM_ENGLISH);
- CPPUNIT_ASSERT_EQUAL(OUString("$D:$D"), aSymbol);
+ CPPUNIT_ASSERT_EQUAL(u"$D:$D"_ustr, aSymbol);
// Check that the formula using the name, now in E3, still has the same result.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in E3 after column insertion.", OUString("=SUM(EntireColumn)"), m_pDoc->GetFormula(4,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in E3 after column insertion.", u"=SUM(EntireColumn)"_ustr, m_pDoc->GetFormula(4,2,0));
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(ScAddress(4,2,0)));
// Check that the named row reference still points to the same entire row
// and does not have a #REF! error due to inserted columns.
- pName = m_pDoc->GetRangeName()->findByUpperName("ENTIREROW");
+ pName = m_pDoc->GetRangeName()->findByUpperName(u"ENTIREROW"_ustr);
CPPUNIT_ASSERT(pName);
aSymbol = pName->GetSymbol(aNamePos, formula::FormulaGrammar::GRAM_ENGLISH);
- CPPUNIT_ASSERT_EQUAL(OUString("$2:$2"), aSymbol);
+ CPPUNIT_ASSERT_EQUAL(u"$2:$2"_ustr, aSymbol);
// Check that the formula using the name, now in E4, still has the same result.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in E4 after column insertion.", OUString("=SUM(EntireRow)"), m_pDoc->GetFormula(4,3,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in E4 after column insertion.", u"=SUM(EntireRow)"_ustr, m_pDoc->GetFormula(4,3,0));
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(4,3,0)));
@@ -2513,7 +2513,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateInsertColumns)
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMove)
{
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
@@ -2523,10 +2523,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMove)
m_pDoc->SetValue(ScAddress(1,5,0), 3);
// Set formulas to A9:A12 that references B4:B6.
- m_pDoc->SetString(ScAddress(0,8,0), "=SUM(B4:B6)");
- m_pDoc->SetString(ScAddress(0,9,0), "=SUM($B$4:$B$6)");
- m_pDoc->SetString(ScAddress(0,10,0), "=B5");
- m_pDoc->SetString(ScAddress(0,11,0), "=$B$6");
+ m_pDoc->SetString(ScAddress(0,8,0), u"=SUM(B4:B6)"_ustr);
+ m_pDoc->SetString(ScAddress(0,9,0), u"=SUM($B$4:$B$6)"_ustr);
+ m_pDoc->SetString(ScAddress(0,10,0), u"=B5"_ustr);
+ m_pDoc->SetString(ScAddress(0,11,0), u"=$B$6"_ustr);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(0,8,0));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(0,9,0));
@@ -2544,10 +2544,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMove)
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(0,10,0));
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(0,11,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(D4:D6)"), m_pDoc->GetFormula(0,8,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM($D$4:$D$6)"), m_pDoc->GetFormula(0,9,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=D5"), m_pDoc->GetFormula(0,10,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=$D$6"), m_pDoc->GetFormula(0,11,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(D4:D6)"_ustr, m_pDoc->GetFormula(0,8,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM($D$4:$D$6)"_ustr, m_pDoc->GetFormula(0,9,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=D5"_ustr, m_pDoc->GetFormula(0,10,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=$D$6"_ustr, m_pDoc->GetFormula(0,11,0));
// Move A9:A12 to B10:B13.
bMoved = rFunc.MoveBlock(ScRange(0,8,0,0,11,0), ScAddress(1,9,0), true, false, false, false);
@@ -2560,10 +2560,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMove)
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(1,12,0));
// Displayed formulas should stay the same since the referenced range hasn't moved.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(D4:D6)"), m_pDoc->GetFormula(1,9,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM($D$4:$D$6)"), m_pDoc->GetFormula(1,10,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=D5"), m_pDoc->GetFormula(1,11,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=$D$6"), m_pDoc->GetFormula(1,12,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(D4:D6)"_ustr, m_pDoc->GetFormula(1,9,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM($D$4:$D$6)"_ustr, m_pDoc->GetFormula(1,10,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=D5"_ustr, m_pDoc->GetFormula(1,11,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=$D$6"_ustr, m_pDoc->GetFormula(1,12,0));
// The value cells are in D4:D6. Move D4:D5 to the right but leave D6
// where it is.
@@ -2576,17 +2576,17 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMove)
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(1,11,0));
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(1,12,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(D4:D6)"), m_pDoc->GetFormula(1,9,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM($D$4:$D$6)"), m_pDoc->GetFormula(1,10,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=E5"), m_pDoc->GetFormula(1,11,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=$D$6"), m_pDoc->GetFormula(1,12,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(D4:D6)"_ustr, m_pDoc->GetFormula(1,9,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM($D$4:$D$6)"_ustr, m_pDoc->GetFormula(1,10,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=E5"_ustr, m_pDoc->GetFormula(1,11,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=$D$6"_ustr, m_pDoc->GetFormula(1,12,0));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
@@ -2597,30 +2597,30 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo)
m_pDoc->SetValue(ScAddress(0,3,0), 4.0);
// Set formulas with single cell references in A6:A8.
- m_pDoc->SetString(ScAddress(0,5,0), "=A1");
+ m_pDoc->SetString(ScAddress(0,5,0), u"=A1"_ustr);
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(0,5,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A1"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A1"_ustr, m_pDoc->GetFormula(0,5,0));
- m_pDoc->SetString(ScAddress(0,6,0), "=A1+A2+A3");
+ m_pDoc->SetString(ScAddress(0,6,0), u"=A1+A2+A3"_ustr);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,6,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A1+A2+A3"), m_pDoc->GetFormula(0,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A1+A2+A3"_ustr, m_pDoc->GetFormula(0,6,0));
- m_pDoc->SetString(ScAddress(0,7,0), "=A1+A3+A4");
+ m_pDoc->SetString(ScAddress(0,7,0), u"=A1+A3+A4"_ustr);
CPPUNIT_ASSERT_EQUAL(8.0, m_pDoc->GetValue(ScAddress(0,7,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A1+A3+A4"), m_pDoc->GetFormula(0,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A1+A3+A4"_ustr, m_pDoc->GetFormula(0,7,0));
// Set formulas with range references in A10:A12.
- m_pDoc->SetString(ScAddress(0,9,0), "=SUM(A1:A2)");
+ m_pDoc->SetString(ScAddress(0,9,0), u"=SUM(A1:A2)"_ustr);
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(0,9,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(A1:A2)"), m_pDoc->GetFormula(0,9,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(A1:A2)"_ustr, m_pDoc->GetFormula(0,9,0));
- m_pDoc->SetString(ScAddress(0,10,0), "=SUM(A1:A3)");
+ m_pDoc->SetString(ScAddress(0,10,0), u"=SUM(A1:A3)"_ustr);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,10,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(A1:A3)"), m_pDoc->GetFormula(0,10,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(A1:A3)"_ustr, m_pDoc->GetFormula(0,10,0));
- m_pDoc->SetString(ScAddress(0,11,0), "=SUM(A1:A4)");
+ m_pDoc->SetString(ScAddress(0,11,0), u"=SUM(A1:A4)"_ustr);
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(0,11,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(A1:A4)"), m_pDoc->GetFormula(0,11,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(A1:A4)"_ustr, m_pDoc->GetFormula(0,11,0));
// Move A1:A3 to C1:C3. Note that A4 remains.
ScDocFunc& rFunc = m_xDocShell->GetDocFunc();
@@ -2628,22 +2628,22 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo)
CPPUNIT_ASSERT(bMoved);
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(0,5,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=C1"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=C1"_ustr, m_pDoc->GetFormula(0,5,0));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,6,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=C1+C2+C3"), m_pDoc->GetFormula(0,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=C1+C2+C3"_ustr, m_pDoc->GetFormula(0,6,0));
CPPUNIT_ASSERT_EQUAL(8.0, m_pDoc->GetValue(ScAddress(0,7,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=C1+C3+A4"), m_pDoc->GetFormula(0,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=C1+C3+A4"_ustr, m_pDoc->GetFormula(0,7,0));
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(0,9,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(C1:C2)"), m_pDoc->GetFormula(0,9,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(C1:C2)"_ustr, m_pDoc->GetFormula(0,9,0));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,10,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(C1:C3)"), m_pDoc->GetFormula(0,10,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(C1:C3)"_ustr, m_pDoc->GetFormula(0,10,0));
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(0,11,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(A1:A4)"), m_pDoc->GetFormula(0,11,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(A1:A4)"_ustr, m_pDoc->GetFormula(0,11,0));
// Undo the move.
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
@@ -2651,22 +2651,22 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo)
pUndoMgr->Undo();
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(0,5,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A1"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A1"_ustr, m_pDoc->GetFormula(0,5,0));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,6,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A1+A2+A3"), m_pDoc->GetFormula(0,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A1+A2+A3"_ustr, m_pDoc->GetFormula(0,6,0));
CPPUNIT_ASSERT_EQUAL(8.0, m_pDoc->GetValue(ScAddress(0,7,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=A1+A3+A4"), m_pDoc->GetFormula(0,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=A1+A3+A4"_ustr, m_pDoc->GetFormula(0,7,0));
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(0,9,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(A1:A2)"), m_pDoc->GetFormula(0,9,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(A1:A2)"_ustr, m_pDoc->GetFormula(0,9,0));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,10,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(A1:A3)"), m_pDoc->GetFormula(0,10,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(A1:A3)"_ustr, m_pDoc->GetFormula(0,10,0));
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(0,11,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(A1:A4)"), m_pDoc->GetFormula(0,11,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(A1:A4)"_ustr, m_pDoc->GetFormula(0,11,0));
// Make sure the broadcasters are still valid by changing the value of A1.
m_pDoc->SetValue(ScAddress(0,0,0), 20);
@@ -2684,7 +2684,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo)
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo2)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
@@ -2748,7 +2748,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo2)
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo3NonShared)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
@@ -2802,7 +2802,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo3NonShared)
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo3Shared)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
@@ -2874,7 +2874,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo3Shared)
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndoDependents)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
std::vector<std::vector<const char*>> aData = {
@@ -2939,7 +2939,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndoDependents)
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo4)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
std::vector<std::vector<const char*>> aData = {
@@ -2970,10 +2970,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo4)
bGood = checkOutput(m_pDoc, aOutRange, aCheckAfter, "A1:A2 moved to B1:B2");
CPPUNIT_ASSERT(bGood);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=B1"), m_pDoc->GetFormula(2,0,0)); // C1
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=B2"), m_pDoc->GetFormula(2,1,0)); // C2
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=B1"), m_pDoc->GetFormula(3,0,0)); // D1
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=B2"), m_pDoc->GetFormula(3,1,0)); // D2
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=B1"_ustr, m_pDoc->GetFormula(2,0,0)); // C1
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=B2"_ustr, m_pDoc->GetFormula(2,1,0)); // C2
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=B1"_ustr, m_pDoc->GetFormula(3,0,0)); // D1
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=B2"_ustr, m_pDoc->GetFormula(3,1,0)); // D2
// Undo the move.
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
@@ -2983,10 +2983,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo4)
bGood = checkOutput(m_pDoc, aOutRange, aCheckInitial, "after undo");
CPPUNIT_ASSERT(bGood);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=B1"), m_pDoc->GetFormula(2,0,0)); // C1
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=B2"), m_pDoc->GetFormula(2,1,0)); // C2
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=A1"), m_pDoc->GetFormula(3,0,0)); // D1
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=A2"), m_pDoc->GetFormula(3,1,0)); // D2
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=B1"_ustr, m_pDoc->GetFormula(2,0,0)); // C1
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=B2"_ustr, m_pDoc->GetFormula(2,1,0)); // C2
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=A1"_ustr, m_pDoc->GetFormula(3,0,0)); // D1
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=A2"_ustr, m_pDoc->GetFormula(3,1,0)); // D2
// Redo and check.
pUndoMgr->Redo();
@@ -2994,10 +2994,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveUndo4)
bGood = checkOutput(m_pDoc, aOutRange, aCheckAfter, "after redo");
CPPUNIT_ASSERT(bGood);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=B1"), m_pDoc->GetFormula(2,0,0)); // C1
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=B2"), m_pDoc->GetFormula(2,1,0)); // C2
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=B1"), m_pDoc->GetFormula(3,0,0)); // D1
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=B2"), m_pDoc->GetFormula(3,1,0)); // D2
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=B1"_ustr, m_pDoc->GetFormula(2,0,0)); // C1
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=B2"_ustr, m_pDoc->GetFormula(2,1,0)); // C2
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=B1"_ustr, m_pDoc->GetFormula(3,0,0)); // D1
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=B2"_ustr, m_pDoc->GetFormula(3,1,0)); // D2
m_pDoc->DeleteTab(0);
}
@@ -3006,17 +3006,17 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveToSheet)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
// Set values to A1:A2 on Sheet1, and B1:B2 to reference them.
m_pDoc->SetValue(ScAddress(0,0,0), 11);
m_pDoc->SetValue(ScAddress(0,1,0), 12);
- m_pDoc->SetString(ScAddress(1,0,0), "=A1");
- m_pDoc->SetString(ScAddress(1,1,0), "=A2");
+ m_pDoc->SetString(ScAddress(1,0,0), u"=A1"_ustr);
+ m_pDoc->SetString(ScAddress(1,1,0), u"=A2"_ustr);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=A1"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=A2"), m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=A1"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=A2"_ustr, m_pDoc->GetFormula(1,1,0));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(ScAddress(1,0,0)));
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(ScAddress(1,1,0)));
@@ -3026,21 +3026,21 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateMoveToSheet)
bool bMoved = rFunc.MoveBlock(ScRange(0,0,0,0,1,0), ScAddress(1,2,1), true, true, false, true);
CPPUNIT_ASSERT(bMoved);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=Sheet2.B3"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=Sheet2.B4"), m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=Sheet2.B3"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=Sheet2.B4"_ustr, m_pDoc->GetFormula(1,1,0));
// Undo and check again.
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
pUndoMgr->Undo();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=A1"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=A2"), m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=A1"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=A2"_ustr, m_pDoc->GetFormula(1,1,0));
// Redo and check.
pUndoMgr->Redo();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=Sheet2.B3"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=Sheet2.B4"), m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=Sheet2.B3"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=Sheet2.B4"_ustr, m_pDoc->GetFormula(1,1,0));
m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
@@ -3050,12 +3050,12 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteContent)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Set value in B2.
m_pDoc->SetValue(ScAddress(1,1,0), 2.0);
// Set formula in C2 to reference B2.
- m_pDoc->SetString(ScAddress(2,1,0), "=B2");
+ m_pDoc->SetString(ScAddress(2,1,0), u"=B2"_ustr);
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(2,1,0)));
@@ -3088,7 +3088,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftLeft)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Insert 1,2,3,4,5 in C1:G1.
for (SCCOL i = 0; i <= 4; ++i)
@@ -3096,7 +3096,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftLeft)
// Insert formula in H1.
ScAddress aPos(7,0,0);
- m_pDoc->SetString(aPos, "=SUM(C1:G1)");
+ m_pDoc->SetString(aPos, u"=SUM(C1:G1)"_ustr);
CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
@@ -3109,7 +3109,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftLeft)
aPos.IncCol(-2);
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(C1:E1)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(C1:E1)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Undo and check.
SfxUndoManager* pUndo = m_pDoc->GetUndoManager();
@@ -3118,7 +3118,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftLeft)
pUndo->Undo();
aPos.IncCol(2);
CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(C1:G1)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(C1:G1)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Delete columns C:D (left end of the reference).
bDeleted = rFunc.DeleteCells(ScRange(2,0,0,3,m_pDoc->MaxRow(),0), &aMark, DelCellCmd::CellsLeft, true);
@@ -3126,13 +3126,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftLeft)
aPos.IncCol(-2);
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(C1:E1)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(C1:E1)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Undo and check again.
pUndo->Undo();
aPos.IncCol(2);
CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(C1:G1)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(C1:G1)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Delete columns B:E (overlaps on the left).
bDeleted = rFunc.DeleteCells(ScRange(1,0,0,4,m_pDoc->MaxRow(),0), &aMark, DelCellCmd::CellsLeft, true);
@@ -3140,13 +3140,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftLeft)
aPos.IncCol(-4);
CPPUNIT_ASSERT_EQUAL(9.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(B1:C1)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(B1:C1)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Undo and check again.
pUndo->Undo();
aPos.IncCol(4);
CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(C1:G1)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(C1:G1)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Start over with a new scenario.
clearSheet(m_pDoc, 0);
@@ -3157,7 +3157,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftLeft)
// Set formula in B1.
aPos = ScAddress(1,0,0);
- m_pDoc->SetString(aPos, "=SUM(C1:H1)");
+ m_pDoc->SetString(aPos, u"=SUM(C1:H1)"_ustr);
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(aPos));
// Delete columns F:H (right end of the reference).
@@ -3165,24 +3165,24 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftLeft)
CPPUNIT_ASSERT(bDeleted);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(C1:E1)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(C1:E1)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Undo and check.
pUndo->Undo();
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(C1:H1)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(C1:H1)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Delete columns G:I (overlaps on the right).
bDeleted = rFunc.DeleteCells(ScRange(6,0,0,8,m_pDoc->MaxRow(),0), &aMark, DelCellCmd::CellsLeft, true);
CPPUNIT_ASSERT(bDeleted);
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(C1:F1)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(C1:F1)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Undo and check again.
pUndo->Undo();
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(C1:H1)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(C1:H1)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
m_pDoc->DeleteTab(0);
}
@@ -3191,7 +3191,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftLeft2)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
std::vector<std::vector<const char*>> aData = {
{ "1", "=COUNT($A$1:$A$4)", "=COUNT(A1)" },
@@ -3222,15 +3222,15 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftLeft2)
auto funcCheckDeleted = [&]()
{
- CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), m_pDoc->GetString(ScAddress(0,0,0))); // A1
- CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), m_pDoc->GetString(ScAddress(0,1,0))); // A2
- CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), m_pDoc->GetString(ScAddress(0,2,0))); // A3
- CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), m_pDoc->GetString(ScAddress(0,3,0))); // A4
-
- CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), m_pDoc->GetString(ScAddress(1,0,0))); // B1
- CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), m_pDoc->GetString(ScAddress(1,1,0))); // B2
- CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), m_pDoc->GetString(ScAddress(1,2,0))); // B3
- CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), m_pDoc->GetString(ScAddress(1,3,0))); // B4
+ CPPUNIT_ASSERT_EQUAL(u"#REF!"_ustr, m_pDoc->GetString(ScAddress(0,0,0))); // A1
+ CPPUNIT_ASSERT_EQUAL(u"#REF!"_ustr, m_pDoc->GetString(ScAddress(0,1,0))); // A2
+ CPPUNIT_ASSERT_EQUAL(u"#REF!"_ustr, m_pDoc->GetString(ScAddress(0,2,0))); // A3
+ CPPUNIT_ASSERT_EQUAL(u"#REF!"_ustr, m_pDoc->GetString(ScAddress(0,3,0))); // A4
+
+ CPPUNIT_ASSERT_EQUAL(u"#REF!"_ustr, m_pDoc->GetString(ScAddress(1,0,0))); // B1
+ CPPUNIT_ASSERT_EQUAL(u"#REF!"_ustr, m_pDoc->GetString(ScAddress(1,1,0))); // B2
+ CPPUNIT_ASSERT_EQUAL(u"#REF!"_ustr, m_pDoc->GetString(ScAddress(1,2,0))); // B3
+ CPPUNIT_ASSERT_EQUAL(u"#REF!"_ustr, m_pDoc->GetString(ScAddress(1,3,0))); // B4
};
funcCheckOriginal();
@@ -3262,7 +3262,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftUp)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Insert 1,2,3,4,5 in A3:A7.
for (SCROW i = 0; i <= 4; ++i)
@@ -3270,7 +3270,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftUp)
// Insert formula in A8.
ScAddress aPos(0,7,0);
- m_pDoc->SetString(aPos, "=SUM(A3:A7)");
+ m_pDoc->SetString(aPos, u"=SUM(A3:A7)"_ustr);
CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
@@ -3283,7 +3283,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftUp)
aPos.IncRow(-2);
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A3:A5)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A3:A5)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Undo and check.
SfxUndoManager* pUndo = m_pDoc->GetUndoManager();
@@ -3292,7 +3292,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftUp)
pUndo->Undo();
aPos.IncRow(2);
CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A3:A7)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A3:A7)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Delete rows 3:4 (top end of the reference).
bDeleted = rFunc.DeleteCells(ScRange(0,2,0,m_pDoc->MaxCol(),3,0), &aMark, DelCellCmd::CellsUp, true);
@@ -3300,13 +3300,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftUp)
aPos.IncRow(-2);
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A3:A5)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A3:A5)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Undo and check again.
pUndo->Undo();
aPos.IncRow(2);
CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A3:A7)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A3:A7)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Delete rows 2:5 (overlaps on the top).
bDeleted = rFunc.DeleteCells(ScRange(0,1,0,m_pDoc->MaxCol(),4,0), &aMark, DelCellCmd::CellsUp, true);
@@ -3314,13 +3314,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftUp)
aPos.IncRow(-4);
CPPUNIT_ASSERT_EQUAL(9.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A2:A3)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A2:A3)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Undo and check again.
pUndo->Undo();
aPos.IncRow(4);
CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A3:A7)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A3:A7)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Start over with a new scenario.
clearSheet(m_pDoc, 0);
@@ -3331,7 +3331,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftUp)
// Set formula in B1.
aPos = ScAddress(0,1,0);
- m_pDoc->SetString(aPos, "=SUM(A3:A8)");
+ m_pDoc->SetString(aPos, u"=SUM(A3:A8)"_ustr);
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(aPos));
// Delete rows 6:8 (bottom end of the reference).
@@ -3339,31 +3339,31 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteAndShiftUp)
CPPUNIT_ASSERT(bDeleted);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A3:A5)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A3:A5)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Undo and check.
pUndo->Undo();
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A3:A8)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A3:A8)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Delete rows 7:9 (overlaps on the bottom).
bDeleted = rFunc.DeleteCells(ScRange(0,6,0,m_pDoc->MaxCol(),8,0), &aMark, DelCellCmd::CellsUp, true);
CPPUNIT_ASSERT(bDeleted);
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A3:A6)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A3:A6)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
// Undo and check again.
pUndo->Undo();
CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(aPos));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A3:A8)"), m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A3:A8)"_ustr, m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateName)
{
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
@@ -3377,17 +3377,17 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateName)
ScRangeName* pGlobalNames = m_pDoc->GetRangeName();
CPPUNIT_ASSERT_MESSAGE("Failed to obtain global named expression object.", pGlobalNames);
ScRangeData* pName = new ScRangeData(
- *m_pDoc, "ToLeft", "RC[-1]", ScAddress(2,1,0),
+ *m_pDoc, u"ToLeft"_ustr, u"RC[-1]"_ustr, ScAddress(2,1,0),
ScRangeData::Type::Name, formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1);
bool bInserted = pGlobalNames->insert(pName);
CPPUNIT_ASSERT_MESSAGE("Failed to insert a new name.", bInserted);
// Insert formulas in D2:D5 using the named expression.
- m_pDoc->SetString(ScAddress(3,1,0), "=ToLeft");
- m_pDoc->SetString(ScAddress(3,2,0), "=ToLeft");
- m_pDoc->SetString(ScAddress(3,3,0), "=ToLeft");
- m_pDoc->SetString(ScAddress(3,4,0), "=ToLeft");
+ m_pDoc->SetString(ScAddress(3,1,0), u"=ToLeft"_ustr);
+ m_pDoc->SetString(ScAddress(3,2,0), u"=ToLeft"_ustr);
+ m_pDoc->SetString(ScAddress(3,3,0), u"=ToLeft"_ustr);
+ m_pDoc->SetString(ScAddress(3,4,0), u"=ToLeft"_ustr);
// Make sure the results are correct.
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(3,1,0));
@@ -3420,22 +3420,22 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateName)
// Insert a new named expression that references these values as absolute range.
pName = new ScRangeData(
- *m_pDoc, "MyRange", "$B$10:$B$12", ScAddress(0,0,0), ScRangeData::Type::Name, formula::FormulaGrammar::GRAM_NATIVE);
+ *m_pDoc, u"MyRange"_ustr, u"$B$10:$B$12"_ustr, ScAddress(0,0,0), ScRangeData::Type::Name, formula::FormulaGrammar::GRAM_NATIVE);
bInserted = pGlobalNames->insert(pName);
CPPUNIT_ASSERT_MESSAGE("Failed to insert a new name.", bInserted);
// Set formula at C8 that references this named expression.
- m_pDoc->SetString(ScAddress(2,7,0), "=SUM(MyRange)");
+ m_pDoc->SetString(ScAddress(2,7,0), u"=SUM(MyRange)"_ustr);
CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(ScAddress(2,7,0)));
// Shift B10:B12 to right by 2 columns.
m_pDoc->InsertCol(ScRange(1,9,0,2,11,0));
// This should shift the absolute range B10:B12 that MyRange references.
- pName = pGlobalNames->findByUpperName("MYRANGE");
+ pName = pGlobalNames->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT_MESSAGE("Failed to find named expression 'MyRange' in the global scope.", pName);
OUString aExpr = pName->GetSymbol();
- CPPUNIT_ASSERT_EQUAL(OUString("$D$10:$D$12"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"$D$10:$D$12"_ustr, aExpr);
// This move shouldn't affect the value of C8.
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(2,7,0));
@@ -3447,12 +3447,12 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateName)
CPPUNIT_ASSERT_EQUAL(43.0, m_pDoc->GetValue(ScAddress(2,7,0)));
// Insert a new sheet before the current.
- m_pDoc->InsertTab(0, "New");
+ m_pDoc->InsertTab(0, u"New"_ustr);
OUString aName;
m_pDoc->GetName(1, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Formula"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Formula"_ustr, aName);
- pName = pGlobalNames->findByUpperName("MYRANGE");
+ pName = pGlobalNames->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT_MESSAGE("Failed to find named expression 'MyRange' in the global scope.", pName);
m_pDoc->SetValue(ScAddress(3,9,1), 10);
@@ -3463,9 +3463,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateName)
aName.clear();
m_pDoc->GetName(0, aName);
- CPPUNIT_ASSERT_EQUAL(OUString("Formula"), aName);
+ CPPUNIT_ASSERT_EQUAL(u"Formula"_ustr, aName);
- pName = pGlobalNames->findByUpperName("MYRANGE");
+ pName = pGlobalNames->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT_MESSAGE("Failed to find named expression 'MyRange' in the global scope.", pName);
m_pDoc->SetValue(ScAddress(3,9,0), 11);
@@ -3476,18 +3476,18 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateName)
pGlobalNames->clear();
pName = new ScRangeData(
- *m_pDoc, "MyRange", "$B$1:$C$6", ScAddress(0,0,0), ScRangeData::Type::Name, formula::FormulaGrammar::GRAM_NATIVE);
+ *m_pDoc, u"MyRange"_ustr, u"$B$1:$C$6"_ustr, ScAddress(0,0,0), ScRangeData::Type::Name, formula::FormulaGrammar::GRAM_NATIVE);
bInserted = pGlobalNames->insert(pName);
CPPUNIT_ASSERT_MESSAGE("Failed to insert a new name.", bInserted);
aExpr = pName->GetSymbol();
- CPPUNIT_ASSERT_EQUAL(OUString("$B$1:$C$6"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"$B$1:$C$6"_ustr, aExpr);
// Insert range of cells to shift right. The range partially overlaps the named range.
m_pDoc->InsertCol(ScRange(2,4,0,3,8,0));
// This should not alter the range.
aExpr = pName->GetSymbol();
- CPPUNIT_ASSERT_EQUAL(OUString("$B$1:$C$6"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"$B$1:$C$6"_ustr, aExpr);
m_pDoc->DeleteTab(0);
}
@@ -3496,7 +3496,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameMove)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Set values to B2:B4.
m_pDoc->SetValue(ScAddress(1,1,0), 1.0);
@@ -3504,17 +3504,17 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameMove)
m_pDoc->SetValue(ScAddress(1,3,0), 3.0);
// Set named range for B2:B4.
- bool bInserted = m_pDoc->InsertNewRangeName("MyRange", ScAddress(0,0,0), "$Test.$B$2:$B$4");
+ bool bInserted = m_pDoc->InsertNewRangeName(u"MyRange"_ustr, ScAddress(0,0,0), u"$Test.$B$2:$B$4"_ustr);
CPPUNIT_ASSERT(bInserted);
// Set formula in A10.
- m_pDoc->SetString(ScAddress(0,9,0), "=SUM(MyRange)");
+ m_pDoc->SetString(ScAddress(0,9,0), u"=SUM(MyRange)"_ustr);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,9,0)));
- ScRangeData* pData = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ ScRangeData* pData = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pData);
OUString aSymbol = pData->GetSymbol(m_pDoc->GetGrammar());
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$2:$B$4"), aSymbol);
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$2:$B$4"_ustr, aSymbol);
// Move B2:B4 to D3.
ScDocFunc& rFunc = m_xDocShell->GetDocFunc();
@@ -3523,7 +3523,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameMove)
// The named range should have moved as well.
aSymbol = pData->GetSymbol(m_pDoc->GetGrammar());
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$D$3:$D$5"), aSymbol);
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$D$3:$D$5"_ustr, aSymbol);
// The value of A10 should remain unchanged.
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,9,0)));
@@ -3534,19 +3534,19 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameMove)
// Undo and check.
pUndoMgr->Undo();
- pData = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ pData = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pData);
aSymbol = pData->GetSymbol(m_pDoc->GetGrammar());
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$2:$B$4"), aSymbol);
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$2:$B$4"_ustr, aSymbol);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,9,0)));
// Redo and check.
pUndoMgr->Redo();
- pData = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ pData = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pData);
aSymbol = pData->GetSymbol(m_pDoc->GetGrammar());
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$D$3:$D$5"), aSymbol);
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$D$3:$D$5"_ustr, aSymbol);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,9,0)));
// Undo again to bring it back to the initial condition, and clear the undo buffer.
@@ -3554,7 +3554,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameMove)
pUndoMgr->Clear();
// Add an identical formula to A11 and make a formula group over A10:A11.
- m_pDoc->SetString(ScAddress(0,10,0), "=SUM(MyRange)");
+ m_pDoc->SetString(ScAddress(0,10,0), u"=SUM(MyRange)"_ustr);
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(0,9,0));
CPPUNIT_ASSERT(pFC);
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(9), pFC->GetSharedTopRow());
@@ -3576,11 +3576,11 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameMove)
m_pDoc->SetValue(ScAddress(1,1,0), 2.0);
// Define B2 as 'MyCell'.
- bInserted = m_pDoc->InsertNewRangeName("MyCell", ScAddress(0,0,0), "$Test.$B$2");
+ bInserted = m_pDoc->InsertNewRangeName(u"MyCell"_ustr, ScAddress(0,0,0), u"$Test.$B$2"_ustr);
CPPUNIT_ASSERT(bInserted);
// Set formula to B3 that references B2 via MyCell.
- m_pDoc->SetString(ScAddress(1,2,0), "=MyCell*2");
+ m_pDoc->SetString(ScAddress(1,2,0), u"=MyCell*2"_ustr);
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(1,2,0)));
// Move B2 to D2.
@@ -3599,9 +3599,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameExpandRef)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- bool bInserted = m_pDoc->InsertNewRangeName("MyRange", ScAddress(0,0,0), "$A$1:$A$3");
+ bool bInserted = m_pDoc->InsertNewRangeName(u"MyRange"_ustr, ScAddress(0,0,0), u"$A$1:$A$3"_ustr);
CPPUNIT_ASSERT(bInserted);
// Set values to A1:A3.
@@ -3609,7 +3609,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameExpandRef)
m_pDoc->SetValue(ScAddress(0,1,0), 2.0);
m_pDoc->SetValue(ScAddress(0,2,0), 3.0);
- m_pDoc->SetString(ScAddress(0,5,0), "=SUM(MyRange)");
+ m_pDoc->SetString(ScAddress(0,5,0), u"=SUM(MyRange)"_ustr);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,5,0)));
// Insert a new row at row 4, which should expand the named range to A1:A4.
@@ -3617,10 +3617,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameExpandRef)
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
rFunc.InsertCells(ScRange(0,3,0,m_pDoc->MaxCol(),3,0), &aMark, INS_INSROWS_BEFORE, false, true);
- ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pName);
OUString aSymbol = pName->GetSymbol(m_pDoc->GetGrammar());
- CPPUNIT_ASSERT_EQUAL(OUString("$A$1:$A$4"), aSymbol);
+ CPPUNIT_ASSERT_EQUAL(u"$A$1:$A$4"_ustr, aSymbol);
// Make sure the listening area has been expanded as well. Note the
// formula cell has been pushed downward by one cell.
@@ -3630,10 +3630,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameExpandRef)
// Insert a new column at column 2, which should not expand the named
// range as it is only one column wide.
rFunc.InsertCells(ScRange(1,0,0,1,m_pDoc->MaxRow(),0), &aMark, INS_INSCOLS_BEFORE, false, true);
- pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ pName = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pName);
aSymbol = pName->GetSymbol(m_pDoc->GetGrammar());
- CPPUNIT_ASSERT_EQUAL(OUString("$A$1:$A$4"), aSymbol);
+ CPPUNIT_ASSERT_EQUAL(u"$A$1:$A$4"_ustr, aSymbol);
// Make sure the referenced area has not changed.
m_pDoc->SetValue(ScAddress(0,3,0), 2.0);
@@ -3650,21 +3650,21 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameExpandRef)
m_pDoc->SetValue(ScAddress(1,4,0), 2.0);
m_pDoc->SetValue(ScAddress(1,5,0), 3.0);
- bInserted = m_pDoc->InsertNewRangeName("MyRange", ScAddress(0,0,0), "$B$4:$B$6");
+ bInserted = m_pDoc->InsertNewRangeName(u"MyRange"_ustr, ScAddress(0,0,0), u"$B$4:$B$6"_ustr);
CPPUNIT_ASSERT(bInserted);
// Set formula to A1.
- m_pDoc->SetString(ScAddress(0,0,0), "=SUM(MyRange)");
+ m_pDoc->SetString(ScAddress(0,0,0), u"=SUM(MyRange)"_ustr);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(0,0,0));
// Insert rows over 3:5 which should expand the range by 3 rows.
rFunc.InsertCells(ScRange(0,2,0,m_pDoc->MaxCol(),4,0), &aMark, INS_INSROWS_BEFORE, false, true);
- pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ pName = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pName);
aSymbol = pName->GetSymbol(m_pDoc->GetGrammar());
- CPPUNIT_ASSERT_EQUAL(OUString("$B$4:$B$9"), aSymbol);
+ CPPUNIT_ASSERT_EQUAL(u"$B$4:$B$9"_ustr, aSymbol);
// Clear the document and start over.
m_pDoc->GetRangeName()->clear();
@@ -3676,13 +3676,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameExpandRef)
m_pDoc->SetValue(ScAddress(0,2,0), 3.0);
// Name A1:A3 'MyData'.
- bInserted = m_pDoc->InsertNewRangeName("MyData", ScAddress(0,0,0), "$A$1:$A$3");
+ bInserted = m_pDoc->InsertNewRangeName(u"MyData"_ustr, ScAddress(0,0,0), u"$A$1:$A$3"_ustr);
CPPUNIT_ASSERT(bInserted);
// Set formulas to C1:C2 and E1.
- m_pDoc->SetString(ScAddress(2,0,0), "=SUM(MyData)");
- m_pDoc->SetString(ScAddress(2,1,0), "=SUM(MyData)");
- m_pDoc->SetString(ScAddress(4,0,0), "=SUM(MyData)");
+ m_pDoc->SetString(ScAddress(2,0,0), u"=SUM(MyData)"_ustr);
+ m_pDoc->SetString(ScAddress(2,1,0), u"=SUM(MyData)"_ustr);
+ m_pDoc->SetString(ScAddress(4,0,0), u"=SUM(MyData)"_ustr);
// C1:C2 should be shared.
const ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(2,0,0));
@@ -3720,9 +3720,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameExpandRef2)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- bool bInserted = m_pDoc->InsertNewRangeName("MyRange", ScAddress(0,0,0), "$A$1:$B$3");
+ bool bInserted = m_pDoc->InsertNewRangeName(u"MyRange"_ustr, ScAddress(0,0,0), u"$A$1:$B$3"_ustr);
CPPUNIT_ASSERT(bInserted);
// Insert a new row at row 4, which should expand the named range to A1:A4.
@@ -3732,41 +3732,41 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameExpandRef2)
// Insert a new column at column 3, which should expand the named
rFunc.InsertCells(ScRange(1,0,0,1,m_pDoc->MaxRow(),0), &aMark, INS_INSCOLS_BEFORE, false, true);
- ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pName);
OUString aSymbol = pName->GetSymbol(m_pDoc->GetGrammar());
- CPPUNIT_ASSERT_EQUAL(OUString("$A$1:$C$3"), aSymbol);
+ CPPUNIT_ASSERT_EQUAL(u"$A$1:$C$3"_ustr, aSymbol);
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameDeleteRow)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Insert a new name 'MyRange' to reference B2:B4.
- bool bInserted = m_pDoc->InsertNewRangeName("MyRange", ScAddress(0,0,0), "$B$2:$B$4");
+ bool bInserted = m_pDoc->InsertNewRangeName(u"MyRange"_ustr, ScAddress(0,0,0), u"$B$2:$B$4"_ustr);
CPPUNIT_ASSERT(bInserted);
- const ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ const ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pName);
sc::TokenStringContext aCxt(*m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH);
const ScTokenArray* pCode = pName->GetCode();
OUString aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$4"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"$B$2:$B$4"_ustr, aExpr);
// Insert a new name 'MyAddress' to reference $B$3. Note absolute row.
- bInserted = m_pDoc->InsertNewRangeName("MyAddress", ScAddress(0,0,0), "$B$3");
+ bInserted = m_pDoc->InsertNewRangeName(u"MyAddress"_ustr, ScAddress(0,0,0), u"$B$3"_ustr);
CPPUNIT_ASSERT(bInserted);
- const ScRangeData* pName2 = m_pDoc->GetRangeName()->findByUpperName("MYADDRESS");
+ const ScRangeData* pName2 = m_pDoc->GetRangeName()->findByUpperName(u"MYADDRESS"_ustr);
CPPUNIT_ASSERT(pName2);
sc::TokenStringContext aCxt2(*m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH);
const ScTokenArray* pCode2 = pName2->GetCode();
OUString aExpr2 = pCode2->CreateString(aCxt2, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$B$3"), aExpr2);
+ CPPUNIT_ASSERT_EQUAL(u"$B$3"_ustr, aExpr2);
ScDocFunc& rFunc = m_xDocShell->GetDocFunc();
@@ -3777,16 +3777,16 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameDeleteRow)
// The reference in the 'MyRange' name should get updated to B2:B3.
aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$3"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"$B$2:$B$3"_ustr, aExpr);
// The reference in the 'MyAddress' name should get updated to $B$#REF!.
aExpr2 = pCode2->CreateString(aCxt2, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$B$#REF!"), aExpr2);
+ CPPUNIT_ASSERT_EQUAL(u"$B$#REF!"_ustr, aExpr2);
// Delete row 3 again.
rFunc.DeleteCells(ScRange(0,2,0,m_pDoc->MaxCol(),2,0), &aMark, DelCellCmd::CellsUp, true);
aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$2"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"$B$2:$B$2"_ustr, aExpr);
// Undo and check.
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
@@ -3794,60 +3794,60 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameDeleteRow)
pUndoMgr->Undo();
- pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ pName = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pName);
pCode = pName->GetCode();
aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$3"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"$B$2:$B$3"_ustr, aExpr);
// Undo again and check.
pUndoMgr->Undo();
- pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ pName = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pName);
pCode = pName->GetCode();
aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$4"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"$B$2:$B$4"_ustr, aExpr);
// Delete row 2-3.
rFunc.DeleteCells(ScRange(0,1,0,m_pDoc->MaxCol(),2,0), &aMark, DelCellCmd::CellsUp, true);
aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$2"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"$B$2:$B$2"_ustr, aExpr);
// Undo and check.
pUndoMgr->Undo();
- pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ pName = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pName);
pCode = pName->GetCode();
aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$4"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"$B$2:$B$4"_ustr, aExpr);
- pName2 = m_pDoc->GetRangeName()->findByUpperName("MYADDRESS");
+ pName2 = m_pDoc->GetRangeName()->findByUpperName(u"MYADDRESS"_ustr);
CPPUNIT_ASSERT(pName2);
pCode2 = pName2->GetCode();
aExpr2 = pCode2->CreateString(aCxt2, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$B$3"), aExpr2);
+ CPPUNIT_ASSERT_EQUAL(u"$B$3"_ustr, aExpr2);
- m_pDoc->InsertTab(1, "test2");
+ m_pDoc->InsertTab(1, u"test2"_ustr);
ScMarkData aMark2(m_pDoc->GetSheetLimits());
aMark2.SelectOneTable(1);
rFunc.DeleteCells(ScRange(0,2,1,m_pDoc->MaxCol(),2,1), &aMark2, DelCellCmd::CellsUp, true);
- pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ pName = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pName);
pCode = pName->GetCode();
aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$4"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"$B$2:$B$4"_ustr, aExpr);
- pName2 = m_pDoc->GetRangeName()->findByUpperName("MYADDRESS");
+ pName2 = m_pDoc->GetRangeName()->findByUpperName(u"MYADDRESS"_ustr);
CPPUNIT_ASSERT(pName2);
pCode2 = pName2->GetCode();
@@ -3858,7 +3858,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameDeleteRow)
// which is the reason why it is not updated either).
// This is a tad confusing...
aExpr2 = pCode2->CreateString(aCxt2, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$B$3"), aExpr2);
+ CPPUNIT_ASSERT_EQUAL(u"$B$3"_ustr, aExpr2);
m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
@@ -3866,18 +3866,18 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameDeleteRow)
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameCopySheet)
{
- m_pDoc->InsertTab(0, "Test");
- m_pDoc->InsertTab(1, "Test2");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
+ m_pDoc->InsertTab(1, u"Test2"_ustr);
- bool bInserted = m_pDoc->InsertNewRangeName("RED", ScAddress(0,0,0), "$Test.$B$2");
+ bool bInserted = m_pDoc->InsertNewRangeName(u"RED"_ustr, ScAddress(0,0,0), u"$Test.$B$2"_ustr);
CPPUNIT_ASSERT(bInserted);
- bInserted = m_pDoc->InsertNewRangeName("BLUE", ScAddress(0,0,0), "$Test.$B$3");
+ bInserted = m_pDoc->InsertNewRangeName(u"BLUE"_ustr, ScAddress(0,0,0), u"$Test.$B$3"_ustr);
CPPUNIT_ASSERT(bInserted);
m_pDoc->SetValue(1, 1, 0, 1);
m_pDoc->SetValue(1, 2, 0, 2);
// insert formula into Test2 that is =RED+BLUE
- m_pDoc->SetString(ScAddress(2,2,1), "=RED+BLUE");
+ m_pDoc->SetString(ScAddress(2,2,1), u"=RED+BLUE"_ustr);
double nVal = m_pDoc->GetValue(2, 2, 1);
CPPUNIT_ASSERT_EQUAL(3.0, nVal);
@@ -3901,12 +3901,12 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameCopySheet)
m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
- m_pDoc->InsertTab(0, "Test1");
+ m_pDoc->InsertTab(0, u"Test1"_ustr);
// Global name referencing sheet Test1.
- bInserted = m_pDoc->InsertNewRangeName("sheetnumber", ScAddress(0,0,0), "$Test1.$A$1");
+ bInserted = m_pDoc->InsertNewRangeName(u"sheetnumber"_ustr, ScAddress(0,0,0), u"$Test1.$A$1"_ustr);
CPPUNIT_ASSERT(bInserted);
- m_pDoc->SetString(ScAddress(0,0,0), "=SHEET()");
- m_pDoc->SetString(ScAddress(1,0,0), "=sheetnumber");
+ m_pDoc->SetString(ScAddress(0,0,0), u"=SHEET()"_ustr);
+ m_pDoc->SetString(ScAddress(1,0,0), u"=sheetnumber"_ustr);
nVal = m_pDoc->GetValue(1,0,0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Sheet number should be 1", 1.0, nVal);
@@ -3916,53 +3916,53 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameCopySheet)
CPPUNIT_ASSERT_EQUAL_MESSAGE("New sheet number should be 2", 2.0, nVal);
nVal = m_pDoc->GetValue(1,0,0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Org sheet number should be 1", 1.0, nVal);
- const ScRangeData* pName = m_pDoc->GetRangeName(1)->findByUpperName("SHEETNUMBER");
+ const ScRangeData* pName = m_pDoc->GetRangeName(1)->findByUpperName(u"SHEETNUMBER"_ustr);
CPPUNIT_ASSERT_MESSAGE("New sheet-local name should exist", pName);
// Copy sheet before, shifting following now two sheets.
m_pDoc->CopyTab(0, 0);
nVal = m_pDoc->GetValue(1,0,0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("New sheet number should be 1", 1.0, nVal);
- pName = m_pDoc->GetRangeName(0)->findByUpperName("SHEETNUMBER");
+ pName = m_pDoc->GetRangeName(0)->findByUpperName(u"SHEETNUMBER"_ustr);
CPPUNIT_ASSERT_MESSAGE("New sheet-local name should exist", pName);
nVal = m_pDoc->GetValue(1,0,1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Org sheet number should be 2", 2.0, nVal);
- pName = m_pDoc->GetRangeName(1)->findByUpperName("SHEETNUMBER");
+ pName = m_pDoc->GetRangeName(1)->findByUpperName(u"SHEETNUMBER"_ustr);
CPPUNIT_ASSERT_MESSAGE("Org sheet-local name should not exist", !pName);
nVal = m_pDoc->GetValue(1,0,2);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Old sheet number should be 3", 3.0, nVal);
- pName = m_pDoc->GetRangeName(2)->findByUpperName("SHEETNUMBER");
+ pName = m_pDoc->GetRangeName(2)->findByUpperName(u"SHEETNUMBER"_ustr);
CPPUNIT_ASSERT_MESSAGE("Old sheet-local name should exist", pName);
m_pDoc->DeleteTab(2);
m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
- m_pDoc->InsertTab(0, "Test2");
+ m_pDoc->InsertTab(0, u"Test2"_ustr);
// Local name referencing sheet Test2.
- bInserted = m_pDoc->GetRangeName(0)->insert( new ScRangeData( *m_pDoc, "localname", "$Test2.$A$1"));
+ bInserted = m_pDoc->GetRangeName(0)->insert( new ScRangeData( *m_pDoc, u"localname"_ustr, u"$Test2.$A$1"_ustr));
CPPUNIT_ASSERT(bInserted);
- m_pDoc->SetString(ScAddress(0,0,0), "=SHEET()");
- m_pDoc->SetString(ScAddress(1,0,0), "=localname");
+ m_pDoc->SetString(ScAddress(0,0,0), u"=SHEET()"_ustr);
+ m_pDoc->SetString(ScAddress(1,0,0), u"=localname"_ustr);
nVal = m_pDoc->GetValue(1,0,0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Localname sheet number should be 1", 1.0, nVal);
// Insert sheet before and shift sheet with local name.
- m_pDoc->InsertTab(0, "Test1");
- pName = m_pDoc->GetRangeName(1)->findByUpperName("LOCALNAME");
+ m_pDoc->InsertTab(0, u"Test1"_ustr);
+ pName = m_pDoc->GetRangeName(1)->findByUpperName(u"LOCALNAME"_ustr);
CPPUNIT_ASSERT_MESSAGE("Org sheet-local name should exist", pName);
nVal = m_pDoc->GetValue(1,0,1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Localname sheet number should be 2", 2.0, nVal);
// Copy sheet before, shifting following now two sheets.
m_pDoc->CopyTab(1, 0);
- pName = m_pDoc->GetRangeName(0)->findByUpperName("LOCALNAME");
+ pName = m_pDoc->GetRangeName(0)->findByUpperName(u"LOCALNAME"_ustr);
CPPUNIT_ASSERT_MESSAGE("New sheet-local name should exist", pName);
nVal = m_pDoc->GetValue(1,0,0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("New sheet number should be 1", 1.0, nVal);
- pName = m_pDoc->GetRangeName(1)->findByUpperName("LOCALNAME");
+ pName = m_pDoc->GetRangeName(1)->findByUpperName(u"LOCALNAME"_ustr);
CPPUNIT_ASSERT_MESSAGE("Old sheet-local name should not exist", !pName);
- pName = m_pDoc->GetRangeName(2)->findByUpperName("LOCALNAME");
+ pName = m_pDoc->GetRangeName(2)->findByUpperName(u"LOCALNAME"_ustr);
CPPUNIT_ASSERT_MESSAGE("Org sheet-local name should exist", pName);
nVal = m_pDoc->GetValue(1,0,2);
CPPUNIT_ASSERT_EQUAL_MESSAGE("New sheet number should be 3", 3.0, nVal);
@@ -3974,40 +3974,40 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameCopySheet)
// Test nested names during copying sheet.
- m_pDoc->InsertTab(0, "Test2");
+ m_pDoc->InsertTab(0, u"Test2"_ustr);
ScAddress aPos(0,0,0);
- bInserted = m_pDoc->InsertNewRangeName( "global", aPos, "$Test2.$A$1");
+ bInserted = m_pDoc->InsertNewRangeName( u"global"_ustr, aPos, u"$Test2.$A$1"_ustr);
CPPUNIT_ASSERT(bInserted);
- bInserted = m_pDoc->InsertNewRangeName( aPos.Tab(), "local", aPos, "$Test2.$A$2");
+ bInserted = m_pDoc->InsertNewRangeName( aPos.Tab(), u"local"_ustr, aPos, u"$Test2.$A$2"_ustr);
CPPUNIT_ASSERT(bInserted);
- bInserted = m_pDoc->InsertNewRangeName( "global_global", aPos, "global*100");
+ bInserted = m_pDoc->InsertNewRangeName( u"global_global"_ustr, aPos, u"global*100"_ustr);
CPPUNIT_ASSERT(bInserted);
- bInserted = m_pDoc->InsertNewRangeName( "global_local", aPos, "local*1000");
+ bInserted = m_pDoc->InsertNewRangeName( u"global_local"_ustr, aPos, u"local*1000"_ustr);
CPPUNIT_ASSERT(bInserted);
- bInserted = m_pDoc->InsertNewRangeName( "global_unused", aPos, "$Test2.$A$1");
+ bInserted = m_pDoc->InsertNewRangeName( u"global_unused"_ustr, aPos, u"$Test2.$A$1"_ustr);
CPPUNIT_ASSERT(bInserted);
- bInserted = m_pDoc->InsertNewRangeName( "global_unused_noref", aPos, "42");
+ bInserted = m_pDoc->InsertNewRangeName( u"global_unused_noref"_ustr, aPos, u"42"_ustr);
CPPUNIT_ASSERT(bInserted);
- bInserted = m_pDoc->InsertNewRangeName( aPos.Tab(), "local_global", aPos, "global*10000");
+ bInserted = m_pDoc->InsertNewRangeName( aPos.Tab(), u"local_global"_ustr, aPos, u"global*10000"_ustr);
CPPUNIT_ASSERT(bInserted);
- bInserted = m_pDoc->InsertNewRangeName( aPos.Tab(), "local_local", aPos, "local*100000");
+ bInserted = m_pDoc->InsertNewRangeName( aPos.Tab(), u"local_local"_ustr, aPos, u"local*100000"_ustr);
CPPUNIT_ASSERT(bInserted);
- bInserted = m_pDoc->InsertNewRangeName( aPos.Tab(), "local_unused", aPos, "$Test2.$A$2");
+ bInserted = m_pDoc->InsertNewRangeName( aPos.Tab(), u"local_unused"_ustr, aPos, u"$Test2.$A$2"_ustr);
CPPUNIT_ASSERT(bInserted);
- bInserted = m_pDoc->InsertNewRangeName( aPos.Tab(), "local_unused_noref", aPos, "23");
+ bInserted = m_pDoc->InsertNewRangeName( aPos.Tab(), u"local_unused_noref"_ustr, aPos, u"23"_ustr);
CPPUNIT_ASSERT(bInserted);
- m_pDoc->SetString(aPos, "=SHEET()");
+ m_pDoc->SetString(aPos, u"=SHEET()"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=A1*10+SHEET()");
+ m_pDoc->SetString(aPos, u"=A1*10+SHEET()"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=global_global");
+ m_pDoc->SetString(aPos, u"=global_global"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=global_local");
+ m_pDoc->SetString(aPos, u"=global_local"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=local_global");
+ m_pDoc->SetString(aPos, u"=local_global"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=local_local");
+ m_pDoc->SetString(aPos, u"=local_local"_ustr);
testFormulaRefUpdateNameCopySheetCheckTab( m_pDoc, 0, false);
@@ -4031,31 +4031,31 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheetLocalMove)
{
SCTAB nSheet1 = 0;
SCTAB nSheet2 = 1;
- m_pDoc->InsertTab( nSheet1, "Sheet1");
- m_pDoc->InsertTab( nSheet2, "Sheet2");
+ m_pDoc->InsertTab( nSheet1, u"Sheet1"_ustr);
+ m_pDoc->InsertTab( nSheet2, u"Sheet2"_ustr);
ScAddress aPos(0,0,nSheet1);
bool bOk;
- bOk = m_pDoc->InsertNewRangeName( 0, "MyCell", aPos, "$Sheet1.$B$2");
+ bOk = m_pDoc->InsertNewRangeName( 0, u"MyCell"_ustr, aPos, u"$Sheet1.$B$2"_ustr);
CPPUNIT_ASSERT(bOk);
aPos.SetTab(nSheet2);
- bOk = m_pDoc->InsertNewRangeName( 1, "MyCell", aPos, "$Sheet2.$B$2");
+ bOk = m_pDoc->InsertNewRangeName( 1, u"MyCell"_ustr, aPos, u"$Sheet2.$B$2"_ustr);
CPPUNIT_ASSERT(bOk);
aPos.SetTab(nSheet1);
aPos.IncCol();
- m_pDoc->SetString( aPos, "x");
+ m_pDoc->SetString( aPos, u"x"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "1.0");
+ m_pDoc->SetString( aPos, u"1.0"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=MyCell");
+ m_pDoc->SetString( aPos, u"=MyCell"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Sheet1.B3", 1.0, m_pDoc->GetValue(aPos));
aPos.SetTab(nSheet2);
aPos.SetRow(1);
- m_pDoc->SetString( aPos, "2.0");
+ m_pDoc->SetString( aPos, u"2.0"_ustr);
aPos.IncRow();
- m_pDoc->SetString( aPos, "=MyCell");
+ m_pDoc->SetString( aPos, u"=MyCell"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Sheet2.B3", 2.0, m_pDoc->GetValue(aPos));
ScDocFunc& rFunc = m_xDocShell->GetDocFunc();
@@ -4069,9 +4069,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheetLocalMove)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Move x: Sheet2.B3", 2.0, m_pDoc->GetValue(ScAddress(1,2,nSheet2)));
// Formulas not changed.
aFormula = m_pDoc->GetFormula( 1,2,nSheet1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Move x: Sheet1.B3", OUString("=MyCell"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Move x: Sheet1.B3", u"=MyCell"_ustr, aFormula);
aFormula = m_pDoc->GetFormula( 1,2,nSheet2);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Move x: Sheet2.B3", OUString("=MyCell"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Move x: Sheet2.B3", u"=MyCell"_ustr, aFormula);
// Move Sheet2.B2 ("2.0") to Sheet1.C2
bOk = rFunc.MoveBlock( ScRange(1,1,nSheet2,1,1,nSheet2), ScAddress(2,1,nSheet1), true, false, false, false);
@@ -4081,18 +4081,18 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheetLocalMove)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Move 2.0: Sheet2.B3", 2.0, m_pDoc->GetValue(ScAddress(1,2,nSheet2)));
// Formulas not changed.
aFormula = m_pDoc->GetFormula( 1,2,nSheet1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Move 2.0: Sheet1.B3", OUString("=MyCell"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Move 2.0: Sheet1.B3", u"=MyCell"_ustr, aFormula);
aFormula = m_pDoc->GetFormula( 1,2,nSheet2);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Move 2.0: Sheet2.B3", OUString("=MyCell"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Move 2.0: Sheet2.B3", u"=MyCell"_ustr, aFormula);
ScRangeData* pName;
// Check that the sheet-local named reference points to the moved cell, now
// Sheet1.C2
- pName = m_pDoc->GetRangeName(nSheet2)->findByUpperName("MYCELL");
+ pName = m_pDoc->GetRangeName(nSheet2)->findByUpperName(u"MYCELL"_ustr);
CPPUNIT_ASSERT(pName);
aFormula = pName->GetSymbol( ScAddress(), formula::FormulaGrammar::GRAM_ENGLISH);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Move 2.0: Sheet2 sheet-local name", OUString("$Sheet1.$C$2"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Move 2.0: Sheet2 sheet-local name", u"$Sheet1.$C$2"_ustr, aFormula);
// Move Sheet2.B3 ("=MyCell") to Sheet1.C3
bOk = rFunc.MoveBlock( ScRange(1,2,nSheet2,1,2,nSheet2), ScAddress(2,2,nSheet1), true, false, false, false);
@@ -4103,26 +4103,26 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheetLocalMove)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Move =MyCell: Sheet1.C3", 2.0, m_pDoc->GetValue(ScAddress(2,2,nSheet1)));
// One formula identical, one adjusted.
aFormula = m_pDoc->GetFormula( 1,2,nSheet1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Move =MyCell: Sheet1.B3", OUString("=MyCell"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Move =MyCell: Sheet1.B3", u"=MyCell"_ustr, aFormula);
aFormula = m_pDoc->GetFormula( 2,2,nSheet1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Move =MyCell: Sheet1.C3", OUString("=Sheet2.MyCell"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Move =MyCell: Sheet1.C3", u"=Sheet2.MyCell"_ustr, aFormula);
// Check that the sheet-local named reference in Sheet1 still points to the
// original cell Sheet1.B2
- pName = m_pDoc->GetRangeName(nSheet1)->findByUpperName("MYCELL");
+ pName = m_pDoc->GetRangeName(nSheet1)->findByUpperName(u"MYCELL"_ustr);
CPPUNIT_ASSERT(pName);
aFormula = pName->GetSymbol( ScAddress(), formula::FormulaGrammar::GRAM_ENGLISH);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Move =MyCell: Sheet1 sheet-local name", OUString("$Sheet1.$B$2"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Move =MyCell: Sheet1 sheet-local name", u"$Sheet1.$B$2"_ustr, aFormula);
// Check that the sheet-local named reference in Sheet2 still points to the
// moved cell, now Sheet1.C2
- pName = m_pDoc->GetRangeName(nSheet2)->findByUpperName("MYCELL");
+ pName = m_pDoc->GetRangeName(nSheet2)->findByUpperName(u"MYCELL"_ustr);
CPPUNIT_ASSERT(pName);
aFormula = pName->GetSymbol( ScAddress(), formula::FormulaGrammar::GRAM_ENGLISH);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Move =MyCell: Sheet2 sheet-local name", OUString("$Sheet1.$C$2"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Move =MyCell: Sheet2 sheet-local name", u"$Sheet1.$C$2"_ustr, aFormula);
// Insert sheet before the others.
- m_pDoc->InsertTab(0, "Sheet0");
+ m_pDoc->InsertTab(0, u"Sheet0"_ustr);
++nSheet1;
++nSheet2;
@@ -4130,17 +4130,17 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheetLocalMove)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Insert Sheet0: Sheet1.B3", 1.0, m_pDoc->GetValue(ScAddress(1,2,nSheet1)));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Insert Sheet0: Sheet1.C3", 2.0, m_pDoc->GetValue(ScAddress(2,2,nSheet1)));
aFormula = m_pDoc->GetFormula( 1,2,nSheet1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Insert Sheet0: Sheet1.B3", OUString("=MyCell"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Insert Sheet0: Sheet1.B3", u"=MyCell"_ustr, aFormula);
aFormula = m_pDoc->GetFormula( 2,2,nSheet1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Insert Sheet0: Sheet1.C3", OUString("=Sheet2.MyCell"), aFormula);
- pName = m_pDoc->GetRangeName(nSheet1)->findByUpperName("MYCELL");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Insert Sheet0: Sheet1.C3", u"=Sheet2.MyCell"_ustr, aFormula);
+ pName = m_pDoc->GetRangeName(nSheet1)->findByUpperName(u"MYCELL"_ustr);
CPPUNIT_ASSERT(pName);
aFormula = pName->GetSymbol( ScAddress(), formula::FormulaGrammar::GRAM_ENGLISH);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Insert Sheet0: Sheet1 sheet-local name", OUString("$Sheet1.$B$2"), aFormula);
- pName = m_pDoc->GetRangeName(nSheet2)->findByUpperName("MYCELL");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Insert Sheet0: Sheet1 sheet-local name", u"$Sheet1.$B$2"_ustr, aFormula);
+ pName = m_pDoc->GetRangeName(nSheet2)->findByUpperName(u"MYCELL"_ustr);
CPPUNIT_ASSERT(pName);
aFormula = pName->GetSymbol( ScAddress(), formula::FormulaGrammar::GRAM_ENGLISH);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Insert Sheet0: Sheet2 sheet-local name", OUString("$Sheet1.$C$2"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Insert Sheet0: Sheet2 sheet-local name", u"$Sheet1.$C$2"_ustr, aFormula);
// Delete sheet before the others.
m_pDoc->DeleteTab(0);
@@ -4151,17 +4151,17 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheetLocalMove)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet0: Sheet1.B3", 1.0, m_pDoc->GetValue(ScAddress(1,2,nSheet1)));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet0: Sheet1.C3", 2.0, m_pDoc->GetValue(ScAddress(2,2,nSheet1)));
aFormula = m_pDoc->GetFormula( 1,2,nSheet1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet0: Sheet1.B3", OUString("=MyCell"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet0: Sheet1.B3", u"=MyCell"_ustr, aFormula);
aFormula = m_pDoc->GetFormula( 2,2,nSheet1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet0: Sheet1.C3", OUString("=Sheet2.MyCell"), aFormula);
- pName = m_pDoc->GetRangeName(nSheet1)->findByUpperName("MYCELL");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet0: Sheet1.C3", u"=Sheet2.MyCell"_ustr, aFormula);
+ pName = m_pDoc->GetRangeName(nSheet1)->findByUpperName(u"MYCELL"_ustr);
CPPUNIT_ASSERT(pName);
aFormula = pName->GetSymbol( ScAddress(), formula::FormulaGrammar::GRAM_ENGLISH);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet0: Sheet1 sheet-local name", OUString("$Sheet1.$B$2"), aFormula);
- pName = m_pDoc->GetRangeName(nSheet2)->findByUpperName("MYCELL");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet0: Sheet1 sheet-local name", u"$Sheet1.$B$2"_ustr, aFormula);
+ pName = m_pDoc->GetRangeName(nSheet2)->findByUpperName(u"MYCELL"_ustr);
CPPUNIT_ASSERT(pName);
aFormula = pName->GetSymbol( ScAddress(), formula::FormulaGrammar::GRAM_ENGLISH);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet0: Sheet2 sheet-local name", OUString("$Sheet1.$C$2"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet0: Sheet2 sheet-local name", u"$Sheet1.$C$2"_ustr, aFormula);
// Delete last sheet with sheet-local name.
m_pDoc->DeleteTab(nSheet2);
@@ -4172,15 +4172,15 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheetLocalMove)
// Nothing changed except the sheet-local name and its use.
CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet2: Sheet1.B3", 1.0, m_pDoc->GetValue(ScAddress(1,2,nSheet1)));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet2: Sheet1.C3", 0.0, m_pDoc->GetValue(ScAddress(2,2,nSheet1)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet2: Sheet1.C3", OUString("#NAME?"), m_pDoc->GetString(ScAddress(2,2,nSheet1)));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet2: Sheet1.C3", u"#NAME?"_ustr, m_pDoc->GetString(ScAddress(2,2,nSheet1)));
aFormula = m_pDoc->GetFormula( 1,2,nSheet1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet2: Sheet1.B3", OUString("=MyCell"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet2: Sheet1.B3", u"=MyCell"_ustr, aFormula);
aFormula = m_pDoc->GetFormula( 2,2,nSheet1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet2: Sheet1.C3", OUString("=#NAME?"), aFormula);
- pName = m_pDoc->GetRangeName(nSheet1)->findByUpperName("MYCELL");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet2: Sheet1.C3", u"=#NAME?"_ustr, aFormula);
+ pName = m_pDoc->GetRangeName(nSheet1)->findByUpperName(u"MYCELL"_ustr);
CPPUNIT_ASSERT(pName);
aFormula = pName->GetSymbol( ScAddress(), formula::FormulaGrammar::GRAM_ENGLISH);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet2: Sheet1 sheet-local name", OUString("$Sheet1.$B$2"), aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Delete Sheet2: Sheet1 sheet-local name", u"$Sheet1.$B$2"_ustr, aFormula);
CPPUNIT_ASSERT(!m_pDoc->GetRangeName(nSheet2));
nSheet2 = -1;
@@ -4189,20 +4189,20 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateSheetLocalMove)
CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateNameDelete)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Insert a new name 'MyRange' to reference B1
- bool bInserted = m_pDoc->InsertNewRangeName("MyRange", ScAddress(0,0,0), "$Test.$B$1");
+ bool bInserted = m_pDoc->InsertNewRangeName(u"MyRange"_ustr, ScAddress(0,0,0), u"$Test.$B$1"_ustr);
CPPUNIT_ASSERT(bInserted);
- const ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+ const ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName(u"MYRANGE"_ustr);
CPPUNIT_ASSERT(pName);
m_pDoc->DeleteCol(1, 0, 3, 0, 0, 1);
const ScTokenArray* pCode = pName->GetCode();
sc::TokenStringContext aCxt(*m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH);
OUString aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$1"), aExpr);
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$B$1"_ustr, aExpr);
m_pDoc->DeleteTab(0);
}
@@ -4242,7 +4242,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateValidity)
setExpandRefs(false);
setCalcAsShown(m_pDoc, true);
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
// Set values in C2:C4.
m_pDoc->SetValue(ScAddress(2,1,0), 1.0);
@@ -4251,7 +4251,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateValidity)
// Set validity in A2.
ScValidationData aData(
- SC_VALID_LIST, ScConditionMode::Equal, "C2:C4", "", *m_pDoc, ScAddress(0,1,0), "", "",
+ SC_VALID_LIST, ScConditionMode::Equal, u"C2:C4"_ustr, u""_ustr, *m_pDoc, ScAddress(0,1,0), u""_ustr, u""_ustr,
m_pDoc->GetGrammar(), m_pDoc->GetGrammar());
sal_uInt32 nIndex = m_pDoc->AddValidationEntry(aData);
@@ -4331,8 +4331,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateValidity)
CPPUNIT_TEST_FIXTURE(TestFormula, testTokenArrayRefUpdateMove)
{
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
ScAddress aPos(0,0,0); // A1
@@ -4345,10 +4345,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testTokenArrayRefUpdateMove)
aRefCxt.mnTabDelta = -1;
std::vector<OUString> aTests = {
- "B1*C1",
- "SUM(B1:C1)",
- "$Sheet1.B1",
- "SUM(Sheet1.B1:Sheet2.B1)"
+ u"B1*C1"_ustr,
+ u"SUM(B1:C1)"_ustr,
+ u"$Sheet1.B1"_ustr,
+ u"SUM(Sheet1.B1:Sheet2.B1)"_ustr
};
// Since C3 is not referenced in any of the above formulas, moving C3 from
@@ -4377,13 +4377,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testTokenArrayRefUpdateMove)
CPPUNIT_TEST_FIXTURE(TestFormula, testMultipleOperations)
{
- m_pDoc->InsertTab(0, "MultiOp");
+ m_pDoc->InsertTab(0, u"MultiOp"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
// Insert the reference formula at top row.
m_pDoc->SetValue(ScAddress(0,0,0), 1);
- m_pDoc->SetString(ScAddress(1,0,0), "=A1*10");
+ m_pDoc->SetString(ScAddress(1,0,0), u"=A1*10"_ustr);
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(1,0,0)));
// Insert variable inputs in A3:A5.
@@ -4407,7 +4407,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testMultipleOperations)
clearRange(m_pDoc, ScRange(0,2,0,1,4,0));
// This time, use indirect reference formula cell.
- m_pDoc->SetString(ScAddress(2,0,0), "=B1"); // C1 simply references B1.
+ m_pDoc->SetString(ScAddress(2,0,0), u"=B1"_ustr); // C1 simply references B1.
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(2,0,0)));
// Insert variable inputs in A3:A5.
@@ -4428,13 +4428,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testMultipleOperations)
CPPUNIT_TEST_FIXTURE(TestFormula, testFuncCOLUMN)
{
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->SetString(ScAddress(5,10,0), "=COLUMN()");
+ m_pDoc->SetString(ScAddress(5,10,0), u"=COLUMN()"_ustr);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(5,10,0)));
- m_pDoc->SetString(ScAddress(0,1,0), "=F11");
+ m_pDoc->SetString(ScAddress(0,1,0), u"=F11"_ustr);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,1,0)));
// Move the formula cell with COLUMN() function to change its value.
@@ -4457,7 +4457,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncCOLUMN)
CPPUNIT_TEST_FIXTURE(TestFormula, testFuncCOUNT)
{
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
m_pDoc->SetValue(ScAddress(0,0,0), 2); // A1
@@ -4465,30 +4465,30 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncCOUNT)
m_pDoc->SetValue(ScAddress(0,2,0), 6); // A3
ScAddress aPos(1,0,0);
- m_pDoc->SetString(aPos, "=COUNT(A1:A3)");
+ m_pDoc->SetString(aPos, u"=COUNT(A1:A3)"_ustr);
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=COUNT(A1:A3;2)");
+ m_pDoc->SetString(aPos, u"=COUNT(A1:A3;2)"_ustr);
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=COUNT(A1:A3;2;4)");
+ m_pDoc->SetString(aPos, u"=COUNT(A1:A3;2;4)"_ustr);
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=COUNT(A1:A3;2;4;6)");
+ m_pDoc->SetString(aPos, u"=COUNT(A1:A3;2;4;6)"_ustr);
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(aPos));
// Matrix in C1.
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(2, 0, 2, 0, aMark, "=COUNT(SEARCH(\"a\";{\"a\";\"b\";\"a\"}))");
+ m_pDoc->InsertMatrixFormula(2, 0, 2, 0, aMark, u"=COUNT(SEARCH(\"a\";{\"a\";\"b\";\"a\"}))"_ustr);
// Check that the #VALUE! error of "a" not found in "b" is not counted.
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(2,0,0)));
// Matrix in C3.
- m_pDoc->InsertMatrixFormula(2, 2, 2, 2, aMark, "=COUNTA(SEARCH(\"a\";{\"a\";\"b\";\"a\"}))");
+ m_pDoc->InsertMatrixFormula(2, 2, 2, 2, aMark, u"=COUNTA(SEARCH(\"a\";{\"a\";\"b\";\"a\"}))"_ustr);
// Check that the #VALUE! error of "a" not found in "b" is counted.
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(2,2,0)));
@@ -4498,7 +4498,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncCOUNT)
CPPUNIT_TEST_FIXTURE(TestFormula, testFuncCOUNTBLANK)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
std::vector<std::vector<const char*>> aData = {
{ "1", nullptr, "=B1", "=\"\"" },
@@ -4544,13 +4544,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncCOUNTBLANK)
CPPUNIT_TEST_FIXTURE(TestFormula, testFuncROW)
{
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->SetString(ScAddress(5,10,0), "=ROW()");
+ m_pDoc->SetString(ScAddress(5,10,0), u"=ROW()"_ustr);
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(ScAddress(5,10,0)));
- m_pDoc->SetString(ScAddress(0,1,0), "=F11");
+ m_pDoc->SetString(ScAddress(0,1,0), u"=F11"_ustr);
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(ScAddress(0,1,0)));
// Insert 2 new rows at row 4.
@@ -4571,9 +4571,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncROW)
// Clear sheet and start over.
clearSheet(m_pDoc, 0);
- m_pDoc->SetString(ScAddress(0,1,0), "=ROW(A5)");
- m_pDoc->SetString(ScAddress(1,1,0), "=ROW(B5)");
- m_pDoc->SetString(ScAddress(1,2,0), "=ROW(B6)");
+ m_pDoc->SetString(ScAddress(0,1,0), u"=ROW(A5)"_ustr);
+ m_pDoc->SetString(ScAddress(1,1,0), u"=ROW(B5)"_ustr);
+ m_pDoc->SetString(ScAddress(1,2,0), u"=ROW(B6)"_ustr);
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(ScAddress(1,1,0)));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(1,2,0)));
@@ -4589,9 +4589,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncROW)
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
rFunc.InsertCells(ScRange(0,3,0,m_pDoc->MaxCol(),3,0), &aMark, INS_INSROWS_BEFORE, false, true);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=ROW(A6)"), m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=ROW(B6)"), m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=ROW(B7)"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=ROW(A6)"_ustr, m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=ROW(B6)"_ustr, m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=ROW(B7)"_ustr, m_pDoc->GetFormula(1,2,0));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(1,1,0)));
@@ -4603,14 +4603,14 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncROW)
CPPUNIT_TEST_FIXTURE(TestFormula, testFuncSUM)
{
CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
- m_pDoc->InsertTab (0, "foo"));
+ m_pDoc->InsertTab (0, u"foo"_ustr));
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
// Single argument case.
m_pDoc->SetValue(ScAddress(0,0,0), 1);
m_pDoc->SetValue(ScAddress(0,1,0), 1);
- m_pDoc->SetString(ScAddress(0,2,0), "=SUM(A1:A2)");
+ m_pDoc->SetString(ScAddress(0,2,0), u"=SUM(A1:A2)"_ustr);
m_pDoc->CalcAll();
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(0,2,0)));
@@ -4627,9 +4627,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncSUM)
m_pDoc->SetValue(ScAddress(1,3,0), 6);
m_pDoc->SetValue(ScAddress(1,4,0), 7);
- m_pDoc->SetString(ScAddress(3,0,0), "=SUM(A1:A2;B1:B2)");
- m_pDoc->SetString(ScAddress(3,1,0), "=SUM(A2:A3;B2:B3)");
- m_pDoc->SetString(ScAddress(3,2,0), "=SUM(A3:A4;B3:B4)");
+ m_pDoc->SetString(ScAddress(3,0,0), u"=SUM(A1:A2;B1:B2)"_ustr);
+ m_pDoc->SetString(ScAddress(3,1,0), u"=SUM(A2:A3;B2:B3)"_ustr);
+ m_pDoc->SetString(ScAddress(3,2,0), u"=SUM(A3:A4;B3:B4)"_ustr);
CPPUNIT_ASSERT_EQUAL(30.0, m_pDoc->GetValue(ScAddress(3,0,0)));
CPPUNIT_ASSERT_EQUAL(35.0, m_pDoc->GetValue(ScAddress(3,1,0)));
CPPUNIT_ASSERT_EQUAL(20.0, m_pDoc->GetValue(ScAddress(3,2,0)));
@@ -4641,11 +4641,11 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncSUM)
m_pDoc->SetValue(ScAddress(0,0,0), 1.0);
m_pDoc->SetValue(ScAddress(0,1,0), 10.0);
m_pDoc->SetValue(ScAddress(0,2,0), 100.0);
- m_pDoc->SetString(ScAddress(0,3,0), "=SUM(A1:A3)");
+ m_pDoc->SetString(ScAddress(0,3,0), u"=SUM(A1:A3)"_ustr);
CPPUNIT_ASSERT_EQUAL(111.0, m_pDoc->GetValue(ScAddress(0,3,0)));
// Set #DIV/0! error to A3. A4 should also inherit this error.
- m_pDoc->SetString(ScAddress(0,2,0), "=1/0");
+ m_pDoc->SetString(ScAddress(0,2,0), u"=1/0"_ustr);
FormulaError nErr = m_pDoc->GetErrCode(ScAddress(0,2,0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell should have a division by zero error.",
int(FormulaError::DivisionByZero), static_cast<int>(nErr));
@@ -4654,17 +4654,17 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncSUM)
int(FormulaError::DivisionByZero), static_cast<int>(nErr));
// Set #NA! to A2. A4 should now inherit this error.
- m_pDoc->SetString(ScAddress(0,1,0), "=NA()");
+ m_pDoc->SetString(ScAddress(0,1,0), u"=NA()"_ustr);
nErr = m_pDoc->GetErrCode(ScAddress(0,1,0));
CPPUNIT_ASSERT_MESSAGE("A2 should be an error.", nErr != FormulaError::NONE);
CPPUNIT_ASSERT_EQUAL_MESSAGE("A4 should have inherited the same error as A2.",
static_cast<int>(nErr), static_cast<int>(m_pDoc->GetErrCode(ScAddress(0,3,0))));
// Test the dreaded 0.1 + 0.2 - 0.3 != 0.0
- m_pDoc->SetString(ScAddress(1,0,0), "=SUM(0.1;0.2;-0.3)");
+ m_pDoc->SetString(ScAddress(1,0,0), u"=SUM(0.1;0.2;-0.3)"_ustr);
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(1,0,0)));
// Also for +/- operators
- m_pDoc->SetString(ScAddress(1,1,0), "=0.1+0.2-0.3");
+ m_pDoc->SetString(ScAddress(1,1,0), u"=0.1+0.2-0.3"_ustr);
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(1,1,0)));
m_pDoc->DeleteTab(0);
@@ -4674,20 +4674,20 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncPRODUCT)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto recalc.
- CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab(0, "foo"));
+ CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab(0, u"foo"_ustr));
ScAddress aPos(3, 0, 0);
m_pDoc->SetValue(0, 0, 0, 3.0); // A1
- m_pDoc->SetString(aPos, "=PRODUCT(A1)");
+ m_pDoc->SetString(aPos, u"=PRODUCT(A1)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT failed", 3.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(0, 0, 0, -3.0); // A1
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT failed", -3.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=PRODUCT(B1)");
+ m_pDoc->SetString(aPos, u"=PRODUCT(B1)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT failed", 0.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(1, 0, 0, 10.0); // B1
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT failed", 10.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=PRODUCT(A1:C3)");
+ m_pDoc->SetString(aPos, u"=PRODUCT(A1:C3)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT failed", -30.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(1, 1, 0, -1.0); // B2
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT failed", 30.0, m_pDoc->GetValue(aPos));
@@ -4706,18 +4706,18 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncPRODUCT)
m_pDoc->SetValue(2, 2, 0, 0.0); // C3
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of PRODUCT failed", 0.0, m_pDoc->GetValue(aPos), 10e-4);
- m_pDoc->SetString(aPos, "=PRODUCT({2;3;4})");
+ m_pDoc->SetString(aPos, u"=PRODUCT({2;3;4})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT with inline array failed", 24.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=PRODUCT({2;-2;2})");
+ m_pDoc->SetString(aPos, u"=PRODUCT({2;-2;2})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT with inline array failed", -8.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=PRODUCT({8;0.125;-1})");
+ m_pDoc->SetString(aPos, u"=PRODUCT({8;0.125;-1})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT with inline array failed", -1.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=PRODUCT({2;3};{4;5})");
+ m_pDoc->SetString(aPos, u"=PRODUCT({2;3};{4;5})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT with inline array failed", 120.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=PRODUCT({10;-8};{3;-1};{15;30};{7})");
+ m_pDoc->SetString(aPos, u"=PRODUCT({10;-8};{3;-1};{15;30};{7})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT with inline array failed", 756000.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=PRODUCT({10;-0.1;8};{0.125;4;0.25;2};{0.5};{1};{-1})");
+ m_pDoc->SetString(aPos, u"=PRODUCT({10;-0.1;8};{0.125;4;0.25;2};{0.5};{1};{-1})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT with inline array failed", 1.0, m_pDoc->GetValue(aPos));
m_pDoc->DeleteTab(0);
@@ -4725,12 +4725,12 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncPRODUCT)
CPPUNIT_TEST_FIXTURE(TestFormula, testFuncSUMPRODUCT)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto recalc.
ScAddress aPos(0,0,0);
- m_pDoc->SetString(aPos, "=SUMPRODUCT(B1:B3;C1:C3)");
+ m_pDoc->SetString(aPos, u"=SUMPRODUCT(B1:B3;C1:C3)"_ustr);
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(ScAddress(2,0,0), 1.0); // C1
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(aPos));
@@ -4746,7 +4746,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncSUMPRODUCT)
CPPUNIT_ASSERT_EQUAL(-3.0, m_pDoc->GetValue(aPos));
// Force an error in C2 and test ForcedArray matrix error propagation.
- m_pDoc->SetString( 2, 1, 0, "=1/0");
+ m_pDoc->SetString( 2, 1, 0, u"=1/0"_ustr);
FormulaError nError = m_pDoc->GetErrCode(aPos);
CPPUNIT_ASSERT_MESSAGE("Formula result should be a propagated error", nError != FormulaError::NONE);
@@ -4755,7 +4755,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncSUMPRODUCT)
m_pDoc->SetValue(ScAddress(4,0,0), -3.0); // E1
m_pDoc->SetValue(ScAddress(4,1,0), 4.0); // E2
// Non-intersecting formula in F3.
- m_pDoc->SetString(ScAddress(5,2,0), "=SUMPRODUCT(ABS(E1:E2);E1:E2+E1:E2)");
+ m_pDoc->SetString(ScAddress(5,2,0), u"=SUMPRODUCT(ABS(E1:E2);E1:E2+E1:E2)"_ustr);
CPPUNIT_ASSERT_EQUAL(14.0, m_pDoc->GetValue(ScAddress(5,2,0)));
m_pDoc->DeleteTab(0);
@@ -4763,12 +4763,12 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncSUMPRODUCT)
CPPUNIT_TEST_FIXTURE(TestFormula, testFuncSUMXMY2)
{
- m_pDoc->InsertTab(0, "Test SumXMY2");
+ m_pDoc->InsertTab(0, u"Test SumXMY2"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto recalc.
ScAddress aPos(0,0,0);
- m_pDoc->SetString(aPos, "=SUMXMY2(B1:B3;C1:C3)");
+ m_pDoc->SetString(aPos, u"=SUMXMY2(B1:B3;C1:C3)"_ustr);
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(ScAddress(1,0,0), 1.0); // B1
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(aPos));
@@ -4783,7 +4783,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncSUMXMY2)
m_pDoc->SetValue(ScAddress(2,2,0), 1.0); // C3
CPPUNIT_ASSERT_EQUAL(9.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(0, 4, 0, "=SUMXMY2({2;3;4};{4;3;2})");
+ m_pDoc->SetString(0, 4, 0, u"=SUMXMY2({2;3;4};{4;3;2})"_ustr);
double result = m_pDoc->GetValue(0, 4, 0);
ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of SUMXMY2 with inline arrays failed", 8.0, result);
@@ -4793,11 +4793,11 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncSUMXMY2)
CPPUNIT_TEST_FIXTURE(TestFormula, testFuncMIN)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto recalc.
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
// A1:A2
- m_pDoc->SetString(ScAddress(0,0,0), "a");
- m_pDoc->SetString(ScAddress(0,1,0), "b");
+ m_pDoc->SetString(ScAddress(0,0,0), u"a"_ustr);
+ m_pDoc->SetString(ScAddress(0,1,0), u"b"_ustr);
// B1:B2
m_pDoc->SetValue(ScAddress(1,0,0), 1.0);
@@ -4806,7 +4806,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncMIN)
// Matrix in C1:C2.
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(2, 0, 2, 1, aMark, "=MIN(IF(A1:A2=\"c\";B1:B2))");
+ m_pDoc->InsertMatrixFormula(2, 0, 2, 1, aMark, u"=MIN(IF(A1:A2=\"c\";B1:B2))"_ustr);
// Formula cell in C1:C2 should be a 1x2 matrix array.
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(2,0,0));
@@ -4826,7 +4826,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncMIN)
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(2,1,0)));
// Inline array input (A4).
- m_pDoc->SetString(ScAddress(0,3,0), "=MIN({-2;4;3})");
+ m_pDoc->SetString(ScAddress(0,3,0), u"=MIN({-2;4;3})"_ustr);
CPPUNIT_ASSERT_EQUAL(-2.0, m_pDoc->GetValue(ScAddress(0,3,0)));
// Add more values to B3:B4.
@@ -4834,7 +4834,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncMIN)
m_pDoc->SetValue(ScAddress(1,3,0), -20.0);
// Get the MIN of B1:B4.
- m_pDoc->SetString(ScAddress(2,4,0), "=MIN(B1:B4)");
+ m_pDoc->SetString(ScAddress(2,4,0), u"=MIN(B1:B4)"_ustr);
CPPUNIT_ASSERT_EQUAL(-20.0, m_pDoc->GetValue(ScAddress(2,4,0)));
m_pDoc->DeleteTab(0);
@@ -4843,7 +4843,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncMIN)
CPPUNIT_TEST_FIXTURE(TestFormula, testFuncN)
{
CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
- m_pDoc->InsertTab (0, "foo"));
+ m_pDoc->InsertTab (0, u"foo"_ustr));
double result;
@@ -4853,38 +4853,38 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncN)
// Put values to reference.
double val = 0;
m_pDoc->SetValue(0, 0, 0, val);
- m_pDoc->SetString(0, 2, 0, "Text");
+ m_pDoc->SetString(0, 2, 0, u"Text"_ustr);
val = 1;
m_pDoc->SetValue(0, 3, 0, val);
val = -1;
m_pDoc->SetValue(0, 4, 0, val);
val = 12.3;
m_pDoc->SetValue(0, 5, 0, val);
- m_pDoc->SetString(0, 6, 0, "'12.3");
+ m_pDoc->SetString(0, 6, 0, u"'12.3"_ustr);
// Cell references
- m_pDoc->SetString(1, 0, 0, "=N(A1)");
- m_pDoc->SetString(1, 1, 0, "=N(A2)");
- m_pDoc->SetString(1, 2, 0, "=N(A3)");
- m_pDoc->SetString(1, 3, 0, "=N(A4)");
- m_pDoc->SetString(1, 4, 0, "=N(A5)");
- m_pDoc->SetString(1, 5, 0, "=N(A6)");
- m_pDoc->SetString(1, 6, 0, "=N(A9)");
+ m_pDoc->SetString(1, 0, 0, u"=N(A1)"_ustr);
+ m_pDoc->SetString(1, 1, 0, u"=N(A2)"_ustr);
+ m_pDoc->SetString(1, 2, 0, u"=N(A3)"_ustr);
+ m_pDoc->SetString(1, 3, 0, u"=N(A4)"_ustr);
+ m_pDoc->SetString(1, 4, 0, u"=N(A5)"_ustr);
+ m_pDoc->SetString(1, 5, 0, u"=N(A6)"_ustr);
+ m_pDoc->SetString(1, 6, 0, u"=N(A9)"_ustr);
// In-line values
- m_pDoc->SetString(1, 7, 0, "=N(0)");
- m_pDoc->SetString(1, 8, 0, "=N(1)");
- m_pDoc->SetString(1, 9, 0, "=N(-1)");
- m_pDoc->SetString(1, 10, 0, "=N(123)");
- m_pDoc->SetString(1, 11, 0, "=N(\"\")");
- m_pDoc->SetString(1, 12, 0, "=N(\"12\")");
- m_pDoc->SetString(1, 13, 0, "=N(\"foo\")");
+ m_pDoc->SetString(1, 7, 0, u"=N(0)"_ustr);
+ m_pDoc->SetString(1, 8, 0, u"=N(1)"_ustr);
+ m_pDoc->SetString(1, 9, 0, u"=N(-1)"_ustr);
+ m_pDoc->SetString(1, 10, 0, u"=N(123)"_ustr);
+ m_pDoc->SetString(1, 11, 0, u"=N(\"\")"_ustr);
+ m_pDoc->SetString(1, 12, 0, u"=N(\"12\")"_ustr);
+ m_pDoc->SetString(1, 13, 0, u"=N(\"foo\")"_ustr);
// Range references
- m_pDoc->SetString(2, 2, 0, "=N(A1:A8)");
- m_pDoc->SetString(2, 3, 0, "=N(A1:A8)");
- m_pDoc->SetString(2, 4, 0, "=N(A1:A8)");
- m_pDoc->SetString(2, 5, 0, "=N(A1:A8)");
+ m_pDoc->SetString(2, 2, 0, u"=N(A1:A8)"_ustr);
+ m_pDoc->SetString(2, 3, 0, u"=N(A1:A8)"_ustr);
+ m_pDoc->SetString(2, 4, 0, u"=N(A1:A8)"_ustr);
+ m_pDoc->SetString(2, 5, 0, u"=N(A1:A8)"_ustr);
// Calculate and check the results.
m_pDoc->CalcAll();
@@ -4926,7 +4926,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncCOUNTIF)
// COUNTIF (test case adopted from OOo i#36381)
CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
- m_pDoc->InsertTab (0, "foo"));
+ m_pDoc->InsertTab (0, u"foo"_ustr));
// Empty A1:A39 first.
clearRange(m_pDoc, ScRange(0, 0, 0, 0, 40, 0));
@@ -4992,8 +4992,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncCOUNTIF)
// Clear A1:A2.
clearRange(m_pDoc, ScRange(0, 0, 0, 0, 1, 0));
- m_pDoc->SetString(0, 0, 0, "=\"\"");
- m_pDoc->SetString(0, 1, 0, "=COUNTIF(A1;1)");
+ m_pDoc->SetString(0, 0, 0, u"=\"\""_ustr);
+ m_pDoc->SetString(0, 1, 0, u"=COUNTIF(A1;1)"_ustr);
double result = m_pDoc->GetValue(0, 1, 0);
ASSERT_DOUBLES_EQUAL_MESSAGE("We shouldn't count empty string as valid number.", 0.0, result);
@@ -5003,10 +5003,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncCOUNTIF)
// Set formula cells with blank results in A1:A4.
for (SCROW i = 0; i <=3; ++i)
- m_pDoc->SetString(ScAddress(0,i,0), "=\"\"");
+ m_pDoc->SetString(ScAddress(0,i,0), u"=\"\""_ustr);
// Insert formula into A5 to count all cells with empty strings.
- m_pDoc->SetString(ScAddress(0,4,0), "=COUNTIF(A1:A4;\"\"");
+ m_pDoc->SetString(ScAddress(0,4,0), u"=COUNTIF(A1:A4;\"\""_ustr);
// We should correctly count with empty string key.
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(0,4,0)));
@@ -5016,12 +5016,12 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncCOUNTIF)
clearSheet(m_pDoc, 0);
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(0,0, 0,1, aMark, "=COUNTIF(B1:B5;C1:C2)");
+ m_pDoc->InsertMatrixFormula(0,0, 0,1, aMark, u"=COUNTIF(B1:B5;C1:C2)"_ustr);
// As we will be testing for 0.0 values, check that formulas are actually present.
OUString aFormula = m_pDoc->GetFormula(0,0,0);
- CPPUNIT_ASSERT_EQUAL(OUString("{=COUNTIF(B1:B5;C1:C2)}"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"{=COUNTIF(B1:B5;C1:C2)}"_ustr, aFormula);
aFormula = m_pDoc->GetFormula(0,1,0);
- CPPUNIT_ASSERT_EQUAL(OUString("{=COUNTIF(B1:B5;C1:C2)}"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"{=COUNTIF(B1:B5;C1:C2)}"_ustr, aFormula);
// The 0.0 results expected.
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(0,1,0)));
diff --git a/sc/qa/unit/ucalc_formula2.cxx b/sc/qa/unit/ucalc_formula2.cxx
index 70f945a4ca5c..f0f3c41ff2b4 100644
--- a/sc/qa/unit/ucalc_formula2.cxx
+++ b/sc/qa/unit/ucalc_formula2.cxx
@@ -160,19 +160,19 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncIF)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
- m_pDoc->SetString(ScAddress(0, 0, 0), "=IF(B1=2;\"two\";\"not two\")");
- CPPUNIT_ASSERT_EQUAL(OUString("not two"), m_pDoc->GetString(ScAddress(0, 0, 0)));
+ m_pDoc->SetString(ScAddress(0, 0, 0), u"=IF(B1=2;\"two\";\"not two\")"_ustr);
+ CPPUNIT_ASSERT_EQUAL(u"not two"_ustr, m_pDoc->GetString(ScAddress(0, 0, 0)));
m_pDoc->SetValue(ScAddress(1, 0, 0), 2.0);
- CPPUNIT_ASSERT_EQUAL(OUString("two"), m_pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"two"_ustr, m_pDoc->GetString(ScAddress(0, 0, 0)));
m_pDoc->SetValue(ScAddress(1, 0, 0), 3.0);
- CPPUNIT_ASSERT_EQUAL(OUString("not two"), m_pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"not two"_ustr, m_pDoc->GetString(ScAddress(0, 0, 0)));
// Test nested IF in array/matrix if the nested IF condition is a scalar.
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(0, 2, 1, 2, aMark, "=IF({1;0};IF(1;23);42)");
+ m_pDoc->InsertMatrixFormula(0, 2, 1, 2, aMark, u"=IF({1;0};IF(1;23);42)"_ustr);
// Results must be 23 and 42.
CPPUNIT_ASSERT_EQUAL(23.0, m_pDoc->GetValue(ScAddress(0, 2, 0)));
CPPUNIT_ASSERT_EQUAL(42.0, m_pDoc->GetValue(ScAddress(1, 2, 0)));
@@ -187,13 +187,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncIF)
ScRange aRange = insertRangeData(m_pDoc, aPos, aData);
CPPUNIT_ASSERT_EQUAL(aPos, aRange.aStart);
}
- m_pDoc->InsertMatrixFormula(3, 3, 3, 3, aMark, "=SUM(IF(A5:A8;IF(B5:B8;C5:C8;0);0))");
+ m_pDoc->InsertMatrixFormula(3, 3, 3, 3, aMark, u"=SUM(IF(A5:A8;IF(B5:B8;C5:C8;0);0))"_ustr);
// Result must be 16, only the first row matches all criteria.
CPPUNIT_ASSERT_EQUAL(16.0, m_pDoc->GetValue(ScAddress(3, 3, 0)));
// A11:B11
// Test nested IF in array/matrix if the nested IF has no Else path.
- m_pDoc->InsertMatrixFormula(0, 10, 1, 10, aMark, "=IF(IF({1;0};12);34;56)");
+ m_pDoc->InsertMatrixFormula(0, 10, 1, 10, aMark, u"=IF(IF({1;0};12);34;56)"_ustr);
// Results must be 34 and 56.
CPPUNIT_ASSERT_EQUAL(34.0, m_pDoc->GetValue(ScAddress(0, 10, 0)));
CPPUNIT_ASSERT_EQUAL(56.0, m_pDoc->GetValue(ScAddress(1, 10, 0)));
@@ -205,18 +205,18 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCHOOSE)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
- m_pDoc->SetString(ScAddress(0, 0, 0), "=CHOOSE(B1;\"one\";\"two\";\"three\")");
+ m_pDoc->SetString(ScAddress(0, 0, 0), u"=CHOOSE(B1;\"one\";\"two\";\"three\")"_ustr);
FormulaError nError = m_pDoc->GetErrCode(ScAddress(0, 0, 0));
CPPUNIT_ASSERT_MESSAGE("Formula result should be an error since B1 is still empty.",
nError != FormulaError::NONE);
m_pDoc->SetValue(ScAddress(1, 0, 0), 1.0);
- CPPUNIT_ASSERT_EQUAL(OUString("one"), m_pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"one"_ustr, m_pDoc->GetString(ScAddress(0, 0, 0)));
m_pDoc->SetValue(ScAddress(1, 0, 0), 2.0);
- CPPUNIT_ASSERT_EQUAL(OUString("two"), m_pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"two"_ustr, m_pDoc->GetString(ScAddress(0, 0, 0)));
m_pDoc->SetValue(ScAddress(1, 0, 0), 3.0);
- CPPUNIT_ASSERT_EQUAL(OUString("three"), m_pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"three"_ustr, m_pDoc->GetString(ScAddress(0, 0, 0)));
m_pDoc->SetValue(ScAddress(1, 0, 0), 4.0);
nError = m_pDoc->GetErrCode(ScAddress(0, 0, 0));
CPPUNIT_ASSERT_MESSAGE("Formula result should be an error due to out-of-bound input..",
@@ -229,7 +229,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncIFERROR)
{
// IFERROR/IFNA (fdo#56124)
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "foo"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"foo"_ustr));
// Empty A1:A39 first.
clearRange(m_pDoc, ScRange(0, 0, 0, 0, 40, 0));
@@ -278,7 +278,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncIFERROR)
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
m_pDoc->InsertMatrixFormula(0, 20 + nRows - 2, 0, 20 + nRows - 1, aMark,
- "=IFERROR(3*A11:A12;1998)");
+ u"=IFERROR(3*A11:A12;1998)"_ustr);
m_pDoc->CalcAll();
@@ -305,7 +305,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncIFERROR)
const SCCOL nStartCol = aPos.Col() + nCols;
const SCROW nStartRow = aPos.Row() + nElems2;
m_pDoc->InsertMatrixFormula(nStartCol, nStartRow, nStartCol + nCols - 1,
- nStartRow + nElems2 - 1, aMark, "=IFERROR(C1:E3;\"Error\")");
+ nStartRow + nElems2 - 1, aMark, u"=IFERROR(C1:E3;\"Error\")"_ustr);
m_pDoc->CalcAll();
@@ -325,9 +325,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncIFERROR)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSHEET)
{
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(SC_TAB_APPEND, "test1"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet",
+ m_pDoc->InsertTab(SC_TAB_APPEND, u"test1"_ustr));
- m_pDoc->SetString(0, 0, 0, "=SHEETS()");
+ m_pDoc->SetString(0, 0, 0, u"=SHEETS()"_ustr);
m_pDoc->CalcFormulaTree(false, false);
double original = m_pDoc->GetValue(0, 0, 0);
@@ -335,7 +336,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSHEET)
"result of SHEETS() should equal the number of sheets, but doesn't.",
static_cast<SCTAB>(original), m_pDoc->GetTableCount());
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(SC_TAB_APPEND, "test2"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet",
+ m_pDoc->InsertTab(SC_TAB_APPEND, u"test2"_ustr));
double modified = m_pDoc->GetValue(0, 0, 0);
ASSERT_DOUBLES_EQUAL_MESSAGE("result of SHEETS() did not get updated after sheet insertion.",
@@ -353,11 +355,11 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSHEET)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncNOW)
{
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "foo"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"foo"_ustr));
double val = 1;
m_pDoc->SetValue(0, 0, 0, val);
- m_pDoc->SetString(0, 1, 0, "=IF(A1>0;NOW();0");
+ m_pDoc->SetString(0, 1, 0, u"=IF(A1>0;NOW();0"_ustr);
double now1 = m_pDoc->GetValue(0, 1, 0);
CPPUNIT_ASSERT_MESSAGE("Value of NOW() should be positive.", now1 > 0.0);
@@ -381,7 +383,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncNUMBERVALUE)
{
// NUMBERVALUE fdo#57180
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "foo"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"foo"_ustr));
// Empty A1:A39 first.
clearRange(m_pDoc, ScRange(0, 0, 0, 0, 40, 0));
@@ -433,14 +435,14 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncLEN)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
// Leave A1:A3 empty, and insert an array of LEN in B1:B3 that references
// these empty cells.
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(1, 0, 1, 2, aMark, "=LEN(A1:A3)");
+ m_pDoc->InsertMatrixFormula(1, 0, 1, 2, aMark, u"=LEN(A1:A3)"_ustr);
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1, 0, 0));
CPPUNIT_ASSERT(pFC);
@@ -466,7 +468,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncLOOKUP)
{
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Raw data
const char* aData[][2] = {
@@ -517,29 +519,28 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncLOOKUP)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncLOOKUParrayWithError)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true);
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
std::vector<std::vector<const char*>> aData = { { "x", "y", "z" }, { "a", "b", "c" } };
insertRangeData(m_pDoc, ScAddress(2, 1, 0), aData); // C2:E3
- m_pDoc->SetString(0, 0, 0, "=LOOKUP(2;1/(C2:E2<>\"\");C3:E3)"); // A1
+ m_pDoc->SetString(0, 0, 0, u"=LOOKUP(2;1/(C2:E2<>\"\");C3:E3)"_ustr); // A1
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Should find match for last column.", OUString("c"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should find match for last column.", u"c"_ustr,
m_pDoc->GetString(0, 0, 0));
- m_pDoc->SetString(4, 1, 0, ""); // E2
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Should find match for second last column.", OUString("b"),
+ m_pDoc->SetString(4, 1, 0, u""_ustr); // E2
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should find match for second last column.", u"b"_ustr,
m_pDoc->GetString(0, 0, 0));
- m_pDoc->SetString(6, 1, 0, "one"); // G2
- m_pDoc->SetString(6, 5, 0, "two"); // G6
+ m_pDoc->SetString(6, 1, 0, u"one"_ustr); // G2
+ m_pDoc->SetString(6, 5, 0, u"two"_ustr); // G6
// Creates an interim array {1,#DIV/0!,#DIV/0!,#DIV/0!,1,#DIV/0!,#DIV/0!,#DIV/0!}
- m_pDoc->SetString(7, 8, 0, "=LOOKUP(2;1/(NOT(ISBLANK(G2:G9)));G2:G9)"); // H9
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Should find match for last row.", OUString("two"),
+ m_pDoc->SetString(7, 8, 0, u"=LOOKUP(2;1/(NOT(ISBLANK(G2:G9)));G2:G9)"_ustr); // H9
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should find match for last row.", u"two"_ustr,
m_pDoc->GetString(7, 8, 0));
// Lookup on empty range.
- m_pDoc->SetString(9, 8, 0, "=LOOKUP(2;1/(NOT(ISBLANK(I2:I9)));I2:I9)"); // J9
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Should find no match.", OUString("#N/A"),
- m_pDoc->GetString(9, 8, 0));
+ m_pDoc->SetString(9, 8, 0, u"=LOOKUP(2;1/(NOT(ISBLANK(I2:I9)));I2:I9)"_ustr); // J9
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should find no match.", u"#N/A"_ustr, m_pDoc->GetString(9, 8, 0));
m_pDoc->DeleteTab(0);
}
@@ -547,25 +548,25 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncLOOKUParrayWithError)
CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf141146)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true);
- m_pDoc->InsertTab(0, "Test1");
- m_pDoc->InsertTab(1, "Test2");
+ m_pDoc->InsertTab(0, u"Test1"_ustr);
+ m_pDoc->InsertTab(1, u"Test2"_ustr);
std::vector<std::vector<const char*>> aData
= { { "k1", "value1" }, { "k2", "value2" }, { "k3", "value3" } };
insertRangeData(m_pDoc, ScAddress(0, 1, 1), aData); // A2:B4
- m_pDoc->SetString(4, 0, 1, "k2"); // E1
+ m_pDoc->SetString(4, 0, 1, u"k2"_ustr); // E1
- m_pDoc->SetString(4, 1, 1, "=LOOKUP(1;1/(A$2:A$4=E$1);1)");
- m_pDoc->SetString(4, 2, 1, "=LOOKUP(E1;A$2:A$4;B2:B4)");
- m_pDoc->SetString(4, 3, 1, "=LOOKUP(1;1/(A$2:A$4=E$1);B2:B4)");
+ m_pDoc->SetString(4, 1, 1, u"=LOOKUP(1;1/(A$2:A$4=E$1);1)"_ustr);
+ m_pDoc->SetString(4, 2, 1, u"=LOOKUP(E1;A$2:A$4;B2:B4)"_ustr);
+ m_pDoc->SetString(4, 3, 1, u"=LOOKUP(1;1/(A$2:A$4=E$1);B2:B4)"_ustr);
// Without the fix in place, this test would have failed with
// - Expected: #N/A
// - Actual :
- CPPUNIT_ASSERT_EQUAL(OUString("#N/A"), m_pDoc->GetString(4, 1, 1));
- CPPUNIT_ASSERT_EQUAL(OUString("value2"), m_pDoc->GetString(4, 2, 1));
- CPPUNIT_ASSERT_EQUAL(OUString("value2"), m_pDoc->GetString(4, 3, 1));
+ CPPUNIT_ASSERT_EQUAL(u"#N/A"_ustr, m_pDoc->GetString(4, 1, 1));
+ CPPUNIT_ASSERT_EQUAL(u"value2"_ustr, m_pDoc->GetString(4, 2, 1));
+ CPPUNIT_ASSERT_EQUAL(u"value2"_ustr, m_pDoc->GetString(4, 3, 1));
m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
@@ -575,7 +576,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncVLOOKUP)
{
// VLOOKUP
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "foo"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"foo"_ustr));
// Clear A1:F40.
clearRange(m_pDoc, ScRange(0, 0, 0, 5, 39, 0));
@@ -657,9 +658,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncVLOOKUP)
m_pDoc->SetValue(ScAddress(0, 2, 0), 1.0);
m_pDoc->SetValue(ScAddress(0, 4, 0), 2.0);
m_pDoc->SetValue(ScAddress(0, 7, 0), 4.0);
- m_pDoc->SetString(ScAddress(1, 2, 0), "One");
- m_pDoc->SetString(ScAddress(1, 4, 0), "Two");
- m_pDoc->SetString(ScAddress(1, 7, 0), "Four");
+ m_pDoc->SetString(ScAddress(1, 2, 0), u"One"_ustr);
+ m_pDoc->SetString(ScAddress(1, 4, 0), u"Two"_ustr);
+ m_pDoc->SetString(ScAddress(1, 7, 0), u"Four"_ustr);
// D1:D5 contain match values.
m_pDoc->SetValue(ScAddress(3, 0, 0), 1.0);
@@ -669,35 +670,35 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncVLOOKUP)
m_pDoc->SetValue(ScAddress(3, 4, 0), 5.0);
// E1:E5 contain formulas.
- m_pDoc->SetString(ScAddress(4, 0, 0), "=VLOOKUP(D1;$A$1:$B$8;2)");
- m_pDoc->SetString(ScAddress(4, 1, 0), "=VLOOKUP(D2;$A$1:$B$8;2)");
- m_pDoc->SetString(ScAddress(4, 2, 0), "=VLOOKUP(D3;$A$1:$B$8;2)");
- m_pDoc->SetString(ScAddress(4, 3, 0), "=VLOOKUP(D4;$A$1:$B$8;2)");
- m_pDoc->SetString(ScAddress(4, 4, 0), "=VLOOKUP(D5;$A$1:$B$8;2)");
+ m_pDoc->SetString(ScAddress(4, 0, 0), u"=VLOOKUP(D1;$A$1:$B$8;2)"_ustr);
+ m_pDoc->SetString(ScAddress(4, 1, 0), u"=VLOOKUP(D2;$A$1:$B$8;2)"_ustr);
+ m_pDoc->SetString(ScAddress(4, 2, 0), u"=VLOOKUP(D3;$A$1:$B$8;2)"_ustr);
+ m_pDoc->SetString(ScAddress(4, 3, 0), u"=VLOOKUP(D4;$A$1:$B$8;2)"_ustr);
+ m_pDoc->SetString(ScAddress(4, 4, 0), u"=VLOOKUP(D5;$A$1:$B$8;2)"_ustr);
m_pDoc->CalcAll();
// Check the formula results in E1:E5.
- CPPUNIT_ASSERT_EQUAL(OUString("One"), m_pDoc->GetString(ScAddress(4, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Two"), m_pDoc->GetString(ScAddress(4, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Two"), m_pDoc->GetString(ScAddress(4, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Four"), m_pDoc->GetString(ScAddress(4, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Four"), m_pDoc->GetString(ScAddress(4, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"One"_ustr, m_pDoc->GetString(ScAddress(4, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Two"_ustr, m_pDoc->GetString(ScAddress(4, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Two"_ustr, m_pDoc->GetString(ScAddress(4, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Four"_ustr, m_pDoc->GetString(ScAddress(4, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Four"_ustr, m_pDoc->GetString(ScAddress(4, 4, 0)));
// Start over again.
clearSheet(m_pDoc, 0);
// Set A,B,...,G to A1:A7.
- m_pDoc->SetString(ScAddress(0, 0, 0), "A");
- m_pDoc->SetString(ScAddress(0, 1, 0), "B");
- m_pDoc->SetString(ScAddress(0, 2, 0), "C");
- m_pDoc->SetString(ScAddress(0, 3, 0), "D");
- m_pDoc->SetString(ScAddress(0, 4, 0), "E");
- m_pDoc->SetString(ScAddress(0, 5, 0), "F");
- m_pDoc->SetString(ScAddress(0, 6, 0), "G");
+ m_pDoc->SetString(ScAddress(0, 0, 0), u"A"_ustr);
+ m_pDoc->SetString(ScAddress(0, 1, 0), u"B"_ustr);
+ m_pDoc->SetString(ScAddress(0, 2, 0), u"C"_ustr);
+ m_pDoc->SetString(ScAddress(0, 3, 0), u"D"_ustr);
+ m_pDoc->SetString(ScAddress(0, 4, 0), u"E"_ustr);
+ m_pDoc->SetString(ScAddress(0, 5, 0), u"F"_ustr);
+ m_pDoc->SetString(ScAddress(0, 6, 0), u"G"_ustr);
// Set the formula in C1.
- m_pDoc->SetString(ScAddress(2, 0, 0), "=VLOOKUP(\"C\";A1:A16;1)");
- CPPUNIT_ASSERT_EQUAL(OUString("C"), m_pDoc->GetString(ScAddress(2, 0, 0)));
+ m_pDoc->SetString(ScAddress(2, 0, 0), u"=VLOOKUP(\"C\";A1:A16;1)"_ustr);
+ CPPUNIT_ASSERT_EQUAL(u"C"_ustr, m_pDoc->GetString(ScAddress(2, 0, 0)));
// A21:E24, test position dependent implicit intersection as argument to a
// scalar value parameter in a function that has a ReferenceOrForceArray
@@ -798,7 +799,7 @@ void TestFormula2::runTestHorizontalMATCH(ScDocument* pDoc, const char* aData[Da
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncMATCH)
{
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "foo"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"foo"_ustr));
clearRange(m_pDoc, ScRange(0, 0, 0, 40, 40, 0));
{
@@ -855,10 +856,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncMATCH)
m_pDoc->SetValue(ScAddress(0, 7, 0), 4.0);
// Find value 2 which is in A6.
- m_pDoc->SetString(ScAddress(1, 0, 0), "=MATCH(2;A1:A20)");
+ m_pDoc->SetString(ScAddress(1, 0, 0), u"=MATCH(2;A1:A20)"_ustr);
m_pDoc->CalcAll();
- CPPUNIT_ASSERT_EQUAL(OUString("6"), m_pDoc->GetString(ScAddress(1, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"6"_ustr, m_pDoc->GetString(ScAddress(1, 0, 0)));
}
{
@@ -875,7 +876,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncMATCH)
// Find string value "33" in concatenated array, no implicit
// intersection is involved, array is forced.
- m_pDoc->SetString(ScAddress(0, 5, 0), "=MATCH(\"33\";B1:B5&B1:B5)");
+ m_pDoc->SetString(ScAddress(0, 5, 0), u"=MATCH(\"33\";B1:B5&B1:B5)"_ustr);
m_pDoc->CalcAll();
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(0, 5, 0)));
}
@@ -885,7 +886,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncMATCH)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCELL)
{
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "foo"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"foo"_ustr));
clearRange(m_pDoc, ScRange(0, 0, 0, 2, 20, 0)); // Clear A1:C21.
@@ -920,7 +921,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCELL)
/** See also test case document fdo#44456 sheet cpearson */
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncDATEDIF)
{
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "foo"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"foo"_ustr));
std::vector<std::vector<const char*>> aData = {
{ "2007-01-01", "2007-01-10", "d", "9", "=DATEDIF(A1;B1;C1)" },
@@ -961,18 +962,18 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncDATEDIF)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncINDIRECT)
{
- OUString aTabName("foo");
+ OUString aTabName(u"foo"_ustr);
CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, aTabName));
clearRange(m_pDoc, ScRange(0, 0, 0, 0, 10, 0)); // Clear A1:A11
bool bGood = m_pDoc->GetName(0, aTabName);
CPPUNIT_ASSERT_MESSAGE("failed to get sheet name.", bGood);
- OUString aTest = "Test", aRefErr = "#REF!";
+ OUString aTest = u"Test"_ustr, aRefErr = u"#REF!"_ustr;
m_pDoc->SetString(0, 10, 0, aTest);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected cell value.", aTest, m_pDoc->GetString(0, 10, 0));
- OUString aPrefix = "=INDIRECT(\"";
+ OUString aPrefix = u"=INDIRECT(\""_ustr;
OUString aFormula = aPrefix + aTabName + ".A11\")"; // Calc A1
m_pDoc->SetString(0, 0, 0, aFormula);
@@ -1046,9 +1047,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncINDIRECT)
//
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncINDIRECT2)
{
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "foo"));
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(1, "bar"));
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(2, "baz"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"foo"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(1, u"bar"_ustr));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(2, u"baz"_ustr));
m_pDoc->SetValue(0, 0, 0, 10.0);
m_pDoc->SetValue(0, 1, 0, 10.0);
@@ -1059,36 +1060,36 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncINDIRECT2)
m_pDoc->SetValue(0, i, 1, 1.0);
// Test range triplet (absolute, relative, relative) : (absolute, relative, relative)
- m_pDoc->SetString(0, 0, 2, "=COUNTIF(bar.$A1:INDIRECT(\"$A\"&foo.$A$1),1)");
+ m_pDoc->SetString(0, 0, 2, u"=COUNTIF(bar.$A1:INDIRECT(\"$A\"&foo.$A$1),1)"_ustr);
// Test range triplet (absolute, relative, relative) : (absolute, absolute, relative)
- m_pDoc->SetString(0, 1, 2, "=COUNTIF(bar.$A1:INDIRECT(\"$A\"&foo.$A$2),1)");
+ m_pDoc->SetString(0, 1, 2, u"=COUNTIF(bar.$A1:INDIRECT(\"$A\"&foo.$A$2),1)"_ustr);
// Test range triplet (absolute, relative, relative) : (absolute, absolute, absolute)
- m_pDoc->SetString(0, 2, 2, "=COUNTIF(bar.$A1:INDIRECT(\"$A\"&foo.$A$3),1)");
+ m_pDoc->SetString(0, 2, 2, u"=COUNTIF(bar.$A1:INDIRECT(\"$A\"&foo.$A$3),1)"_ustr);
// Test range triplet (absolute, absolute, relative) : (absolute, relative, relative)
- m_pDoc->SetString(0, 3, 2, "=COUNTIF(bar.$A$1:INDIRECT(\"$A\"&foo.$A$1),1)");
+ m_pDoc->SetString(0, 3, 2, u"=COUNTIF(bar.$A$1:INDIRECT(\"$A\"&foo.$A$1),1)"_ustr);
// Test range triplet (absolute, absolute, relative) : (absolute, absolute, relative)
- m_pDoc->SetString(0, 4, 2, "=COUNTIF(bar.$A$1:INDIRECT(\"$A\"&foo.$A$2),1)");
+ m_pDoc->SetString(0, 4, 2, u"=COUNTIF(bar.$A$1:INDIRECT(\"$A\"&foo.$A$2),1)"_ustr);
// Test range triplet (absolute, absolute, relative) : (absolute, absolute, relative)
- m_pDoc->SetString(0, 5, 2, "=COUNTIF(bar.$A$1:INDIRECT(\"$A\"&foo.$A$3),1)");
+ m_pDoc->SetString(0, 5, 2, u"=COUNTIF(bar.$A$1:INDIRECT(\"$A\"&foo.$A$3),1)"_ustr);
// Test range triplet (absolute, absolute, absolute) : (absolute, relative, relative)
- m_pDoc->SetString(0, 6, 2, "=COUNTIF($bar.$A$1:INDIRECT(\"$A\"&foo.$A$1),1)");
+ m_pDoc->SetString(0, 6, 2, u"=COUNTIF($bar.$A$1:INDIRECT(\"$A\"&foo.$A$1),1)"_ustr);
// Test range triplet (absolute, absolute, absolute) : (absolute, absolute, relative)
- m_pDoc->SetString(0, 7, 2, "=COUNTIF($bar.$A$1:INDIRECT(\"$A\"&foo.$A$2),1)");
+ m_pDoc->SetString(0, 7, 2, u"=COUNTIF($bar.$A$1:INDIRECT(\"$A\"&foo.$A$2),1)"_ustr);
// Check indirect reference "bar.$A\"&foo.$A$1
- m_pDoc->SetString(0, 8, 2, "=COUNTIF(bar.$A$1:INDIRECT(\"bar.$A\"&foo.$A$1),1)");
+ m_pDoc->SetString(0, 8, 2, u"=COUNTIF(bar.$A$1:INDIRECT(\"bar.$A\"&foo.$A$1),1)"_ustr);
// This case should return illegal argument error because
// they reference 2 different absolute sheets
// Test range triplet (absolute, absolute, absolute) : (absolute, absolute, absolute)
- m_pDoc->SetString(0, 9, 2, "=COUNTIF($bar.$A$1:INDIRECT(\"$A\"&foo.$A$3),1)");
+ m_pDoc->SetString(0, 9, 2, u"=COUNTIF($bar.$A$1:INDIRECT(\"$A\"&foo.$A$3),1)"_ustr);
m_pDoc->CalcAll();
@@ -1113,23 +1114,23 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncINDIRECT2)
// as INDIRECT returns ParamClass::Reference
CPPUNIT_TEST_FIXTURE(TestFormula2, testFunc_MATCH_INDIRECT)
{
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "foo"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"foo"_ustr));
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
ScRangeName* pGlobalNames = m_pDoc->GetRangeName();
- ScRangeData* pRangeData = new ScRangeData(*m_pDoc, "RoleAssignment", "$D$4:$D$13");
+ ScRangeData* pRangeData = new ScRangeData(*m_pDoc, u"RoleAssignment"_ustr, u"$D$4:$D$13"_ustr);
pGlobalNames->insert(pRangeData);
// D6: data to match, in 3rd row of named range.
- m_pDoc->SetString(3, 5, 0, "Test1");
+ m_pDoc->SetString(3, 5, 0, u"Test1"_ustr);
// F15: Formula generating indirect reference of corner addresses taking
// row+offset and column from named range, which are not in array context
// thus don't create arrays of offsets.
m_pDoc->SetString(5, 14, 0,
- "=MATCH(\"Test1\";INDIRECT(ADDRESS(ROW(RoleAssignment)+1;COLUMN("
+ u"=MATCH(\"Test1\";INDIRECT(ADDRESS(ROW(RoleAssignment)+1;COLUMN("
"RoleAssignment))&\":\"&ADDRESS(ROW(RoleAssignment)+ROWS(RoleAssignment)-1;"
- "COLUMN(RoleAssignment)));0)");
+ "COLUMN(RoleAssignment)));0)"_ustr);
// Match in 2nd row of range offset by 1 expected.
ASSERT_DOUBLES_EQUAL_MESSAGE("Failed to not propagate array context from MATCH to INDIRECT",
@@ -1140,7 +1141,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFunc_MATCH_INDIRECT)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTracking)
{
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "foo"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"foo"_ustr));
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
@@ -1156,7 +1157,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTracking)
const ScAddress aE6(4, 5, 0);
// B2 listens on D2.
- m_pDoc->SetString(aB2, "=D2");
+ m_pDoc->SetString(aB2, u"=D2"_ustr);
double val = m_pDoc->GetValue(aB2);
ASSERT_DOUBLES_EQUAL_MESSAGE("Referencing an empty cell should yield zero.", 0.0, val);
@@ -1189,7 +1190,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTracking)
// Now, let's test the range dependency tracking.
// B2 listens on D2:E6.
- m_pDoc->SetString(aB2, "=SUM(D2:E6)");
+ m_pDoc->SetString(aB2, u"=SUM(D2:E6)"_ustr);
val = m_pDoc->GetValue(aB2);
ASSERT_DOUBLES_EQUAL_MESSAGE("Summing an empty range should yield zero.", 0.0, val);
@@ -1258,10 +1259,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTracking)
m_pDoc->SetValue(0, nRow, 0, ++val);
// Formula in column 2 that references cell to the left.
- m_pDoc->SetString(1, nRow, 0, "=RC[-1]");
+ m_pDoc->SetString(1, nRow, 0, u"=RC[-1]"_ustr);
// Formula in column 3 that references cell to the left.
- m_pDoc->SetString(2, nRow, 0, "=RC[-1]*2");
+ m_pDoc->SetString(2, nRow, 0, u"=RC[-1]*2"_ustr);
}
// Check formula values.
@@ -1277,7 +1278,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTracking)
// Intentionally insert a formula in column 1. This will break column 1's
// uniformity of consisting only of static value cells.
- m_pDoc->SetString(aA5, "=R2C3");
+ m_pDoc->SetString(aA5, u"=R2C3"_ustr);
ASSERT_DOUBLES_EQUAL_MESSAGE("Unexpected formula value.", 2.0, m_pDoc->GetValue(aA5));
ASSERT_DOUBLES_EQUAL_MESSAGE("Unexpected formula value.", 2.0, m_pDoc->GetValue(aB5));
ASSERT_DOUBLES_EQUAL_MESSAGE("Unexpected formula value.", 4.0, m_pDoc->GetValue(aC5));
@@ -1287,7 +1288,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTracking)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTracking2)
{
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "foo"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"foo"_ustr));
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
@@ -1297,8 +1298,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTracking2)
m_pDoc->SetValue(1, 0, 0, val);
val = 5.0;
m_pDoc->SetValue(0, 1, 0, val);
- m_pDoc->SetString(2, 0, 0, "=A1/B1");
- m_pDoc->SetString(1, 1, 0, "=B1*C1");
+ m_pDoc->SetString(2, 0, 0, u"=A1/B1"_ustr);
+ m_pDoc->SetString(1, 1, 0, u"=B1*C1"_ustr);
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(1, 1, 0)); // B2 should equal 2.
@@ -1313,7 +1314,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTracking3)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
std::vector<std::vector<const char*>> aData = {
{ "1", "2", "=SUM(A1:B1)", "=SUM(C1:C3)" },
@@ -1342,7 +1343,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTrackingDeleteRow)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Values in A1:A3.
m_pDoc->SetValue(ScAddress(0, 0, 0), 1.0);
@@ -1350,10 +1351,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTrackingDeleteRow)
m_pDoc->SetValue(ScAddress(0, 2, 0), 5.0);
// SUM(A1:A3) in A5.
- m_pDoc->SetString(ScAddress(0, 4, 0), "=SUM(A1:A3)");
+ m_pDoc->SetString(ScAddress(0, 4, 0), u"=SUM(A1:A3)"_ustr);
// A6 to reference A5.
- m_pDoc->SetString(ScAddress(0, 5, 0), "=A5*10");
+ m_pDoc->SetString(ScAddress(0, 5, 0), u"=A5*10"_ustr);
const ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(0, 5, 0));
CPPUNIT_ASSERT(pFC);
@@ -1397,7 +1398,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTrackingDeleteCol)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
std::vector<std::vector<const char*>> aData = {
{ "2", "=A1", "=B1" }, // not grouped
@@ -1512,7 +1513,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTrackingDeleteCol)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaMatrixResultUpdate)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation.
@@ -1521,15 +1522,15 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaMatrixResultUpdate)
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(1, 0, 1, 0, aMark, "=A1");
+ m_pDoc->InsertMatrixFormula(1, 0, 1, 0, aMark, u"=A1"_ustr);
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(ScAddress(1, 0, 0)));
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1, 0, 0));
CPPUNIT_ASSERT_MESSAGE("Failed to get formula cell.", pFC);
pFC->SetChanged(
false); // Clear this flag to simulate displaying of formula cell value on screen.
- m_pDoc->SetString(ScAddress(0, 0, 0), "ABC");
- CPPUNIT_ASSERT_EQUAL(OUString("ABC"), m_pDoc->GetString(ScAddress(1, 0, 0)));
+ m_pDoc->SetString(ScAddress(0, 0, 0), u"ABC"_ustr);
+ CPPUNIT_ASSERT_EQUAL(u"ABC"_ustr, m_pDoc->GetString(ScAddress(1, 0, 0)));
pFC->SetChanged(false);
// Put a new value into A1. The formula should update.
@@ -1542,10 +1543,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaMatrixResultUpdate)
CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRef)
{
ScDocShellRef xExtDocSh = new ScDocShell;
- OUString aExtDocName("file:///extdata.fake");
- OUString aExtSh1Name("Data1");
- OUString aExtSh2Name("Data2");
- OUString aExtSh3Name("Data3");
+ OUString aExtDocName(u"file:///extdata.fake"_ustr);
+ OUString aExtSh1Name(u"Data1"_ustr);
+ OUString aExtSh2Name(u"Data2"_ustr);
+ OUString aExtSh3Name(u"Data3"_ustr);
SfxMedium* pMed = new SfxMedium(aExtDocName, StreamMode::STD_READWRITE);
xExtDocSh->DoLoad(pMed);
CPPUNIT_ASSERT_MESSAGE("external document instance not loaded.",
@@ -1562,10 +1563,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRef)
// Sheet 1
rExtDoc.SetString(0, 0, 0, name);
- rExtDoc.SetString(0, 1, 0, "Andy");
- rExtDoc.SetString(0, 2, 0, "Bruce");
- rExtDoc.SetString(0, 3, 0, "Charlie");
- rExtDoc.SetString(0, 4, 0, "David");
+ rExtDoc.SetString(0, 1, 0, u"Andy"_ustr);
+ rExtDoc.SetString(0, 2, 0, u"Bruce"_ustr);
+ rExtDoc.SetString(0, 3, 0, u"Charlie"_ustr);
+ rExtDoc.SetString(0, 4, 0, u"David"_ustr);
rExtDoc.SetString(1, 0, 0, value);
double val = 10;
rExtDoc.SetValue(1, 1, 0, val);
@@ -1580,10 +1581,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRef)
// Sheet 3
rExtDoc.SetString(0, 0, 2, name);
- rExtDoc.SetString(0, 1, 2, "Edward");
- rExtDoc.SetString(0, 2, 2, "Frank");
- rExtDoc.SetString(0, 3, 2, "George");
- rExtDoc.SetString(0, 4, 2, "Henry");
+ rExtDoc.SetString(0, 1, 2, u"Edward"_ustr);
+ rExtDoc.SetString(0, 2, 2, u"Frank"_ustr);
+ rExtDoc.SetString(0, 3, 2, u"George"_ustr);
+ rExtDoc.SetString(0, 4, 2, u"Henry"_ustr);
rExtDoc.SetString(1, 0, 2, value);
val = 99;
rExtDoc.SetValue(1, 1, 2, val);
@@ -1596,8 +1597,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRef)
// Test external references on the main document while the external
// document is still in memory.
- m_pDoc->InsertTab(0, "Test Sheet");
- m_pDoc->SetString(0, 0, 0, "='file:///extdata.fake'#Data1.A1");
+ m_pDoc->InsertTab(0, u"Test Sheet"_ustr);
+ m_pDoc->SetString(0, 0, 0, u"='file:///extdata.fake'#Data1.A1"_ustr);
OUString test = m_pDoc->GetString(0, 0, 0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Value is different from the original", name, test);
@@ -1614,15 +1615,15 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRef)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected sheet name.", aTabNames[1], aExtSh2Name);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected sheet name.", aTabNames[2], aExtSh3Name);
- m_pDoc->SetString(1, 0, 0, "='file:///extdata.fake'#Data1.B1");
+ m_pDoc->SetString(1, 0, 0, u"='file:///extdata.fake'#Data1.B1"_ustr);
test = m_pDoc->GetString(1, 0, 0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Value is different from the original", value, test);
- m_pDoc->SetString(0, 1, 0, "='file:///extdata.fake'#Data1.A2");
- m_pDoc->SetString(0, 2, 0, "='file:///extdata.fake'#Data1.A3");
- m_pDoc->SetString(0, 3, 0, "='file:///extdata.fake'#Data1.A4");
- m_pDoc->SetString(0, 4, 0, "='file:///extdata.fake'#Data1.A5");
- m_pDoc->SetString(0, 5, 0, "='file:///extdata.fake'#Data1.A6");
+ m_pDoc->SetString(0, 1, 0, u"='file:///extdata.fake'#Data1.A2"_ustr);
+ m_pDoc->SetString(0, 2, 0, u"='file:///extdata.fake'#Data1.A3"_ustr);
+ m_pDoc->SetString(0, 3, 0, u"='file:///extdata.fake'#Data1.A4"_ustr);
+ m_pDoc->SetString(0, 4, 0, u"='file:///extdata.fake'#Data1.A5"_ustr);
+ m_pDoc->SetString(0, 5, 0, u"='file:///extdata.fake'#Data1.A6"_ustr);
{
// Referencing an empty cell should display '0'.
@@ -1633,11 +1634,11 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRef)
CPPUNIT_ASSERT_MESSAGE("Unexpected cell value.", test.equalsAscii(pChecks[i]));
}
}
- m_pDoc->SetString(1, 1, 0, "='file:///extdata.fake'#Data1.B2");
- m_pDoc->SetString(1, 2, 0, "='file:///extdata.fake'#Data1.B3");
- m_pDoc->SetString(1, 3, 0, "='file:///extdata.fake'#Data1.B4");
- m_pDoc->SetString(1, 4, 0, "='file:///extdata.fake'#Data1.B5");
- m_pDoc->SetString(1, 5, 0, "='file:///extdata.fake'#Data1.B6");
+ m_pDoc->SetString(1, 1, 0, u"='file:///extdata.fake'#Data1.B2"_ustr);
+ m_pDoc->SetString(1, 2, 0, u"='file:///extdata.fake'#Data1.B3"_ustr);
+ m_pDoc->SetString(1, 3, 0, u"='file:///extdata.fake'#Data1.B4"_ustr);
+ m_pDoc->SetString(1, 4, 0, u"='file:///extdata.fake'#Data1.B5"_ustr);
+ m_pDoc->SetString(1, 5, 0, u"='file:///extdata.fake'#Data1.B6"_ustr);
{
double pChecks[] = { 10, 11, 12, 13, 0 };
for (size_t i = 0; i < SAL_N_ELEMENTS(pChecks); ++i)
@@ -1647,10 +1648,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRef)
}
}
- m_pDoc->SetString(2, 0, 0, "='file:///extdata.fake'#Data3.A1");
- m_pDoc->SetString(2, 1, 0, "='file:///extdata.fake'#Data3.A2");
- m_pDoc->SetString(2, 2, 0, "='file:///extdata.fake'#Data3.A3");
- m_pDoc->SetString(2, 3, 0, "='file:///extdata.fake'#Data3.A4");
+ m_pDoc->SetString(2, 0, 0, u"='file:///extdata.fake'#Data3.A1"_ustr);
+ m_pDoc->SetString(2, 1, 0, u"='file:///extdata.fake'#Data3.A2"_ustr);
+ m_pDoc->SetString(2, 2, 0, u"='file:///extdata.fake'#Data3.A3"_ustr);
+ m_pDoc->SetString(2, 3, 0, u"='file:///extdata.fake'#Data3.A4"_ustr);
{
const char* pChecks[] = { "Name", "Edward", "Frank", "George" };
for (size_t i = 0; i < SAL_N_ELEMENTS(pChecks); ++i)
@@ -1660,10 +1661,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRef)
}
}
- m_pDoc->SetString(3, 0, 0, "='file:///extdata.fake'#Data3.B1");
- m_pDoc->SetString(3, 1, 0, "='file:///extdata.fake'#Data3.B2");
- m_pDoc->SetString(3, 2, 0, "='file:///extdata.fake'#Data3.B3");
- m_pDoc->SetString(3, 3, 0, "='file:///extdata.fake'#Data3.B4");
+ m_pDoc->SetString(3, 0, 0, u"='file:///extdata.fake'#Data3.B1"_ustr);
+ m_pDoc->SetString(3, 1, 0, u"='file:///extdata.fake'#Data3.B2"_ustr);
+ m_pDoc->SetString(3, 2, 0, u"='file:///extdata.fake'#Data3.B3"_ustr);
+ m_pDoc->SetString(3, 3, 0, u"='file:///extdata.fake'#Data3.B4"_ustr);
{
const char* pChecks[] = { "Value", "99", "98", "97" };
for (size_t i = 0; i < SAL_N_ELEMENTS(pChecks); ++i)
@@ -1723,15 +1724,15 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRangeName)
findLoadedDocShellByName(aExtDocName) != nullptr);
ScDocument& rExtDoc = xExtDocSh->GetDocument();
- rExtDoc.InsertTab(0, "Data1");
+ rExtDoc.InsertTab(0, u"Data1"_ustr);
rExtDoc.SetValue(0, 0, 0, 123.456);
ScRangeName* pRangeName = rExtDoc.GetRangeName();
- ScRangeData* pRangeData = new ScRangeData(rExtDoc, "ExternalName", "$Data1.$A$1");
+ ScRangeData* pRangeData = new ScRangeData(rExtDoc, u"ExternalName"_ustr, u"$Data1.$A$1"_ustr);
pRangeName->insert(pRangeData);
- m_pDoc->InsertTab(0, "Test Sheet");
- m_pDoc->SetString(0, 1, 0, "='file:///extdata.fake'#ExternalName");
+ m_pDoc->InsertTab(0, u"Test Sheet"_ustr);
+ m_pDoc->SetString(0, 1, 0, u"='file:///extdata.fake'#ExternalName"_ustr);
double nVal = m_pDoc->GetValue(0, 1, 0);
ASSERT_DOUBLES_EQUAL(123.456, nVal);
@@ -1747,18 +1748,18 @@ void TestFormula2::testExtRefFuncT(ScDocument* pDoc, ScDocument& rExtDoc)
clearRange(pDoc, ScRange(0, 0, 0, 1, 9, 0));
clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0));
- rExtDoc.SetString(0, 0, 0, "'1.2");
- rExtDoc.SetString(0, 1, 0, "Foo");
+ rExtDoc.SetString(0, 0, 0, u"'1.2"_ustr);
+ rExtDoc.SetString(0, 1, 0, u"Foo"_ustr);
rExtDoc.SetValue(0, 2, 0, 12.3);
- pDoc->SetString(0, 0, 0, "=T('file:///extdata.fake'#Data.A1)");
- pDoc->SetString(0, 1, 0, "=T('file:///extdata.fake'#Data.A2)");
- pDoc->SetString(0, 2, 0, "=T('file:///extdata.fake'#Data.A3)");
+ pDoc->SetString(0, 0, 0, u"=T('file:///extdata.fake'#Data.A1)"_ustr);
+ pDoc->SetString(0, 1, 0, u"=T('file:///extdata.fake'#Data.A2)"_ustr);
+ pDoc->SetString(0, 2, 0, u"=T('file:///extdata.fake'#Data.A3)"_ustr);
pDoc->CalcAll();
OUString aRes = pDoc->GetString(0, 0, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected result with T.", OUString("1.2"), aRes);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected result with T.", u"1.2"_ustr, aRes);
aRes = pDoc->GetString(0, 1, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected result with T.", OUString("Foo"), aRes);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected result with T.", u"Foo"_ustr, aRes);
aRes = pDoc->GetString(0, 2, 0);
CPPUNIT_ASSERT_MESSAGE("Unexpected result with T.", aRes.isEmpty());
}
@@ -1772,7 +1773,7 @@ void TestFormula2::testExtRefFuncOFFSET(ScDocument* pDoc, ScDocument& rExtDoc)
// External document has sheet named 'Data', and the internal doc has sheet named 'Test'.
rExtDoc.SetValue(ScAddress(0, 1, 0), 1.2); // Set 1.2 to A2.
- pDoc->SetString(ScAddress(0, 0, 0), "=OFFSET('file:///extdata.fake'#Data.$A$1;1;0;1;1)");
+ pDoc->SetString(ScAddress(0, 0, 0), u"=OFFSET('file:///extdata.fake'#Data.$A$1;1;0;1;1)"_ustr);
CPPUNIT_ASSERT_EQUAL(1.2, pDoc->GetValue(ScAddress(0, 0, 0)));
}
@@ -1782,29 +1783,29 @@ void TestFormula2::testExtRefFuncVLOOKUP(ScDocument* pDoc, ScDocument& rExtDoc)
clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0));
// Populate the external document.
- rExtDoc.SetString(ScAddress(0, 0, 0), "A1");
- rExtDoc.SetString(ScAddress(0, 1, 0), "A2");
- rExtDoc.SetString(ScAddress(0, 2, 0), "A3");
- rExtDoc.SetString(ScAddress(0, 3, 0), "A4");
- rExtDoc.SetString(ScAddress(0, 4, 0), "A5");
-
- rExtDoc.SetString(ScAddress(1, 0, 0), "B1");
- rExtDoc.SetString(ScAddress(1, 1, 0), "B2");
- rExtDoc.SetString(ScAddress(1, 2, 0), "B3");
- rExtDoc.SetString(ScAddress(1, 3, 0), "B4");
- rExtDoc.SetString(ScAddress(1, 4, 0), "B5");
+ rExtDoc.SetString(ScAddress(0, 0, 0), u"A1"_ustr);
+ rExtDoc.SetString(ScAddress(0, 1, 0), u"A2"_ustr);
+ rExtDoc.SetString(ScAddress(0, 2, 0), u"A3"_ustr);
+ rExtDoc.SetString(ScAddress(0, 3, 0), u"A4"_ustr);
+ rExtDoc.SetString(ScAddress(0, 4, 0), u"A5"_ustr);
+
+ rExtDoc.SetString(ScAddress(1, 0, 0), u"B1"_ustr);
+ rExtDoc.SetString(ScAddress(1, 1, 0), u"B2"_ustr);
+ rExtDoc.SetString(ScAddress(1, 2, 0), u"B3"_ustr);
+ rExtDoc.SetString(ScAddress(1, 3, 0), u"B4"_ustr);
+ rExtDoc.SetString(ScAddress(1, 4, 0), u"B5"_ustr);
// Put formula in the source document.
- pDoc->SetString(ScAddress(0, 0, 0), "A2");
+ pDoc->SetString(ScAddress(0, 0, 0), u"A2"_ustr);
// Sort order TRUE
- pDoc->SetString(ScAddress(1, 0, 0), "=VLOOKUP(A1;'file:///extdata.fake'#Data.A1:B5;2;1)");
- CPPUNIT_ASSERT_EQUAL(OUString("B2"), pDoc->GetString(ScAddress(1, 0, 0)));
+ pDoc->SetString(ScAddress(1, 0, 0), u"=VLOOKUP(A1;'file:///extdata.fake'#Data.A1:B5;2;1)"_ustr);
+ CPPUNIT_ASSERT_EQUAL(u"B2"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
// Sort order FALSE. It should return the same result.
- pDoc->SetString(ScAddress(1, 0, 0), "=VLOOKUP(A1;'file:///extdata.fake'#Data.A1:B5;2;0)");
- CPPUNIT_ASSERT_EQUAL(OUString("B2"), pDoc->GetString(ScAddress(1, 0, 0)));
+ pDoc->SetString(ScAddress(1, 0, 0), u"=VLOOKUP(A1;'file:///extdata.fake'#Data.A1:B5;2;0)"_ustr);
+ CPPUNIT_ASSERT_EQUAL(u"B2"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
}
void TestFormula2::testExtRefConcat(ScDocument* pDoc, ScDocument& rExtDoc)
@@ -1815,19 +1816,19 @@ void TestFormula2::testExtRefConcat(ScDocument* pDoc, ScDocument& rExtDoc)
sc::AutoCalcSwitch aACSwitch(*pDoc, true);
// String and number
- rExtDoc.SetString(ScAddress(0, 0, 0), "Answer: ");
+ rExtDoc.SetString(ScAddress(0, 0, 0), u"Answer: "_ustr);
rExtDoc.SetValue(ScAddress(0, 1, 0), 42);
// Concat operation should combine string and number converted to string
pDoc->SetString(ScAddress(0, 0, 0),
- "='file:///extdata.fake'#Data.A1 & 'file:///extdata.fake'#Data.A2");
- CPPUNIT_ASSERT_EQUAL(OUString("Answer: 42"), pDoc->GetString(ScAddress(0, 0, 0)));
+ u"='file:///extdata.fake'#Data.A1 & 'file:///extdata.fake'#Data.A2"_ustr);
+ CPPUNIT_ASSERT_EQUAL(u"Answer: 42"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRefFunctions)
{
ScDocShellRef xExtDocSh = new ScDocShell;
- OUString aExtDocName("file:///extdata.fake");
+ OUString aExtDocName(u"file:///extdata.fake"_ustr);
SfxMedium* pMed = new SfxMedium(aExtDocName, StreamMode::STD_READWRITE);
xExtDocSh->DoLoad(pMed);
CPPUNIT_ASSERT_MESSAGE("external document instance not loaded.",
@@ -1845,7 +1846,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRefFunctions)
// Populate the external source document.
ScDocument& rExtDoc = xExtDocSh->GetDocument();
- rExtDoc.InsertTab(0, "Data");
+ rExtDoc.InsertTab(0, u"Data"_ustr);
double val = 1;
rExtDoc.SetValue(0, 0, 0, val);
// leave cell B1 empty.
@@ -1859,7 +1860,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRefFunctions)
rExtDoc.SetValue(0, 3, 0, val);
rExtDoc.SetValue(1, 3, 0, val);
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
static const struct
{
@@ -1889,7 +1890,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRefFunctions)
// external range reference should be 1x1 and have one error value.
// XXX NOTE: in case we supported sparse matrix that can hold this large
// areas these tests may be adapted.
- m_pDoc->SetString(0, 0, 0, "=SUM('file:///extdata.fake'#Data.B1:AMJ1048575)");
+ m_pDoc->SetString(0, 0, 0, u"=SUM('file:///extdata.fake'#Data.B1:AMJ1048575)"_ustr);
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(0, 0, 0));
FormulaError nErr = pFC->GetErrCode();
CPPUNIT_ASSERT_EQUAL_MESSAGE(
@@ -1898,7 +1899,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRefFunctions)
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(0, 0, 0, 0, aMark, "'file:///extdata.fake'#Data.B1:AMJ1048575");
+ m_pDoc->InsertMatrixFormula(0, 0, 0, 0, aMark,
+ u"'file:///extdata.fake'#Data.B1:AMJ1048575"_ustr);
pFC = m_pDoc->GetFormulaCell(ScAddress(0, 0, 0));
nErr = pFC->GetErrCode();
CPPUNIT_ASSERT_EQUAL_MESSAGE(
@@ -1929,7 +1931,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRefUnresolved)
{
#if !defined(_WIN32) //FIXME
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Test error propagation of unresolved (not existing document) external
// references. Well, let's hope no build machine has such file with sheet...
@@ -2010,7 +2012,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRefUnresolved)
CPPUNIT_TEST_FIXTURE(TestFormula2, testMatrixOp)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
for (SCROW nRow = 0; nRow < 4; ++nRow)
{
@@ -2019,8 +2021,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testMatrixOp)
m_pDoc->SetValue(1, 0, 0, 2.0);
m_pDoc->SetValue(3, 0, 0, 1.0);
m_pDoc->SetValue(3, 1, 0, 2.0);
- m_pDoc->SetString(2, 0, 0, "=SUMPRODUCT((A1:A4)*B1+D1)");
- m_pDoc->SetString(2, 1, 0, "=SUMPRODUCT((A1:A4)*B1-D2)");
+ m_pDoc->SetString(2, 0, 0, u"=SUMPRODUCT((A1:A4)*B1+D1)"_ustr);
+ m_pDoc->SetString(2, 1, 0, u"=SUMPRODUCT((A1:A4)*B1-D2)"_ustr);
double nVal = m_pDoc->GetValue(2, 0, 0);
CPPUNIT_ASSERT_EQUAL(16.0, nVal);
@@ -2028,14 +2030,14 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testMatrixOp)
nVal = m_pDoc->GetValue(2, 1, 0);
CPPUNIT_ASSERT_EQUAL(4.0, nVal);
- m_pDoc->SetString(4, 0, 0, "=SUMPRODUCT({1;2;4}+8)");
- m_pDoc->SetString(4, 1, 0, "=SUMPRODUCT(8+{1;2;4})");
- m_pDoc->SetString(4, 2, 0, "=SUMPRODUCT({1;2;4}-8)");
- m_pDoc->SetString(4, 3, 0, "=SUMPRODUCT(8-{1;2;4})");
- m_pDoc->SetString(4, 4, 0, "=SUMPRODUCT({1;2;4}+{8;16;32})");
- m_pDoc->SetString(4, 5, 0, "=SUMPRODUCT({8;16;32}+{1;2;4})");
- m_pDoc->SetString(4, 6, 0, "=SUMPRODUCT({1;2;4}-{8;16;32})");
- m_pDoc->SetString(4, 7, 0, "=SUMPRODUCT({8;16;32}-{1;2;4})");
+ m_pDoc->SetString(4, 0, 0, u"=SUMPRODUCT({1;2;4}+8)"_ustr);
+ m_pDoc->SetString(4, 1, 0, u"=SUMPRODUCT(8+{1;2;4})"_ustr);
+ m_pDoc->SetString(4, 2, 0, u"=SUMPRODUCT({1;2;4}-8)"_ustr);
+ m_pDoc->SetString(4, 3, 0, u"=SUMPRODUCT(8-{1;2;4})"_ustr);
+ m_pDoc->SetString(4, 4, 0, u"=SUMPRODUCT({1;2;4}+{8;16;32})"_ustr);
+ m_pDoc->SetString(4, 5, 0, u"=SUMPRODUCT({8;16;32}+{1;2;4})"_ustr);
+ m_pDoc->SetString(4, 6, 0, u"=SUMPRODUCT({1;2;4}-{8;16;32})"_ustr);
+ m_pDoc->SetString(4, 7, 0, u"=SUMPRODUCT({8;16;32}-{1;2;4})"_ustr);
double fResult[8] = { 31.0, 31.0, -17.0, 17.0, 63.0, 63.0, -49.0, 49.0 };
for (size_t i = 0; i < SAL_N_ELEMENTS(fResult); ++i)
{
@@ -2049,9 +2051,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRangeOp)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
- m_pDoc->InsertTab(2, "Sheet3");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
+ m_pDoc->InsertTab(2, u"Sheet3"_ustr);
// Sheet1.B1:B3
m_pDoc->SetValue(1, 0, 0, 1.0);
@@ -2072,44 +2074,44 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRangeOp)
// Current sheet is Sheet1, so B1:B2 implies relative Sheet1.B1:B2
ScAddress aPos(0, 0, 0);
- m_pDoc->SetString(aPos, "=SUM(B1:B2:B3)");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(B1:B3)"),
+ m_pDoc->SetString(aPos, u"=SUM(B1:B2:B3)"_ustr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(B1:B3)"_ustr,
m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
CPPUNIT_ASSERT_EQUAL(7.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=SUM(B1:B3:B2)");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(B1:B3)"),
+ m_pDoc->SetString(aPos, u"=SUM(B1:B3:B2)"_ustr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(B1:B3)"_ustr,
m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
CPPUNIT_ASSERT_EQUAL(7.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=SUM(B2:B3:B1)");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(B1:B3)"),
+ m_pDoc->SetString(aPos, u"=SUM(B2:B3:B1)"_ustr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(B1:B3)"_ustr,
m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
CPPUNIT_ASSERT_EQUAL(7.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=SUM(Sheet2.B1:B2:B3)");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(Sheet2.B1:B3)"),
+ m_pDoc->SetString(aPos, u"=SUM(Sheet2.B1:B2:B3)"_ustr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(Sheet2.B1:B3)"_ustr,
m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
CPPUNIT_ASSERT_EQUAL(56.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=SUM(B2:B2:Sheet1.B2)");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(Sheet1.B2:B2)"),
+ m_pDoc->SetString(aPos, u"=SUM(B2:B2:Sheet1.B2)"_ustr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(Sheet1.B2:B2)"_ustr,
m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=SUM(B2:B3:Sheet2.B1)");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(Sheet1.B1:Sheet2.B3)"),
+ m_pDoc->SetString(aPos, u"=SUM(B2:B3:Sheet2.B1)"_ustr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(Sheet1.B1:Sheet2.B3)"_ustr,
m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
CPPUNIT_ASSERT_EQUAL(63.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=SUM(Sheet1.B1:Sheet2.B2:Sheet3.B3)");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(Sheet1.B1:Sheet3.B3)"),
+ m_pDoc->SetString(aPos, u"=SUM(Sheet1.B1:Sheet2.B2:Sheet3.B3)"_ustr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(Sheet1.B1:Sheet3.B3)"_ustr,
m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
CPPUNIT_ASSERT_EQUAL(511.0, m_pDoc->GetValue(aPos));
@@ -2117,20 +2119,20 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRangeOp)
// The actual representation of the error case may change, so this test may
// have to be adapted.
aPos.IncRow();
- m_pDoc->SetString(aPos, "=SUM(B1:Sheet2.B2:Sheet3.B3)");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(b1:sheet2.b2:Sheet3.B3)"),
+ m_pDoc->SetString(aPos, u"=SUM(B1:Sheet2.B2:Sheet3.B3)"_ustr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(b1:sheet2.b2:Sheet3.B3)"_ustr,
m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
- CPPUNIT_ASSERT_EQUAL(OUString("#NAME?"), m_pDoc->GetString(aPos));
+ CPPUNIT_ASSERT_EQUAL(u"#NAME?"_ustr, m_pDoc->GetString(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=SUM(Sheet1.B1:Sheet3.B2:Sheet2.B3)");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(Sheet1.B1:Sheet3.B3)"),
+ m_pDoc->SetString(aPos, u"=SUM(Sheet1.B1:Sheet3.B2:Sheet2.B3)"_ustr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(Sheet1.B1:Sheet3.B3)"_ustr,
m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
CPPUNIT_ASSERT_EQUAL(511.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=SUM(B$2:B$2:B2)");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", OUString("=SUM(B$2:B2)"),
+ m_pDoc->SetString(aPos, u"=SUM(B$2:B$2:B2)"_ustr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula.", u"=SUM(B$2:B2)"_ustr,
m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(aPos));
@@ -2143,7 +2145,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncFORMULA)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
// Data in B1:D3
std::vector<std::vector<const char*>> aData = {
@@ -2171,7 +2173,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncFORMULA)
// Matrix in D4:D6, no intersection with B1:B3
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(3, 3, 3, 5, aMark, "=FORMULA(B1:B3)");
+ m_pDoc->InsertMatrixFormula(3, 3, 3, 5, aMark, u"=FORMULA(B1:B3)"_ustr);
for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i)
{
CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(aChecks[i]), m_pDoc->GetString(3, i + 3, 0));
@@ -2184,7 +2186,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncTableRef)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
ScDocFunc& rDocFunc = m_xDocShell->GetDocFunc();
@@ -2195,7 +2197,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncTableRef)
// Insert "table" database range definition for A1:B4, with default
// HasHeader=true and HasTotals=false.
- std::unique_ptr<ScDBData> pData(new ScDBData("table", 0, 0, 0, 1, 3));
+ std::unique_ptr<ScDBData> pData(new ScDBData(u"table"_ustr, 0, 0, 0, 1, 3));
bool bInserted = pDBs->getNamedDBs().insert(std::move(pData));
CPPUNIT_ASSERT_MESSAGE("Failed to insert \"table\" database range.", bInserted);
}
@@ -2351,22 +2353,22 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncTableRef)
}
// Set header in column B. Use ScDocFunc to have table column names refreshed.
- rDocFunc.SetStringCell(ScAddress(1, 0, 0), "NewHeader", true);
+ rDocFunc.SetStringCell(ScAddress(1, 0, 0), u"NewHeader"_ustr, true);
// Verify that formula adapted using the updated table column names.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=SUM(table[[#Data];[NewHeader]])"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=SUM(table[[#Data];[NewHeader]])"_ustr,
m_pDoc->GetFormula(1, 5, 0));
// Set header in column A to identical string. Internal table column name
// for B should get a "2" appended.
- rDocFunc.SetStringCell(ScAddress(0, 0, 0), "NewHeader", true);
+ rDocFunc.SetStringCell(ScAddress(0, 0, 0), u"NewHeader"_ustr, true);
// Verify that formula adapted using the updated table column names.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=SUM(table[[#Data];[NewHeader2]])"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=SUM(table[[#Data];[NewHeader2]])"_ustr,
m_pDoc->GetFormula(1, 5, 0));
// Set header in column B to empty string, effectively clearing the cell.
- rDocFunc.SetStringCell(ScAddress(1, 0, 0), "", true);
+ rDocFunc.SetStringCell(ScAddress(1, 0, 0), u""_ustr, true);
// Verify that formula is still using the previous table column name.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=SUM(table[[#Data];[NewHeader2]])"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=SUM(table[[#Data];[NewHeader2]])"_ustr,
m_pDoc->GetFormula(1, 5, 0));
// === header-less ===
@@ -2376,7 +2378,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncTableRef)
CPPUNIT_ASSERT_MESSAGE("Failed to fetch DB collection object.", pDBs);
// Insert "headerless" database range definition for E10:F12, without headers.
- std::unique_ptr<ScDBData> pData(new ScDBData("hltable", 0, 4, 9, 5, 11, true, false));
+ std::unique_ptr<ScDBData> pData(new ScDBData(u"hltable"_ustr, 0, 4, 9, 5, 11, true, false));
bool bInserted = pDBs->getNamedDBs().insert(std::move(pData));
CPPUNIT_ASSERT_MESSAGE("Failed to insert \"hltable\" database range.", bInserted);
}
@@ -2535,22 +2537,22 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncFTEST)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "FTest");
+ m_pDoc->InsertTab(0, u"FTest"_ustr);
ScAddress aPos(6, 0, 0);
- m_pDoc->SetString(aPos, "=FTEST(A1:C3;D1:F3)");
+ m_pDoc->SetString(aPos, u"=FTEST(A1:C3;D1:F3)"_ustr);
m_pDoc->SetValue(0, 0, 0, 9.0); // A1
OUString aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("FTEST should return #VALUE! for less than 2 values",
- OUString("#VALUE!"), aVal);
+ u"#VALUE!"_ustr, aVal);
m_pDoc->SetValue(0, 1, 0, 8.0); // A2
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("FTEST should return #VALUE! for less than 2 values",
- OUString("#VALUE!"), aVal);
+ u"#VALUE!"_ustr, aVal);
m_pDoc->SetValue(3, 0, 0, 5.0); // D1
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("FTEST should return #VALUE! for less than 2 values",
- OUString("#VALUE!"), aVal);
+ u"#VALUE!"_ustr, aVal);
m_pDoc->SetValue(3, 1, 0, 6.0); // D2
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of FTEST failed", 1.0000,
m_pDoc->GetValue(aPos), 10e-4);
@@ -2597,24 +2599,24 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncFTEST)
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of FTEST failed", 0.0422,
m_pDoc->GetValue(aPos), 10e-4);
- m_pDoc->SetString(0, 2, 0, "a"); // A3
+ m_pDoc->SetString(0, 2, 0, u"a"_ustr); // A3
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of FTEST failed", 0.0334,
m_pDoc->GetValue(aPos), 10e-4);
- m_pDoc->SetString(2, 0, 0, "b"); // C1
+ m_pDoc->SetString(2, 0, 0, u"b"_ustr); // C1
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of FTEST failed", 0.0261,
m_pDoc->GetValue(aPos), 10e-4);
- m_pDoc->SetString(5, 1, 0, "c"); // F2
+ m_pDoc->SetString(5, 1, 0, u"c"_ustr); // F2
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of FTEST failed", 0.0219,
m_pDoc->GetValue(aPos), 10e-4);
- m_pDoc->SetString(4, 2, 0, "d"); // E3
+ m_pDoc->SetString(4, 2, 0, u"d"_ustr); // E3
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of FTEST failed", 0.0161,
m_pDoc->GetValue(aPos), 10e-4);
- m_pDoc->SetString(3, 2, 0, "e"); // D3
+ m_pDoc->SetString(3, 2, 0, u"e"_ustr); // D3
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of FTEST failed", 0.0110,
m_pDoc->GetValue(aPos), 10e-4);
m_pDoc->DeleteTab(0);
- m_pDoc->InsertTab(0, "FTest2");
+ m_pDoc->InsertTab(0, u"FTest2"_ustr);
/* Summary of the following test
A1:A5 = SQRT(C1*9/10)*{ 1.0, 1.0, 1.0, 1.0, 1.0 };
@@ -2674,31 +2676,31 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncFTEST)
m_pDoc->SetValue(3, 0, 0, fParameter[0]); // D1
m_pDoc->SetValue(3, 1, 0, fParameter[0]); // D2
aPos.Set(2, 0, 0); // C1
- m_pDoc->SetString(aPos, "=POWER(1.5;D1)"); // C1
+ m_pDoc->SetString(aPos, u"=POWER(1.5;D1)"_ustr); // C1
aPos.Set(2, 1, 0); // C2
- m_pDoc->SetString(aPos, "=POWER(1.5;D2)"); // C2
+ m_pDoc->SetString(aPos, u"=POWER(1.5;D2)"_ustr); // C2
for (SCROW nRow = 0; nRow < 5;
++nRow) // Set A1:A5 = SQRT(C1*9/10), and A6:A10 = -SQRT(C1*9/10)
{
aPos.Set(0, nRow, 0);
- m_pDoc->SetString(aPos, "=SQRT(C1*9/10)");
+ m_pDoc->SetString(aPos, u"=SQRT(C1*9/10)"_ustr);
aPos.Set(0, nRow + 5, 0);
- m_pDoc->SetString(aPos, "=-SQRT(C1*9/10)");
+ m_pDoc->SetString(aPos, u"=-SQRT(C1*9/10)"_ustr);
}
for (SCROW nRow = 0; nRow < 10;
++nRow) // Set B1:B10 = SQRT(C2*19/20), and B11:B20 = -SQRT(C2*19/20)
{
aPos.Set(1, nRow, 0);
- m_pDoc->SetString(aPos, "=SQRT(C2*19/20)");
+ m_pDoc->SetString(aPos, u"=SQRT(C2*19/20)"_ustr);
aPos.Set(1, nRow + 10, 0);
- m_pDoc->SetString(aPos, "=-SQRT(C2*19/20)");
+ m_pDoc->SetString(aPos, u"=-SQRT(C2*19/20)"_ustr);
}
aPos.Set(4, 0, 0); // E1
- m_pDoc->SetString(aPos, "=FTEST(A1:A10;B1:B20)");
+ m_pDoc->SetString(aPos, u"=FTEST(A1:A10;B1:B20)"_ustr);
aPos.Set(4, 1, 0); // E2
- m_pDoc->SetString(aPos, "=FTEST(B1:B20;A1:A10)");
+ m_pDoc->SetString(aPos, u"=FTEST(B1:B20;A1:A10)"_ustr);
ScAddress aPosRev(4, 1, 0); // E2
aPos.Set(4, 0, 0); // E1
@@ -2726,10 +2728,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncFTESTBug)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "FTest");
+ m_pDoc->InsertTab(0, u"FTest"_ustr);
ScAddress aPos(9, 0, 0);
- m_pDoc->SetString(aPos, "=FTEST(H1:H3;I1:I3)");
+ m_pDoc->SetString(aPos, u"=FTEST(H1:H3;I1:I3)"_ustr);
m_pDoc->SetValue(7, 0, 0, 9.0); // H1
m_pDoc->SetValue(7, 1, 0, 8.0); // H2
@@ -2747,14 +2749,14 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCHITEST)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "ChiTest");
+ m_pDoc->InsertTab(0, u"ChiTest"_ustr);
ScAddress aPos(6, 0, 0);
// 2x2 matrices test
- m_pDoc->SetString(aPos, "=CHITEST(A1:B2;D1:E2)");
+ m_pDoc->SetString(aPos, u"=CHITEST(A1:B2;D1:E2)"_ustr);
OUString aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("CHITEST should return Err:502 for matrices with empty cells",
- OUString("Err:502"), aVal);
+ u"Err:502"_ustr, aVal);
m_pDoc->SetValue(0, 0, 0, 1.0); // A1
m_pDoc->SetValue(0, 1, 0, 2.0); // A2
@@ -2762,7 +2764,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCHITEST)
m_pDoc->SetValue(1, 1, 0, 1.0); // B2
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("CHITEST should return Err:502 for matrix with empty cells",
- OUString("Err:502"), aVal);
+ u"Err:502"_ustr, aVal);
m_pDoc->SetValue(3, 0, 0, 2.0); // D1
m_pDoc->SetValue(3, 1, 0, 3.0); // D2
@@ -2778,14 +2780,14 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCHITEST)
m_pDoc->SetValue(4, 0, 0, 0.0); // E1
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("CHITEST should return #DIV/0 for expected values of 0",
- OUString("#DIV/0!"), aVal);
+ u"#DIV/0!"_ustr, aVal);
m_pDoc->SetValue(4, 0, 0, 3.0); // E1
m_pDoc->SetValue(1, 1, 0, 0.0); // B2
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of CHITEST failed", 0.1410,
m_pDoc->GetValue(aPos), 10e-4);
// 3x3 matrices test
- m_pDoc->SetString(aPos, "=CHITEST(A1:C3;D1:F3)");
+ m_pDoc->SetString(aPos, u"=CHITEST(A1:C3;D1:F3)"_ustr);
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of CHITEST failed", 0.7051,
m_pDoc->GetValue(aPos), 10e-4);
@@ -2803,18 +2805,18 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCHITEST)
m_pDoc->GetValue(aPos), 10e-4);
// test with strings
- m_pDoc->SetString(4, 2, 0, "a"); // E3
+ m_pDoc->SetString(4, 2, 0, u"a"_ustr); // E3
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("CHITEST should return Err:502 for matrices with strings",
- OUString("Err:502"), aVal);
- m_pDoc->SetString(1, 2, 0, "a"); // B3
+ u"Err:502"_ustr, aVal);
+ m_pDoc->SetString(1, 2, 0, u"a"_ustr); // B3
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("CHITEST should return Err:502 for matrices with strings",
- OUString("Err:502"), aVal);
+ u"Err:502"_ustr, aVal);
m_pDoc->SetValue(4, 2, 0, 1.0); // E3
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("CHITEST should return Err:502 for matrices with strings",
- OUString("Err:502"), aVal);
+ u"Err:502"_ustr, aVal);
m_pDoc->SetValue(1, 2, 0, 2.0); // B3
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of CHITEST failed", 0.1117,
m_pDoc->GetValue(aPos), 10e-4);
@@ -2845,7 +2847,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCHITEST)
// no convergence error
m_pDoc->SetValue(4, 0, 0, 1.0E308); // E1
aVal = m_pDoc->GetString(aPos);
- CPPUNIT_ASSERT_EQUAL(OUString("Err:523"), aVal);
+ CPPUNIT_ASSERT_EQUAL(u"Err:523"_ustr, aVal);
m_pDoc->SetValue(4, 0, 0, 3.0); // E1
// zero in all cells
@@ -2869,7 +2871,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCHITEST)
m_pDoc->SetValue(3, 0, 0, 0.0); // D1
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("CHITEST should return #DIV/0! for matrices with empty",
- OUString("#DIV/0!"), aVal);
+ u"#DIV/0!"_ustr, aVal);
m_pDoc->SetValue(3, 1, 0, 0.0); // D2
m_pDoc->SetValue(3, 2, 0, 0.0); // D3
m_pDoc->SetValue(4, 0, 0, 0.0); // E1
@@ -2880,7 +2882,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCHITEST)
m_pDoc->SetValue(5, 2, 0, 0.0); // F3
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("CHITEST should return #DIV/0! for matrices with empty",
- OUString("#DIV/0!"), aVal);
+ u"#DIV/0!"_ustr, aVal);
m_pDoc->DeleteTab(0);
}
@@ -2889,14 +2891,14 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncTTEST)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "TTest");
+ m_pDoc->InsertTab(0, u"TTest"_ustr);
ScAddress aPos(6, 0, 0);
// type 1, mode/tails 1
- m_pDoc->SetString(aPos, "=TTEST(A1:C3;D1:F3;1;1)");
+ m_pDoc->SetString(aPos, u"=TTEST(A1:C3;D1:F3;1;1)"_ustr);
OUString aVal = m_pDoc->GetString(aPos);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("TTEST should return #VALUE! for empty matrices",
- OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("TTEST should return #VALUE! for empty matrices", u"#VALUE!"_ustr,
+ aVal);
m_pDoc->SetValue(0, 0, 0, 8.0); // A1
m_pDoc->SetValue(1, 0, 0, 2.0); // B1
@@ -2947,21 +2949,21 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncTTEST)
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of TTEST failed", 0.25529,
m_pDoc->GetValue(aPos), 10e-5);
- m_pDoc->SetString(1, 1, 0, "a"); // B2
+ m_pDoc->SetString(1, 1, 0, u"a"_ustr); // B2
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of TTEST failed", 0.12016,
m_pDoc->GetValue(aPos), 10e-5);
- m_pDoc->SetString(4, 1, 0, "b"); // E2
+ m_pDoc->SetString(4, 1, 0, u"b"_ustr); // E2
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of TTEST failed", 0.12016,
m_pDoc->GetValue(aPos), 10e-5);
- m_pDoc->SetString(2, 2, 0, "c"); // C3
+ m_pDoc->SetString(2, 2, 0, u"c"_ustr); // C3
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of TTEST failed", 0.25030,
m_pDoc->GetValue(aPos), 10e-5);
- m_pDoc->SetString(5, 1, 0, "d"); // F2
+ m_pDoc->SetString(5, 1, 0, u"d"_ustr); // F2
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of TTEST failed", 0.19637,
m_pDoc->GetValue(aPos), 10e-5);
// type 1, mode/tails 2
- m_pDoc->SetString(aPos, "=TTEST(A1:C3;D1:F3;2;1)");
+ m_pDoc->SetString(aPos, u"=TTEST(A1:C3;D1:F3;2;1)"_ustr);
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of TTEST failed", 0.39273,
m_pDoc->GetValue(aPos), 10e-5);
m_pDoc->SetValue(1, 1, 0, 4.0); // B2
@@ -2984,7 +2986,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncTTEST)
m_pDoc->GetValue(aPos), 10e-5);
// type 2, mode/tails 2
- m_pDoc->SetString(aPos, "=TTEST(A1:C3;D1:F3;2;2)");
+ m_pDoc->SetString(aPos, u"=TTEST(A1:C3;D1:F3;2;2)"_ustr);
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of TTEST failed", 0.62549,
m_pDoc->GetValue(aPos), 10e-5);
m_pDoc->SetValue(5, 1, 0, -1.0); // F2
@@ -3004,7 +3006,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncTTEST)
m_pDoc->GetValue(aPos), 10e-5);
// type 3, mode/tails 1
- m_pDoc->SetString(aPos, "=TTEST(A1:C3;D1:F3;1;3)");
+ m_pDoc->SetString(aPos, u"=TTEST(A1:C3;D1:F3;1;3)"_ustr);
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Calculation of TTEST failed", 0.22132,
m_pDoc->GetValue(aPos), 10e-5);
m_pDoc->SetValue(0, 0, 0, 1.0); // A1
@@ -3033,11 +3035,11 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMX2PY2)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "SumX2PY2 Test");
+ m_pDoc->InsertTab(0, u"SumX2PY2 Test"_ustr);
OUString aVal;
ScAddress aPos(6, 0, 0);
- m_pDoc->SetString(aPos, "=SUMX2PY2(A1:C3;D1:F3)");
+ m_pDoc->SetString(aPos, u"=SUMX2PY2(A1:C3;D1:F3)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2PY2 failed", 0.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(0, 0, 0, 1.0); // A1
@@ -3072,24 +3074,24 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMX2PY2)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2PY2 failed", 407.0, m_pDoc->GetValue(aPos));
// add some strings
- m_pDoc->SetString(4, 1, 0, "a"); // E2
+ m_pDoc->SetString(4, 1, 0, u"a"_ustr); // E2
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2PY2 failed", 357.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(1, 1, 0, "a"); // B2
+ m_pDoc->SetString(1, 1, 0, u"a"_ustr); // B2
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2PY2 failed", 357.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(0, 0, 0, "a"); // A1
+ m_pDoc->SetString(0, 0, 0, u"a"_ustr); // A1
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2PY2 failed", 352.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(3, 0, 0, "a"); // D1
+ m_pDoc->SetString(3, 0, 0, u"a"_ustr); // D1
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2PY2 failed", 352.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMX2PY2({1;2;3};{2;3;4})");
+ m_pDoc->SetString(aPos, u"=SUMX2PY2({1;2;3};{2;3;4})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2PY2 failed", 43.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMX2PY2({1;2;3};{2;3})");
+ m_pDoc->SetString(aPos, u"=SUMX2PY2({1;2;3};{2;3})"_ustr);
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUMX2PY2 should return #VALUE! for matrices with different sizes",
- OUString("#VALUE!"), aVal);
- m_pDoc->SetString(aPos, "=SUMX2PY2({1;2;3})");
+ u"#VALUE!"_ustr, aVal);
+ m_pDoc->SetString(aPos, u"=SUMX2PY2({1;2;3})"_ustr);
aVal = m_pDoc->GetString(aPos);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("SUMX2PY2 needs two parameters", OUString("Err:511"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("SUMX2PY2 needs two parameters", u"Err:511"_ustr, aVal);
m_pDoc->DeleteTab(0);
}
@@ -3098,11 +3100,11 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMX2MY2)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "SumX2MY2 Test");
+ m_pDoc->InsertTab(0, u"SumX2MY2 Test"_ustr);
OUString aVal;
ScAddress aPos(6, 0, 0);
- m_pDoc->SetString(aPos, "=SUMX2MY2(A1:C3;D1:F3)");
+ m_pDoc->SetString(aPos, u"=SUMX2MY2(A1:C3;D1:F3)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2MY2 failed", 0.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(0, 0, 0, 10.0); // A1
@@ -3143,28 +3145,28 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMX2MY2)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2MY2 failed", 25.0, m_pDoc->GetValue(aPos));
// add some strings
- m_pDoc->SetString(5, 2, 0, "a"); // F3
+ m_pDoc->SetString(5, 2, 0, u"a"_ustr); // F3
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2MY2 failed", 45.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(0, 2, 0, "a"); // A3
+ m_pDoc->SetString(0, 2, 0, u"a"_ustr); // A3
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2MY2 failed", -10.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(1, 0, 0, "a"); // B1
+ m_pDoc->SetString(1, 0, 0, u"a"_ustr); // B1
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2MY2 failed", -13.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(3, 0, 0, "a"); // D1
+ m_pDoc->SetString(3, 0, 0, u"a"_ustr); // D1
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2MY2 failed", -32.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMX2MY2({1;3;5};{0;4;4})");
+ m_pDoc->SetString(aPos, u"=SUMX2MY2({1;3;5};{0;4;4})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2MY2 failed", 3.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMX2MY2({1;-3;-5};{0;-4;4})");
+ m_pDoc->SetString(aPos, u"=SUMX2MY2({1;-3;-5};{0;-4;4})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2MY2 failed", 3.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMX2MY2({9;5;1};{3;-3;3})");
+ m_pDoc->SetString(aPos, u"=SUMX2MY2({9;5;1};{3;-3;3})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMX2MY2 failed", 80.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMX2MY2({1;2;3};{2;3})");
+ m_pDoc->SetString(aPos, u"=SUMX2MY2({1;2;3};{2;3})"_ustr);
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUMX2MY2 should return #VALUE! for matrices with different sizes",
- OUString("#VALUE!"), aVal);
- m_pDoc->SetString(aPos, "=SUMX2MY2({1;2;3})");
+ u"#VALUE!"_ustr, aVal);
+ m_pDoc->SetString(aPos, u"=SUMX2MY2({1;2;3})"_ustr);
aVal = m_pDoc->GetString(aPos);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("SUMX2MY2 needs two parameters", OUString("Err:511"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("SUMX2MY2 needs two parameters", u"Err:511"_ustr, aVal);
m_pDoc->DeleteTab(0);
}
@@ -3173,30 +3175,30 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncGCD)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "GCDTest");
+ m_pDoc->InsertTab(0, u"GCDTest"_ustr);
OUString aVal;
ScAddress aPos(4, 0, 0);
- m_pDoc->SetString(aPos, "=GCD(A1)");
+ m_pDoc->SetString(aPos, u"=GCD(A1)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of GCD for failed", 0.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(0, 0, 0, 10.0); // A1
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of GCD for failed", 10.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(0, 0, 0, -2.0); // A1
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("GCD should return Err:502 for values less than 0",
- OUString("Err:502"), aVal);
- m_pDoc->SetString(0, 0, 0, "a"); // A1
+ u"Err:502"_ustr, aVal);
+ m_pDoc->SetString(0, 0, 0, u"a"_ustr); // A1
aVal = m_pDoc->GetString(aPos);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("GCD should return #VALUE! for a single string",
- OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("GCD should return #VALUE! for a single string", u"#VALUE!"_ustr,
+ aVal);
- m_pDoc->SetString(aPos, "=GCD(A1:B2)");
+ m_pDoc->SetString(aPos, u"=GCD(A1:B2)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of GCD for failed", 0.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(0, 1, 0, -12.0); // B1
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("GCD should return Err:502 for a matrix with values less than 0",
- OUString("Err:502"), aVal);
+ u"Err:502"_ustr, aVal);
m_pDoc->SetValue(0, 0, 0, 15.0); // A1
m_pDoc->SetValue(0, 1, 0, 0.0); // B1
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of GCD for failed", 15.0, m_pDoc->GetValue(aPos));
@@ -3227,42 +3229,42 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncGCD)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of GCD for failed", 5.0, m_pDoc->GetValue(aPos));
// inline array
- m_pDoc->SetString(aPos, "=GCD({3;6;9})");
+ m_pDoc->SetString(aPos, u"=GCD({3;6;9})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of GCD for failed", 3.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=GCD({150;0})");
+ m_pDoc->SetString(aPos, u"=GCD({150;0})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of GCD for failed", 150.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=GCD({-3;6;9})");
+ m_pDoc->SetString(aPos, u"=GCD({-3;6;9})"_ustr);
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("GCD should return Err:502 for an array with values less than 0",
- OUString("Err:502"), aVal);
- m_pDoc->SetString(aPos, "=GCD({\"a\";6;9})");
+ u"Err:502"_ustr, aVal);
+ m_pDoc->SetString(aPos, u"=GCD({\"a\";6;9})"_ustr);
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("GCD should return Err:502 for an array with strings",
- OUString("Err:502"), aVal);
+ u"Err:502"_ustr, aVal);
//many inline array
- m_pDoc->SetString(aPos, "=GCD({6;6;6};{3;6;9})");
+ m_pDoc->SetString(aPos, u"=GCD({6;6;6};{3;6;9})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of GCD for failed", 3.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=GCD({300;300;300};{150;0})");
+ m_pDoc->SetString(aPos, u"=GCD({300;300;300};{150;0})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of GCD for failed", 150.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=GCD({3;6;9};{3;-6;9})");
+ m_pDoc->SetString(aPos, u"=GCD({3;6;9};{3;-6;9})"_ustr);
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("GCD should return Err:502 for an array with values less than 0",
- OUString("Err:502"), aVal);
- m_pDoc->SetString(aPos, "=GCD({3;6;9};{\"a\";6;9})");
+ u"Err:502"_ustr, aVal);
+ m_pDoc->SetString(aPos, u"=GCD({3;6;9};{\"a\";6;9})"_ustr);
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("GCD should return Err:502 for an array with strings",
- OUString("Err:502"), aVal);
+ u"Err:502"_ustr, aVal);
// inline list of values
- m_pDoc->SetString(aPos, "=GCD(12;24;36;48;60)");
+ m_pDoc->SetString(aPos, u"=GCD(12;24;36;48;60)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of GCD for failed", 12.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=GCD(0;12;24;36;48;60)");
+ m_pDoc->SetString(aPos, u"=GCD(0;12;24;36;48;60)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of GCD for failed", 12.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=GCD(\"a\";1)");
+ m_pDoc->SetString(aPos, u"=GCD(\"a\";1)"_ustr);
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("GCD should return #VALUE! for an array with strings",
- OUString("#VALUE!"), aVal);
+ u"#VALUE!"_ustr, aVal);
m_pDoc->DeleteTab(0);
}
@@ -3271,30 +3273,30 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncLCM)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "LCMTest");
+ m_pDoc->InsertTab(0, u"LCMTest"_ustr);
OUString aVal;
ScAddress aPos(4, 0, 0);
- m_pDoc->SetString(aPos, "=LCM(A1)");
+ m_pDoc->SetString(aPos, u"=LCM(A1)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of LCM for failed", 0.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(0, 0, 0, 10.0); // A1
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of LCM for failed", 10.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(0, 0, 0, -2.0); // A1
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("LCM should return Err:502 for values less than 0",
- OUString("Err:502"), aVal);
- m_pDoc->SetString(0, 0, 0, "a"); // A1
+ u"Err:502"_ustr, aVal);
+ m_pDoc->SetString(0, 0, 0, u"a"_ustr); // A1
aVal = m_pDoc->GetString(aPos);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("LCM should return #VALUE! for a single string",
- OUString("#VALUE!"), aVal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("LCM should return #VALUE! for a single string", u"#VALUE!"_ustr,
+ aVal);
- m_pDoc->SetString(aPos, "=LCM(A1:B2)");
+ m_pDoc->SetString(aPos, u"=LCM(A1:B2)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of GCD for failed", 1.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(0, 1, 0, -12.0); // B1
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("LCM should return Err:502 for a matrix with values less than 0",
- OUString("Err:502"), aVal);
+ u"Err:502"_ustr, aVal);
m_pDoc->SetValue(0, 0, 0, 15.0); // A1
m_pDoc->SetValue(0, 1, 0, 0.0); // A2
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of LCM for failed", 0.0, m_pDoc->GetValue(aPos));
@@ -3326,41 +3328,41 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncLCM)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of LCM for failed", 198.0, m_pDoc->GetValue(aPos));
// inline array
- m_pDoc->SetString(aPos, "=LCM({3;6;9})");
+ m_pDoc->SetString(aPos, u"=LCM({3;6;9})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of LCM for failed", 18.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=LCM({150;0})");
+ m_pDoc->SetString(aPos, u"=LCM({150;0})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of LCM for failed", 0.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=LCM({-3;6;9})");
+ m_pDoc->SetString(aPos, u"=LCM({-3;6;9})"_ustr);
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("LCM should return Err:502 for an array with values less than 0",
- OUString("Err:502"), aVal);
- m_pDoc->SetString(aPos, "=LCM({\"a\";6;9})");
+ u"Err:502"_ustr, aVal);
+ m_pDoc->SetString(aPos, u"=LCM({\"a\";6;9})"_ustr);
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("LCM should return Err:502 for an array with strings",
- OUString("Err:502"), aVal);
+ u"Err:502"_ustr, aVal);
//many inline array
- m_pDoc->SetString(aPos, "=LCM({6;6;6};{3;6;9})");
+ m_pDoc->SetString(aPos, u"=LCM({6;6;6};{3;6;9})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of LCM for failed", 18.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=LCM({300;300;300};{150;0})");
+ m_pDoc->SetString(aPos, u"=LCM({300;300;300};{150;0})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of LCM for failed", 0.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=LCM({3;6;9};{3;-6;9})");
+ m_pDoc->SetString(aPos, u"=LCM({3;6;9};{3;-6;9})"_ustr);
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("LCM should return Err:502 for an array with values less than 0",
- OUString("Err:502"), aVal);
- m_pDoc->SetString(aPos, "=LCM({3;6;9};{\"a\";6;9})");
+ u"Err:502"_ustr, aVal);
+ m_pDoc->SetString(aPos, u"=LCM({3;6;9};{\"a\";6;9})"_ustr);
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("LCM should return Err:502 for an array with strings",
- OUString("Err:502"), aVal);
+ u"Err:502"_ustr, aVal);
- m_pDoc->SetString(aPos, "=LCM(12;24;36;48;60)");
+ m_pDoc->SetString(aPos, u"=LCM(12;24;36;48;60)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of LCM for failed", 720.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=LCM(0;12;24;36;48;60)");
+ m_pDoc->SetString(aPos, u"=LCM(0;12;24;36;48;60)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of LCM for failed", 0.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=LCM(\"a\";1)");
+ m_pDoc->SetString(aPos, u"=LCM(\"a\";1)"_ustr);
aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("LCM should return #VALUE! for an array with strings",
- OUString("#VALUE!"), aVal);
+ u"#VALUE!"_ustr, aVal);
m_pDoc->DeleteTab(0);
}
@@ -3369,11 +3371,11 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMSQ)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "SUMSQTest");
+ m_pDoc->InsertTab(0, u"SUMSQTest"_ustr);
ScAddress aPos(4, 0, 0);
- m_pDoc->SetString(aPos, "=SUMSQ(A1)");
+ m_pDoc->SetString(aPos, u"=SUMSQ(A1)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 0.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(0, 0, 0, 1.0); // A1
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 1.0, m_pDoc->GetValue(aPos));
@@ -3382,15 +3384,15 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMSQ)
m_pDoc->SetValue(0, 1, 0, -2.0); // A2
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 1.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ(A1:A3)");
+ m_pDoc->SetString(aPos, u"=SUMSQ(A1:A3)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 5.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(1, 0, 0, 3.0); // B1
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 5.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ(A1:C3)");
+ m_pDoc->SetString(aPos, u"=SUMSQ(A1:C3)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 14.0, m_pDoc->GetValue(aPos));
m_pDoc->SetValue(1, 1, 0, -4.0); // B2
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 30.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(1, 2, 0, "a"); // B3
+ m_pDoc->SetString(1, 2, 0, u"a"_ustr); // B3
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ with a string for failed", 30.0,
m_pDoc->GetValue(aPos));
m_pDoc->SetValue(1, 2, 0, 0.0); // B3
@@ -3410,38 +3412,38 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMSQ)
m_pDoc->GetValue(aPos));
// inline array
- m_pDoc->SetString(aPos, "=SUMSQ({1;2;3})");
+ m_pDoc->SetString(aPos, u"=SUMSQ({1;2;3})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 14.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ({3;6;9})");
+ m_pDoc->SetString(aPos, u"=SUMSQ({3;6;9})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 126.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ({15;0})");
+ m_pDoc->SetString(aPos, u"=SUMSQ({15;0})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 225.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ({-3;3;1})");
+ m_pDoc->SetString(aPos, u"=SUMSQ({-3;3;1})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 19.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ({\"a\";-4;-5})");
+ m_pDoc->SetString(aPos, u"=SUMSQ({\"a\";-4;-5})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 41.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ({2;3};{4;5})");
+ m_pDoc->SetString(aPos, u"=SUMSQ({2;3};{4;5})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 54.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ({-3;3;1};{-1})");
+ m_pDoc->SetString(aPos, u"=SUMSQ({-3;3;1};{-1})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 20.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ({-4};{1;4;2};{-5;7};{9})");
+ m_pDoc->SetString(aPos, u"=SUMSQ({-4};{1;4;2};{-5;7};{9})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 192.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ({-2;2};{1};{-1};{0;0;0;4})");
+ m_pDoc->SetString(aPos, u"=SUMSQ({-2;2};{1};{-1};{0;0;0;4})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 26.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ(4;1;-3)");
+ m_pDoc->SetString(aPos, u"=SUMSQ(4;1;-3)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 26.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ(0;5;13;-7;-4)");
+ m_pDoc->SetString(aPos, u"=SUMSQ(0;5;13;-7;-4)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 259.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ(0;12;24;36;48;60)");
+ m_pDoc->SetString(aPos, u"=SUMSQ(0;12;24;36;48;60)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 7920.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ(0;-12;-24;36;-48;60)");
+ m_pDoc->SetString(aPos, u"=SUMSQ(0;-12;-24;36;-48;60)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 7920.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUMSQ(\"a\";1;\"d\";-4;2)");
+ m_pDoc->SetString(aPos, u"=SUMSQ(\"a\";1;\"d\";-4;2)"_ustr);
OUString aVal = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUMSQ should return #VALUE! for an array with strings",
- OUString("#VALUE!"), aVal);
+ u"#VALUE!"_ustr, aVal);
m_pDoc->DeleteTab(0);
}
@@ -3450,7 +3452,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncMDETERM)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "MDETERM_test");
+ m_pDoc->InsertTab(0, u"MDETERM_test"_ustr);
ScAddress aPos(8, 0, 0);
static constexpr std::u16string_view aColCodes(u"ABCDEFGH");
OUStringBuffer aFormulaBuffer("=MDETERM(A1:B2)");
@@ -3496,7 +3498,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncMDETERM)
for (SCROW nRow = 0; nRow < 4; nRow++)
for (SCCOL nCol = 0; nCol < 4; nCol++)
m_pDoc->SetValue(nCol, nRow, 0, static_cast<double>(aVals[nIdx++]));
- m_pDoc->SetString(aPos, "=MDETERM(A1:D4)");
+ m_pDoc->SetString(aPos, u"=MDETERM(A1:D4)"_ustr);
// Following test is conservative in the sense that on Linux x86_64 the error is less that 1.0E-9
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Calculation of MDETERM incorrect for non-singular integer matrix", -180655.0,
@@ -3508,7 +3510,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaErrorPropagation)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
@@ -3523,75 +3525,75 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaErrorPropagation)
aPos.IncCol();
aPos.IncRow(); // C2
- m_pDoc->SetString(aPos, "=ISERROR(A1:B1+3)");
+ m_pDoc->SetString(aPos, u"=ISERROR(A1:B1+3)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos.Format(ScRefFlags::VALID).toUtf8().getStr(), aTRUE,
m_pDoc->GetString(aPos));
aPos.IncRow(); // C3
- m_pDoc->SetString(aPos, "=ISERROR(A1:B1+{3})");
+ m_pDoc->SetString(aPos, u"=ISERROR(A1:B1+{3})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos.Format(ScRefFlags::VALID).toUtf8().getStr(), aTRUE,
m_pDoc->GetString(aPos));
aPos.IncRow(); // C4
aPos2 = aPos;
aPos2.IncCol(); // D4
m_pDoc->InsertMatrixFormula(aPos.Col(), aPos.Row(), aPos2.Col(), aPos2.Row(), aMark,
- "=ISERROR(A1:B1+{3})");
+ u"=ISERROR(A1:B1+{3})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos.Format(ScRefFlags::VALID).toUtf8().getStr(), aFALSE,
m_pDoc->GetString(aPos));
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos2.Format(ScRefFlags::VALID).toUtf8().getStr(), aFALSE,
m_pDoc->GetString(aPos2));
aPos.IncRow(); // C5
- m_pDoc->SetString(aPos, "=ISERROR({1;\"x\"}+{3;4})");
+ m_pDoc->SetString(aPos, u"=ISERROR({1;\"x\"}+{3;4})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos.Format(ScRefFlags::VALID).toUtf8().getStr(), aFALSE,
m_pDoc->GetString(aPos));
aPos.IncRow(); // C6
aPos2 = aPos;
aPos2.IncCol(); // D6
m_pDoc->InsertMatrixFormula(aPos.Col(), aPos.Row(), aPos2.Col(), aPos2.Row(), aMark,
- "=ISERROR({1;\"x\"}+{3;4})");
+ u"=ISERROR({1;\"x\"}+{3;4})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos.Format(ScRefFlags::VALID).toUtf8().getStr(), aFALSE,
m_pDoc->GetString(aPos));
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos2.Format(ScRefFlags::VALID).toUtf8().getStr(), aTRUE,
m_pDoc->GetString(aPos2));
aPos.IncRow(); // C7
- m_pDoc->SetString(aPos, "=ISERROR({\"x\";2}+{3;4})");
+ m_pDoc->SetString(aPos, u"=ISERROR({\"x\";2}+{3;4})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos.Format(ScRefFlags::VALID).toUtf8().getStr(), aTRUE,
m_pDoc->GetString(aPos));
aPos.IncRow(); // C8
aPos2 = aPos;
aPos2.IncCol(); // D8
m_pDoc->InsertMatrixFormula(aPos.Col(), aPos.Row(), aPos2.Col(), aPos2.Row(), aMark,
- "=ISERROR({\"x\";2}+{3;4})");
+ u"=ISERROR({\"x\";2}+{3;4})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos.Format(ScRefFlags::VALID).toUtf8().getStr(), aTRUE,
m_pDoc->GetString(aPos));
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos2.Format(ScRefFlags::VALID).toUtf8().getStr(), aFALSE,
m_pDoc->GetString(aPos2));
aPos.IncRow(); // C9
- m_pDoc->SetString(aPos, "=ISERROR(({1;\"x\"}+{3;4})-{5;6})");
+ m_pDoc->SetString(aPos, u"=ISERROR(({1;\"x\"}+{3;4})-{5;6})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos.Format(ScRefFlags::VALID).toUtf8().getStr(), aFALSE,
m_pDoc->GetString(aPos));
aPos.IncRow(); // C10
aPos2 = aPos;
aPos2.IncCol(); // D10
m_pDoc->InsertMatrixFormula(aPos.Col(), aPos.Row(), aPos2.Col(), aPos2.Row(), aMark,
- "=ISERROR(({1;\"x\"}+{3;4})-{5;6})");
+ u"=ISERROR(({1;\"x\"}+{3;4})-{5;6})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos.Format(ScRefFlags::VALID).toUtf8().getStr(), aFALSE,
m_pDoc->GetString(aPos));
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos2.Format(ScRefFlags::VALID).toUtf8().getStr(), aTRUE,
m_pDoc->GetString(aPos2));
aPos.IncRow(); // C11
- m_pDoc->SetString(aPos, "=ISERROR(({\"x\";2}+{3;4})-{5;6})");
+ m_pDoc->SetString(aPos, u"=ISERROR(({\"x\";2}+{3;4})-{5;6})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos.Format(ScRefFlags::VALID).toUtf8().getStr(), aTRUE,
m_pDoc->GetString(aPos));
aPos.IncRow(); // C12
aPos2 = aPos;
aPos2.IncCol(); // D12
m_pDoc->InsertMatrixFormula(aPos.Col(), aPos.Row(), aPos2.Col(), aPos2.Row(), aMark,
- "=ISERROR(({\"x\";2}+{3;4})-{5;6})");
+ u"=ISERROR(({\"x\";2}+{3;4})-{5;6})"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos.Format(ScRefFlags::VALID).toUtf8().getStr(), aTRUE,
m_pDoc->GetString(aPos));
CPPUNIT_ASSERT_EQUAL_MESSAGE(aPos2.Format(ScRefFlags::VALID).toUtf8().getStr(), aFALSE,
@@ -3612,7 +3614,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf97369)
const double SHIFT1 = 200;
const double SHIFT2 = 400;
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "tdf97369"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"tdf97369"_ustr));
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
@@ -3627,27 +3629,27 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf97369)
const ColumnTest columnTest(m_pDoc, TOTAL_ROWS, START1, END1, START2, END2);
auto lExpectedinD = [=](SCROW n) { return 3.0 * (n - START1) + SHIFT1 + SHIFT2; };
- columnTest(3, "=SUM(A1:C1)", lExpectedinD);
+ columnTest(3, u"=SUM(A1:C1)"_ustr, lExpectedinD);
auto lExpectedinE = [=](SCROW) { return SHIFT1 + SHIFT2; };
- columnTest(4, "=SUM(A$1:C$1)", lExpectedinE);
+ columnTest(4, u"=SUM(A$1:C$1)"_ustr, lExpectedinE);
auto lExpectedinF = [](SCROW n) { return ((2 * n + 1 - ROW_RANGE) * ROW_RANGE) / 2.0; };
- columnTest(5, "=SUM(A1:A10)", lExpectedinF);
+ columnTest(5, u"=SUM(A1:A10)"_ustr, lExpectedinF);
auto lExpectedinG = [](SCROW n) { return ((n + 1) * n) / 2.0; };
- columnTest(6, "=SUM(A$1:A10)", lExpectedinG);
+ columnTest(6, u"=SUM(A$1:A10)"_ustr, lExpectedinG);
auto lExpectedinH = [=](SCROW n) {
return 3.0 * (((2 * n + 1 - ROW_RANGE) * ROW_RANGE) / 2) + ROW_RANGE * (SHIFT1 + SHIFT2);
};
- columnTest(7, "=SUM(A1:C10)", lExpectedinH);
+ columnTest(7, u"=SUM(A1:C10)"_ustr, lExpectedinH);
auto lExpectedinI = [=](SCROW) {
return 3.0 * (((2 * START1 + 1 - ROW_RANGE) * ROW_RANGE) / 2)
+ ROW_RANGE * (SHIFT1 + SHIFT2);
};
- columnTest(8, "=SUM(A$1:C$10)", lExpectedinI);
+ columnTest(8, u"=SUM(A$1:C$10)"_ustr, lExpectedinI);
m_pDoc->DeleteTab(0);
}
@@ -3657,7 +3659,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf97587)
const SCROW TOTAL_ROWS = 150;
const SCROW ROW_RANGE = 10;
- CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, "tdf97587"));
+ CPPUNIT_ASSERT_MESSAGE("failed to insert sheet", m_pDoc->InsertTab(0, u"tdf97587"_ustr));
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
@@ -3680,7 +3682,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf97587)
ScMarkData aMark(m_pDoc->GetSheetLimits());
ScAddress aPos(1, 0, 0);
- m_pDoc->SetString(aPos, "=SUM(A1:A10)");
+ m_pDoc->SetString(aPos, u"=SUM(A1:A10)"_ustr);
// Copy formula cell to clipboard.
ScClipParam aClipParam(aPos, false);
@@ -3705,7 +3707,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf97587)
CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf93415)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Sheet1"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(0, u"Sheet1"_ustr));
ScCalcConfig aConfig;
aConfig.SetStringRefSyntax(formula::FormulaGrammar::CONV_XL_R1C1);
@@ -3713,46 +3715,46 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf93415)
m_pDoc->CalcAll();
ScAddress aPos(0, 0, 0);
- m_pDoc->SetString(aPos, "=ADDRESS(1;1;;;\"Sheet1\")");
+ m_pDoc->SetString(aPos, u"=ADDRESS(1;1;;;\"Sheet1\")"_ustr);
// Without the fix in place, this would have failed with
// - Expected: Sheet1!$A$1
// - Actual : Sheet1.$A$1
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet1!$A$1"), m_pDoc->GetString(aPos));
+ CPPUNIT_ASSERT_EQUAL(u"Sheet1!$A$1"_ustr, m_pDoc->GetString(aPos));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf132519)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Sheet1"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(0, u"Sheet1"_ustr));
ScCalcConfig aConfig;
aConfig.SetStringRefSyntax(formula::FormulaGrammar::CONV_XL_R1C1);
m_pDoc->SetCalcConfig(aConfig);
m_pDoc->CalcAll();
- m_pDoc->SetString(2, 0, 0, "X");
- m_pDoc->SetString(1, 0, 0, "=CELL(\"ADDRESS\"; C1)");
- m_pDoc->SetString(0, 0, 0, "=INDIRECT(B1)");
+ m_pDoc->SetString(2, 0, 0, u"X"_ustr);
+ m_pDoc->SetString(1, 0, 0, u"=CELL(\"ADDRESS\"; C1)"_ustr);
+ m_pDoc->SetString(0, 0, 0, u"=INDIRECT(B1)"_ustr);
// Without the fix in place, this test would have failed with
// - Expected: X
// - Actual : #REF!
- CPPUNIT_ASSERT_EQUAL(OUString("X"), m_pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"X"_ustr, m_pDoc->GetString(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("R1C3"), m_pDoc->GetString(1, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"R1C3"_ustr, m_pDoc->GetString(1, 0, 0));
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf127334)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Sheet1"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(0, u"Sheet1"_ustr));
m_pDoc->SetString(
0, 0, 0,
- "= (((DATE(2019;9;17) + TIME(0;0;1)) - DATE(2019;9;17)) - TIME(0;0;1))/TIME(0;0;1)");
+ u"= (((DATE(2019;9;17) + TIME(0;0;1)) - DATE(2019;9;17)) - TIME(0;0;1))/TIME(0;0;1)"_ustr);
// Without the fix in place, this test would have failed with
// - Expected: 0
@@ -3764,24 +3766,24 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf127334)
CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf100818)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Sheet1"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(0, u"Sheet1"_ustr));
//Insert local range name
- ScRangeData* pLocal = new ScRangeData(*m_pDoc, "local", "$Sheet1.$A$1");
+ ScRangeData* pLocal = new ScRangeData(*m_pDoc, u"local"_ustr, u"$Sheet1.$A$1"_ustr);
std::unique_ptr<ScRangeName> pLocalRangeName(new ScRangeName);
pLocalRangeName->insert(pLocal);
m_pDoc->SetRangeName(0, std::move(pLocalRangeName));
m_pDoc->SetValue(0, 0, 0, 1.0);
- CPPUNIT_ASSERT(m_pDoc->InsertTab(1, "Sheet2"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(1, u"Sheet2"_ustr));
- m_pDoc->SetString(0, 0, 1, "=INDIRECT(\"Sheet1.local\")");
+ m_pDoc->SetString(0, 0, 1, u"=INDIRECT(\"Sheet1.local\")"_ustr);
// Without the fix in place, this test would have failed with
// - Expected: 1
// - Actual : #REF!
- CPPUNIT_ASSERT_EQUAL(OUString("1"), m_pDoc->GetString(0, 0, 1));
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, m_pDoc->GetString(0, 0, 1));
m_pDoc->DeleteTab(1);
m_pDoc->SetRangeName(0, nullptr); // Delete the names.
@@ -3790,7 +3792,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf100818)
CPPUNIT_TEST_FIXTURE(TestFormula2, testMatConcat)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Test"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(0, u"Test"_ustr));
for (SCCOL nCol = 0; nCol < 10; ++nCol)
{
@@ -3802,7 +3804,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testMatConcat)
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(0, 12, 9, 21, aMark, "=A1:J10&A1:J10");
+ m_pDoc->InsertMatrixFormula(0, 12, 9, 21, aMark, u"=A1:J10&A1:J10"_ustr);
for (SCCOL nCol = 0; nCol < 10; ++nCol)
{
@@ -3825,24 +3827,24 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testMatConcat)
CPPUNIT_ASSERT_EQUAL(aPos, aRange.aStart);
}
// Matrix formula in C17:C21
- m_pDoc->InsertMatrixFormula(2, 16, 2, 20, aMark, "=A12:A16&B12:B16");
+ m_pDoc->InsertMatrixFormula(2, 16, 2, 20, aMark, u"=A12:A16&B12:B16"_ustr);
// Check proper concatenation including empty cells.
OUString aStr;
ScAddress aPos(2, 16, 0);
aStr = m_pDoc->GetString(aPos);
- CPPUNIT_ASSERT_EQUAL(OUString("qw"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"qw"_ustr, aStr);
aPos.IncRow();
aStr = m_pDoc->GetString(aPos);
- CPPUNIT_ASSERT_EQUAL(OUString("a"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, aStr);
aPos.IncRow();
aStr = m_pDoc->GetString(aPos);
- CPPUNIT_ASSERT_EQUAL(OUString("x"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"x"_ustr, aStr);
aPos.IncRow();
aStr = m_pDoc->GetString(aPos);
CPPUNIT_ASSERT_EQUAL(OUString(), aStr);
aPos.IncRow();
aStr = m_pDoc->GetString(aPos);
- CPPUNIT_ASSERT_EQUAL(OUString("er"), aStr);
+ CPPUNIT_ASSERT_EQUAL(u"er"_ustr, aStr);
m_pDoc->DeleteTab(0);
}
@@ -3851,7 +3853,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testMatConcatReplication)
{
// if one of the matrices is a one column or row matrix
// the matrix is replicated across the larger matrix
- CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Test"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(0, u"Test"_ustr));
for (SCCOL nCol = 0; nCol < 10; ++nCol)
{
@@ -3863,7 +3865,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testMatConcatReplication)
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(0, 12, 9, 21, aMark, "=A1:J10&A1:J1");
+ m_pDoc->InsertMatrixFormula(0, 12, 9, 21, aMark, u"=A1:J10&A1:J1"_ustr);
for (SCCOL nCol = 0; nCol < 10; ++nCol)
{
@@ -3879,30 +3881,30 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testMatConcatReplication)
CPPUNIT_TEST_FIXTURE(TestFormula2, testRefR1C1WholeCol)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Test"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(0, u"Test"_ustr));
ScAddress aPos(1, 1, 1);
ScCompiler aComp(*m_pDoc, aPos, FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
- std::unique_ptr<ScTokenArray> pTokens(aComp.CompileString("=C[10]"));
+ std::unique_ptr<ScTokenArray> pTokens(aComp.CompileString(u"=C[10]"_ustr));
sc::TokenStringContext aCxt(*m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH);
OUString aFormula = pTokens->CreateString(aCxt, aPos);
- CPPUNIT_ASSERT_EQUAL(OUString("L:L"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"L:L"_ustr, aFormula);
m_pDoc->DeleteTab(0);
}
CPPUNIT_TEST_FIXTURE(TestFormula2, testRefR1C1WholeRow)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Test"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(0, u"Test"_ustr));
ScAddress aPos(1, 1, 1);
ScCompiler aComp(*m_pDoc, aPos, FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
- std::unique_ptr<ScTokenArray> pTokens(aComp.CompileString("=R[3]"));
+ std::unique_ptr<ScTokenArray> pTokens(aComp.CompileString(u"=R[3]"_ustr));
sc::TokenStringContext aCxt(*m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH);
OUString aFormula = pTokens->CreateString(aCxt, aPos);
- CPPUNIT_ASSERT_EQUAL(OUString("5:5"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"5:5"_ustr, aFormula);
m_pDoc->DeleteTab(0);
}
@@ -3912,13 +3914,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testSingleCellCopyColumnLabel)
ScDocOptions aOptions = m_pDoc->GetDocOptions();
aOptions.SetLookUpColRowNames(true);
m_pDoc->SetDocOptions(aOptions);
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(0, 0, 0, "a");
+ m_pDoc->SetString(0, 0, 0, u"a"_ustr);
m_pDoc->SetValue(0, 1, 0, 1.0);
m_pDoc->SetValue(0, 2, 0, 2.0);
m_pDoc->SetValue(0, 3, 0, 3.0);
- m_pDoc->SetString(1, 1, 0, "='a'");
+ m_pDoc->SetString(1, 1, 0, u"='a'"_ustr);
double nVal = m_pDoc->GetValue(1, 1, 0);
ASSERT_DOUBLES_EQUAL(1.0, nVal);
@@ -3935,13 +3937,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testSingleCellCopyColumnLabel)
// Significant whitespace operator intersection in Excel syntax, tdf#96426
CPPUNIT_TEST_FIXTURE(TestFormula2, testIntersectionOpExcel)
{
- CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Test"));
+ CPPUNIT_ASSERT(m_pDoc->InsertTab(0, u"Test"_ustr));
ScRangeName* pGlobalNames = m_pDoc->GetRangeName();
// Horizontal cell range covering C2.
- pGlobalNames->insert(new ScRangeData(*m_pDoc, "horz", "$B$2:$D$2"));
+ pGlobalNames->insert(new ScRangeData(*m_pDoc, u"horz"_ustr, u"$B$2:$D$2"_ustr));
// Vertical cell range covering C2.
- pGlobalNames->insert(new ScRangeData(*m_pDoc, "vert", "$C$1:$C$3"));
+ pGlobalNames->insert(new ScRangeData(*m_pDoc, u"vert"_ustr, u"$C$1:$C$3"_ustr));
// Data in C2.
m_pDoc->SetValue(2, 1, 0, 1.0);
@@ -3949,18 +3951,18 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testIntersectionOpExcel)
// Choose formula positions that don't intersect with those data ranges.
ScAddress aPos(0, 3, 0);
- m_pDoc->SetString(aPos, "=B2:D2 C1:C3");
+ m_pDoc->SetString(aPos, u"=B2:D2 C1:C3"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("A4 intersecting references failed", 1.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=horz vert");
+ m_pDoc->SetString(aPos, u"=horz vert"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("A5 intersecting named expressions failed", 1.0,
m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=(horz vert)*2");
+ m_pDoc->SetString(aPos, u"=(horz vert)*2"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("A6 calculating with intersecting named expressions failed", 2.0,
m_pDoc->GetValue(aPos));
aPos.IncRow();
- m_pDoc->SetString(aPos, "=2*(horz vert)");
+ m_pDoc->SetString(aPos, u"=2*(horz vert)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("A7 calculating with intersecting named expressions failed", 2.0,
m_pDoc->GetValue(aPos));
@@ -3971,7 +3973,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testIntersectionOpExcel)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRowsHidden)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
m_pDoc->SetValue(0, 0, 0, 1); //A1
m_pDoc->SetValue(0, 1, 0, 2); //A2
m_pDoc->SetValue(0, 2, 0, 4); //A3
@@ -3980,7 +3982,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRowsHidden)
m_pDoc->SetValue(0, 5, 0, 32); //A6
ScAddress aPos(0, 6, 0);
- m_pDoc->SetString(aPos, "=SUBTOTAL(109; A1:A6)");
+ m_pDoc->SetString(aPos, u"=SUBTOTAL(109; A1:A6)"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUBTOTAL failed", 63.0, m_pDoc->GetValue(aPos));
//Hide row 1
m_pDoc->SetRowHidden(0, 0, 0, true);
@@ -3992,7 +3994,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRowsHidden)
m_pDoc->SetRowHidden(1, 2, 0, false);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUBTOTAL failed", 63.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=AGGREGATE(9; 5; A1:A6)"); //9=SUM 5=Ignore only hidden rows
+ m_pDoc->SetString(aPos, u"=AGGREGATE(9; 5; A1:A6)"_ustr); //9=SUM 5=Ignore only hidden rows
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of AGGREGATE failed", 63.0, m_pDoc->GetValue(aPos));
//Hide row 1
m_pDoc->SetRowHidden(0, 0, 0, true);
@@ -4004,7 +4006,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRowsHidden)
m_pDoc->SetRowHidden(2, 4, 0, false);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of AGGREGATE failed", 63.0, m_pDoc->GetValue(aPos));
- m_pDoc->SetString(aPos, "=SUM(A1:A6)");
+ m_pDoc->SetString(aPos, u"=SUM(A1:A6)"_ustr);
m_pDoc->SetRowHidden(2, 4, 0, true);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUM failed", 63.0, m_pDoc->GetValue(aPos));
@@ -4015,7 +4017,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRowsHidden)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMIFS)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Data in A1:B7, query in A9:A11
std::vector<std::vector<const char*>> aData = {
@@ -4029,11 +4031,11 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMIFS)
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
// Matrix formula in C8:C10 with SUMIFS
- m_pDoc->InsertMatrixFormula(2, 7, 2, 9, aMark, "=SUMIFS(B1:B7;A1:A7;A9:A11)");
+ m_pDoc->InsertMatrixFormula(2, 7, 2, 9, aMark, u"=SUMIFS(B1:B7;A1:A7;A9:A11)"_ustr);
// Matrix formula in D8:D10 with COUNTIFS
- m_pDoc->InsertMatrixFormula(3, 7, 3, 9, aMark, "=COUNTIFS(A1:A7;A9:A11)");
+ m_pDoc->InsertMatrixFormula(3, 7, 3, 9, aMark, u"=COUNTIFS(A1:A7;A9:A11)"_ustr);
// Matrix formula in E8:E10 with AVERAGEIFS
- m_pDoc->InsertMatrixFormula(4, 7, 4, 9, aMark, "=AVERAGEIFS(B1:B7;A1:A7;A9:A11)");
+ m_pDoc->InsertMatrixFormula(4, 7, 4, 9, aMark, u"=AVERAGEIFS(B1:B7;A1:A7;A9:A11)"_ustr);
{
// Result B1+B5, B2+B6, B3+B7 and counts and averages.
@@ -4045,13 +4047,15 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMIFS)
}
// Matrix formula in G8:G10 with SUMIFS and reference list arrays.
- m_pDoc->InsertMatrixFormula(6, 7, 6, 9, aMark,
- "=SUMIFS(OFFSET(B1;ROW(1:3);0;2);OFFSET(B1;ROW(1:3);0;2);\">4\")");
+ m_pDoc->InsertMatrixFormula(
+ 6, 7, 6, 9, aMark, u"=SUMIFS(OFFSET(B1;ROW(1:3);0;2);OFFSET(B1;ROW(1:3);0;2);\">4\")"_ustr);
// Matrix formula in H8:H10 with COUNTIFS and reference list arrays.
- m_pDoc->InsertMatrixFormula(7, 7, 7, 9, aMark, "=COUNTIFS(OFFSET(B1;ROW(1:3);0;2);\">4\")");
+ m_pDoc->InsertMatrixFormula(7, 7, 7, 9, aMark,
+ u"=COUNTIFS(OFFSET(B1;ROW(1:3);0;2);\">4\")"_ustr);
// Matrix formula in I8:I10 with AVERAGEIFS and reference list arrays.
m_pDoc->InsertMatrixFormula(
- 8, 7, 8, 9, aMark, "=AVERAGEIFS(OFFSET(B1;ROW(1:3);0;2);OFFSET(B1;ROW(1:3);0;2);\">4\")");
+ 8, 7, 8, 9, aMark,
+ u"=AVERAGEIFS(OFFSET(B1;ROW(1:3);0;2);OFFSET(B1;ROW(1:3);0;2);\">4\")"_ustr);
{
// Result sums, counts and averages.
@@ -4066,11 +4070,11 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMIFS)
// Matrix formula in K8:K10 with SUMIFS and reference list array condition
// and "normal" data range.
m_pDoc->InsertMatrixFormula(10, 7, 10, 9, aMark,
- "=SUMIFS(B1:B2;OFFSET(B1;ROW(1:3);0;2);\">4\")");
+ u"=SUMIFS(B1:B2;OFFSET(B1;ROW(1:3);0;2);\">4\")"_ustr);
// Matrix formula in L8:L10 with AVERAGEIFS and reference list array
// condition and "normal" data range.
m_pDoc->InsertMatrixFormula(11, 7, 11, 9, aMark,
- "=AVERAGEIFS(B1:B2;OFFSET(B1;ROW(1:3);0;2);\">4\")");
+ u"=AVERAGEIFS(B1:B2;OFFSET(B1;ROW(1:3);0;2);\">4\")"_ustr);
{
// Result sums and averages.
@@ -4088,16 +4092,16 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMIFS)
// "normal" criteria range.
m_pDoc->InsertMatrixFormula(
6, 17, 6, 19, aMark,
- "=SUMIFS(OFFSET(B1;ROW(1:3);0;2);OFFSET(B1;ROW(1:3);0;2);\">4\";B1:B2;\">1\")");
+ u"=SUMIFS(OFFSET(B1;ROW(1:3);0;2);OFFSET(B1;ROW(1:3);0;2);\">4\";B1:B2;\">1\")"_ustr);
// Matrix formula in H18:H20 with COUNTIFS and reference list arrays and a
// "normal" criteria range.
m_pDoc->InsertMatrixFormula(7, 17, 7, 19, aMark,
- "=COUNTIFS(OFFSET(B1;ROW(1:3);0;2);\">4\";B1:B2;\">1\")");
+ u"=COUNTIFS(OFFSET(B1;ROW(1:3);0;2);\">4\";B1:B2;\">1\")"_ustr);
// Matrix formula in I18:I20 with AVERAGEIFS and reference list arrays and
// a "normal" criteria range.
m_pDoc->InsertMatrixFormula(
8, 17, 8, 19, aMark,
- "=AVERAGEIFS(OFFSET(B1;ROW(1:3);0;2);OFFSET(B1;ROW(1:3);0;2);\">4\";B1:B2;\">1\")");
+ u"=AVERAGEIFS(OFFSET(B1;ROW(1:3);0;2);OFFSET(B1;ROW(1:3);0;2);\">4\";B1:B2;\">1\")"_ustr);
{
// Result sums, counts and averages.
@@ -4114,11 +4118,12 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMIFS)
// Matrix formula in K18:K20 with SUMIFS and reference list array condition
// and "normal" data range and a "normal" criteria range.
m_pDoc->InsertMatrixFormula(10, 17, 10, 19, aMark,
- "=SUMIFS(B1:B2;OFFSET(B1;ROW(1:3);0;2);\">4\";B1:B2;\">1\")");
+ u"=SUMIFS(B1:B2;OFFSET(B1;ROW(1:3);0;2);\">4\";B1:B2;\">1\")"_ustr);
// Matrix formula in L18:L20 with AVERAGEIFS and reference list array
// condition and "normal" data range and a "normal" criteria range.
- m_pDoc->InsertMatrixFormula(11, 17, 11, 19, aMark,
- "=AVERAGEIFS(B1:B2;OFFSET(B1;ROW(1:3);0;2);\">4\";B1:B2;\">1\")");
+ m_pDoc->InsertMatrixFormula(
+ 11, 17, 11, 19, aMark,
+ u"=AVERAGEIFS(B1:B2;OFFSET(B1;ROW(1:3);0;2);\">4\";B1:B2;\">1\")"_ustr);
{
// Result sums and averages.
@@ -4138,16 +4143,16 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMIFS)
// "normal" criteria range, swapped.
m_pDoc->InsertMatrixFormula(
6, 27, 6, 29, aMark,
- "=SUMIFS(OFFSET(B1;ROW(1:3);0;2);B1:B2;\">1\";OFFSET(B1;ROW(1:3);0;2);\">4\")");
+ u"=SUMIFS(OFFSET(B1;ROW(1:3);0;2);B1:B2;\">1\";OFFSET(B1;ROW(1:3);0;2);\">4\")"_ustr);
// Matrix formula in H28:H30 with COUNTIFS and reference list arrays and a
// "normal" criteria range, swapped.
m_pDoc->InsertMatrixFormula(7, 27, 7, 29, aMark,
- "=COUNTIFS(B1:B2;\">1\";OFFSET(B1;ROW(1:3);0;2);\">4\")");
+ u"=COUNTIFS(B1:B2;\">1\";OFFSET(B1;ROW(1:3);0;2);\">4\")"_ustr);
// Matrix formula in I28:I30 with AVERAGEIFS and reference list arrays and
// a "normal" criteria range, swapped.
m_pDoc->InsertMatrixFormula(
8, 27, 8, 29, aMark,
- "=AVERAGEIFS(OFFSET(B1;ROW(1:3);0;2);B1:B2;\">1\";OFFSET(B1;ROW(1:3);0;2);\">4\")");
+ u"=AVERAGEIFS(OFFSET(B1;ROW(1:3);0;2);B1:B2;\">1\";OFFSET(B1;ROW(1:3);0;2);\">4\")"_ustr);
{
// Result sums, counts and averages.
@@ -4164,12 +4169,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMIFS)
// Matrix formula in K28:K30 with SUMIFS and reference list array condition
// and "normal" data range and a "normal" criteria range, swapped.
m_pDoc->InsertMatrixFormula(10, 27, 10, 29, aMark,
- "=SUMIFS(B1:B2;B1:B2;\">1\";OFFSET(B1;ROW(1:3);0;2);\">4\")");
+ u"=SUMIFS(B1:B2;B1:B2;\">1\";OFFSET(B1;ROW(1:3);0;2);\">4\")"_ustr);
// Matrix formula in L28:L30 with AVERAGEIFS and reference list array
// condition and "normal" data range and a "normal" criteria range,
// swapped.
- m_pDoc->InsertMatrixFormula(11, 27, 11, 29, aMark,
- "=AVERAGEIFS(B1:B2;B1:B2;\">1\";OFFSET(B1;ROW(1:3);0;2);\">4\")");
+ m_pDoc->InsertMatrixFormula(
+ 11, 27, 11, 29, aMark,
+ u"=AVERAGEIFS(B1:B2;B1:B2;\">1\";OFFSET(B1;ROW(1:3);0;2);\">4\")"_ustr);
{
// Result sums and averages.
@@ -4190,7 +4196,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncSUMIFS)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCOUNTIFEmpty)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Data in A1:A9.
std::vector<std::vector<const char*>> aData
@@ -4220,7 +4226,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCOUNTIFEmpty)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCOUNTIFSRangeReduce)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Data in A1:C9.
std::vector<std::vector<const char*>> aData = { { "" },
@@ -4255,7 +4261,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCOUNTIFSRangeReduce)
// the range reduction). This should only match the A8-C8 row, but it also shouldn't crash.
// Matching empty cells using a cell reference needs a formula to set the cell to
// an empty string, plain empty cell wouldn't do, so use K2 for that.
- m_pDoc->SetFormula(ScAddress(10, 1, 0), "=\"\"", formula::FormulaGrammar::GRAM_NATIVE_UI);
+ m_pDoc->SetFormula(ScAddress(10, 1, 0), u"=\"\""_ustr, formula::FormulaGrammar::GRAM_NATIVE_UI);
m_pDoc->SetFormula(ScAddress(10, 0, 0),
"=COUNTIFS($A1:$A" + OUString::number(maxRow + 1) + "; A8; $B1:$B"
+ OUString::number(maxRow + 1) + "; K2; $C1:$C"
@@ -4270,7 +4276,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncCOUNTIFSRangeReduce)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRefListArraySUBTOTAL)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
m_pDoc->SetValue(0, 0, 0, 1.0); // A1
m_pDoc->SetValue(0, 1, 0, 2.0); // A2
@@ -4282,7 +4288,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRefListArraySUBTOTAL)
// Matrix in B7:B9, individual SUM of A2:A3, A3:A4 and A4:A5
ScMarkData aMark(m_pDoc->GetSheetLimits());
aMark.SelectOneTable(0);
- m_pDoc->InsertMatrixFormula(1, 6, 1, 8, aMark, "=SUBTOTAL(9;OFFSET(A1;ROW(1:3);0;2))");
+ m_pDoc->InsertMatrixFormula(1, 6, 1, 8, aMark, u"=SUBTOTAL(9;OFFSET(A1;ROW(1:3);0;2))"_ustr);
ScAddress aPos(1, 6, 0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUBTOTAL SUM for A2:A3 failed", 6.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
@@ -4291,7 +4297,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRefListArraySUBTOTAL)
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUBTOTAL SUM for A4:A5 failed", 24.0, m_pDoc->GetValue(aPos));
// Matrix in C7:C9, individual AVERAGE of A2:A3, A3:A4 and A4:A5
- m_pDoc->InsertMatrixFormula(2, 6, 2, 8, aMark, "=SUBTOTAL(1;OFFSET(A1;ROW(1:3);0;2))");
+ m_pDoc->InsertMatrixFormula(2, 6, 2, 8, aMark, u"=SUBTOTAL(1;OFFSET(A1;ROW(1:3);0;2))"_ustr);
aPos.Set(2, 6, 0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUBTOTAL AVERAGE for A2:A3 failed", 3.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
@@ -4300,7 +4306,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRefListArraySUBTOTAL)
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUBTOTAL AVERAGE for A4:A5 failed", 12.0, m_pDoc->GetValue(aPos));
// Matrix in D7:D9, individual MIN of A2:A3, A3:A4 and A4:A5
- m_pDoc->InsertMatrixFormula(3, 6, 3, 8, aMark, "=SUBTOTAL(5;OFFSET(A1;ROW(1:3);0;2))");
+ m_pDoc->InsertMatrixFormula(3, 6, 3, 8, aMark, u"=SUBTOTAL(5;OFFSET(A1;ROW(1:3);0;2))"_ustr);
aPos.Set(3, 6, 0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUBTOTAL MIN for A2:A3 failed", 2.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
@@ -4309,7 +4315,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRefListArraySUBTOTAL)
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUBTOTAL MIN for A4:A5 failed", 8.0, m_pDoc->GetValue(aPos));
// Matrix in E7:E9, individual MAX of A2:A3, A3:A4 and A4:A5
- m_pDoc->InsertMatrixFormula(4, 6, 4, 8, aMark, "=SUBTOTAL(4;OFFSET(A1;ROW(1:3);0;2))");
+ m_pDoc->InsertMatrixFormula(4, 6, 4, 8, aMark, u"=SUBTOTAL(4;OFFSET(A1;ROW(1:3);0;2))"_ustr);
aPos.Set(4, 6, 0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUBTOTAL MAX for A2:A3 failed", 4.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
@@ -4318,7 +4324,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRefListArraySUBTOTAL)
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUBTOTAL MAX for A4:A5 failed", 16.0, m_pDoc->GetValue(aPos));
// Matrix in F7:F9, individual STDEV of A2:A3, A3:A4 and A4:A5
- m_pDoc->InsertMatrixFormula(5, 6, 5, 8, aMark, "=SUBTOTAL(7;OFFSET(A1;ROW(1:3);0;2))");
+ m_pDoc->InsertMatrixFormula(5, 6, 5, 8, aMark, u"=SUBTOTAL(7;OFFSET(A1;ROW(1:3);0;2))"_ustr);
aPos.Set(5, 6, 0);
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("SUBTOTAL STDEV for A2:A3 failed", 1.414214,
m_pDoc->GetValue(aPos), 1e-6);
@@ -4332,7 +4338,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRefListArraySUBTOTAL)
// Matrix in G7:G9, individual AVERAGE of A2:A3, A3:A4 and A4:A5
// Plus two "ordinary" ranges, one before and one after.
m_pDoc->InsertMatrixFormula(6, 6, 6, 8, aMark,
- "=SUBTOTAL(1;A1:A2;OFFSET(A1;ROW(1:3);0;2);A5:A6)");
+ u"=SUBTOTAL(1;A1:A2;OFFSET(A1;ROW(1:3);0;2);A5:A6)"_ustr);
aPos.Set(6, 6, 0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUBTOTAL AVERAGE for A1:A2,A2:A3,A5:A6 failed", 9.5,
m_pDoc->GetValue(aPos));
@@ -4346,7 +4352,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRefListArraySUBTOTAL)
// Matrix in H7:H9, individual MAX of A2:A3, A3:A4 and A4:A5
// Plus two "ordinary" ranges, one before and one after.
m_pDoc->InsertMatrixFormula(7, 6, 7, 8, aMark,
- "=SUBTOTAL(4;A1:A2;OFFSET(A1;ROW(1:3);0;2);A5:A6)");
+ u"=SUBTOTAL(4;A1:A2;OFFSET(A1;ROW(1:3);0;2);A5:A6)"_ustr);
aPos.Set(7, 6, 0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUBTOTAL MAX for A1:A2,A2:A3,A5:A6 failed", 32.0,
m_pDoc->GetValue(aPos));
@@ -4360,7 +4366,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRefListArraySUBTOTAL)
// Matrix in I7:I9, individual STDEV of A2:A3, A3:A4 and A4:A5
// Plus two "ordinary" ranges, one before and one after.
m_pDoc->InsertMatrixFormula(8, 6, 8, 8, aMark,
- "=SUBTOTAL(7;A1:A2;OFFSET(A1;ROW(1:3);0;2);A5:A6)");
+ u"=SUBTOTAL(7;A1:A2;OFFSET(A1;ROW(1:3);0;2);A5:A6)"_ustr);
aPos.Set(8, 6, 0);
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("SUBTOTAL STDEV for A1:A2,A2:A3,A5:A6 failed", 12.35718,
m_pDoc->GetValue(aPos), 1e-5);
@@ -4372,10 +4378,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRefListArraySUBTOTAL)
m_pDoc->GetValue(aPos), 1e-5);
// Empty two cells such that they affect two ranges.
- m_pDoc->SetString(0, 1, 0, ""); // A2
- m_pDoc->SetString(0, 2, 0, ""); // A3
+ m_pDoc->SetString(0, 1, 0, u""_ustr); // A2
+ m_pDoc->SetString(0, 2, 0, u""_ustr); // A3
// Matrix in J7:J9, individual COUNTBLANK of A2:A3, A3:A4 and A4:A5
- m_pDoc->InsertMatrixFormula(9, 6, 9, 8, aMark, "=COUNTBLANK(OFFSET(A1;ROW(1:3);0;2))");
+ m_pDoc->InsertMatrixFormula(9, 6, 9, 8, aMark, u"=COUNTBLANK(OFFSET(A1;ROW(1:3);0;2))"_ustr);
aPos.Set(9, 6, 0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("COUNTBLANK for A1:A2,A2:A3,A5:A6 failed", 2.0,
m_pDoc->GetValue(aPos));
@@ -4393,12 +4399,12 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRefListArraySUBTOTAL)
m_pDoc->SetRowHidden(1, 3, 0, true);
// Matrix in K7, array of references as OFFSET result.
m_pDoc->InsertMatrixFormula(10, 6, 10, 6, aMark,
- "=SUM(SUBTOTAL(109;OFFSET(A1;ROW(A1:A7)-ROW(A1);;1)))");
+ u"=SUM(SUBTOTAL(109;OFFSET(A1;ROW(A1:A7)-ROW(A1);;1)))"_ustr);
aPos.Set(10, 6, 0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUM SUBTOTAL failed", 49.0, m_pDoc->GetValue(aPos));
aPos.IncRow();
// ForceArray in K8, array of references as OFFSET result.
- m_pDoc->SetString(aPos, "=SUMPRODUCT(SUBTOTAL(109;OFFSET(A1;ROW(A1:A7)-ROW(A1);;1)))");
+ m_pDoc->SetString(aPos, u"=SUMPRODUCT(SUBTOTAL(109;OFFSET(A1;ROW(A1:A7)-ROW(A1);;1)))"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("SUMPRODUCT SUBTOTAL failed", 49.0, m_pDoc->GetValue(aPos));
m_pDoc->DeleteTab(0);
@@ -4409,9 +4415,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncRefListArraySUBTOTAL)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncJumpMatrixArrayIF)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(0, 0, 0, "a"); // A1
+ m_pDoc->SetString(0, 0, 0, u"a"_ustr); // A1
std::vector<std::vector<const char*>> aData
= { { "a", "1" }, { "b", "2" }, { "a", "4" } }; // A7:B9
insertRangeData(m_pDoc, ScAddress(0, 6, 0), aData);
@@ -4420,13 +4426,13 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncJumpMatrixArrayIF)
aMark.SelectOneTable(0);
// Matrix in C10, summing B7,B9
- m_pDoc->InsertMatrixFormula(2, 9, 2, 9, aMark, "=SUM(IF(EXACT(A7:A9;A$1);B7:B9;0))");
+ m_pDoc->InsertMatrixFormula(2, 9, 2, 9, aMark, u"=SUM(IF(EXACT(A7:A9;A$1);B7:B9;0))"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Formula C10 failed", 5.0, m_pDoc->GetValue(ScAddress(2, 9, 0)));
// Matrix in C11, summing B7,B9
m_pDoc->InsertMatrixFormula(
2, 10, 2, 10, aMark,
- "=SUM(IF(EXACT(OFFSET(A7;0;0):OFFSET(A7;2;0);A$1);OFFSET(A7;0;1):OFFSET(A7;2;1);0))");
+ u"=SUM(IF(EXACT(OFFSET(A7;0;0):OFFSET(A7;2;0);A$1);OFFSET(A7;0;1):OFFSET(A7;2;1);0))"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Formula C11 failed", 5.0, m_pDoc->GetValue(ScAddress(2, 10, 0)));
m_pDoc->DeleteTab(0);
@@ -4437,7 +4443,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncJumpMatrixArrayIF)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncJumpMatrixArrayOFFSET)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
std::vector<std::vector<const char*>> aData = { { "abc" }, { "bcd" }, { "cde" } };
insertRangeData(m_pDoc, ScAddress(0, 0, 0), aData); // A1:A3
@@ -4447,7 +4453,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncJumpMatrixArrayOFFSET)
// Matrix in C5:C7, COLUMN()-3 here offsets by 0 but the entire expression
// is in array/matrix context.
- m_pDoc->InsertMatrixFormula(2, 4, 2, 6, aMark, "=FIND(\"c\";OFFSET(A1:A3;0;COLUMN()-3))");
+ m_pDoc->InsertMatrixFormula(2, 4, 2, 6, aMark, u"=FIND(\"c\";OFFSET(A1:A3;0;COLUMN()-3))"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Formula C5 failed", 3.0, m_pDoc->GetValue(ScAddress(2, 4, 0)));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Formula C6 failed", 2.0, m_pDoc->GetValue(ScAddress(2, 5, 0)));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Formula C7 failed", 1.0, m_pDoc->GetValue(ScAddress(2, 6, 0)));
@@ -4462,15 +4468,15 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testIterations)
aDocOpts.SetIter(true);
m_pDoc->SetDocOptions(aDocOpts);
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
m_pDoc->SetValue(0, 0, 0, 0.01); // A1
- m_pDoc->SetString(0, 1, 0, "=A1"); // A2
- m_pDoc->SetString(0, 2, 0, "=COS(A2)"); // A3
+ m_pDoc->SetString(0, 1, 0, u"=A1"_ustr); // A2
+ m_pDoc->SetString(0, 2, 0, u"=COS(A2)"_ustr); // A3
m_pDoc->CalcAll();
// Establish reference cycle for the computation of the fixed point of COS() function
- m_pDoc->SetString(0, 0, 0, "=A3"); // A1
+ m_pDoc->SetString(0, 0, 0, u"=A3"_ustr); // A1
m_pDoc->CalcAll();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell A3 should not have any formula error", FormulaError::NONE,
@@ -4479,7 +4485,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testIterations)
0.7387, m_pDoc->GetValue(0, 2, 0), 1e-4);
// Modify the formula
- m_pDoc->SetString(0, 2, 0, "=COS(A2)+0.001"); // A3
+ m_pDoc->SetString(0, 2, 0, u"=COS(A2)+0.001"_ustr); // A3
m_pDoc->CalcAll();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell A3 should not have any formula error after perturbation",
@@ -4499,10 +4505,10 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testIterations)
CPPUNIT_TEST_FIXTURE(TestFormula2, testInsertColCellStoreEventSwap)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
m_pDoc->SetValue(0, 0, 0, 1.0); // A1
- m_pDoc->SetString(1, 0, 0, "=A1"); // B1
+ m_pDoc->SetString(1, 0, 0, u"=A1"_ustr); // B1
// Insert column left of B
m_pDoc->InsertCol(ScRange(1, 0, 0, 1, m_pDoc->MaxRow(), 0));
ScAddress aPos(2, 0, 0); // C1, new formula position
@@ -4513,7 +4519,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testInsertColCellStoreEventSwap)
// ScDocument::SetString() can't be used as it doesn't expose the behavior
// in question, use ScDocFunc::SetFormulaCell() instead which actually is
// also called when editing a cell and creating a formula cell.
- ScFormulaCell* pCell = new ScFormulaCell(*m_pDoc, aPos, "=A1+1");
+ ScFormulaCell* pCell = new ScFormulaCell(*m_pDoc, aPos, u"=A1+1"_ustr);
ScDocFunc& rDocFunc = m_xDocShell->GetDocFunc();
rDocFunc.SetFormulaCell(aPos, pCell, false); // C1, change formula
CPPUNIT_ASSERT_EQUAL_MESSAGE("Initial calculation failed", 2.0, m_pDoc->GetValue(aPos));
@@ -4525,20 +4531,20 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testInsertColCellStoreEventSwap)
CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf147398)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(0, 0, 0, "=SUM(A3:A5)");
- m_pDoc->SetString(0, 1, 0, "=COUNT(A3:A5)");
- m_pDoc->SetString(1, 0, 0, "=SUM(B3:B5)");
- m_pDoc->SetString(1, 1, 0, "=COUNT(B3:B5)");
- m_pDoc->SetString(2, 0, 0, "=SUM(C3:C5)");
- m_pDoc->SetString(2, 1, 0, "=COUNT(C3:C5)");
- m_pDoc->SetString(3, 0, 0, "=SUM(D3:D5)");
- m_pDoc->SetString(3, 1, 0, "=COUNT(D3:D5)");
- m_pDoc->SetString(4, 0, 0, "=SUM(E3:E5)");
- m_pDoc->SetString(4, 1, 0, "=COUNT(E3:E5)");
+ m_pDoc->SetString(0, 0, 0, u"=SUM(A3:A5)"_ustr);
+ m_pDoc->SetString(0, 1, 0, u"=COUNT(A3:A5)"_ustr);
+ m_pDoc->SetString(1, 0, 0, u"=SUM(B3:B5)"_ustr);
+ m_pDoc->SetString(1, 1, 0, u"=COUNT(B3:B5)"_ustr);
+ m_pDoc->SetString(2, 0, 0, u"=SUM(C3:C5)"_ustr);
+ m_pDoc->SetString(2, 1, 0, u"=COUNT(C3:C5)"_ustr);
+ m_pDoc->SetString(3, 0, 0, u"=SUM(D3:D5)"_ustr);
+ m_pDoc->SetString(3, 1, 0, u"=COUNT(D3:D5)"_ustr);
+ m_pDoc->SetString(4, 0, 0, u"=SUM(E3:E5)"_ustr);
+ m_pDoc->SetString(4, 1, 0, u"=COUNT(E3:E5)"_ustr);
- m_pDoc->SetString(5, 0, 0, "=SUM(A1:E1)/SUM(A2:E2)");
+ m_pDoc->SetString(5, 0, 0, u"=SUM(A1:E1)/SUM(A2:E2)"_ustr);
m_pDoc->SetValue(ScAddress(0, 2, 0), 50.0);
m_pDoc->SetValue(ScAddress(0, 3, 0), 100.0);
@@ -4601,14 +4607,14 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf147398)
#if SC_USE_SSE2
CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf156985)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
- m_pDoc->SetString(0, 0, 0, "=-170.87");
- m_pDoc->SetString(0, 1, 0, "-223.73");
- m_pDoc->SetString(0, 2, 0, "-12.58");
- m_pDoc->SetString(0, 3, 0, "234.98");
- m_pDoc->SetString(0, 4, 0, "172.2");
- m_pDoc->SetString(0, 5, 0, "=SUM(A1:A5)");
+ m_pDoc->SetString(0, 0, 0, u"=-170.87"_ustr);
+ m_pDoc->SetString(0, 1, 0, u"-223.73"_ustr);
+ m_pDoc->SetString(0, 2, 0, u"-12.58"_ustr);
+ m_pDoc->SetString(0, 3, 0, u"234.98"_ustr);
+ m_pDoc->SetString(0, 4, 0, u"172.2"_ustr);
+ m_pDoc->SetString(0, 5, 0, u"=SUM(A1:A5)"_ustr);
// Without the fix in place, this test would have failed with
// - Expected: 0
@@ -4622,19 +4628,19 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf156985)
CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaAfterDeleteRows)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Fill A1:A70000 with 1.0
std::vector<double> aVals(70000, 1.0);
m_pDoc->SetValues(ScAddress(0, 0, 0), aVals);
// Set A70001 with formula "=SUM(A1:A70000)"
- m_pDoc->SetString(0, 70000, 0, "=SUM(A1:A70000)");
+ m_pDoc->SetString(0, 70000, 0, u"=SUM(A1:A70000)"_ustr);
// Delete rows 2:69998
m_pDoc->DeleteRow(ScRange(0, 1, 0, m_pDoc->MaxCol(), 69997, 0));
const ScAddress aPos(0, 3, 0); // A4
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A4.", OUString("=SUM(A1:A3)"),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A4.", u"=SUM(A1:A3)"_ustr,
m_pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
ASSERT_DOUBLES_EQUAL_MESSAGE("Wrong value at A4", 3.0, m_pDoc->GetValue(aPos));
@@ -4654,7 +4660,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testRegexForXLOOKUP)
bOldWildCard = true;
}
- m_pDoc->InsertTab(0, "Test1");
+ m_pDoc->InsertTab(0, u"Test1"_ustr);
std::vector<std::vector<const char*>> aData = { { "Element", "Relative Atomic Mass" },
{ "Hydrogen", "1.008" },
@@ -4669,9 +4675,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testRegexForXLOOKUP)
{ "Neon", "20.18" } };
insertRangeData(m_pDoc, ScAddress(0, 0, 0), aData); // A1:B11
- m_pDoc->SetString(4, 14, 0, "^bo.*"); // E15 - search regex string
+ m_pDoc->SetString(4, 14, 0, u"^bo.*"_ustr); // E15 - search regex string
- m_pDoc->SetFormula(ScAddress(5, 14, 0), "=XLOOKUP(E15;A$2:A$11;B$2:B$11;;2)",
+ m_pDoc->SetFormula(ScAddress(5, 14, 0), u"=XLOOKUP(E15;A$2:A$11;B$2:B$11;;2)"_ustr,
formula::FormulaGrammar::GRAM_NATIVE_UI); // F15
// Without the fix in place, this test would have failed with
diff --git a/sc/qa/unit/ucalc_parallelism.cxx b/sc/qa/unit/ucalc_parallelism.cxx
index cb43b1af8e82..12e25024931c 100644
--- a/sc/qa/unit/ucalc_parallelism.cxx
+++ b/sc/qa/unit/ucalc_parallelism.cxx
@@ -66,7 +66,7 @@ void ScParallelismTest::tearDown()
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testSUMIFS)
{
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
m_pDoc->SetValue(0, 0, 0, 1001);
@@ -145,7 +145,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testSUMIFS)
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testDivision)
{
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
for (auto i = 1; i < 1000; i++)
{
@@ -164,7 +164,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testDivision)
if (i%10)
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(sMessage.getStr(), static_cast<double>(i)/(i%10), m_pDoc->GetValue(2, i, 0), 1e-10);
else
- CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), OUString("#DIV/0!"), m_pDoc->GetString(2, i, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), u"#DIV/0!"_ustr, m_pDoc->GetString(2, i, 0));
}
m_pDoc->DeleteTab(0);
@@ -172,7 +172,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testDivision)
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testVLOOKUP)
{
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
for (auto i = 1; i < 2000; i++)
{
@@ -200,13 +200,13 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testVLOOKUP)
{
if (i == 1042)
m_pDoc->SetFormula(ScAddress(2, i, 0),
- "=VLOOKUP(1042.42; "
- "A$2:B$2000; 2; 0)",
+ u"=VLOOKUP(1042.42; "
+ "A$2:B$2000; 2; 0)"_ustr,
formula::FormulaGrammar::GRAM_NATIVE_UI);
else
m_pDoc->SetFormula(ScAddress(2, i, 0),
- "=VLOOKUP(1.234; "
- "A$2:B$2000; 2; 0)",
+ u"=VLOOKUP(1.234; "
+ "A$2:B$2000; 2; 0)"_ustr,
formula::FormulaGrammar::GRAM_NATIVE_UI);
}
}
@@ -228,7 +228,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testVLOOKUP)
else
{
// The corresponding value in A is i+0.1
- CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), OUString("#N/A"), m_pDoc->GetString(2, i, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), u"#N/A"_ustr, m_pDoc->GetString(2, i, 0));
}
}
else
@@ -236,7 +236,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testVLOOKUP)
if (i == 1042)
CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), OUString("N" + OUString::number(i*10)), m_pDoc->GetString(2, i, 0));
else
- CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), OUString("#N/A"), m_pDoc->GetString(2, i, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), u"#N/A"_ustr, m_pDoc->GetString(2, i, 0));
}
}
@@ -245,7 +245,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testVLOOKUP)
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testVLOOKUPSUM)
{
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
const size_t nNumRows = 2048;
OUString aTableRef = "$A$1:$B$" + OUString::number(nNumRows);
@@ -275,7 +275,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testVLOOKUPSUM)
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testSingleRef)
{
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
const size_t nNumRows = 200;
for (size_t i = 0; i < nNumRows; ++i)
@@ -296,13 +296,13 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testSingleRef)
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testTdf147905)
{
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
OUString aFormula;
const size_t nNumRows = 500;
for (size_t i = 0; i < nNumRows; ++i)
{
- m_pDoc->SetString(0, i, 0, "AAAAAAAA");
+ m_pDoc->SetString(0, i, 0, u"AAAAAAAA"_ustr);
aFormula = "=PROPER($A" + OUString::number(i+1) + ")";
m_pDoc->SetFormula(ScAddress(1, i, 0),
aFormula,
@@ -314,10 +314,10 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testTdf147905)
for (size_t i = 0; i < nNumRows; ++i)
{
OString aMsg = "At row " + OString::number(i);
- CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), OUString("AAAAAAAA"), m_pDoc->GetString(0, i, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), u"AAAAAAAA"_ustr, m_pDoc->GetString(0, i, 0));
// Without the fix in place, this test would have failed here
- CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), OUString("Aaaaaaaa"), m_pDoc->GetString(1, i, 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), u"Aaaaaaaa"_ustr, m_pDoc->GetString(1, i, 0));
}
m_pDoc->DeleteTab(0);
}
@@ -338,7 +338,7 @@ static void lcl_setupCommon(ScDocument* pDoc, size_t nNumRows, size_t nConstCell
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testSUMIFImplicitRange)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false);
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
const size_t nNumRows = 1048;
const size_t nConstCellValue = 20;
@@ -368,14 +368,14 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testSUMIFImplicitRange)
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFGCycleWithPlainFormulaCell1)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false);
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
const size_t nNumRows = 1048;
// Column A contains no formula-group
// A1 = 100
m_pDoc->SetValue(0, 0, 0, 100.0);
// A500 = B499 + 1
m_pDoc->SetFormula(ScAddress(0, 499, 0),
- "=$B499 + 1",
+ u"=$B499 + 1"_ustr,
formula::FormulaGrammar::GRAM_NATIVE_UI);
// Column B has a formula-group referencing column A.
OUString aFormula;
@@ -406,7 +406,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFGCycleWithPlainFormulaCell1)
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFGCycleWithPlainFormulaCell2)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false);
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
const size_t nNumRows = 1048;
// Column A
OUString aFormula;
@@ -428,7 +428,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFGCycleWithPlainFormulaCell2)
// Column C has no FG but a cell at C500 that references A499
m_pDoc->SetFormula(ScAddress(2, 499, 0), // C500
- "=$A499 + 1",
+ u"=$A499 + 1"_ustr,
formula::FormulaGrammar::GRAM_NATIVE_UI);
m_xDocShell->DoHardRecalc();
@@ -488,7 +488,7 @@ static void lcl_setupMultipleFGColumn(ScDocument* pDocument, size_t nNumRowsInBl
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testMultipleFGColumn)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false);
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
constexpr size_t nNumRowsInBlock = 200;
constexpr size_t nNumFG = 50;
@@ -518,7 +518,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testMultipleFGColumn)
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFormulaGroupSpanEval)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false);
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
constexpr size_t nFGLen = 2048;
OUString aFormula;
@@ -589,7 +589,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFormulaGroupSpanEval)
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFormulaGroupSpanEvalNonGroup)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false);
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
constexpr size_t nFGLen = 2048;
OUString aFormula;
@@ -638,7 +638,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFormulaGroupSpanEvalNonGroup)
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testArrayFormulaGroup)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false);
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
m_pDoc->SetValue(1, 0, 0, 2.0); // B1 <== 2
m_pDoc->SetValue(2, 0, 0, 1.0); // C1 <== 1
@@ -675,7 +675,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testArrayFormulaGroup)
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testDependentFormulaGroupCollection)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false);
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
OUString aFormula;
@@ -728,7 +728,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testDependentFormulaGroupCollection)
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFormulaGroupWithForwardSelfReference)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false);
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
OUString aFormula;
m_pDoc->SetValue(2, 4, 0, 10.0); // C5 <== 10
@@ -766,7 +766,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFormulaGroupWithForwardSelfReference
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFormulaGroupsInCyclesAndWithSelfReference)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false);
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
m_pDoc->SetValue(1, 0, 0, 1.0); // B1 <== 1
m_pDoc->SetValue(3, 0, 0, 2.0); // D1 <== 2
@@ -835,7 +835,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFormulaGroupsInCyclesAndWithSelfRefe
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFormulaGroupsInCyclesAndWithSelfReference2)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false);
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
m_pDoc->SetValue(1, 0, 0, 1.0); // B1 <== 1
m_pDoc->SetValue(3, 0, 0, 2.0); // D1 <== 2
@@ -901,7 +901,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFormulaGroupsInCyclesAndWithSelfRefe
CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFormulaGroupsInCyclesAndWithSelfReference3)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false);
- m_pDoc->InsertTab(0, "1");
+ m_pDoc->InsertTab(0, u"1"_ustr);
m_pDoc->SetValue(1, 1, 0, 2.0); // B2 <== 2
for (size_t nRow = 1; nRow < 105; ++nRow)
@@ -923,7 +923,7 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testFormulaGroupsInCyclesAndWithSelfRefe
// What happens with tdf#132451 is that the copy&paste C6->C5 really just sets the dirty flag
// for C5 and all the cells that depend on it (D5,B6,C6,D6,B7,...), and it also resets
// flags marking the C formula group as disabled for parallel calculation because of the cycle.
- m_pDoc->SetFormula(ScAddress(2, 4, 0), "=B5*1.01011", formula::FormulaGrammar::GRAM_NATIVE_UI);
+ m_pDoc->SetFormula(ScAddress(2, 4, 0), u"=B5*1.01011"_ustr, formula::FormulaGrammar::GRAM_NATIVE_UI);
m_pDoc->GetFormulaCell(ScAddress(2,4,0))->GetCellGroup()->mbPartOfCycle = false;
m_pDoc->GetFormulaCell(ScAddress(2,4,0))->GetCellGroup()->meCalcState = sc::GroupCalcEnabled;
diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx
index e87de42a8ac1..70ae86370afc 100644
--- a/sc/qa/unit/ucalc_pivottable.cxx
+++ b/sc/qa/unit/ucalc_pivottable.cxx
@@ -203,8 +203,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTable)
/**
* Basic test for pivot tables.
*/
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Dimension definition
static const DPFieldDef aFields[] = {
@@ -359,7 +359,7 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTable)
// Insert a brand new pivot table object once again, but this time, don't
// create the output to avoid creating a data cache.
m_pDoc->DeleteTab(1);
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(1, u"Table"_ustr);
pDPObj = createDPFromRange(
m_pDoc, ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0), aFields, nFieldCount, false);
@@ -391,8 +391,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableLabels)
* Test against unwanted automatic format detection on field names and
* field members in pivot tables.
*/
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Dimension definition
static const DPFieldDef aFields[] = {
@@ -451,8 +451,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDateLabels)
* rather than text cells. Grouping by date or number functionality
* depends on this.
*/
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Dimension definition
static const DPFieldDef aFields[] = {
@@ -529,8 +529,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableFilters)
/**
* Test for pivot table's filtering functionality by page fields.
*/
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Dimension definition
static const DPFieldDef aFields[] = {
@@ -590,7 +590,7 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableFilters)
ScAddress aFormulaAddr = aOutRange.aEnd;
aFormulaAddr.IncRow(2);
m_pDoc->SetString(aFormulaAddr.Col(), aFormulaAddr.Row(), aFormulaAddr.Tab(),
- "=B6");
+ u"=B6"_ustr);
double fTest = m_pDoc->GetValue(aFormulaAddr);
ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect formula value that references a cell in the pivot table output.", 80.0, fTest);
@@ -598,9 +598,9 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableFilters)
pDPObj->BuildAllDimensionMembers();
ScDPSaveData aSaveData(*pDPObj->GetSaveData());
ScDPSaveDimension* pPageDim = aSaveData.GetDimensionByName(
- "Group2");
+ u"Group2"_ustr);
CPPUNIT_ASSERT_MESSAGE("Dimension not found", pPageDim);
- OUString aPage("A");
+ OUString aPage(u"A"_ustr);
pPageDim->SetCurrentPage(&aPage);
pDPObj->SetSaveData(aSaveData);
aOutRange = refresh(pDPObj);
@@ -684,8 +684,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNamedSource)
/**
* Test for pivot table's named source range.
*/
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Dimension definition
static const DPFieldDef aFields[] = {
@@ -712,7 +712,7 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNamedSource)
OUString aRangeStr(aSrcRange.Format(*m_pDoc, ScRefFlags::RANGE_ABS_3D));
// Name this range.
- OUString aRangeName("MyData");
+ OUString aRangeName(u"MyData"_ustr);
ScRangeName* pNames = m_pDoc->GetRangeName();
CPPUNIT_ASSERT_MESSAGE("Failed to get global range name container.", pNames);
ScRangeData* pName = new ScRangeData(
@@ -759,7 +759,7 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNamedSource)
m_pDoc->MoveTab(1, 0);
OUString aTabName;
m_pDoc->GetName(0, aTabName);
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong sheet name.", OUString("Table"), aTabName);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong sheet name.", u"Table"_ustr, aTabName);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Pivot table output is on the wrong sheet!",
static_cast<SCTAB>(0), pDPObj->GetOutRange().aStart.Tab());
@@ -791,7 +791,7 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableCache)
* Test for pivot table cache. Each dimension in the pivot cache stores
* only unique values that are sorted in ascending order.
*/
- m_pDoc->InsertTab(0, "Data");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
// Raw data
const std::vector<std::vector<const char*>> aData = {
@@ -813,11 +813,11 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableCache)
tools::Long nDimCount = aCache.GetColumnCount();
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong dimension count.", tools::Long(3), nDimCount);
OUString aDimName = aCache.GetDimensionName(0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong dimension name", OUString("F1"), aDimName);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong dimension name", u"F1"_ustr, aDimName);
aDimName = aCache.GetDimensionName(1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong dimension name", OUString("F2"), aDimName);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong dimension name", u"F2"_ustr, aDimName);
aDimName = aCache.GetDimensionName(2);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong dimension name", OUString("F3"), aDimName);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong dimension name", u"F3"_ustr, aDimName);
// In each dimension, member ID values also represent their sort order (in
// source dimensions only, not in group dimensions). Value items are
@@ -836,27 +836,27 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableCache)
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem->GetType());
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
- OUString("A"), pItem->GetString());
+ u"A"_ustr, pItem->GetString());
pItem = aCache.GetItemDataById(0, 2);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem->GetType());
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
- OUString("F"), pItem->GetString());
+ u"F"_ustr, pItem->GetString());
pItem = aCache.GetItemDataById(0, 3);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem->GetType());
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
- OUString("R"), pItem->GetString());
+ u"R"_ustr, pItem->GetString());
pItem = aCache.GetItemDataById(0, 4);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem->GetType());
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
- OUString("Y"), pItem->GetString());
+ u"Y"_ustr, pItem->GetString());
pItem = aCache.GetItemDataById(0, 5);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem->GetType());
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
- OUString("Z"), pItem->GetString());
+ u"Z"_ustr, pItem->GetString());
pItem = aCache.GetItemDataById(0, 6);
CPPUNIT_ASSERT_MESSAGE("wrong item value", !pItem);
@@ -867,17 +867,17 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableCache)
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem->GetType());
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
- OUString("A"), pItem->GetString());
+ u"A"_ustr, pItem->GetString());
pItem = aCache.GetItemDataById(1, 1);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem->GetType());
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
- OUString("B"), pItem->GetString());
+ u"B"_ustr, pItem->GetString());
pItem = aCache.GetItemDataById(1, 2);
CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem);
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value", ScDPItemData::String, pItem->GetType());
CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong item value",
- OUString("C"), pItem->GetString());
+ u"C"_ustr, pItem->GetString());
pItem = aCache.GetItemDataById(1, 3);
CPPUNIT_ASSERT_MESSAGE("wrong item value", !pItem);
@@ -1000,8 +1000,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDuplicateDataFields)
* Test for pivot table containing data fields that reference the same
* source field but different functions.
*/
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Raw data
const std::vector<std::vector<const char*>> aData = {
@@ -1095,8 +1095,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDuplicateDataFields)
CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNormalGrouping)
{
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Raw data
const std::vector<std::vector<const char*>> aData = {
@@ -1153,8 +1153,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNormalGrouping)
ScDPDimensionSaveData* pDimData = pSaveData->GetDimensionData();
CPPUNIT_ASSERT_MESSAGE("Failed to create dimension data.", pDimData);
- OUString aGroupPrefix("Group");
- OUString aBaseDimName("Name");
+ OUString aGroupPrefix(u"Group"_ustr);
+ OUString aBaseDimName(u"Name"_ustr);
OUString aGroupDimName =
pDimData->CreateGroupDimName(aBaseDimName, *pDPObj, false, nullptr);
@@ -1162,12 +1162,12 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNormalGrouping)
// Group A, B and C together.
ScDPSaveGroupDimension aGroupDim(aBaseDimName, aGroupDimName);
OUString aGroupName = aGroupDim.CreateGroupName(aGroupPrefix);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected group name", OUString("Group1"), aGroupName);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected group name", u"Group1"_ustr, aGroupName);
ScDPSaveGroupItem aGroup(aGroupName);
- aGroup.AddElement("A");
- aGroup.AddElement("B");
- aGroup.AddElement("C");
+ aGroup.AddElement(u"A"_ustr);
+ aGroup.AddElement(u"B"_ustr);
+ aGroup.AddElement(u"C"_ustr);
aGroupDim.AddGroupItem(aGroup);
pDimData->AddGroupDimension(aGroupDim);
@@ -1204,12 +1204,12 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNormalGrouping)
ScDPSaveGroupDimension* pGroupDim = pDimData->GetGroupDimAccForBase(aBaseDimName);
CPPUNIT_ASSERT_MESSAGE("There should be an existing group dimension.", pGroupDim);
OUString aGroupName = pGroupDim->CreateGroupName(aGroupPrefix);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected group name", OUString("Group2"), aGroupName);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected group name", u"Group2"_ustr, aGroupName);
ScDPSaveGroupItem aGroup(aGroupName);
- aGroup.AddElement("D");
- aGroup.AddElement("E");
- aGroup.AddElement("F");
+ aGroup.AddElement(u"D"_ustr);
+ aGroup.AddElement(u"E"_ustr);
+ aGroup.AddElement(u"F"_ustr);
pGroupDim->AddGroupItem(aGroup);
}
@@ -1244,8 +1244,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNormalGrouping)
CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNumberGrouping)
{
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Raw data
const std::vector<std::vector<const char*>> aData = {
@@ -1304,7 +1304,7 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNumberGrouping)
aInfo.mfStart = 30;
aInfo.mfEnd = 60;
aInfo.mfStep = 10;
- ScDPSaveNumGroupDimension aGroup("Order", aInfo);
+ ScDPSaveNumGroupDimension aGroup(u"Order"_ustr, aInfo);
pDimData->AddNumGroupDimension(aGroup);
}
@@ -1337,8 +1337,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNumberGrouping)
CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDateGrouping)
{
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Raw data
const std::vector<std::vector<const char*>> aData = {
@@ -1377,7 +1377,7 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDateGrouping)
ScDPDimensionSaveData* pDimData = pSaveData->GetDimensionData();
CPPUNIT_ASSERT_MESSAGE("No dimension data !?", pDimData);
- OUString aBaseDimName("Date");
+ OUString aBaseDimName(u"Date"_ustr);
ScDPNumGroupInfo aInfo;
aInfo.mbEnable = true;
@@ -1444,9 +1444,9 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDateGrouping)
{
// Let's hide year 2012.
pSaveData = pDPObj->GetSaveData();
- ScDPSaveDimension* pDim = pSaveData->GetDimensionByName("Years");
+ ScDPSaveDimension* pDim = pSaveData->GetDimensionByName(u"Years"_ustr);
CPPUNIT_ASSERT_MESSAGE("Years dimension should exist.", pDim);
- ScDPSaveMember* pMem = pDim->GetMemberByName("2012");
+ ScDPSaveMember* pMem = pDim->GetMemberByName(u"2012"_ustr);
CPPUNIT_ASSERT_MESSAGE("Member should exist.", pMem);
pMem->SetIsVisible(false);
}
@@ -1509,8 +1509,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDateGrouping)
CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableEmptyRows)
{
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Raw data
const std::vector<std::vector<const char*>> aData = {
@@ -1584,7 +1584,7 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableEmptyRows)
}
// Modify the source to remove member 'A', then refresh the table.
- m_pDoc->SetString(1, 2, 0, "B");
+ m_pDoc->SetString(1, 2, 0, u"B"_ustr);
o3tl::sorted_vector<ScDPObject*> aRefs;
TranslateId pErr = pDPs->ReloadCache(pDPObj, aRefs);
@@ -1622,8 +1622,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableEmptyRows)
CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableTextNumber)
{
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Raw data
const char* aData[][2] = {
@@ -1693,7 +1693,7 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableTextNumber)
ScDPSaveDimension* pDim = aSaveData.GetExistingDimensionByName(u"Name");
CPPUNIT_ASSERT(pDim);
pDim->SetOrientation(sheet::DataPilotFieldOrientation_PAGE);
- OUString aVisiblePage("0004");
+ OUString aVisiblePage(u"0004"_ustr);
pDim->SetCurrentPage(&aVisiblePage);
pDPObj->SetSaveData(aSaveData);
@@ -1727,8 +1727,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableCaseInsensitiveStrings)
* Test for checking that pivot table treats strings in a case insensitive
* manner.
*/
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Raw data
const std::vector<std::vector<const char*>> aData = {
@@ -1821,16 +1821,16 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableNumStability)
{ "Total", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false },
};
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
ScAddress aPos(1,1,0);
ScRange aDataRange = insertRangeData(m_pDoc, aPos, aData);
// Insert formulas to manually calculate sums for each name.
- m_pDoc->SetString(aDataRange.aStart.Col(), aDataRange.aEnd.Row()+1, aDataRange.aStart.Tab(), "=SUMIF(R[-23]C:R[-1]C;\"Dennis\";R[-23]C[3]:R[-1]C[3])");
- m_pDoc->SetString(aDataRange.aStart.Col(), aDataRange.aEnd.Row()+2, aDataRange.aStart.Tab(), "=SUMIF(R[-24]C:R[-2]C;\"Mike\";R[-24]C[3]:R[-2]C[3])");
- m_pDoc->SetString(aDataRange.aStart.Col(), aDataRange.aEnd.Row()+3, aDataRange.aStart.Tab(), "=SUMIF(R[-25]C:R[-3]C;\"Sam\";R[-25]C[3]:R[-3]C[3])");
+ m_pDoc->SetString(aDataRange.aStart.Col(), aDataRange.aEnd.Row()+1, aDataRange.aStart.Tab(), u"=SUMIF(R[-23]C:R[-1]C;\"Dennis\";R[-23]C[3]:R[-1]C[3])"_ustr);
+ m_pDoc->SetString(aDataRange.aStart.Col(), aDataRange.aEnd.Row()+2, aDataRange.aStart.Tab(), u"=SUMIF(R[-24]C:R[-2]C;\"Mike\";R[-24]C[3]:R[-2]C[3])"_ustr);
+ m_pDoc->SetString(aDataRange.aStart.Col(), aDataRange.aEnd.Row()+3, aDataRange.aStart.Tab(), u"=SUMIF(R[-25]C:R[-3]C;\"Sam\";R[-25]C[3]:R[-3]C[3])"_ustr);
m_pDoc->CalcAll();
@@ -1891,8 +1891,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableFieldReference)
* Test for pivot table that include field with various non-default field
* references.
*/
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Raw data
const std::vector<std::vector<const char*>> aData = {
@@ -1945,7 +1945,7 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableFieldReference)
aFieldRef.ReferenceField = "Name";
aFieldRef.ReferenceItemType = sheet::DataPilotFieldReferenceItemType::NAMED;
aFieldRef.ReferenceItemName = "A";
- ScDPSaveDimension* pDim = aSaveData.GetDimensionByName("Value");
+ ScDPSaveDimension* pDim = aSaveData.GetDimensionByName(u"Value"_ustr);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve dimension 'Value'.", pDim);
pDim->SetReferenceValue(&aFieldRef);
pDPObj->SetSaveData(aSaveData);
@@ -2060,8 +2060,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDocFunc)
/**
* Test pivot table functionality performed via ScDBDocFunc.
*/
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Raw data
const std::vector<std::vector<const char*>> aData = {
@@ -2128,8 +2128,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDocFunc)
CPPUNIT_TEST_FIXTURE(TestPivottable, testFuncGETPIVOTDATA)
{
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Raw data
const std::vector<std::vector<const char*>> aData = {
@@ -2284,8 +2284,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testFuncGETPIVOTDATA)
CPPUNIT_TEST_FIXTURE(TestPivottable, testFuncGETPIVOTDATALeafAccess)
{
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Raw data
const std::vector<std::vector<const char*>> aData = {
@@ -2377,8 +2377,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableRepeatItemLabels)
/**
* Test pivot table per-field repeat item labels functionality
*/
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Dimension definition
static const DPFieldDef aFields[] = {
@@ -2457,8 +2457,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDPCollection)
/**
* Test DPCollection public methods
*/
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Dimension definition
static const DPFieldDef aFields[] = {
@@ -2495,13 +2495,13 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableDPCollection)
// Add 2 DP objects
ScDPObject* pDPObj = createDPFromRange(m_pDoc, aDataRange , aFields, nFieldCount, false);
pDPs->InsertNewTable(std::unique_ptr<ScDPObject>(pDPObj));
- pDPObj->SetName("DP1"); // set custom name
+ pDPObj->SetName(u"DP1"_ustr); // set custom name
CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.", size_t(1), pDPs->GetCount());
ScDPObject* pDPObj2 = createDPFromRange(m_pDoc, aDataRange, aFields, nFieldCount, false);
pDPs->InsertNewTable(std::unique_ptr<ScDPObject>(pDPObj2));
- pDPObj2->SetName("DP2"); // set custom name
+ pDPObj2->SetName(u"DP2"_ustr); // set custom name
CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be two DP tables", size_t(2), pDPs->GetCount());
CPPUNIT_ASSERT_EQUAL_MESSAGE("should return first DPObject",
@@ -2546,8 +2546,8 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testPivotTableMedianFunc)
/**
* Test pivot table median function
*/
- m_pDoc->InsertTab(0, "Data");
- m_pDoc->InsertTab(1, "Table");
+ m_pDoc->InsertTab(0, u"Data"_ustr);
+ m_pDoc->InsertTab(1, u"Table"_ustr);
// Raw data
const std::vector<std::vector<const char*>> aData = {
diff --git a/sc/qa/unit/ucalc_range.cxx b/sc/qa/unit/ucalc_range.cxx
index 54f7d1c89b7f..4c515e402698 100644
--- a/sc/qa/unit/ucalc_range.cxx
+++ b/sc/qa/unit/ucalc_range.cxx
@@ -44,14 +44,14 @@ CPPUNIT_TEST_FIXTURE(ScRangeTest, testOverlap)
CPPUNIT_TEST_FIXTURE(ScRangeTest, testRangeParsing)
{
ScRange aRange;
- ScRefFlags nRes = aRange.Parse(":1", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ ScRefFlags nRes = aRange.Parse(u":1"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
}
CPPUNIT_TEST_FIXTURE(ScRangeTest, testAddressParsing)
{
ScAddress aAddr;
- ScRefFlags nRes = aAddr.Parse("1", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ ScRefFlags nRes = aAddr.Parse(u"1"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
}
@@ -59,7 +59,7 @@ CPPUNIT_TEST_FIXTURE(ScRangeTest, testTdf147451)
{
ScAddress aAddr;
// "Sheet1" is technically a valid address like "XF1", but it should overflow.
- ScRefFlags nRes = aAddr.Parse("Sheet1", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ ScRefFlags nRes = aAddr.Parse(u"Sheet1"_ustr, *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
}
diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx
index 9e466ce84e06..0e21a27b5574 100644
--- a/sc/qa/unit/ucalc_sharedformula.cxx
+++ b/sc/qa/unit/ucalc_sharedformula.cxx
@@ -35,16 +35,16 @@ class TestSharedFormula : public ScUcalcTestBase
CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulas)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScAddress aPos(1, 9, 0); // B10
- m_pDoc->SetString(aPos, "=A10*2"); // Insert into B10.
+ m_pDoc->SetString(aPos, u"=A10*2"_ustr); // Insert into B10.
const ScFormulaCell* pFC = m_pDoc->GetFormulaCell(aPos);
CPPUNIT_ASSERT_MESSAGE("Expected to be a non-shared cell.", pFC);
CPPUNIT_ASSERT_MESSAGE("Expected to be a non-shared cell.", !pFC->IsShared());
aPos.SetRow(10); // B11
- m_pDoc->SetString(aPos, "=A11*2");
+ m_pDoc->SetString(aPos, u"=A11*2"_ustr);
pFC = m_pDoc->GetFormulaCell(aPos);
CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC);
CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC->IsShared());
@@ -53,7 +53,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulas)
CPPUNIT_ASSERT_EQUAL_MESSAGE("The token is expected to be shared.", pFC->GetCode(), pFC->GetSharedCode());
aPos.SetRow(8); // B9
- m_pDoc->SetString(aPos, "=A9*2");
+ m_pDoc->SetString(aPos, u"=A9*2"_ustr);
pFC = m_pDoc->GetFormulaCell(aPos);
CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC);
CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC->IsShared());
@@ -62,14 +62,14 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulas)
CPPUNIT_ASSERT_EQUAL_MESSAGE("The token is expected to be shared.", pFC->GetCode(), pFC->GetSharedCode());
aPos.SetRow(12); // B13
- m_pDoc->SetString(aPos, "=A13*2");
+ m_pDoc->SetString(aPos, u"=A13*2"_ustr);
pFC = m_pDoc->GetFormulaCell(aPos);
CPPUNIT_ASSERT_MESSAGE("This formula cell shouldn't be shared yet.", pFC);
CPPUNIT_ASSERT_MESSAGE("This formula cell shouldn't be shared yet.", !pFC->IsShared());
// Insert a formula to B12, and B9:B13 should be shared.
aPos.SetRow(11); // B12
- m_pDoc->SetString(aPos, "=A12*2");
+ m_pDoc->SetString(aPos, u"=A12*2"_ustr);
pFC = m_pDoc->GetFormulaCell(aPos);
CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC);
CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC->IsShared());
@@ -79,9 +79,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulas)
// Insert formulas to B15:B16.
aPos.SetRow(14); // B15
- m_pDoc->SetString(aPos, "=A15*2");
+ m_pDoc->SetString(aPos, u"=A15*2"_ustr);
aPos.SetRow(15); // B16
- m_pDoc->SetString(aPos, "=A16*2");
+ m_pDoc->SetString(aPos, u"=A16*2"_ustr);
pFC = m_pDoc->GetFormulaCell(aPos);
CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC);
CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC->IsShared());
@@ -91,7 +91,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulas)
// Insert a formula to B14, and B9:B16 should be shared.
aPos.SetRow(13); // B14
- m_pDoc->SetString(aPos, "=A14*2");
+ m_pDoc->SetString(aPos, u"=A14*2"_ustr);
pFC = m_pDoc->GetFormulaCell(aPos);
CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC);
CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC->IsShared());
@@ -101,7 +101,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulas)
// Insert an incompatible formula to B12, to split the shared range to B9:B11 and B13:B16.
aPos.SetRow(11); // B12
- m_pDoc->SetString(aPos, "=$A$1*4");
+ m_pDoc->SetString(aPos, u"=$A$1*4"_ustr);
pFC = m_pDoc->GetFormulaCell(aPos);
CPPUNIT_ASSERT_MESSAGE("This cell shouldn't be shared.", pFC);
CPPUNIT_ASSERT_MESSAGE("This cell shouldn't be shared.", !pFC->IsShared());
@@ -124,13 +124,13 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulas)
// Extend B13:B16 to B13:B20.
aPos.SetRow(16); // B17
- m_pDoc->SetString(aPos, "=A17*2");
+ m_pDoc->SetString(aPos, u"=A17*2"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=A18*2");
+ m_pDoc->SetString(aPos, u"=A18*2"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=A19*2");
+ m_pDoc->SetString(aPos, u"=A19*2"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=A20*2");
+ m_pDoc->SetString(aPos, u"=A20*2"_ustr);
pFC = m_pDoc->GetFormulaCell(aPos);
CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC);
CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC->IsShared());
@@ -185,7 +185,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulas)
// Set string value to B16 to make B17:B18 shared.
aPos.SetRow(15);
- ScCellValue aCell(svl::SharedString("Test"));
+ ScCellValue aCell(svl::SharedString(u"Test"_ustr));
CPPUNIT_ASSERT_EQUAL_MESSAGE("This should be a string value.", CELLTYPE_STRING, aCell.getType());
aCell.commit(*m_pDoc, aPos);
CPPUNIT_ASSERT_EQUAL(aCell.getSharedString()->getString(), m_pDoc->GetString(aPos));
@@ -199,7 +199,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulas)
// Set edit text to B17. Now B18 should be non-shared.
ScFieldEditEngine& rEditEngine = m_pDoc->GetEditEngine();
- rEditEngine.SetTextCurrentDefaults("Edit Text");
+ rEditEngine.SetTextCurrentDefaults(u"Edit Text"_ustr);
aPos.SetRow(16);
m_pDoc->SetEditText(aPos, rEditEngine.CreateTextObject());
CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, m_pDoc->GetCellType(aPos));
@@ -212,23 +212,23 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulas)
clearRange(m_pDoc, ScRange(0,0,0,2,100,0));
aPos.SetRow(1);
- m_pDoc->SetString(aPos, "=A2*10");
+ m_pDoc->SetString(aPos, u"=A2*10"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=A3*10");
+ m_pDoc->SetString(aPos, u"=A3*10"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=A4*10");
+ m_pDoc->SetString(aPos, u"=A4*10"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=A5*10");
+ m_pDoc->SetString(aPos, u"=A5*10"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=A6*10");
+ m_pDoc->SetString(aPos, u"=A6*10"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=A7*10");
+ m_pDoc->SetString(aPos, u"=A7*10"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=A8*10");
+ m_pDoc->SetString(aPos, u"=A8*10"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=A9*10");
+ m_pDoc->SetString(aPos, u"=A9*10"_ustr);
aPos.IncRow();
- m_pDoc->SetString(aPos, "=A10*10");
+ m_pDoc->SetString(aPos, u"=A10*10"_ustr);
pFC = m_pDoc->GetFormulaCell(aPos);
CPPUNIT_ASSERT_MESSAGE("B10 should be a formula cell.", pFC);
@@ -305,7 +305,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulas)
CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdate)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false); // turn off auto calculation.
@@ -325,9 +325,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdate)
insertRangeData(m_pDoc, ScAddress(1,0,0), aData);
}
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", OUString("=A10"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", OUString("=A11"), m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", OUString("=A12"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", u"=A10"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", u"=A11"_ustr, m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", u"=A12"_ustr, m_pDoc->GetFormula(1,2,0));
const ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
CPPUNIT_ASSERT_MESSAGE("This must be a shared formula cell.", pFC);
@@ -337,9 +337,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdate)
// Insert cells over A11:B11 to shift to right. This should split the B1:B3 grouping into 3.
m_pDoc->InsertCol(ScRange(0,10,0,1,10,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", OUString("=A10"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", OUString("=C11"), m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", OUString("=A12"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", u"=A10"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", u"=C11"_ustr, m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", u"=A12"_ustr, m_pDoc->GetFormula(1,2,0));
pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
CPPUNIT_ASSERT_MESSAGE("B1 should be a non-shared formula cell.", pFC);
@@ -354,9 +354,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdate)
// Delete cells over A11:B11 to bring it back to the previous state.
m_pDoc->DeleteCol(ScRange(0,10,0,1,10,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", OUString("=A10"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", OUString("=A11"), m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", OUString("=A12"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", u"=A10"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", u"=A11"_ustr, m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", u"=A12"_ustr, m_pDoc->GetFormula(1,2,0));
pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
CPPUNIT_ASSERT_MESSAGE("This must be a shared formula cell.", pFC);
@@ -366,9 +366,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdate)
// Insert cells over A11:A12 and shift down.
m_pDoc->InsertRow(ScRange(0,10,0,0,11,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", OUString("=A10"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", OUString("=A13"), m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", OUString("=A14"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", u"=A10"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", u"=A13"_ustr, m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", u"=A14"_ustr, m_pDoc->GetFormula(1,2,0));
pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
CPPUNIT_ASSERT_MESSAGE("B1 should be a non-shared formula cell.", pFC);
@@ -382,9 +382,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdate)
// Delete A11:A12 to bring it back to the way it was.
m_pDoc->DeleteRow(ScRange(0,10,0,0,11,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", OUString("=A10"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", OUString("=A11"), m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", OUString("=A12"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", u"=A10"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", u"=A11"_ustr, m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", u"=A12"_ustr, m_pDoc->GetFormula(1,2,0));
pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
CPPUNIT_ASSERT_MESSAGE("This must be a shared formula cell.", pFC);
@@ -394,9 +394,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdate)
// Insert cells over A11:B11 to shift to right again.
m_pDoc->InsertCol(ScRange(0,10,0,1,10,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", OUString("=A10"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", OUString("=C11"), m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", OUString("=A12"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", u"=A10"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", u"=C11"_ustr, m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", u"=A12"_ustr, m_pDoc->GetFormula(1,2,0));
pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
CPPUNIT_ASSERT_MESSAGE("B1 should be a non-shared formula cell.", pFC);
@@ -410,9 +410,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdate)
// Insert cells over A12:B12 to shift to right.
m_pDoc->InsertCol(ScRange(0,11,0,1,11,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", OUString("=A10"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", OUString("=C11"), m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", OUString("=C12"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", u"=A10"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", u"=C11"_ustr, m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", u"=C12"_ustr, m_pDoc->GetFormula(1,2,0));
pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
CPPUNIT_ASSERT_MESSAGE("B1 should be a non-shared formula cell.", pFC);
@@ -426,9 +426,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdate)
// Insert cells over A10:B10 to shift to right.
m_pDoc->InsertCol(ScRange(0,9,0,1,9,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", OUString("=C10"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", OUString("=C11"), m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", OUString("=C12"), m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B1", u"=C10"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B2", u"=C11"_ustr, m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in B3", u"=C12"_ustr, m_pDoc->GetFormula(1,2,0));
// B1:B3 should be now grouped.
pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
@@ -445,7 +445,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateMove)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Set values in B2:B4.
for (SCROW i = 1; i <= 3; ++i)
@@ -480,9 +480,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateMove)
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(1,2,0)));
// The formulas should have been adjusted for the move.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=R[-1]C[-1]"), m_pDoc->GetFormula(2,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=R[-1]C[-1]"), m_pDoc->GetFormula(2,2,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=R[-1]C[-1]"), m_pDoc->GetFormula(2,3,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=R[-1]C[-1]"_ustr, m_pDoc->GetFormula(2,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=R[-1]C[-1]"_ustr, m_pDoc->GetFormula(2,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=R[-1]C[-1]"_ustr, m_pDoc->GetFormula(2,3,0));
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
CPPUNIT_ASSERT(pUndoMgr);
@@ -494,9 +494,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateMove)
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(1,3,0)));
// And the formulas should have been re-adjusted to their original references.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=RC[-1]"), m_pDoc->GetFormula(2,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=RC[-1]"), m_pDoc->GetFormula(2,2,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=RC[-1]"), m_pDoc->GetFormula(2,3,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=RC[-1]"_ustr, m_pDoc->GetFormula(2,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=RC[-1]"_ustr, m_pDoc->GetFormula(2,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=RC[-1]"_ustr, m_pDoc->GetFormula(2,3,0));
m_pDoc->DeleteTab(0);
}
@@ -506,7 +506,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateMove2)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, false); // turn auto calc off this time.
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Set values in B2:B3, and E2:E3.
for (SCROW i = 1; i <= 2; ++i)
@@ -575,7 +575,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateMove2)
CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateRange)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Insert values to A3:A5.
m_pDoc->SetValue(ScAddress(0,2,0), 1);
@@ -593,9 +593,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateRange)
insertRangeData(m_pDoc, ScAddress(1,2,0), aData);
}
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=SUM($A$3:$A$5)"), m_pDoc->GetFormula(1,2,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=SUM($A$3:$A$5)"), m_pDoc->GetFormula(1,3,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=SUM($A$3:$A$5)"), m_pDoc->GetFormula(1,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=SUM($A$3:$A$5)"_ustr, m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=SUM($A$3:$A$5)"_ustr, m_pDoc->GetFormula(1,3,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=SUM($A$3:$A$5)"_ustr, m_pDoc->GetFormula(1,4,0));
// B3:B5 should be shared.
const ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1,2,0));
@@ -625,9 +625,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateRange)
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(4), pFC->GetSharedTopRow());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(3), pFC->GetSharedLength());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=SUM($A$5:$A$7)"), m_pDoc->GetFormula(1,4,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=SUM($A$5:$A$7)"), m_pDoc->GetFormula(1,5,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=SUM($A$5:$A$7)"), m_pDoc->GetFormula(1,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=SUM($A$5:$A$7)"_ustr, m_pDoc->GetFormula(1,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=SUM($A$5:$A$7)"_ustr, m_pDoc->GetFormula(1,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=SUM($A$5:$A$7)"_ustr, m_pDoc->GetFormula(1,6,0));
m_pDoc->DeleteTab(0);
}
@@ -662,7 +662,7 @@ struct SortByArea
CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateRangeDeleteRow)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
ScRange aWholeArea(0, 0, 0, 100, 100, 0); // Large enough for all references used in the test.
@@ -782,20 +782,20 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateRangeDeleteRo
CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateExternal)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Formula");
+ m_pDoc->InsertTab(0, u"Formula"_ustr);
// Launch an external document shell.
ScDocShellRef xExtDocSh = new ScDocShell;
- SfxMedium* pMed = new SfxMedium("file:///extdata.fake", StreamMode::STD_READWRITE);
+ SfxMedium* pMed = new SfxMedium(u"file:///extdata.fake"_ustr, StreamMode::STD_READWRITE);
xExtDocSh->DoLoad(pMed);
ScDocument& rExtDoc = xExtDocSh->GetDocument();
// Populate A1:A3.
- rExtDoc.InsertTab(0, "Data");
- rExtDoc.SetString(ScAddress(0,0,0), "A");
- rExtDoc.SetString(ScAddress(0,1,0), "B");
- rExtDoc.SetString(ScAddress(0,2,0), "C");
+ rExtDoc.InsertTab(0, u"Data"_ustr);
+ rExtDoc.SetString(ScAddress(0,0,0), u"A"_ustr);
+ rExtDoc.SetString(ScAddress(0,1,0), u"B"_ustr);
+ rExtDoc.SetString(ScAddress(0,2,0), u"C"_ustr);
{
// Insert formula cells in A7:A10 of the host document, referencing A1:A3
@@ -811,16 +811,16 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateExternal)
}
// Check the formula results.
- CPPUNIT_ASSERT_EQUAL(OUString("A"), m_pDoc->GetString(ScAddress(0,6,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("B"), m_pDoc->GetString(ScAddress(0,7,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("C"), m_pDoc->GetString(ScAddress(0,8,0)));
+ CPPUNIT_ASSERT_EQUAL(u"A"_ustr, m_pDoc->GetString(ScAddress(0,6,0)));
+ CPPUNIT_ASSERT_EQUAL(u"B"_ustr, m_pDoc->GetString(ScAddress(0,7,0)));
+ CPPUNIT_ASSERT_EQUAL(u"C"_ustr, m_pDoc->GetString(ScAddress(0,8,0)));
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(0,9,0)));
// Check the formulas too.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("='file:///extdata.fake'#$Data.A1"), m_pDoc->GetFormula(0,6,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("='file:///extdata.fake'#$Data.A2"), m_pDoc->GetFormula(0,7,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("='file:///extdata.fake'#$Data.A3"), m_pDoc->GetFormula(0,8,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=COUNTA('file:///extdata.fake'#$Data.A1:A3)"), m_pDoc->GetFormula(0,9,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"='file:///extdata.fake'#$Data.A1"_ustr, m_pDoc->GetFormula(0,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"='file:///extdata.fake'#$Data.A2"_ustr, m_pDoc->GetFormula(0,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"='file:///extdata.fake'#$Data.A3"_ustr, m_pDoc->GetFormula(0,8,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=COUNTA('file:///extdata.fake'#$Data.A1:A3)"_ustr, m_pDoc->GetFormula(0,9,0));
// Delete rows 1 and 2. This should not change the references in the formula cells below.
ScDocFunc& rDocFunc = m_xDocShell->GetDocFunc();
@@ -829,26 +829,26 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateExternal)
rDocFunc.DeleteCells(ScRange(0,0,0,m_pDoc->MaxCol(),1,0), &aMark, DelCellCmd::CellsUp, true);
// Check the shifted formula cells now in A5:A8.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("='file:///extdata.fake'#$Data.A1"), m_pDoc->GetFormula(0,4,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("='file:///extdata.fake'#$Data.A2"), m_pDoc->GetFormula(0,5,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("='file:///extdata.fake'#$Data.A3"), m_pDoc->GetFormula(0,6,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=COUNTA('file:///extdata.fake'#$Data.A1:A3)"), m_pDoc->GetFormula(0,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"='file:///extdata.fake'#$Data.A1"_ustr, m_pDoc->GetFormula(0,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"='file:///extdata.fake'#$Data.A2"_ustr, m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"='file:///extdata.fake'#$Data.A3"_ustr, m_pDoc->GetFormula(0,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=COUNTA('file:///extdata.fake'#$Data.A1:A3)"_ustr, m_pDoc->GetFormula(0,7,0));
// Undo and check the formulas again.
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
CPPUNIT_ASSERT(pUndoMgr);
pUndoMgr->Undo();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("='file:///extdata.fake'#$Data.A1"), m_pDoc->GetFormula(0,6,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("='file:///extdata.fake'#$Data.A2"), m_pDoc->GetFormula(0,7,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("='file:///extdata.fake'#$Data.A3"), m_pDoc->GetFormula(0,8,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=COUNTA('file:///extdata.fake'#$Data.A1:A3)"), m_pDoc->GetFormula(0,9,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"='file:///extdata.fake'#$Data.A1"_ustr, m_pDoc->GetFormula(0,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"='file:///extdata.fake'#$Data.A2"_ustr, m_pDoc->GetFormula(0,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"='file:///extdata.fake'#$Data.A3"_ustr, m_pDoc->GetFormula(0,8,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=COUNTA('file:///extdata.fake'#$Data.A1:A3)"_ustr, m_pDoc->GetFormula(0,9,0));
// Redo the row deletion and check the formulas again.
pUndoMgr->Redo();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("='file:///extdata.fake'#$Data.A1"), m_pDoc->GetFormula(0,4,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("='file:///extdata.fake'#$Data.A2"), m_pDoc->GetFormula(0,5,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("='file:///extdata.fake'#$Data.A3"), m_pDoc->GetFormula(0,6,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=COUNTA('file:///extdata.fake'#$Data.A1:A3)"), m_pDoc->GetFormula(0,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"='file:///extdata.fake'#$Data.A1"_ustr, m_pDoc->GetFormula(0,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"='file:///extdata.fake'#$Data.A2"_ustr, m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"='file:///extdata.fake'#$Data.A3"_ustr, m_pDoc->GetFormula(0,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=COUNTA('file:///extdata.fake'#$Data.A1:A3)"_ustr, m_pDoc->GetFormula(0,7,0));
xExtDocSh->DoClose();
@@ -866,7 +866,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasInsertRow)
for (size_t i = 0; i < SAL_N_ELEMENTS(pRows); ++i)
{
ScAddress aPos(1, pRows[i], 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=$A$5"), pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=$A$5"_ustr, pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
}
// B1:B2 should be grouped.
@@ -893,7 +893,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasInsertRow)
for (SCROW i = 0; i <= 3; ++i)
{
ScAddress aPos(1,i,0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=$A$4"), pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=$A$4"_ustr, pDoc->GetFormula(aPos.Col(), aPos.Row(), aPos.Tab()));
}
// Ensure that B5 is empty.
@@ -917,7 +917,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasInsertRow)
} aCheck;
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Scenario inspired by fdo#76470.
@@ -963,7 +963,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasInsertRow)
CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasDeleteRows)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
{
@@ -1061,7 +1061,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasDeleteColumns)
{
using namespace formula;
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
@@ -1072,12 +1072,12 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasDeleteColumns)
// First, test a single cell case. A value in B1 and formula in C1.
m_pDoc->SetValue(ScAddress(1,0,0), 11.0);
- m_pDoc->SetString(ScAddress(2,0,0), "=RC[-1]");
+ m_pDoc->SetString(ScAddress(2,0,0), u"=RC[-1]"_ustr);
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(ScAddress(2,0,0)));
// Delete column B.
rFunc.DeleteCells(ScRange(1,0,0,1,m_pDoc->MaxRow(),0), &aMark, DelCellCmd::CellsLeft, true);
- CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), m_pDoc->GetString(ScAddress(1,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"#REF!"_ustr, m_pDoc->GetString(ScAddress(1,0,0)));
// The reference should still point to row 1 but the column status should be set to 'deleted'.
const ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
@@ -1093,7 +1093,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasDeleteColumns)
// The formula string should show #REF! in lieu of the column position (only for Calc A1 syntax).
sc::CompileFormulaContext aCFCxt(*m_pDoc, FormulaGrammar::GRAM_ENGLISH);
- CPPUNIT_ASSERT_EQUAL(OUString("=#REF!1"), pFC->GetFormula(aCFCxt));
+ CPPUNIT_ASSERT_EQUAL(u"=#REF!1"_ustr, pFC->GetFormula(aCFCxt));
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
CPPUNIT_ASSERT(pUndoMgr);
@@ -1103,7 +1103,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasDeleteColumns)
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(ScAddress(2,0,0)));
pFC = m_pDoc->GetFormulaCell(ScAddress(2,0,0));
CPPUNIT_ASSERT(pFC);
- CPPUNIT_ASSERT_EQUAL(OUString("=B1"), pFC->GetFormula(aCFCxt));
+ CPPUNIT_ASSERT_EQUAL(u"=B1"_ustr, pFC->GetFormula(aCFCxt));
// Clear row 1 and move over to a formula group case.
clearRange(m_pDoc, ScRange(0,0,0,m_pDoc->MaxCol(),0,0));
@@ -1113,7 +1113,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasDeleteColumns)
{
m_pDoc->SetValue(ScAddress(0,i,0), (i+1));
m_pDoc->SetValue(ScAddress(1,i,0), (i+11));
- m_pDoc->SetString(ScAddress(2,i,0), "=RC[-2]+RC[-1]");
+ m_pDoc->SetString(ScAddress(2,i,0), u"=RC[-2]+RC[-1]"_ustr);
double fCheck = m_pDoc->GetValue(ScAddress(0,i,0));
fCheck += m_pDoc->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_EQUAL(fCheck, m_pDoc->GetValue(ScAddress(2,i,0)));
@@ -1125,15 +1125,15 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasDeleteColumns)
for (SCROW i = 0; i <= 1; ++i)
{
ScAddress aPos(1,i,0);
- CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), m_pDoc->GetString(aPos));
+ CPPUNIT_ASSERT_EQUAL(u"#REF!"_ustr, m_pDoc->GetString(aPos));
}
pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0)); // B1
CPPUNIT_ASSERT(pFC);
- CPPUNIT_ASSERT_EQUAL(OUString("=A1+#REF!1"), pFC->GetFormula(aCFCxt));
+ CPPUNIT_ASSERT_EQUAL(u"=A1+#REF!1"_ustr, pFC->GetFormula(aCFCxt));
pFC = m_pDoc->GetFormulaCell(ScAddress(1,1,0)); // B2
CPPUNIT_ASSERT(pFC);
- CPPUNIT_ASSERT_EQUAL(OUString("=A2+#REF!2"), pFC->GetFormula(aCFCxt));
+ CPPUNIT_ASSERT_EQUAL(u"=A2+#REF!2"_ustr, pFC->GetFormula(aCFCxt));
// Undo deletion of column B and check the results of C1:C2.
pUndoMgr->Undo();
@@ -1149,9 +1149,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasDeleteColumns)
CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateMoveSheets)
{
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
- m_pDoc->InsertTab(2, "Sheet3");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
+ m_pDoc->InsertTab(2, u"Sheet3"_ustr);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // make sure auto calc is on.
@@ -1164,7 +1164,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateMoveSheets)
// Fill formula cells A1:A8 on Sheet1, to refer to the same cell address on Sheet2.
for (SCROW i = 0; i <= 7; ++i)
- m_pDoc->SetString(ScAddress(0,i,0), "=Sheet2!RC");
+ m_pDoc->SetString(ScAddress(0,i,0), u"=Sheet2!RC"_ustr);
// Check the results.
for (SCROW i = 0; i <= 7; ++i)
@@ -1176,33 +1176,33 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateMoveSheets)
// Check sheet names.
std::vector<OUString> aTabNames = m_pDoc->GetAllTableNames();
CPPUNIT_ASSERT_MESSAGE("There should be at least 3 sheets.", aTabNames.size() >= 3);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet3"), aTabNames[0]);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet1"), aTabNames[1]);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet2"), aTabNames[2]);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet3"_ustr, aTabNames[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet1"_ustr, aTabNames[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet2"_ustr, aTabNames[2]);
// Check the results again on Sheet1.
for (SCROW i = 0; i <= 7; ++i)
{
CPPUNIT_ASSERT_EQUAL(static_cast<double>(i+1), m_pDoc->GetValue(ScAddress(0,i,1)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula expression.", OUString("=Sheet2!RC"), m_pDoc->GetFormula(0,i,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula expression.", u"=Sheet2!RC"_ustr, m_pDoc->GetFormula(0,i,1));
}
// Insert a new sheet at the left end.
- m_pDoc->InsertTab(0, "Sheet4");
+ m_pDoc->InsertTab(0, u"Sheet4"_ustr);
// Check sheet names.
aTabNames = m_pDoc->GetAllTableNames();
CPPUNIT_ASSERT_MESSAGE("There should be at least 4 sheets.", aTabNames.size() >= 4);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet4"), aTabNames[0]);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet3"), aTabNames[1]);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet1"), aTabNames[2]);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet2"), aTabNames[3]);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet4"_ustr, aTabNames[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet3"_ustr, aTabNames[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet1"_ustr, aTabNames[2]);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet2"_ustr, aTabNames[3]);
// Check the results again on Sheet1.
for (SCROW i = 0; i <= 7; ++i)
{
CPPUNIT_ASSERT_EQUAL(static_cast<double>(i+1), m_pDoc->GetValue(ScAddress(0,i,2)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula expression.", OUString("=Sheet2!RC"), m_pDoc->GetFormula(0,i,2));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula expression.", u"=Sheet2!RC"_ustr, m_pDoc->GetFormula(0,i,2));
}
// Delete Sheet4.
@@ -1211,15 +1211,15 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateMoveSheets)
// Check sheet names.
aTabNames = m_pDoc->GetAllTableNames();
CPPUNIT_ASSERT_MESSAGE("There should be at least 3 sheets.", aTabNames.size() >= 3);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet3"), aTabNames[0]);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet1"), aTabNames[1]);
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet2"), aTabNames[2]);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet3"_ustr, aTabNames[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet1"_ustr, aTabNames[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet2"_ustr, aTabNames[2]);
// Check the results again on Sheet1.
for (SCROW i = 0; i <= 7; ++i)
{
CPPUNIT_ASSERT_EQUAL(static_cast<double>(i+1), m_pDoc->GetValue(ScAddress(0,i,1)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula expression.", OUString("=Sheet2!RC"), m_pDoc->GetFormula(0,i,1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula expression.", u"=Sheet2!RC"_ustr, m_pDoc->GetFormula(0,i,1));
}
m_pDoc->DeleteTab(2);
@@ -1231,15 +1231,15 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateCopySheets)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // make sure auto calc is on.
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
m_pDoc->SetValue(ScAddress(0,0,1), 1.0); // A1 on Sheet2
m_pDoc->SetValue(ScAddress(0,1,1), 2.0); // A2 on Sheet2
// Reference values on Sheet2, but use absolute sheet references.
- m_pDoc->SetString(ScAddress(0,0,0), "=$Sheet2.A1");
- m_pDoc->SetString(ScAddress(0,1,0), "=$Sheet2.A2");
+ m_pDoc->SetString(ScAddress(0,0,0), u"=$Sheet2.A1"_ustr);
+ m_pDoc->SetString(ScAddress(0,1,0), u"=$Sheet2.A2"_ustr);
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(0,1,0)));
@@ -1247,8 +1247,8 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateCopySheets)
// Copy Sheet1 and insert the copied sheet before the current Sheet1 position.
m_pDoc->CopyTab(0, 0);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=$Sheet2.A1"), m_pDoc->GetFormula(0,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=$Sheet2.A2"), m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=$Sheet2.A1"_ustr, m_pDoc->GetFormula(0,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=$Sheet2.A2"_ustr, m_pDoc->GetFormula(0,1,0));
// Check the values on the copied sheet.
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(0,0,0)));
@@ -1267,8 +1267,8 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateDeleteSheets)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // make sure auto calc is on.
- m_pDoc->InsertTab(0, "Sheet1");
- m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(0, u"Sheet1"_ustr);
+ m_pDoc->InsertTab(1, u"Sheet2"_ustr);
// Set values to B2:B4 on Sheet2.
m_pDoc->SetValue(ScAddress(1,1,1), 1.0);
@@ -1276,35 +1276,35 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateDeleteSheets)
m_pDoc->SetValue(ScAddress(1,3,1), 3.0);
// Set formulas in A1:A3 on Sheet1 that reference B2:B4 on Sheet2.
- m_pDoc->SetString(ScAddress(0,0,0), "=Sheet2.B2");
- m_pDoc->SetString(ScAddress(0,1,0), "=Sheet2.B3");
- m_pDoc->SetString(ScAddress(0,2,0), "=Sheet2.B4");
+ m_pDoc->SetString(ScAddress(0,0,0), u"=Sheet2.B2"_ustr);
+ m_pDoc->SetString(ScAddress(0,1,0), u"=Sheet2.B3"_ustr);
+ m_pDoc->SetString(ScAddress(0,2,0), u"=Sheet2.B4"_ustr);
// Check the formula results.
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(0,2,0)));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=Sheet2.B2"), m_pDoc->GetFormula(0,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=Sheet2.B3"), m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=Sheet2.B4"), m_pDoc->GetFormula(0,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=Sheet2.B2"_ustr, m_pDoc->GetFormula(0,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=Sheet2.B3"_ustr, m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=Sheet2.B4"_ustr, m_pDoc->GetFormula(0,2,0));
// Delete Sheet2.
ScDocFunc& rFunc = m_xDocShell->GetDocFunc();
rFunc.DeleteTable(1, true);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=#REF!.B2"), m_pDoc->GetFormula(0,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=#REF!.B3"), m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=#REF!.B4"), m_pDoc->GetFormula(0,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=#REF!.B2"_ustr, m_pDoc->GetFormula(0,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=#REF!.B3"_ustr, m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=#REF!.B4"_ustr, m_pDoc->GetFormula(0,2,0));
// Undo the deletion and make sure the formulas are back to the way they were.
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
CPPUNIT_ASSERT(pUndoMgr);
pUndoMgr->Undo();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=Sheet2.B2"), m_pDoc->GetFormula(0,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=Sheet2.B3"), m_pDoc->GetFormula(0,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", OUString("=Sheet2.B4"), m_pDoc->GetFormula(0,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=Sheet2.B2"_ustr, m_pDoc->GetFormula(0,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=Sheet2.B3"_ustr, m_pDoc->GetFormula(0,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula", u"=Sheet2.B4"_ustr, m_pDoc->GetFormula(0,2,0));
// TODO: We can't test redo yet as ScUndoDeleteTab::Redo() relies on
// view shell to do its thing.
@@ -1315,12 +1315,12 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasRefUpdateDeleteSheets)
CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasCopyPaste)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
// Fill formula cells B1:B10.
for (SCROW i = 0; i <= 9; ++i)
- m_pDoc->SetString(1, i, 0, "=RC[-1]");
+ m_pDoc->SetString(1, i, 0, u"=RC[-1]"_ustr);
ScAddress aPos(1, 8, 0); // B9
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(aPos);
@@ -1394,17 +1394,17 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasCopyPaste)
CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaInsertColumn)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Set shared formula group over H2:H3.
- m_pDoc->SetString(ScAddress(7,1,0), "=G3*B3");
- m_pDoc->SetString(ScAddress(7,2,0), "=G4*B4");
+ m_pDoc->SetString(ScAddress(7,1,0), u"=G3*B3"_ustr);
+ m_pDoc->SetString(ScAddress(7,2,0), u"=G4*B4"_ustr);
// Insert a single column at Column F. This used to crash before fdo#74041.
m_pDoc->InsertCol(ScRange(5,0,0,5,m_pDoc->MaxRow(),0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=H3*B3"), m_pDoc->GetFormula(8,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=H4*B4"), m_pDoc->GetFormula(8,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=H3*B3"_ustr, m_pDoc->GetFormula(8,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=H4*B4"_ustr, m_pDoc->GetFormula(8,2,0));
m_pDoc->DeleteTab(0);
}
@@ -1414,7 +1414,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaMoveBlock)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Set values to A1:A3.
m_pDoc->SetValue(ScAddress(0,0,0), 1.0);
@@ -1422,9 +1422,9 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaMoveBlock)
m_pDoc->SetValue(ScAddress(0,2,0), 3.0);
// Set formulas in B1:B3 to reference A1:A3.
- m_pDoc->SetString(ScAddress(1,0,0), "=RC[-1]");
- m_pDoc->SetString(ScAddress(1,1,0), "=RC[-1]");
- m_pDoc->SetString(ScAddress(1,2,0), "=RC[-1]");
+ m_pDoc->SetString(ScAddress(1,0,0), u"=RC[-1]"_ustr);
+ m_pDoc->SetString(ScAddress(1,1,0), u"=RC[-1]"_ustr);
+ m_pDoc->SetString(ScAddress(1,2,0), u"=RC[-1]"_ustr);
ScRange aFormulaRange(1,0,0,1,2,0);
@@ -1477,7 +1477,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaMoveBlock)
// Set formulas to B1:B5.
for (SCROW i = 0; i <= 4; ++i)
- m_pDoc->SetString(ScAddress(1,i,0), "=RC[-1]");
+ m_pDoc->SetString(ScAddress(1,i,0), u"=RC[-1]"_ustr);
// Check the initial formula results.
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(1,0,0)));
@@ -1518,7 +1518,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUpdateOnNamedRangeChang
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
const char* const pName = "MyRange";
const char* const pExpr1 = "$Test.$A$1:$A$3";
@@ -1541,16 +1541,16 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUpdateOnNamedRangeChang
m_pDoc->SetValue(ScAddress(0,3,0), 4.0);
// Set formula to B1:B3.
- m_pDoc->SetString(ScAddress(1,0,0), "=SUM(MyRange)");
- m_pDoc->SetString(ScAddress(1,1,0), "=SUM(MyRange)");
- m_pDoc->SetString(ScAddress(1,2,0), "=SUM(MyRange)");
+ m_pDoc->SetString(ScAddress(1,0,0), u"=SUM(MyRange)"_ustr);
+ m_pDoc->SetString(ScAddress(1,1,0), u"=SUM(MyRange)"_ustr);
+ m_pDoc->SetString(ScAddress(1,2,0), u"=SUM(MyRange)"_ustr);
// Set single formula with no named range to B5.
- m_pDoc->SetString(ScAddress(1,4,0), "=ROW()");
+ m_pDoc->SetString(ScAddress(1,4,0), u"=ROW()"_ustr);
// Set shared formula with no named range to B7:B8.
- m_pDoc->SetString(ScAddress(1,6,0), "=ROW()");
- m_pDoc->SetString(ScAddress(1,7,0), "=ROW()");
+ m_pDoc->SetString(ScAddress(1,6,0), u"=ROW()"_ustr);
+ m_pDoc->SetString(ScAddress(1,7,0), u"=ROW()"_ustr);
// B1:B3 should be grouped.
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
@@ -1573,7 +1573,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUpdateOnNamedRangeChang
CPPUNIT_ASSERT_EQUAL(8.0, m_pDoc->GetValue(ScAddress(1,7,0)));
// Set a single formula to C1.
- m_pDoc->SetString(ScAddress(2,0,0), "=AVERAGE(MyRange)");
+ m_pDoc->SetString(ScAddress(2,0,0), u"=AVERAGE(MyRange)"_ustr);
pFC = m_pDoc->GetFormulaCell(ScAddress(2,0,0));
CPPUNIT_ASSERT(pFC);
CPPUNIT_ASSERT_MESSAGE("C1 should not be shared.", !pFC->IsShared());
@@ -1594,13 +1594,13 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUpdateOnNamedRangeChang
rFunc.ModifyAllRangeNames(aNewNames);
// Check to make sure all displayed formulas are still good.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(MyRange)"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(MyRange)"), m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(MyRange)"), m_pDoc->GetFormula(1,2,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=ROW()"), m_pDoc->GetFormula(1,4,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=ROW()"), m_pDoc->GetFormula(1,6,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=ROW()"), m_pDoc->GetFormula(1,7,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=AVERAGE(MyRange)"), m_pDoc->GetFormula(2,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(MyRange)"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(MyRange)"_ustr, m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(MyRange)"_ustr, m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=ROW()"_ustr, m_pDoc->GetFormula(1,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=ROW()"_ustr, m_pDoc->GetFormula(1,6,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=ROW()"_ustr, m_pDoc->GetFormula(1,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=AVERAGE(MyRange)"_ustr, m_pDoc->GetFormula(2,0,0));
// Check the calculation results as well.
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(1,0,0)));
@@ -1624,7 +1624,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUpdateOnDBChange)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "RangeTest");
+ m_pDoc->InsertTab(0, u"RangeTest"_ustr);
// Put 1, 2, 3, 4 in A1:A4.
for (SCROW i = 0; i <= 3; ++i)
@@ -1634,13 +1634,13 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUpdateOnDBChange)
CPPUNIT_ASSERT_MESSAGE("Failed to fetch DB collection object.", pDBs);
// Define database range 'MyRange' for A1:A2.
- std::unique_ptr<ScDBData> pData(new ScDBData("MyRange", 0, 0, 0, 0, 1));
+ std::unique_ptr<ScDBData> pData(new ScDBData(u"MyRange"_ustr, 0, 0, 0, 0, 1));
bool bInserted = pDBs->getNamedDBs().insert(std::move(pData));
CPPUNIT_ASSERT_MESSAGE("Failed to insert a new database range.", bInserted);
// Insert in C2:C4 a group of formula cells that reference MyRange.
for (SCROW i = 1; i <= 3; ++i)
- m_pDoc->SetString(ScAddress(2,i,0), "=SUM(MyRange)");
+ m_pDoc->SetString(ScAddress(2,i,0), u"=SUM(MyRange)"_ustr);
// Make sure C2:C4 is a formula group.
const ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(2,1,0));
@@ -1657,7 +1657,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUpdateOnDBChange)
// Change the range referenced by MyRange to A1:A4.
ScDBCollection aNewDBs(*m_pDoc);
- std::unique_ptr<ScDBData> pNewData(new ScDBData("MyRange", 0, 0, 0, 0, 3));
+ std::unique_ptr<ScDBData> pNewData(new ScDBData(u"MyRange"_ustr, 0, 0, 0, 0, 3));
bInserted = aNewDBs.getNamedDBs().insert(std::move(pNewData));
CPPUNIT_ASSERT_MESSAGE("Failed to insert a new database range.", bInserted);
@@ -1691,7 +1691,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaAbsCellListener)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
m_pDoc->SetValue(ScAddress(0,0,0), 1.0);
@@ -1742,7 +1742,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
const std::vector<std::vector<const char*>> aData = {
{ "=SUM(B1:B2)", "1" },
@@ -1798,19 +1798,19 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
// Directly set a different formula cell, which bypasses
// ScDocument::SetString(), mimicking formula input in view.
{
- ScFormulaCell* pCell = new ScFormulaCell( *m_pDoc, aPos, "=B4");
+ ScFormulaCell* pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B4"_ustr);
ScDocFunc& rDocFunc = m_xDocShell->GetDocFunc();
rDocFunc.SetFormulaCell( aPos, pCell, false);
}
break;
case 1:
- m_pDoc->SetString( aPos, "=B4"); // set formula
+ m_pDoc->SetString( aPos, u"=B4"_ustr); // set formula
break;
case 2:
- m_pDoc->SetString( aPos, "x"); // set string
+ m_pDoc->SetString( aPos, u"x"_ustr); // set string
break;
case 3:
- m_pDoc->SetString( aPos, "4096"); // set number/numeric
+ m_pDoc->SetString( aPos, u"4096"_ustr); // set number/numeric
break;
case 4:
m_pDoc->SetValue( aPos, 4096.0); // set numeric
@@ -1821,7 +1821,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
case 6:
// Set formula cell vector.
{
- ScFormulaCell* pCell = new ScFormulaCell( *m_pDoc, aPos, "=B4");
+ ScFormulaCell* pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B4"_ustr);
std::vector<ScFormulaCell*> aCells { pCell };
m_pDoc->SetFormulaCells( aPos, aCells);
}
@@ -1884,10 +1884,10 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
// Add grouping formulas in A1:A2, keep A3:A7
aPos = ScAddress(0,0,0);
std::vector<ScFormulaCell*>().swap( aCells);
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=SUM(B1:C1)");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=SUM(B1:C1)"_ustr);
aCells.push_back(pCell);
aPos.IncRow();
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=SUM(B2:C2)");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=SUM(B2:C2)"_ustr);
aCells.push_back(pCell);
aPos.IncRow(-1);
m_pDoc->SetFormulaCells( aPos, aCells);
@@ -1909,10 +1909,10 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
// Add formulas in A1:A2, keep A3:A7
aPos = ScAddress(0,0,0);
std::vector<ScFormulaCell*>().swap( aCells);
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B1+C1");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B1+C1"_ustr);
aCells.push_back(pCell);
aPos.IncRow();
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B2+C2");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B2+C2"_ustr);
aCells.push_back(pCell);
aPos.IncRow(-1);
m_pDoc->SetFormulaCells( aPos, aCells);
@@ -1940,10 +1940,10 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
// Add formula in A2, overwrite A3, keep A4:A7
aPos = ScAddress(0,1,0);
std::vector<ScFormulaCell*>().swap( aCells);
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B2+C2");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B2+C2"_ustr);
aCells.push_back(pCell);
aPos.IncRow();
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B3+C3");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B3+C3"_ustr);
aCells.push_back(pCell);
aPos.IncRow(-1);
m_pDoc->SetFormulaCells( aPos, aCells);
@@ -1971,10 +1971,10 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
// Overwrite A3:A4, keep A5:A7
aPos = ScAddress(0,2,0);
std::vector<ScFormulaCell*>().swap( aCells);
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B3+C3");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B3+C3"_ustr);
aCells.push_back(pCell);
aPos.IncRow();
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B4+C4");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B4+C4"_ustr);
aCells.push_back(pCell);
aPos.IncRow(-1);
m_pDoc->SetFormulaCells( aPos, aCells);
@@ -2003,10 +2003,10 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
// Keep A3, overwrite A4:A5, keep A6:A7
aPos = ScAddress(0,3,0);
std::vector<ScFormulaCell*>().swap( aCells);
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B4+C4");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B4+C4"_ustr);
aCells.push_back(pCell);
aPos.IncRow();
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B5+C5");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B5+C5"_ustr);
aCells.push_back(pCell);
aPos.IncRow(-1);
m_pDoc->SetFormulaCells( aPos, aCells);
@@ -2039,10 +2039,10 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
// Keep A3:A4, overwrite A5:A6, keep A7
aPos = ScAddress(0,4,0);
std::vector<ScFormulaCell*>().swap( aCells);
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B5+C5");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B5+C5"_ustr);
aCells.push_back(pCell);
aPos.IncRow();
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B6+C6");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B6+C6"_ustr);
aCells.push_back(pCell);
aPos.IncRow(-1);
m_pDoc->SetFormulaCells( aPos, aCells);
@@ -2075,10 +2075,10 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
// Keep A3:A5, overwrite A6:A7
aPos = ScAddress(0,5,0);
std::vector<ScFormulaCell*>().swap( aCells);
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B6+C6");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B6+C6"_ustr);
aCells.push_back(pCell);
aPos.IncRow();
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B7+C7");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B7+C7"_ustr);
aCells.push_back(pCell);
aPos.IncRow(-1);
m_pDoc->SetFormulaCells( aPos, aCells);
@@ -2107,10 +2107,10 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
// Keep A3:A6, overwrite A7, add A8
aPos = ScAddress(0,6,0);
std::vector<ScFormulaCell*>().swap( aCells);
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B7+C7");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B7+C7"_ustr);
aCells.push_back(pCell);
aPos.IncRow();
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B8+C8");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B8+C8"_ustr);
aCells.push_back(pCell);
aPos.IncRow(-1);
m_pDoc->SetFormulaCells( aPos, aCells);
@@ -2139,10 +2139,10 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
// Keep A3:A7, add A8:A9
aPos = ScAddress(0,7,0);
std::vector<ScFormulaCell*>().swap( aCells);
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B8+C8");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B8+C8"_ustr);
aCells.push_back(pCell);
aPos.IncRow();
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=B9+C9");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=B9+C9"_ustr);
aCells.push_back(pCell);
aPos.IncRow(-1);
m_pDoc->SetFormulaCells( aPos, aCells);
@@ -2171,10 +2171,10 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
// Keep A3:A7, add grouping formulas in A8:A9
aPos = ScAddress(0,7,0);
std::vector<ScFormulaCell*>().swap( aCells);
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=SUM(B8:C8)");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=SUM(B8:C8)"_ustr);
aCells.push_back(pCell);
aPos.IncRow();
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=SUM(B9:C9)");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=SUM(B9:C9)"_ustr);
aCells.push_back(pCell);
aPos.IncRow(-1);
m_pDoc->SetFormulaCells( aPos, aCells);
@@ -2197,10 +2197,10 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUnshareAreaListeners)
// Overwrite grouping formulas in A4:A5
aPos = ScAddress(0,3,0);
std::vector<ScFormulaCell*>().swap( aCells);
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=SUM(B4:C4)");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=SUM(B4:C4)"_ustr);
aCells.push_back(pCell);
aPos.IncRow();
- pCell = new ScFormulaCell( *m_pDoc, aPos, "=SUM(B5:C5)");
+ pCell = new ScFormulaCell( *m_pDoc, aPos, u"=SUM(B5:C5)"_ustr);
aCells.push_back(pCell);
aPos.IncRow(-1);
m_pDoc->SetFormulaCells( aPos, aCells);
@@ -2226,8 +2226,8 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaListenerDeleteArea)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test0");
- m_pDoc->InsertTab(1, "Test1");
+ m_pDoc->InsertTab(0, u"Test0"_ustr);
+ m_pDoc->InsertTab(1, u"Test1"_ustr);
const std::vector<std::vector<const char*>> aData0 = {
{ "", "", "=Test1.C1" },
@@ -2270,7 +2270,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUpdateOnReplacement)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
const std::vector<std::vector<const char*>> aData = {
{ "1" },
@@ -2396,7 +2396,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaUpdateOnReplacement)
}
// Replace A4 with 0.
- m_pDoc->SetString( ScAddress(0,3,0), "0");
+ m_pDoc->SetString( ScAddress(0,3,0), u"0"_ustr);
// Check that A2:A3 and A5:A8 are formula groups.
pFC = m_pDoc->GetFormulaCell(ScAddress(0,1,0));
@@ -2425,7 +2425,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaDeleteTopCell)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
const std::vector<std::vector<const char*>> aData = {
{ "=SUM(B$1:B$2)", "1" },
@@ -2455,7 +2455,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaDeleteTopCell)
CPPUNIT_ASSERT_EQUAL( 3.0, m_pDoc->GetValue( ScAddress(0,1,0)));
// Replace B1 with 4.
- m_pDoc->SetString( ScAddress(1,0,0), "4");
+ m_pDoc->SetString( ScAddress(1,0,0), u"4"_ustr);
// Check result A2.
CPPUNIT_ASSERT_EQUAL( 6.0, m_pDoc->GetValue( ScAddress(0,1,0)));
@@ -2469,7 +2469,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaCutCopyMoveIntoRef)
// tdf#123714 case 1
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Data in A1:C3
std::vector<std::vector<const char*>> aData = {
@@ -2505,7 +2505,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaCutCopyMoveIntoRef)
// tdf#123714 case 2
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Data in A1:C3
std::vector<std::vector<const char*>> aData = {
@@ -2582,7 +2582,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaCutCopyMoveWithRef)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Data in A1:C4
std::vector<std::vector<const char*>> aData = {
@@ -2653,7 +2653,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaCutCopyMoveWithinRun)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Data in C3:E9
const std::vector<std::vector<const char*>> aData = {
@@ -2729,7 +2729,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulaInsertShift)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Data in A1:C2
const std::vector<std::vector<const char*>> aData = {
diff --git a/sc/qa/unit/ucalc_solver.cxx b/sc/qa/unit/ucalc_solver.cxx
index 06feb5347db4..9a8025c248b9 100644
--- a/sc/qa/unit/ucalc_solver.cxx
+++ b/sc/qa/unit/ucalc_solver.cxx
@@ -20,7 +20,7 @@ class SolverTest : public ScModelTestBase
{
public:
SolverTest()
- : ScModelTestBase("sc/qa/unit/data")
+ : ScModelTestBase(u"sc/qa/unit/data"_ustr)
{
}
@@ -59,17 +59,17 @@ void SolverTest::TestConstraintsModelA(SolverSettings* pSettings)
{
std::vector<ModelConstraint> aConstraints = pSettings->GetConstraints();
- CPPUNIT_ASSERT_EQUAL(OUString("$C$1:$C$10"), aConstraints[0].aLeftStr);
+ CPPUNIT_ASSERT_EQUAL(u"$C$1:$C$10"_ustr, aConstraints[0].aLeftStr);
CPPUNIT_ASSERT_EQUAL(CO_LESS_EQUAL, aConstraints[0].nOperator);
- CPPUNIT_ASSERT_EQUAL(OUString("100"), aConstraints[0].aRightStr);
+ CPPUNIT_ASSERT_EQUAL(u"100"_ustr, aConstraints[0].aRightStr);
- CPPUNIT_ASSERT_EQUAL(OUString("$F$5"), aConstraints[1].aLeftStr);
+ CPPUNIT_ASSERT_EQUAL(u"$F$5"_ustr, aConstraints[1].aLeftStr);
CPPUNIT_ASSERT_EQUAL(CO_EQUAL, aConstraints[1].nOperator);
- CPPUNIT_ASSERT_EQUAL(OUString("500"), aConstraints[1].aRightStr);
+ CPPUNIT_ASSERT_EQUAL(u"500"_ustr, aConstraints[1].aRightStr);
- CPPUNIT_ASSERT_EQUAL(OUString("$D$1:$D$5"), aConstraints[2].aLeftStr);
+ CPPUNIT_ASSERT_EQUAL(u"$D$1:$D$5"_ustr, aConstraints[2].aLeftStr);
CPPUNIT_ASSERT_EQUAL(CO_BINARY, aConstraints[2].nOperator);
- CPPUNIT_ASSERT_EQUAL(OUString(""), aConstraints[2].aRightStr);
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, aConstraints[2].aRightStr);
}
/* This test creates a model in a single tab and test if the model info
@@ -85,27 +85,27 @@ CPPUNIT_TEST_FIXTURE(SolverTest, testSingleModel)
// Test solver default settings on an empty tab
// Here we only test default settings that are not engine-dependent
- CPPUNIT_ASSERT_EQUAL(OUString(""), pSettings->GetParameter(SP_OBJ_CELL));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pSettings->GetParameter(SP_OBJ_CELL));
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(OT_MAXIMIZE),
pSettings->GetParameter(SP_OBJ_TYPE).toInt32());
- CPPUNIT_ASSERT_EQUAL(OUString(""), pSettings->GetParameter(SP_OBJ_VAL));
- CPPUNIT_ASSERT_EQUAL(OUString(""), pSettings->GetParameter(SP_VAR_CELLS));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pSettings->GetParameter(SP_OBJ_VAL));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pSettings->GetParameter(SP_VAR_CELLS));
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pSettings->GetParameter(SP_CONSTR_COUNT).toInt32());
// Create a simple model
- pSettings->SetParameter(SP_OBJ_CELL, OUString("$A$1"));
+ pSettings->SetParameter(SP_OBJ_CELL, u"$A$1"_ustr);
pSettings->SetParameter(SP_OBJ_TYPE, OUString::number(OT_MINIMIZE));
pSettings->SetParameter(SP_OBJ_VAL, OUString::number(0));
- pSettings->SetParameter(SP_VAR_CELLS, OUString("$D$1:$D$5"));
+ pSettings->SetParameter(SP_VAR_CELLS, u"$D$1:$D$5"_ustr);
std::vector<ModelConstraint> aConstraints = CreateConstraintsModelA();
pSettings->SetConstraints(aConstraints);
// Test if the model parameters were set
- CPPUNIT_ASSERT_EQUAL(OUString("$A$1"), pSettings->GetParameter(SP_OBJ_CELL));
+ CPPUNIT_ASSERT_EQUAL(u"$A$1"_ustr, pSettings->GetParameter(SP_OBJ_CELL));
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(OT_MINIMIZE),
pSettings->GetParameter(SP_OBJ_TYPE).toInt32());
- CPPUNIT_ASSERT_EQUAL(OUString("0"), pSettings->GetParameter(SP_OBJ_VAL));
- CPPUNIT_ASSERT_EQUAL(OUString("$D$1:$D$5"), pSettings->GetParameter(SP_VAR_CELLS));
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pSettings->GetParameter(SP_OBJ_VAL));
+ CPPUNIT_ASSERT_EQUAL(u"$D$1:$D$5"_ustr, pSettings->GetParameter(SP_VAR_CELLS));
// Test if the constraints were correctly set before saving
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), pSettings->GetParameter(SP_CONSTR_COUNT).toInt32());
@@ -113,18 +113,18 @@ CPPUNIT_TEST_FIXTURE(SolverTest, testSingleModel)
// Save and reload the file
pSettings->SaveSolverSettings();
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
pTable = pDoc->FetchTable(0);
pSettings = pTable->GetSolverSettings();
CPPUNIT_ASSERT(pSettings);
// Test if the model parameters remain set in the file
- CPPUNIT_ASSERT_EQUAL(OUString("$A$1"), pSettings->GetParameter(SP_OBJ_CELL));
+ CPPUNIT_ASSERT_EQUAL(u"$A$1"_ustr, pSettings->GetParameter(SP_OBJ_CELL));
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(OT_MINIMIZE),
pSettings->GetParameter(SP_OBJ_TYPE).toInt32());
- CPPUNIT_ASSERT_EQUAL(OUString("0"), pSettings->GetParameter(SP_OBJ_VAL));
- CPPUNIT_ASSERT_EQUAL(OUString("$D$1:$D$5"), pSettings->GetParameter(SP_VAR_CELLS));
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pSettings->GetParameter(SP_OBJ_VAL));
+ CPPUNIT_ASSERT_EQUAL(u"$D$1:$D$5"_ustr, pSettings->GetParameter(SP_VAR_CELLS));
// Test if the constraints remain correct after saving
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), pSettings->GetParameter(SP_CONSTR_COUNT).toInt32());
@@ -141,26 +141,26 @@ CPPUNIT_TEST_FIXTURE(SolverTest, tdf156815)
CPPUNIT_ASSERT(pSettings);
// Check current values in the solver model
- CPPUNIT_ASSERT_EQUAL(OUString("$Sheet2.$A$1"), pSettings->GetParameter(SP_OBJ_CELL));
- CPPUNIT_ASSERT_EQUAL(OUString("$Sheet2.$A$3:$B$3"), pSettings->GetParameter(SP_VAR_CELLS));
+ CPPUNIT_ASSERT_EQUAL(u"$Sheet2.$A$1"_ustr, pSettings->GetParameter(SP_OBJ_CELL));
+ CPPUNIT_ASSERT_EQUAL(u"$Sheet2.$A$3:$B$3"_ustr, pSettings->GetParameter(SP_VAR_CELLS));
std::vector<ModelConstraint> aConstraints = pSettings->GetConstraints();
- CPPUNIT_ASSERT_EQUAL(OUString("$Sheet2.$A$2"), aConstraints[0].aLeftStr);
- CPPUNIT_ASSERT_EQUAL(OUString("$Sheet2.$B$2"), aConstraints[0].aRightStr);
+ CPPUNIT_ASSERT_EQUAL(u"$Sheet2.$A$2"_ustr, aConstraints[0].aLeftStr);
+ CPPUNIT_ASSERT_EQUAL(u"$Sheet2.$B$2"_ustr, aConstraints[0].aRightStr);
// Rename Sheet2 to NewName
ScDocFunc& rDocFunc = getScDocShell()->GetDocFunc();
- rDocFunc.RenameTable(1, "NewName", false, true);
+ rDocFunc.RenameTable(1, u"NewName"_ustr, false, true);
// Check whether the ranges where updated
pSettings = pTable->GetSolverSettings();
CPPUNIT_ASSERT(pSettings);
- CPPUNIT_ASSERT_EQUAL(OUString("$NewName.$A$1"), pSettings->GetParameter(SP_OBJ_CELL));
- CPPUNIT_ASSERT_EQUAL(OUString("$NewName.$A$3:$B$3"), pSettings->GetParameter(SP_VAR_CELLS));
+ CPPUNIT_ASSERT_EQUAL(u"$NewName.$A$1"_ustr, pSettings->GetParameter(SP_OBJ_CELL));
+ CPPUNIT_ASSERT_EQUAL(u"$NewName.$A$3:$B$3"_ustr, pSettings->GetParameter(SP_VAR_CELLS));
aConstraints = pSettings->GetConstraints();
- CPPUNIT_ASSERT_EQUAL(OUString("$NewName.$A$2"), aConstraints[0].aLeftStr);
- CPPUNIT_ASSERT_EQUAL(OUString("$NewName.$B$2"), aConstraints[0].aRightStr);
+ CPPUNIT_ASSERT_EQUAL(u"$NewName.$A$2"_ustr, aConstraints[0].aLeftStr);
+ CPPUNIT_ASSERT_EQUAL(u"$NewName.$B$2"_ustr, aConstraints[0].aRightStr);
}
// Tests if settings for the DEPS and SCO solvers are kept in the file
@@ -173,23 +173,23 @@ CPPUNIT_TEST_FIXTURE(SolverTest, tdf158735)
ScTable* pTable = pDoc->FetchTable(0);
std::shared_ptr<sc::SolverSettings> pSettings = pTable->GetSolverSettings();
CPPUNIT_ASSERT(pSettings);
- CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.comp.Calc.NLPSolver.DEPSSolverImpl"),
+ CPPUNIT_ASSERT_EQUAL(u"com.sun.star.comp.Calc.NLPSolver.DEPSSolverImpl"_ustr,
pSettings->GetParameter(SP_LO_ENGINE));
- CPPUNIT_ASSERT_EQUAL(OUString("0.45"), pSettings->GetParameter(SP_AGENT_SWITCH_RATE));
- CPPUNIT_ASSERT_EQUAL(OUString("0.85"), pSettings->GetParameter(SP_CROSSOVER_PROB));
- CPPUNIT_ASSERT_EQUAL(OUString("1500"), pSettings->GetParameter(SP_LEARNING_CYCLES));
- CPPUNIT_ASSERT_EQUAL(OUString("0"), pSettings->GetParameter(SP_ENHANCED_STATUS));
+ CPPUNIT_ASSERT_EQUAL(u"0.45"_ustr, pSettings->GetParameter(SP_AGENT_SWITCH_RATE));
+ CPPUNIT_ASSERT_EQUAL(u"0.85"_ustr, pSettings->GetParameter(SP_CROSSOVER_PROB));
+ CPPUNIT_ASSERT_EQUAL(u"1500"_ustr, pSettings->GetParameter(SP_LEARNING_CYCLES));
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pSettings->GetParameter(SP_ENHANCED_STATUS));
// Test the non-default values of the SCO model
pTable = pDoc->FetchTable(1);
pSettings = pTable->GetSolverSettings();
CPPUNIT_ASSERT(pSettings);
- CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.comp.Calc.NLPSolver.SCOSolverImpl"),
+ CPPUNIT_ASSERT_EQUAL(u"com.sun.star.comp.Calc.NLPSolver.SCOSolverImpl"_ustr,
pSettings->GetParameter(SP_LO_ENGINE));
- CPPUNIT_ASSERT_EQUAL(OUString("180"), pSettings->GetParameter(SP_LIBRARY_SIZE));
- CPPUNIT_ASSERT_EQUAL(OUString("0.00055"), pSettings->GetParameter(SP_STAGNATION_TOLERANCE));
- CPPUNIT_ASSERT_EQUAL(OUString("1"), pSettings->GetParameter(SP_RND_STARTING_POINT));
- CPPUNIT_ASSERT_EQUAL(OUString("80"), pSettings->GetParameter(SP_STAGNATION_LIMIT));
+ CPPUNIT_ASSERT_EQUAL(u"180"_ustr, pSettings->GetParameter(SP_LIBRARY_SIZE));
+ CPPUNIT_ASSERT_EQUAL(u"0.00055"_ustr, pSettings->GetParameter(SP_STAGNATION_TOLERANCE));
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pSettings->GetParameter(SP_RND_STARTING_POINT));
+ CPPUNIT_ASSERT_EQUAL(u"80"_ustr, pSettings->GetParameter(SP_STAGNATION_LIMIT));
}
// Tests if range addresses from XLSX files that belong to the same sheet are not imported
@@ -203,17 +203,17 @@ CPPUNIT_TEST_FIXTURE(SolverTest, tdf156814)
std::shared_ptr<sc::SolverSettings> pSettings = pTable->GetSolverSettings();
CPPUNIT_ASSERT(pSettings);
// Ranges must not contain the sheet name
- CPPUNIT_ASSERT_EQUAL(OUString("$F$2"), pSettings->GetParameter(SP_OBJ_CELL));
- CPPUNIT_ASSERT_EQUAL(OUString("$A$2:$A$11,$C$2:$D$11"), pSettings->GetParameter(SP_VAR_CELLS));
+ CPPUNIT_ASSERT_EQUAL(u"$F$2"_ustr, pSettings->GetParameter(SP_OBJ_CELL));
+ CPPUNIT_ASSERT_EQUAL(u"$A$2:$A$11,$C$2:$D$11"_ustr, pSettings->GetParameter(SP_VAR_CELLS));
// Check also the constraints (ranges must not contain sheet name either)
std::vector<ModelConstraint> aConstraints = pSettings->GetConstraints();
- CPPUNIT_ASSERT_EQUAL(OUString("$H$2:$H$11"), aConstraints[0].aLeftStr);
- CPPUNIT_ASSERT_EQUAL(OUString("$I$2:$I$11"), aConstraints[0].aRightStr);
- CPPUNIT_ASSERT_EQUAL(OUString("$H$2:$H$11"), aConstraints[1].aLeftStr);
- CPPUNIT_ASSERT_EQUAL(OUString("10"), aConstraints[1].aRightStr);
- CPPUNIT_ASSERT_EQUAL(OUString("$I$2:$I$11"), aConstraints[2].aLeftStr);
- CPPUNIT_ASSERT_EQUAL(OUString("0"), aConstraints[2].aRightStr);
+ CPPUNIT_ASSERT_EQUAL(u"$H$2:$H$11"_ustr, aConstraints[0].aLeftStr);
+ CPPUNIT_ASSERT_EQUAL(u"$I$2:$I$11"_ustr, aConstraints[0].aRightStr);
+ CPPUNIT_ASSERT_EQUAL(u"$H$2:$H$11"_ustr, aConstraints[1].aLeftStr);
+ CPPUNIT_ASSERT_EQUAL(u"10"_ustr, aConstraints[1].aRightStr);
+ CPPUNIT_ASSERT_EQUAL(u"$I$2:$I$11"_ustr, aConstraints[2].aLeftStr);
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, aConstraints[2].aRightStr);
}
// Tests if all named ranges and expressions are hidden in the existing model
diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx
index 17e244462f7a..b1178bc29303 100644
--- a/sc/qa/unit/ucalc_sort.cxx
+++ b/sc/qa/unit/ucalc_sort.cxx
@@ -42,7 +42,7 @@ protected:
CPPUNIT_TEST_FIXTURE(TestSort, testSort)
{
- m_pDoc->InsertTab(0, "test1");
+ m_pDoc->InsertTab(0, u"test1"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
@@ -64,8 +64,8 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSort)
// Insert note in cell B2.
ScAddress rAddr(1, 1, 0);
ScPostIt* pNote = m_pDoc->GetOrCreateNote(rAddr);
- pNote->SetText(rAddr, "Hello");
- pNote->SetAuthor("Jim Bob");
+ pNote->SetText(rAddr, u"Hello"_ustr);
+ pNote->SetAuthor(u"Jim Bob"_ustr);
ScSortParam aSortData;
aSortData.nCol1 = 1;
@@ -116,17 +116,17 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSort)
// Title should stay at the top, numbers should be sorted numerically,
// numbers always come before strings, and empty cells always occur at the
// end.
- CPPUNIT_ASSERT_EQUAL(OUString("Title"), m_pDoc->GetString(aPos));
+ CPPUNIT_ASSERT_EQUAL(u"Title"_ustr, m_pDoc->GetString(aPos));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(OUString("1"), m_pDoc->GetString(aPos));
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, m_pDoc->GetString(aPos));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(OUString("9"), m_pDoc->GetString(aPos));
+ CPPUNIT_ASSERT_EQUAL(u"9"_ustr, m_pDoc->GetString(aPos));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(OUString("12"), m_pDoc->GetString(aPos));
+ CPPUNIT_ASSERT_EQUAL(u"12"_ustr, m_pDoc->GetString(aPos));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(OUString("123"), m_pDoc->GetString(aPos));
+ CPPUNIT_ASSERT_EQUAL(u"123"_ustr, m_pDoc->GetString(aPos));
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(OUString("b"), m_pDoc->GetString(aPos));
+ CPPUNIT_ASSERT_EQUAL(u"b"_ustr, m_pDoc->GetString(aPos));
aPos.IncRow();
CPPUNIT_ASSERT_EQUAL(CELLTYPE_NONE, m_pDoc->GetCellType(aPos));
@@ -138,7 +138,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortHorizontal)
SortRefUpdateSetter aUpdateSet;
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true);
- m_pDoc->InsertTab(0, "Sort");
+ m_pDoc->InsertTab(0, u"Sort"_ustr);
// Test case from fdo#78079.
@@ -152,12 +152,12 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortHorizontal)
// Insert raw data into A1:D4.
ScRange aDataRange = insertRangeData(m_pDoc, ScAddress(0,0,0), aData);
- CPPUNIT_ASSERT_EQUAL(OUString("A1:D4"), aDataRange.Format(*m_pDoc, ScRefFlags::VALID));
+ CPPUNIT_ASSERT_EQUAL(u"A1:D4"_ustr, aDataRange.Format(*m_pDoc, ScRefFlags::VALID));
// Check the formula values.
- CPPUNIT_ASSERT_EQUAL(OUString("Yes-No"), m_pDoc->GetString(ScAddress(3,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("No-No"), m_pDoc->GetString(ScAddress(3,2,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Yes-Yes"), m_pDoc->GetString(ScAddress(3,3,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Yes-No"_ustr, m_pDoc->GetString(ScAddress(3,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"No-No"_ustr, m_pDoc->GetString(ScAddress(3,2,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Yes-Yes"_ustr, m_pDoc->GetString(ScAddress(3,3,0)));
// Define A1:D4 as sheet-local anonymous database range.
m_pDoc->SetAnonymousDBData(
@@ -194,9 +194,9 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortHorizontal)
CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
}
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=CONCATENATE(C2;\"-\";D2)"), m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=CONCATENATE(C3;\"-\";D3)"), m_pDoc->GetFormula(1,2,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=CONCATENATE(C4;\"-\";D4)"), m_pDoc->GetFormula(1,3,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=CONCATENATE(C2;\"-\";D2)"_ustr, m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=CONCATENATE(C3;\"-\";D3)"_ustr, m_pDoc->GetFormula(1,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=CONCATENATE(C4;\"-\";D4)"_ustr, m_pDoc->GetFormula(1,3,0));
m_pDoc->DeleteTab(0);
}
@@ -204,7 +204,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortHorizontal)
CPPUNIT_TEST_FIXTURE(TestSort, testSortHorizontalWholeColumn)
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true);
- m_pDoc->InsertTab(0, "Sort");
+ m_pDoc->InsertTab(0, u"Sort"_ustr);
// 0 = empty cell
const std::vector<std::vector<const char*>> aData = {
@@ -216,7 +216,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortHorizontalWholeColumn)
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(2,0,0)));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(3,0,0)));
CPPUNIT_ASSERT_EQUAL(47.0, m_pDoc->GetValue(ScAddress(4,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), m_pDoc->GetString(ScAddress(5,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, m_pDoc->GetString(ScAddress(5,0,0)));
CPPUNIT_ASSERT_EQUAL(9.0, m_pDoc->GetValue(ScAddress(6,0,0)));
// Extend the sort range to whole column.
@@ -254,7 +254,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortHorizontalWholeColumn)
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(3,0,0)));
CPPUNIT_ASSERT_EQUAL(9.0, m_pDoc->GetValue(ScAddress(4,0,0)));
CPPUNIT_ASSERT_EQUAL(47.0, m_pDoc->GetValue(ScAddress(5,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), m_pDoc->GetString(ScAddress(6,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, m_pDoc->GetString(ScAddress(6,0,0)));
// Undo and check.
@@ -265,7 +265,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortHorizontalWholeColumn)
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(2,0,0)));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(3,0,0)));
CPPUNIT_ASSERT_EQUAL(47.0, m_pDoc->GetValue(ScAddress(4,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), m_pDoc->GetString(ScAddress(5,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, m_pDoc->GetString(ScAddress(5,0,0)));
CPPUNIT_ASSERT_EQUAL(9.0, m_pDoc->GetValue(ScAddress(6,0,0)));
// Redo and check.
@@ -274,7 +274,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortHorizontalWholeColumn)
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(3,0,0)));
CPPUNIT_ASSERT_EQUAL(9.0, m_pDoc->GetValue(ScAddress(4,0,0)));
CPPUNIT_ASSERT_EQUAL(47.0, m_pDoc->GetValue(ScAddress(5,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), m_pDoc->GetString(ScAddress(6,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, m_pDoc->GetString(ScAddress(6,0,0)));
m_pDoc->DeleteTab(0);
}
@@ -283,11 +283,11 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortSingleRow)
{
// This test case is from fdo#80462.
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Sort range consists of only one row.
- m_pDoc->SetString(ScAddress(0,0,0), "X");
- m_pDoc->SetString(ScAddress(1,0,0), "Y");
+ m_pDoc->SetString(ScAddress(0,0,0), u"X"_ustr);
+ m_pDoc->SetString(ScAddress(1,0,0), u"Y"_ustr);
// Define A1:B1 as sheet-local anonymous database range.
m_pDoc->SetAnonymousDBData(
@@ -317,7 +317,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortSingleRow)
clearSheet(m_pDoc, 0);
// A1:G1
- m_pDoc->SetString(ScAddress(0,0,0), "Header");
+ m_pDoc->SetString(ScAddress(0,0,0), u"Header"_ustr);
m_pDoc->SetValue(ScAddress(1,0,0), 1.0);
m_pDoc->SetValue(ScAddress(2,0,0), 10.0);
m_pDoc->SetValue(ScAddress(3,0,0), 3.0);
@@ -337,7 +337,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortSingleRow)
CPPUNIT_ASSERT(bSorted);
// Check the result.
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(1,0,0)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(2,0,0)));
CPPUNIT_ASSERT_EQUAL( 3.0, m_pDoc->GetValue(ScAddress(3,0,0)));
@@ -350,7 +350,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortSingleRow)
CPPUNIT_ASSERT(pUndoMgr);
pUndoMgr->Undo();
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(1,0,0)));
CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(2,0,0)));
CPPUNIT_ASSERT_EQUAL( 3.0, m_pDoc->GetValue(ScAddress(3,0,0)));
@@ -360,7 +360,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortSingleRow)
// Redo and check.
pUndoMgr->Redo();
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(1,0,0)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(2,0,0)));
CPPUNIT_ASSERT_EQUAL( 3.0, m_pDoc->GetValue(ScAddress(3,0,0)));
@@ -377,8 +377,8 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortWithFormulaRefs)
{
SortRefUpdateSetter aUpdateSet;
- m_pDoc->InsertTab(0, "List1");
- m_pDoc->InsertTab(1, "List2");
+ m_pDoc->InsertTab(0, u"List1"_ustr);
+ m_pDoc->InsertTab(1, u"List2"_ustr);
const char* aFormulaData[6] = {
"=IF($List1.A2<>\"\";$List1.A2;\"\")",
@@ -436,17 +436,17 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortWithFormulaRefs)
CPPUNIT_TEST_FIXTURE(TestSort, testSortWithStrings)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
ScFieldEditEngine& rEE = m_pDoc->GetEditEngine();
- rEE.SetTextCurrentDefaults("Val1");
- m_pDoc->SetString(ScAddress(1,1,0), "Header");
- m_pDoc->SetString(ScAddress(1,2,0), "Val2");
+ rEE.SetTextCurrentDefaults(u"Val1"_ustr);
+ m_pDoc->SetString(ScAddress(1,1,0), u"Header"_ustr);
+ m_pDoc->SetString(ScAddress(1,2,0), u"Val2"_ustr);
m_pDoc->SetEditText(ScAddress(1,3,0), rEE.CreateTextObject());
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(1,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Val2"), m_pDoc->GetString(ScAddress(1,2,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Val1"), m_pDoc->GetString(ScAddress(1,3,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(1,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Val2"_ustr, m_pDoc->GetString(ScAddress(1,2,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Val1"_ustr, m_pDoc->GetString(ScAddress(1,3,0)));
ScSortParam aParam;
aParam.nCol1 = 1;
@@ -461,17 +461,17 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortWithStrings)
m_pDoc->Sort(0, aParam, false, true, nullptr, nullptr);
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(1,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Val1"), m_pDoc->GetString(ScAddress(1,2,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Val2"), m_pDoc->GetString(ScAddress(1,3,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(1,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Val1"_ustr, m_pDoc->GetString(ScAddress(1,2,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Val2"_ustr, m_pDoc->GetString(ScAddress(1,3,0)));
aParam.maKeyState[0].bAscending = false;
m_pDoc->Sort(0, aParam, false, true, nullptr, nullptr);
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(1,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Val2"), m_pDoc->GetString(ScAddress(1,2,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Val1"), m_pDoc->GetString(ScAddress(1,3,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(1,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Val2"_ustr, m_pDoc->GetString(ScAddress(1,2,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Val1"_ustr, m_pDoc->GetString(ScAddress(1,3,0)));
m_pDoc->DeleteTab(0);
}
@@ -497,7 +497,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortInFormulaGroup)
{ 0, 9, "103" }, { 1, 9, "=A10" },
};
- m_pDoc->InsertTab(0, "sorttest");
+ m_pDoc->InsertTab(0, u"sorttest"_ustr);
for ( auto const & i: aEntries )
m_pDoc->SetString( i.nCol, i.nRow, 0,
@@ -628,13 +628,13 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortWithCellFormats)
} aCheck;
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// Insert some values into A1:A4.
- m_pDoc->SetString(ScAddress(0,0,0), "Header");
- m_pDoc->SetString(ScAddress(0,1,0), "Normal");
- m_pDoc->SetString(ScAddress(0,2,0), "Bold");
- m_pDoc->SetString(ScAddress(0,3,0), "Italic");
+ m_pDoc->SetString(ScAddress(0,0,0), u"Header"_ustr);
+ m_pDoc->SetString(ScAddress(0,1,0), u"Normal"_ustr);
+ m_pDoc->SetString(ScAddress(0,2,0), u"Bold"_ustr);
+ m_pDoc->SetString(ScAddress(0,3,0), u"Italic"_ustr);
// Set A3 bold and A4 italic.
const ScPatternAttr* pPat = m_pDoc->GetPattern(ScAddress(0,2,0));
@@ -684,10 +684,10 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortWithCellFormats)
CPPUNIT_ASSERT(bSorted);
// Check the sort result.
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Bold"), m_pDoc->GetString(ScAddress(0,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Italic"), m_pDoc->GetString(ScAddress(0,2,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Normal"), m_pDoc->GetString(ScAddress(0,3,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Bold"_ustr, m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Italic"_ustr, m_pDoc->GetString(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Normal"_ustr, m_pDoc->GetString(ScAddress(0,3,0)));
// A2 should be bold now.
bool bBold = aCheck.isBold(m_pDoc->GetPattern(ScAddress(0,1,0)));
@@ -711,10 +711,10 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
- m_pDoc->InsertTab(0, "Sort");
+ m_pDoc->InsertTab(0, u"Sort"_ustr);
// Set values to sort in column A.
- m_pDoc->SetString(ScAddress(0,0,0), "Header");
+ m_pDoc->SetString(ScAddress(0,0,0), u"Header"_ustr);
double aValues[] = { 4.0, 36.0, 14.0, 29.0, 98.0, 78.0, 0.0, 99.0, 1.0 };
size_t nCount = std::size(aValues);
@@ -722,9 +722,9 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate)
m_pDoc->SetValue(ScAddress(0,i+1,0), aValues[i]);
// Set formulas to reference these values in column C.
- m_pDoc->SetString(ScAddress(2,0,0), "Formula");
+ m_pDoc->SetString(ScAddress(2,0,0), u"Formula"_ustr);
for (size_t i = 0; i < nCount; ++i)
- m_pDoc->SetString(ScAddress(2,1+i,0), "=RC[-2]");
+ m_pDoc->SetString(ScAddress(2,1+i,0), u"=RC[-2]"_ustr);
// Check the values in column C.
for (size_t i = 0; i < nCount; ++i)
@@ -756,7 +756,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate)
double aSorted[] = { 0.0, 1.0, 4.0, 14.0, 29.0, 36.0, 78.0, 98.0, 99.0 };
// Check the sort result.
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
for (size_t i = 0; i < nCount; ++i)
{
double fCheck = aSorted[i];
@@ -772,14 +772,14 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate)
}
// C2 should now point to A4.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C2!", OUString("=R[2]C[-2]"), m_pDoc->GetFormula(2,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C2!", u"=R[2]C[-2]"_ustr, m_pDoc->GetFormula(2,1,0));
// Undo the sort.
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
pUndoMgr->Undo();
// Check the undo result.
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
for (size_t i = 0; i < nCount; ++i)
{
double fCheck = aValues[i];
@@ -795,12 +795,12 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate)
}
// C2 should now point to A2.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C2!", OUString("=RC[-2]"), m_pDoc->GetFormula(2,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C2!", u"=RC[-2]"_ustr, m_pDoc->GetFormula(2,1,0));
// Redo.
pUndoMgr->Redo();
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
for (size_t i = 0; i < nCount; ++i)
{
double fCheck = aSorted[i];
@@ -816,14 +816,14 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate)
}
// C2 should now point to A4.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C2!", OUString("=R[2]C[-2]"), m_pDoc->GetFormula(2,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in C2!", u"=R[2]C[-2]"_ustr, m_pDoc->GetFormula(2,1,0));
// Undo again.
pUndoMgr->Undo();
// Formulas in column C should all be "RC[-2]" again.
for (size_t i = 0; i < nCount; ++i)
- m_pDoc->SetString(ScAddress(2,1+i,0), "=RC[-2]");
+ m_pDoc->SetString(ScAddress(2,1+i,0), u"=RC[-2]"_ustr);
// Turn off reference update on sort.
SortTypeSetter::changeTo(false);
@@ -832,7 +832,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate)
CPPUNIT_ASSERT(bSorted);
// Check the sort result again.
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
for (size_t i = 0; i < nCount; ++i)
{
double fCheck = aSorted[i];
@@ -841,7 +841,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate)
// Formulas in column C should all remain "RC[-2]".
for (size_t i = 0; i < nCount; ++i)
- m_pDoc->SetString(ScAddress(2,1+i,0), "=RC[-2]");
+ m_pDoc->SetString(ScAddress(2,1+i,0), u"=RC[-2]"_ustr);
// The values in column C should now be the same as sorted values in column A.
m_pDoc->CalcAll(); // just in case...
@@ -861,7 +861,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate2)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
- m_pDoc->InsertTab(0, "Sort");
+ m_pDoc->InsertTab(0, u"Sort"_ustr);
// Set up the sheet.
const char* aData[][2] = {
@@ -920,7 +920,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate2)
// Formulas in column B should still point to their respective left neighbor cell.
for (SCROW i = 1; i <= 4; ++i)
{
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=RC[-1]"), m_pDoc->GetFormula(1,i,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=RC[-1]"_ustr, m_pDoc->GetFormula(1,i,0));
}
// Undo and check the result in column B.
@@ -948,7 +948,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate3)
SortRefUpdateSetter aUpdateSet;
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Sort");
+ m_pDoc->InsertTab(0, u"Sort"_ustr);
const char* pData[] = {
"Header",
@@ -964,7 +964,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate3)
m_pDoc->SetString(ScAddress(0,i,0), OUString::createFromAscii(pData[i]));
// Check the initial values.
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(ScAddress(0,2,0)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(0,3,0)));
@@ -993,7 +993,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate3)
// Check the sorted values.
m_pDoc->CalcAll();
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(0,2,0)));
CPPUNIT_ASSERT_EQUAL( 3.0, m_pDoc->GetValue(ScAddress(0,3,0)));
@@ -1001,15 +1001,15 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate3)
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(ScAddress(0,5,0)));
// Make sure the formula cells have been adjusted correctly.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A4.", OUString("=A2+A3"), m_pDoc->GetFormula(0,3,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", OUString("=A2+10"), m_pDoc->GetFormula(0,4,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", OUString("=A3+10"), m_pDoc->GetFormula(0,5,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A4.", u"=A2+A3"_ustr, m_pDoc->GetFormula(0,3,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A5.", u"=A2+10"_ustr, m_pDoc->GetFormula(0,4,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula in A6.", u"=A3+10"_ustr, m_pDoc->GetFormula(0,5,0));
// Undo and check the result.
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
pUndoMgr->Undo();
m_pDoc->CalcAll();
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(ScAddress(0,2,0)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(0,3,0)));
@@ -1019,7 +1019,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate3)
// Redo and check the result.
pUndoMgr->Redo();
m_pDoc->CalcAll();
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(0,2,0)));
CPPUNIT_ASSERT_EQUAL( 3.0, m_pDoc->GetValue(ScAddress(0,3,0)));
@@ -1047,9 +1047,9 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate4)
void TestSort::testSortRefUpdate4_Impl()
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Sort");
- m_pDoc->InsertTab(1, "Lesson1");
- m_pDoc->InsertTab(2, "Lesson2");
+ m_pDoc->InsertTab(0, u"Sort"_ustr);
+ m_pDoc->InsertTab(1, u"Lesson1"_ustr);
+ m_pDoc->InsertTab(2, u"Lesson2"_ustr);
{
const std::vector<std::vector<const char*>> aData = {
@@ -1126,12 +1126,12 @@ void TestSort::testSortRefUpdate4_Impl()
// Check the sorted values.
m_pDoc->CalcAll();
- CPPUNIT_ASSERT_EQUAL(OUString("Name"), m_pDoc->GetString(ScAddress(0,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Student3"), m_pDoc->GetString(ScAddress(0,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Student4"), m_pDoc->GetString(ScAddress(0,2,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Student5"), m_pDoc->GetString(ScAddress(0,3,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Student2"), m_pDoc->GetString(ScAddress(0,4,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Student1"), m_pDoc->GetString(ScAddress(0,5,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Name"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Student3"_ustr, m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Student4"_ustr, m_pDoc->GetString(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Student5"_ustr, m_pDoc->GetString(ScAddress(0,3,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Student2"_ustr, m_pDoc->GetString(ScAddress(0,4,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Student1"_ustr, m_pDoc->GetString(ScAddress(0,5,0)));
CPPUNIT_ASSERT_EQUAL( 6.0, m_pDoc->GetValue(ScAddress(3,1,0)));
CPPUNIT_ASSERT_EQUAL( 5.0, m_pDoc->GetValue(ScAddress(3,2,0)));
CPPUNIT_ASSERT_EQUAL( 4.0, m_pDoc->GetValue(ScAddress(3,3,0)));
@@ -1159,7 +1159,7 @@ void TestSort::testSortRefUpdate4_Impl()
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
pUndoMgr->Undo();
m_pDoc->CalcAll();
- CPPUNIT_ASSERT_EQUAL(OUString("Name"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Name"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(3,1,0)));
CPPUNIT_ASSERT_EQUAL( 3.0, m_pDoc->GetValue(ScAddress(3,2,0)));
CPPUNIT_ASSERT_EQUAL( 6.0, m_pDoc->GetValue(ScAddress(3,3,0)));
@@ -1169,7 +1169,7 @@ void TestSort::testSortRefUpdate4_Impl()
// Redo and check the result.
pUndoMgr->Redo();
m_pDoc->CalcAll();
- CPPUNIT_ASSERT_EQUAL(OUString("Name"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Name"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 6.0, m_pDoc->GetValue(ScAddress(3,1,0)));
CPPUNIT_ASSERT_EQUAL( 5.0, m_pDoc->GetValue(ScAddress(3,2,0)));
CPPUNIT_ASSERT_EQUAL( 4.0, m_pDoc->GetValue(ScAddress(3,3,0)));
@@ -1198,12 +1198,12 @@ void TestSort::testSortRefUpdate4_Impl()
// Check the sorted values.
m_pDoc->CalcAll();
- CPPUNIT_ASSERT_EQUAL(OUString("Name"), m_pDoc->GetString(ScAddress(0,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Student5"), m_pDoc->GetString(ScAddress(0,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Student4"), m_pDoc->GetString(ScAddress(0,2,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Student3"), m_pDoc->GetString(ScAddress(0,3,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Student2"), m_pDoc->GetString(ScAddress(0,4,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Student1"), m_pDoc->GetString(ScAddress(0,5,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Name"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Student5"_ustr, m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Student4"_ustr, m_pDoc->GetString(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Student3"_ustr, m_pDoc->GetString(ScAddress(0,3,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Student2"_ustr, m_pDoc->GetString(ScAddress(0,4,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Student1"_ustr, m_pDoc->GetString(ScAddress(0,5,0)));
CPPUNIT_ASSERT_EQUAL( 4.0, m_pDoc->GetValue(ScAddress(3,1,0)));
CPPUNIT_ASSERT_EQUAL( 5.0, m_pDoc->GetValue(ScAddress(3,2,0)));
CPPUNIT_ASSERT_EQUAL( 6.0, m_pDoc->GetValue(ScAddress(3,3,0)));
@@ -1244,7 +1244,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate5)
SortRefUpdateSetter aUpdateSet;
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Sort");
+ m_pDoc->InsertTab(0, u"Sort"_ustr);
double aValCheck[][3] = {
// Result, Unsorted order, Sorted result.
@@ -1348,7 +1348,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate6)
SortRefNoUpdateSetter aUpdateSet;
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Sort");
+ m_pDoc->InsertTab(0, u"Sort"_ustr);
const std::vector<std::vector<const char*>> aData = {
{ "Order", "Value", "1" },
@@ -1408,9 +1408,9 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortRefUpdate6)
}
// Make sure that the formulas in C2:C4 are not adjusted.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=C1+B2"), m_pDoc->GetFormula(2,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=C2+B3"), m_pDoc->GetFormula(2,2,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=C3+B4"), m_pDoc->GetFormula(2,3,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=C1+B2"_ustr, m_pDoc->GetFormula(2,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=C2+B3"_ustr, m_pDoc->GetFormula(2,2,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=C3+B4"_ustr, m_pDoc->GetFormula(2,3,0));
// Undo and check.
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();
@@ -1487,7 +1487,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortBroadcaster)
SortRefNoUpdateSetter aUpdateSet;
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Sort");
+ m_pDoc->InsertTab(0, u"Sort"_ustr);
{
const std::vector<std::vector<const char*>> aData = {
@@ -1543,17 +1543,17 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortBroadcaster)
}
// Make sure that the formulas in D1:G2 are not adjusted.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=B1"), m_pDoc->GetFormula(3,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=B2"), m_pDoc->GetFormula(3,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=$B$1"), m_pDoc->GetFormula(4,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=$B$2"), m_pDoc->GetFormula(4,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A1:B1)"), m_pDoc->GetFormula(5,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A2:B2)"), m_pDoc->GetFormula(5,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM($A$1:$B$1)"), m_pDoc->GetFormula(6,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM($A$2:$B$2)"), m_pDoc->GetFormula(6,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=B1"_ustr, m_pDoc->GetFormula(3,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=B2"_ustr, m_pDoc->GetFormula(3,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=$B$1"_ustr, m_pDoc->GetFormula(4,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=$B$2"_ustr, m_pDoc->GetFormula(4,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A1:B1)"_ustr, m_pDoc->GetFormula(5,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A2:B2)"_ustr, m_pDoc->GetFormula(5,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM($A$1:$B$1)"_ustr, m_pDoc->GetFormula(6,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM($A$2:$B$2)"_ustr, m_pDoc->GetFormula(6,1,0));
// Enter new value and check that it is broadcasted. First in empty cell.
- m_pDoc->SetString(1,1,0, "16");
+ m_pDoc->SetString(1,1,0, u"16"_ustr);
double nVal = m_pDoc->GetValue(3,1,0);
ASSERT_DOUBLES_EQUAL( 16.0, nVal);
nVal = m_pDoc->GetValue(4,1,0);
@@ -1564,7 +1564,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortBroadcaster)
ASSERT_DOUBLES_EQUAL( 17.0, nVal);
// Enter new value and check that it is broadcasted. Now overwriting data.
- m_pDoc->SetString(1,0,0, "32");
+ m_pDoc->SetString(1,0,0, u"32"_ustr);
nVal = m_pDoc->GetValue(3,0,0);
ASSERT_DOUBLES_EQUAL( 32.0, nVal);
nVal = m_pDoc->GetValue(4,0,0);
@@ -1646,17 +1646,17 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortBroadcaster)
}
// Make sure that the formulas in A8:B11 are not adjusted.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=A6"), m_pDoc->GetFormula(0,7,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=B6"), m_pDoc->GetFormula(1,7,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=$A$6"), m_pDoc->GetFormula(0,8,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=$B$6"), m_pDoc->GetFormula(1,8,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(A5:A6)"), m_pDoc->GetFormula(0,9,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM(B5:B6)"), m_pDoc->GetFormula(1,9,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM($A$5:$A$6)"), m_pDoc->GetFormula(0,10,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=SUM($B$5:$B$6)"), m_pDoc->GetFormula(1,10,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=A6"_ustr, m_pDoc->GetFormula(0,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=B6"_ustr, m_pDoc->GetFormula(1,7,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=$A$6"_ustr, m_pDoc->GetFormula(0,8,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=$B$6"_ustr, m_pDoc->GetFormula(1,8,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(A5:A6)"_ustr, m_pDoc->GetFormula(0,9,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM(B5:B6)"_ustr, m_pDoc->GetFormula(1,9,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM($A$5:$A$6)"_ustr, m_pDoc->GetFormula(0,10,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=SUM($B$5:$B$6)"_ustr, m_pDoc->GetFormula(1,10,0));
// Enter new value and check that it is broadcasted. First in empty cell.
- m_pDoc->SetString(1,5,0, "16");
+ m_pDoc->SetString(1,5,0, u"16"_ustr);
double nVal = m_pDoc->GetValue(1,7,0);
ASSERT_DOUBLES_EQUAL(16.0, nVal);
nVal = m_pDoc->GetValue(1,8,0);
@@ -1667,7 +1667,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortBroadcaster)
ASSERT_DOUBLES_EQUAL(17.0, nVal);
// Enter new value and check that it is broadcasted. Now overwriting data.
- m_pDoc->SetString(0,5,0, "32");
+ m_pDoc->SetString(0,5,0, u"32"_ustr);
nVal = m_pDoc->GetValue(0,7,0);
ASSERT_DOUBLES_EQUAL(32.0, nVal);
nVal = m_pDoc->GetValue(0,8,0);
@@ -1689,7 +1689,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortBroadcastBroadcaster)
SortRefNoUpdateSetter aUpdateSet;
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
- m_pDoc->InsertTab(0, "Sort");
+ m_pDoc->InsertTab(0, u"Sort"_ustr);
{
const std::vector<std::vector<const char*>> aData = {
@@ -1745,10 +1745,10 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortBroadcastBroadcaster)
}
// Make sure that the formulas in B1:C2 are not adjusted.
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=A1"), m_pDoc->GetFormula(1,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=A2"), m_pDoc->GetFormula(1,1,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=B1"), m_pDoc->GetFormula(2,0,0));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", OUString("=B2"), m_pDoc->GetFormula(2,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=A1"_ustr, m_pDoc->GetFormula(1,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=A2"_ustr, m_pDoc->GetFormula(1,1,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=B1"_ustr, m_pDoc->GetFormula(2,0,0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong formula!", u"=B2"_ustr, m_pDoc->GetFormula(2,1,0));
}
m_pDoc->DeleteTab(0);
@@ -1756,8 +1756,8 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortBroadcastBroadcaster)
CPPUNIT_TEST_FIXTURE(TestSort, testSortOutOfPlaceResult)
{
- m_pDoc->InsertTab(0, "Sort");
- m_pDoc->InsertTab(1, "Result");
+ m_pDoc->InsertTab(0, u"Sort"_ustr);
+ m_pDoc->InsertTab(1, u"Result"_ustr);
const char* pData[] = {
"Header",
@@ -1774,7 +1774,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortOutOfPlaceResult)
m_pDoc->SetString(ScAddress(0,i,0), OUString::createFromAscii(pData[i]));
// Check the initial values.
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(23.0, m_pDoc->GetValue(ScAddress(0,2,0)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(0,3,0)));
@@ -1805,7 +1805,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortOutOfPlaceResult)
CPPUNIT_ASSERT(bSorted);
// Source data still intact.
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(23.0, m_pDoc->GetValue(ScAddress(0,2,0)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(0,3,0)));
@@ -1813,7 +1813,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortOutOfPlaceResult)
CPPUNIT_ASSERT_EQUAL(-2.0, m_pDoc->GetValue(ScAddress(0,5,0)));
// Sort result in C2:C7 on sheet "Result".
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(2,1,1)));
+ CPPUNIT_ASSERT_EQUAL(u"Header"_ustr, m_pDoc->GetString(ScAddress(2,1,1)));
CPPUNIT_ASSERT_EQUAL(-2.0, m_pDoc->GetValue(ScAddress(2,2,1)));
CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(2,3,1)));
CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(2,4,1)));
@@ -1831,7 +1831,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortPartialFormulaGroup)
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
- m_pDoc->InsertTab(0, "Sort");
+ m_pDoc->InsertTab(0, u"Sort"_ustr);
// Set up the sheet.
const char* aData[][2] = {
@@ -1904,7 +1904,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortPartialFormulaGroup)
CPPUNIT_TEST_FIXTURE(TestSort, testSortImages)
{
- m_pDoc->InsertTab(0, "testSortImages");
+ m_pDoc->InsertTab(0, u"testSortImages"_ustr);
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(m_xDocShell.get());
@@ -2000,7 +2000,7 @@ ScQueryParam makeSearchParam( const ScRange& range, SCCOL col, ScQueryOp op, dou
CPPUNIT_TEST_FIXTURE(TestSort, testQueryBinarySearch)
{
- m_pDoc->InsertTab(0, "testQueryBinarySearch");
+ m_pDoc->InsertTab(0, u"testQueryBinarySearch"_ustr);
const ScAddress formulaAddress( 10, 0, 0 );
ScRange range;
diff --git a/sc/qa/unit/ucalc_sparkline.cxx b/sc/qa/unit/ucalc_sparkline.cxx
index a06308813dc5..71d29e868762 100644
--- a/sc/qa/unit/ucalc_sparkline.cxx
+++ b/sc/qa/unit/ucalc_sparkline.cxx
@@ -59,7 +59,7 @@ sc::Sparkline* createTestSparkline(ScDocument& rDoc)
CPPUNIT_TEST_FIXTURE(SparklineTest, testAddSparkline)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pSparkline = createTestSparkline(*m_pDoc);
CPPUNIT_ASSERT(pSparkline);
@@ -83,7 +83,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testAddSparkline)
CPPUNIT_TEST_FIXTURE(SparklineTest, testClearContentSprkline)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pSparkline = createTestSparkline(*m_pDoc);
CPPUNIT_ASSERT(pSparkline);
@@ -98,7 +98,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testClearContentSprkline)
CPPUNIT_TEST_FIXTURE(SparklineTest, testCopyPasteSparkline)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto* pCreatedSparkline = createTestSparkline(*m_pDoc);
CPPUNIT_ASSERT(pCreatedSparkline);
@@ -165,7 +165,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testCopyPasteSparkline)
CPPUNIT_TEST_FIXTURE(SparklineTest, testCutPasteSparkline)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto* pCreatedSparkline = createTestSparkline(*m_pDoc);
CPPUNIT_ASSERT(pCreatedSparkline);
@@ -197,7 +197,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testCutPasteSparkline)
CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoInsertSparkline)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto& rDocFunc = m_xDocShell->GetDocFunc();
@@ -241,7 +241,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoInsertSparkline)
CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoDeleteSparkline)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto& rDocFunc = m_xDocShell->GetDocFunc();
@@ -297,7 +297,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoDeleteSparkline)
CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoDeleteSparklineGroup)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto& rDocFunc = m_xDocShell->GetDocFunc();
@@ -355,7 +355,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoDeleteSparklineGroup)
CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoClearContentForSparkline)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto& rDocFunc = m_xDocShell->GetDocFunc();
@@ -474,7 +474,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoClearContentForSparkline)
CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoEditSparklineGroup)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto& rDocFunc = m_xDocShell->GetDocFunc();
@@ -542,7 +542,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoEditSparklineGroup)
CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoUngroupSparklines)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto& rDocFunc = m_xDocShell->GetDocFunc();
@@ -640,7 +640,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoUngroupSparklines)
CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoGroupSparklines)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto& rDocFunc = m_xDocShell->GetDocFunc();
@@ -765,7 +765,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoGroupSparklines)
CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoEditSparkline)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto& rDocFunc = m_xDocShell->GetDocFunc();
@@ -822,7 +822,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoEditSparkline)
CPPUNIT_TEST_FIXTURE(SparklineTest, testSparklineList)
{
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
auto pSparklineGroup = std::make_shared<sc::SparklineGroup>();
@@ -877,7 +877,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testSparklineList)
CPPUNIT_TEST_FIXTURE(SparklineTest, testSparklineThemeColorChange)
{
m_pDoc->InitDrawLayer();
- m_pDoc->InsertTab(0, "Test");
+ m_pDoc->InsertTab(0, u"Test"_ustr);
// insert test data - A1:A6
insertTestData(*m_pDoc);
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index f792cc0dcd1f..08a1eeb3848b 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -41,7 +41,7 @@ public:
};
ScUiCalcTest::ScUiCalcTest()
- : ScModelTestBase("sc/qa/unit/uicalc/data")
+ : ScModelTestBase(u"sc/qa/unit/uicalc/data"_ustr)
{
}
@@ -99,24 +99,24 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"2015");
- insertStringToCell("A2", u"2015");
- insertStringToCell("A3", u"2015");
+ insertStringToCell(u"A1"_ustr, u"2015");
+ insertStringToCell(u"A2"_ustr, u"2015");
+ insertStringToCell(u"A3"_ustr, u"2015");
- insertStringToCell("B1", u"1");
- insertStringToCell("B2", u"1");
- insertStringToCell("B3", u"2");
+ insertStringToCell(u"B1"_ustr, u"1");
+ insertStringToCell(u"B2"_ustr, u"1");
+ insertStringToCell(u"B3"_ustr, u"2");
- insertStringToCell("C1", u"10");
- insertStringToCell("C2", u"20");
- insertStringToCell("C3", u"5");
+ insertStringToCell(u"C1"_ustr, u"10");
+ insertStringToCell(u"C2"_ustr, u"20");
+ insertStringToCell(u"C3"_ustr, u"5");
- insertStringToCell("D1", u"BIG FISH");
- insertStringToCell("D2", u"FISHFISH");
- insertStringToCell("D3", u"FISHY");
+ insertStringToCell(u"D1"_ustr, u"BIG FISH");
+ insertStringToCell(u"D2"_ustr, u"FISHFISH");
+ insertStringToCell(u"D3"_ustr, u"FISHY");
// Save the document
- save("calc8");
+ save(u"calc8"_ustr);
// Open a new document
createScDoc();
@@ -128,79 +128,79 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences)
OUString aFormula = "=SUMIFS('" + maTempFile.GetURL() + "'#$Sheet1.C1:C3,'"
+ maTempFile.GetURL() + "'#$Sheet1.B1:B3,1,'" + maTempFile.GetURL()
+ "'#$Sheet1.A1:A3,2015)";
- insertStringToCell("A1", aFormula);
+ insertStringToCell(u"A1"_ustr, aFormula);
// tdf#115162: Without the fix in place, this test would have failed with
// - Expected: 30
// - Actual : Err:504
- CPPUNIT_ASSERT_EQUAL(OUString("30"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"30"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
}
{
// tdf#114820
OUString aFormula = "=VLOOKUP('" + maTempFile.GetURL() + "'#$Sheet1.A1;'"
+ maTempFile.GetURL() + "'#$Sheet1.A1:B3,2,0)";
- insertStringToCell("A1", aFormula);
+ insertStringToCell(u"A1"_ustr, aFormula);
// Without the fix in place, this test would have failed with
// - Expected: 1
// - Actual : Err:504
- CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
}
{
// tdf#116149
OUString aFormula = "=VAR('" + maTempFile.GetURL() + "'#$Sheet1.C1;'" + maTempFile.GetURL()
+ "'#$Sheet1.C2)";
- insertStringToCell("A1", aFormula);
+ insertStringToCell(u"A1"_ustr, aFormula);
// Without the fix in place, this test would have failed with
// - Expected: 50
// - Actual : Err:504
- CPPUNIT_ASSERT_EQUAL(OUString("50"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"50"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
}
{
// tdf#100847
// Use an empty cell
OUString aFormula = "=+'" + maTempFile.GetURL() + "'#$Sheet1.A1000";
- insertStringToCell("A1", aFormula);
+ insertStringToCell(u"A1"_ustr, aFormula);
aFormula = "=+'" + maTempFile.GetURL() + "'#$Sheet1.A1000*1";
- insertStringToCell("B1", aFormula);
+ insertStringToCell(u"B1"_ustr, aFormula);
aFormula = "=+N('" + maTempFile.GetURL() + "'#$Sheet1.A1000)*1";
- insertStringToCell("C1", aFormula);
+ insertStringToCell(u"C1"_ustr, aFormula);
- CPPUNIT_ASSERT_EQUAL(OUString("0"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
// Without the fix in place, this test would have failed with
// - Expected: 0
// - Actual : #VALUE!
- CPPUNIT_ASSERT_EQUAL(OUString("0"), pDoc->GetString(ScAddress(1, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("0"), pDoc->GetString(ScAddress(2, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
}
{
//tdf#36387
OUString aAndFormula = "=AND('" + maTempFile.GetURL() + "'#$Sheet1.A1:C1)";
- insertStringToCell("A1", aAndFormula);
+ insertStringToCell(u"A1"_ustr, aAndFormula);
OUString aOrFormula = "=OR('" + maTempFile.GetURL() + "'#$Sheet1.A1:C1)";
- insertStringToCell("B1", aOrFormula);
+ insertStringToCell(u"B1"_ustr, aOrFormula);
// Without the fix in place, this test would have failed with
// - Expected: TRUE
// - Actual : Err:504
- CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), pDoc->GetString(ScAddress(1, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"TRUE"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"TRUE"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
}
{
//tdf#113898
OUString aAndFormula = "=SUMPRODUCT(NOT(ISERROR(FIND(\"FISH\";'" + maTempFile.GetURL()
+ "'#$Sheet1.D1:D3))))";
- insertStringToCell("A1", aAndFormula);
+ insertStringToCell(u"A1"_ustr, aAndFormula);
// Without the fix in place, this test would have failed with
// - Expected: 3
@@ -218,19 +218,19 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf151886)
// Set the system locale to German
SvtSysLocaleOptions aOptions;
OUString sLocaleConfigString = aOptions.GetLanguageTag().getBcp47();
- aOptions.SetLocaleConfigString("de-DE");
+ aOptions.SetLocaleConfigString(u"de-DE"_ustr);
aOptions.Commit();
comphelper::ScopeGuard g([&aOptions, &sLocaleConfigString] {
aOptions.SetLocaleConfigString(sLocaleConfigString);
aOptions.Commit();
});
- insertStringToCell("A1", u"=1,1");
+ insertStringToCell(u"A1"_ustr, u"=1,1");
- insertStringToCell("A2", u"=1.1");
+ insertStringToCell(u"A2"_ustr, u"=1.1");
- CPPUNIT_ASSERT_EQUAL(OUString("1,1"), pDoc->GetString(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("#NAME?"), pDoc->GetString(0, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"1,1"_ustr, pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"#NAME?"_ustr, pDoc->GetString(0, 1, 0));
// change UseEnglishFuncName to true
ScDocShell* pDocSh = getScDocShell();
@@ -239,15 +239,15 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf151886)
aFormulaOptions.SetUseEnglishFuncName(true);
pDocSh->SetFormulaOptions(aFormulaOptions);
- insertStringToCell("A1", u"=1,1");
+ insertStringToCell(u"A1"_ustr, u"=1,1");
- insertStringToCell("A2", u"=1.1");
+ insertStringToCell(u"A2"_ustr, u"=1.1");
// Without the fix in place, this test would have failed with
// - Expected: 1,1
// - Actual : #NAME?
- CPPUNIT_ASSERT_EQUAL(OUString("1,1"), pDoc->GetString(0, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("#NAME?"), pDoc->GetString(0, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"1,1"_ustr, pDoc->GetString(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"#NAME?"_ustr, pDoc->GetString(0, 1, 0));
aFormulaOptions.SetUseEnglishFuncName(bOldStatus);
pDocSh->SetFormulaOptions(aFormulaOptions);
@@ -259,11 +259,11 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf103994)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"1");
- insertStringToCell("B1", u"2");
+ insertStringToCell(u"A1"_ustr, u"1");
+ insertStringToCell(u"B1"_ustr, u"2");
// Save the document
- save("calc8");
+ save(u"calc8"_ustr);
// Open a new document
createScDoc();
@@ -271,18 +271,18 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf103994)
// Insert the reference to the external document
OUString aFormula = "='" + maTempFile.GetURL() + "'#$Sheet1.A1";
- insertStringToCell("A1", aFormula);
+ insertStringToCell(u"A1"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(aFormula, pDoc->GetFormula(0, 0, 0));
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(ScAddress(0, 0, 0)));
- goToCell("A1");
+ goToCell(u"A1"_ustr);
- dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, u".uno:Cut"_ustr, {});
- goToCell("B1");
+ goToCell(u"B1"_ustr);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
// Without the fix in place, this test would have failed with
// - Expected: ='file:///tmp/lu124171irlmb.tmp'#$Sheet1.A1
@@ -296,10 +296,10 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf113541)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"50");
+ insertStringToCell(u"A1"_ustr, u"50");
// Save the document
- save("calc8");
+ save(u"calc8"_ustr);
// Open a new document
createScDoc();
@@ -310,12 +310,12 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf113541)
// Insert the reference to the external document
OUString aFormula = "=['" + maTempFile.GetURL() + "']Sheet1!A1";
- insertStringToCell("A1", aFormula);
+ insertStringToCell(u"A1"_ustr, aFormula);
// Without the fix in place, this test would have failed with
// - Expected: 50
// - Actual : Err:507
- CPPUNIT_ASSERT_EQUAL(OUString("50"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"50"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126577)
@@ -323,16 +323,16 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126577)
createScDoc();
ScDocument* pDoc = getScDoc();
- goToCell("A1:A20");
+ goToCell(u"A1:A20"_ustr);
uno::Sequence<beans::PropertyValue> aArgs(
- comphelper::InitPropertySequence({ { "FillDir", uno::Any(OUString("B")) },
- { "FillCmd", uno::Any(OUString("L")) },
- { "FillStep", uno::Any(OUString("1")) },
- { "FillDateCmd", uno::Any(OUString("D")) },
- { "FillStart", uno::Any(OUString("1")) },
- { "FillMax", uno::Any(OUString("10")) } }));
- dispatchCommand(mxComponent, ".uno:FillSeries", aArgs);
+ comphelper::InitPropertySequence({ { "FillDir", uno::Any(u"B"_ustr) },
+ { "FillCmd", uno::Any(u"L"_ustr) },
+ { "FillStep", uno::Any(u"1"_ustr) },
+ { "FillDateCmd", uno::Any(u"D"_ustr) },
+ { "FillStart", uno::Any(u"1"_ustr) },
+ { "FillMax", uno::Any(u"10"_ustr) } }));
+ dispatchCommand(mxComponent, u".uno:FillSeries"_ustr, aArgs);
for (size_t i = 0; i < 10; ++i)
{
@@ -345,7 +345,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126577)
// Without the fix in place, this test would have failed with
// - Expected:
// - Actual : #NUM!
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, i, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, i, 0)));
}
}
@@ -355,67 +355,67 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf107869)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"A");
- insertStringToCell("A2", u"B");
+ insertStringToCell(u"A1"_ustr, u"A");
+ insertStringToCell(u"A2"_ustr, u"B");
// Add a new comment to A1 and A2
uno::Sequence<beans::PropertyValue> aArgs
- = comphelper::InitPropertySequence({ { "Text", uno::Any(OUString("Comment")) } });
+ = comphelper::InitPropertySequence({ { "Text", uno::Any(u"Comment"_ustr) } });
- goToCell("A1");
- dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
+ goToCell(u"A1"_ustr);
+ dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aArgs);
- goToCell("A2");
- dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
+ goToCell(u"A2"_ustr);
+ dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aArgs);
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on A2", pDoc->HasNote(ScAddress(0, 1, 0)));
- goToCell("A1");
+ goToCell(u"A1"_ustr);
- dispatchCommand(mxComponent, ".uno:SelectRow", {});
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, {});
- dispatchCommand(mxComponent, ".uno:DeleteRows", {});
+ dispatchCommand(mxComponent, u".uno:DeleteRows"_ustr, {});
for (size_t i = 0; i < 10; ++i)
{
- CPPUNIT_ASSERT_EQUAL(OUString("B"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"B"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be no note on A2", !pDoc->HasNote(ScAddress(0, 1, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("A"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("B"), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"B"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on A2", pDoc->HasNote(ScAddress(0, 1, 0)));
- dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
}
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- goToCell("A1:A2");
+ goToCell(u"A1:A2"_ustr);
- dispatchCommand(mxComponent, ".uno:SelectRow", {});
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, {});
- dispatchCommand(mxComponent, ".uno:DeleteRows", {});
+ dispatchCommand(mxComponent, u".uno:DeleteRows"_ustr, {});
for (size_t i = 0; i < 10; ++i)
{
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be no note on A1", !pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be no note on A2", !pDoc->HasNote(ScAddress(0, 1, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("A"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("B"), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"B"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on A2", pDoc->HasNote(ScAddress(0, 1, 0)));
- dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
}
}
@@ -424,47 +424,47 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf63805)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"2012-10-31");
+ insertStringToCell(u"A1"_ustr, u"2012-10-31");
- goToCell("A1:A20");
+ goToCell(u"A1:A20"_ustr);
uno::Sequence<beans::PropertyValue> aArgs(
- comphelper::InitPropertySequence({ { "FillDir", uno::Any(OUString("B")) },
- { "FillCmd", uno::Any(OUString("D")) },
- { "FillStep", uno::Any(OUString("1")) },
- { "FillDateCmd", uno::Any(OUString("M")) },
- { "FillStart", uno::Any(OUString("41213")) } }));
- dispatchCommand(mxComponent, ".uno:FillSeries", aArgs);
+ comphelper::InitPropertySequence({ { "FillDir", uno::Any(u"B"_ustr) },
+ { "FillCmd", uno::Any(u"D"_ustr) },
+ { "FillStep", uno::Any(u"1"_ustr) },
+ { "FillDateCmd", uno::Any(u"M"_ustr) },
+ { "FillStart", uno::Any(u"41213"_ustr) } }));
+ dispatchCommand(mxComponent, u".uno:FillSeries"_ustr, aArgs);
- CPPUNIT_ASSERT_EQUAL(OUString("2012-10-31"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2012-10-31"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
// Without the fix in place, this test would have failed with
// - Expected: 2012-11-30
// - Actual : 2012-12-01
- CPPUNIT_ASSERT_EQUAL(OUString("2012-11-30"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2012-12-31"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2013-01-31"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2013-02-28"), pDoc->GetString(ScAddress(0, 4, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2013-03-31"), pDoc->GetString(ScAddress(0, 5, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2013-04-30"), pDoc->GetString(ScAddress(0, 6, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2013-05-31"), pDoc->GetString(ScAddress(0, 7, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2013-06-30"), pDoc->GetString(ScAddress(0, 8, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2013-07-31"), pDoc->GetString(ScAddress(0, 9, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2013-08-31"), pDoc->GetString(ScAddress(0, 10, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2013-09-30"), pDoc->GetString(ScAddress(0, 11, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2013-10-31"), pDoc->GetString(ScAddress(0, 12, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2013-11-30"), pDoc->GetString(ScAddress(0, 13, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2013-12-31"), pDoc->GetString(ScAddress(0, 14, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-01-31"), pDoc->GetString(ScAddress(0, 15, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-02-28"), pDoc->GetString(ScAddress(0, 16, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-03-31"), pDoc->GetString(ScAddress(0, 17, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-04-30"), pDoc->GetString(ScAddress(0, 18, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-05-31"), pDoc->GetString(ScAddress(0, 19, 0)));
-
- dispatchCommand(mxComponent, ".uno:Undo", {});
-
- CPPUNIT_ASSERT_EQUAL(OUString("2012-10-31"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2012-11-30"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2012-12-31"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2013-01-31"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2013-02-28"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2013-03-31"_ustr, pDoc->GetString(ScAddress(0, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2013-04-30"_ustr, pDoc->GetString(ScAddress(0, 6, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2013-05-31"_ustr, pDoc->GetString(ScAddress(0, 7, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2013-06-30"_ustr, pDoc->GetString(ScAddress(0, 8, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2013-07-31"_ustr, pDoc->GetString(ScAddress(0, 9, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2013-08-31"_ustr, pDoc->GetString(ScAddress(0, 10, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2013-09-30"_ustr, pDoc->GetString(ScAddress(0, 11, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2013-10-31"_ustr, pDoc->GetString(ScAddress(0, 12, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2013-11-30"_ustr, pDoc->GetString(ScAddress(0, 13, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2013-12-31"_ustr, pDoc->GetString(ScAddress(0, 14, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2014-01-31"_ustr, pDoc->GetString(ScAddress(0, 15, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2014-02-28"_ustr, pDoc->GetString(ScAddress(0, 16, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2014-03-31"_ustr, pDoc->GetString(ScAddress(0, 17, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2014-04-30"_ustr, pDoc->GetString(ScAddress(0, 18, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2014-05-31"_ustr, pDoc->GetString(ScAddress(0, 19, 0)));
+
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
+
+ CPPUNIT_ASSERT_EQUAL(u"2012-10-31"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf147894)
@@ -473,17 +473,17 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf147894)
ScDocument* pDoc = getScDoc();
//Select the first row
- goToCell("1:1");
+ goToCell(u"1:1"_ustr);
uno::Sequence<beans::PropertyValue> aArgs(
- comphelper::InitPropertySequence({ { "FillDir", uno::Any(OUString("R")) },
- { "FillCmd", uno::Any(OUString("L")) },
- { "FillStep", uno::Any(OUString("1")) },
- { "FillDateCmd", uno::Any(OUString("D")) },
- { "FillStart", uno::Any(OUString("1")) } }));
+ comphelper::InitPropertySequence({ { "FillDir", uno::Any(u"R"_ustr) },
+ { "FillCmd", uno::Any(u"L"_ustr) },
+ { "FillStep", uno::Any(u"1"_ustr) },
+ { "FillDateCmd", uno::Any(u"D"_ustr) },
+ { "FillStart", uno::Any(u"1"_ustr) } }));
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:FillSeries", aArgs);
+ dispatchCommand(mxComponent, u".uno:FillSeries"_ustr, aArgs);
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_EQUAL(16384.0, pDoc->GetValue(ScAddress(16383, 0, 0)));
@@ -494,27 +494,27 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf94208)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"=COUNTA(B:B)");
- insertStringToCell("A3", u"Range");
- insertStringToCell("A4", u"Range");
- insertStringToCell("A5", u"Range");
- insertStringToCell("A6", u"Range");
- insertStringToCell("A7", u"Range");
- insertStringToCell("A8", u"Range");
- insertStringToCell("B6", u"Test");
+ insertStringToCell(u"A1"_ustr, u"=COUNTA(B:B)");
+ insertStringToCell(u"A3"_ustr, u"Range");
+ insertStringToCell(u"A4"_ustr, u"Range");
+ insertStringToCell(u"A5"_ustr, u"Range");
+ insertStringToCell(u"A6"_ustr, u"Range");
+ insertStringToCell(u"A7"_ustr, u"Range");
+ insertStringToCell(u"A8"_ustr, u"Range");
+ insertStringToCell(u"B6"_ustr, u"Test");
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(ScAddress(0, 0, 0)));
- goToCell("A3:A8");
+ goToCell(u"A3:A8"_ustr);
- dispatchCommand(mxComponent, ".uno:SelectRow", {});
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, {});
//type Control-D/Fill Down
- dispatchCommand(mxComponent, ".uno:FillDown", {});
+ dispatchCommand(mxComponent, u".uno:FillDown"_ustr, {});
CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(0, 0, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
// Without the fix in place, this test would have failed with
// - Expected: 1
@@ -523,10 +523,10 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf94208)
for (SCROW i = 2; i < 8; ++i)
{
- CPPUNIT_ASSERT_EQUAL(OUString("Range"), pDoc->GetString(ScAddress(0, i, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Range"_ustr, pDoc->GetString(ScAddress(0, i, 0)));
}
- CPPUNIT_ASSERT_EQUAL(OUString("Test"), pDoc->GetString(ScAddress(1, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Test"_ustr, pDoc->GetString(ScAddress(1, 5, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf37623)
@@ -534,20 +534,20 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf37623)
createScDoc();
ScDocument* pDoc = getScDoc();
- goToCell("A3:A4");
+ goToCell(u"A3:A4"_ustr);
- dispatchCommand(mxComponent, ".uno:HideRow", {});
+ dispatchCommand(mxComponent, u".uno:HideRow"_ustr, {});
- insertStringToCell("A2", u"1");
+ insertStringToCell(u"A2"_ustr, u"1");
- goToCell("A2:A6");
+ goToCell(u"A2:A6"_ustr);
uno::Sequence<beans::PropertyValue> aArgs(
- comphelper::InitPropertySequence({ { "FillDir", uno::Any(OUString("B")) },
- { "FillCmd", uno::Any(OUString("A")) },
- { "FillStep", uno::Any(OUString("1")) },
- { "FillDateCmd", uno::Any(OUString("M")) } }));
- dispatchCommand(mxComponent, ".uno:FillSeries", aArgs);
+ comphelper::InitPropertySequence({ { "FillDir", uno::Any(u"B"_ustr) },
+ { "FillCmd", uno::Any(u"A"_ustr) },
+ { "FillStep", uno::Any(u"1"_ustr) },
+ { "FillDateCmd", uno::Any(u"M"_ustr) } }));
+ dispatchCommand(mxComponent, u".uno:FillSeries"_ustr, aArgs);
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(ScAddress(0, 1, 0)));
CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(0, 2, 0)));
@@ -567,20 +567,20 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf144308)
xGlobalSheetSettings->setDoAutoComplete(true);
- insertStringToCell("A1", u"ABC");
+ insertStringToCell(u"A1"_ustr, u"ABC");
- insertStringToCell("A2", u"A");
+ insertStringToCell(u"A2"_ustr, u"A");
- CPPUNIT_ASSERT_EQUAL(OUString("ABC"), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"ABC"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
xGlobalSheetSettings->setDoAutoComplete(false);
- insertStringToCell("A3", u"A");
+ insertStringToCell(u"A3"_ustr, u"A");
// Without the fix in place, this test would have failed with
// - Expected: A
// - Actual : ABC
- CPPUNIT_ASSERT_EQUAL(OUString("A"), pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
// Restore the previous value
xGlobalSheetSettings->setDoAutoComplete(bOldValue);
@@ -591,7 +591,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf56036)
createScDoc();
ScDocument* pDoc = getScDoc();
- goToCell("A1");
+ goToCell(u"A1"_ustr);
typeString(u"=SUM( 1 + 2 ");
@@ -610,14 +610,14 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf56036)
// Without the fix in place, this test would have failed with
// - Expected: 6
// - Actual : Err:501
- CPPUNIT_ASSERT_EQUAL(OUString("6"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"6"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf154174_repeat_empty)
{
createScDoc();
- insertStringToCell("A1", u"aaaa");
+ insertStringToCell(u"A1"_ustr, u"aaaa");
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | KEY_SHIFT | awt::Key::Y);
@@ -625,7 +625,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf154174_repeat_empty)
Scheduler::ProcessEventsToIdle();
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("aaaa"), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"aaaa"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::F2);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::F2);
@@ -642,7 +642,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf154174_repeat_empty)
// Without the fix in place, this test would have failed with
// - Expected: aaaa
// - Actual :
- CPPUNIT_ASSERT_EQUAL(OUString("aaaa"), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"aaaa"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf119162)
@@ -650,7 +650,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf119162)
createScDoc();
ScDocument* pDoc = getScDoc();
- goToCell("A1");
+ goToCell(u"A1"_ustr);
typeString(u"Test");
@@ -667,15 +667,15 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf119162)
CPPUNIT_ASSERT_EQUAL(OUString(u"Test" + OUStringChar(u'\xA')),
pDoc->GetString(ScAddress(0, 0, 0)));
- goToCell("A1");
+ goToCell(u"A1"_ustr);
// Without the fix in place, this test would have hung here
- dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {});
+ dispatchCommand(mxComponent, u".uno:ChangeCaseRotateCase"_ustr, {});
CPPUNIT_ASSERT_EQUAL(OUString(u"Test" + OUStringChar(u'\xA')),
pDoc->GetString(ScAddress(0, 0, 0)));
- dispatchCommand(mxComponent, ".uno:ChangeCaseToLower", {});
+ dispatchCommand(mxComponent, u".uno:ChangeCaseToLower"_ustr, {});
CPPUNIT_ASSERT_EQUAL(OUString(u"test" + OUStringChar(u'\xA')),
pDoc->GetString(ScAddress(0, 0, 0)));
@@ -686,31 +686,31 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf90579)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"2300");
- insertStringToCell("A2", u"Libre");
- insertStringToCell("B1", u"10");
- insertStringToCell("B2", u"Office");
- insertStringToCell("C1", u"=SUM(A1:B1)");
- insertStringToCell("C2", u"=A2&B2");
+ insertStringToCell(u"A1"_ustr, u"2300");
+ insertStringToCell(u"A2"_ustr, u"Libre");
+ insertStringToCell(u"B1"_ustr, u"10");
+ insertStringToCell(u"B2"_ustr, u"Office");
+ insertStringToCell(u"C1"_ustr, u"=SUM(A1:B1)");
+ insertStringToCell(u"C2"_ustr, u"=A2&B2");
- CPPUNIT_ASSERT_EQUAL(OUString("2310"), pDoc->GetString(ScAddress(2, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("LibreOffice"), pDoc->GetString(ScAddress(2, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2310"_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"LibreOffice"_ustr, pDoc->GetString(ScAddress(2, 1, 0)));
- goToCell("C1:C2");
+ goToCell(u"C1:C2"_ustr);
- dispatchCommand(mxComponent, ".uno:ConvertFormulaToValue", {});
+ dispatchCommand(mxComponent, u".uno:ConvertFormulaToValue"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("2310"), pDoc->GetString(ScAddress(2, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("LibreOffice"), pDoc->GetString(ScAddress(2, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetFormula(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetFormula(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"2310"_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"LibreOffice"_ustr, pDoc->GetString(ScAddress(2, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetFormula(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetFormula(2, 1, 0));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("2310"), pDoc->GetString(ScAddress(2, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("LibreOffice"), pDoc->GetString(ScAddress(2, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A1:B1)"), pDoc->GetFormula(2, 0, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("=A2&B2"), pDoc->GetFormula(2, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"2310"_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"LibreOffice"_ustr, pDoc->GetString(ScAddress(2, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A1:B1)"_ustr, pDoc->GetFormula(2, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=A2&B2"_ustr, pDoc->GetFormula(2, 1, 0));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf124820)
@@ -718,11 +718,11 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf124820)
createScDoc("tdf124820.xlsx");
ScDocument* pDoc = getScDoc();
- goToCell("B2");
+ goToCell(u"B2"_ustr);
- dispatchCommand(mxComponent, ".uno:Strikeout", {});
+ dispatchCommand(mxComponent, u".uno:Strikeout"_ustr, {});
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
vcl::Font aFont;
@@ -746,7 +746,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf132026)
{
for (size_t i = 0; i < aDirections.size(); ++i)
{
- goToCell("B2");
+ goToCell(u"B2"_ustr);
typeString(*aChar);
sal_uInt16 nDir = aDirections[i];
@@ -763,7 +763,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf132026)
OUString sExpectedResult = OUString::number(nExpected);
CPPUNIT_ASSERT_EQUAL(sExpectedResult, pDoc->GetString(ScAddress(1, 1, 0)));
- goToCell("E2");
+ goToCell(u"E2"_ustr);
typeString(*aChar);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, nDir);
@@ -786,14 +786,14 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf152037)
{
createScDoc("tdf152037.xlsx");
- insertStringToCell("C2", u"abcdefghi");
+ insertStringToCell(u"C2"_ustr, u"abcdefghi");
ScDocument* pDoc = getScDoc();
// Without the fix in place, this test would have failed with
// - Expected: abcdefghi
// - Actual :
- CPPUNIT_ASSERT_EQUAL(OUString("abcdefghi"), pDoc->GetString(ScAddress(2, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"abcdefghi"_ustr, pDoc->GetString(ScAddress(2, 1, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf119155)
@@ -801,14 +801,14 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf119155)
createScDoc("tdf119155.xlsx");
ScDocument* pDoc = getScDoc();
- goToCell("C2:C14");
+ goToCell(u"C2:C14"_ustr);
// Without the fix in place, this test would have hung here
- dispatchCommand(mxComponent, ".uno:ChangeCaseToTitleCase", {});
+ dispatchCommand(mxComponent, u".uno:ChangeCaseToTitleCase"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("Collagene Expert Targeted Wrinkle Corrector Unboxed 10 Ml"),
+ CPPUNIT_ASSERT_EQUAL(u"Collagene Expert Targeted Wrinkle Corrector Unboxed 10 Ml"_ustr,
pDoc->GetString(ScAddress(2, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Vitamina Suractivee Hand Cream 400 Ml"),
+ CPPUNIT_ASSERT_EQUAL(u"Vitamina Suractivee Hand Cream 400 Ml"_ustr,
pDoc->GetString(ScAddress(2, 13, 0)));
}
@@ -824,9 +824,9 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf146795)
aInputOption.SetReplaceCellsWarn(false);
pMod->SetInputOptions(aInputOption);
- goToCell("B2");
+ goToCell(u"B2"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// Move to B3
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
@@ -840,16 +840,16 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf146795)
Scheduler::ProcessEventsToIdle();
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("a"), pDoc->GetString(ScAddress(1, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), pDoc->GetString(ScAddress(1, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), pDoc->GetString(ScAddress(1, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("44"), pDoc->GetString(ScAddress(1, 4, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("44"), pDoc->GetString(ScAddress(1, 5, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), pDoc->GetString(ScAddress(1, 6, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("a"), pDoc->GetString(ScAddress(1, 7, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("44"), pDoc->GetString(ScAddress(1, 8, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, pDoc->GetString(ScAddress(1, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, pDoc->GetString(ScAddress(1, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, pDoc->GetString(ScAddress(1, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"44"_ustr, pDoc->GetString(ScAddress(1, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"44"_ustr, pDoc->GetString(ScAddress(1, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, pDoc->GetString(ScAddress(1, 6, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, pDoc->GetString(ScAddress(1, 7, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"44"_ustr, pDoc->GetString(ScAddress(1, 8, 0)));
// Restore previous status
aInputOption.SetReplaceCellsWarn(bOldStatus);
@@ -868,9 +868,9 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf147744)
aInputOption.SetReplaceCellsWarn(false);
pMod->SetInputOptions(aInputOption);
- goToCell("A2");
+ goToCell(u"A2"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// Move to A3
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
@@ -882,7 +882,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf147744)
Scheduler::ProcessEventsToIdle();
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(ScAddress(0, 1, 0)));
CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(0, 2, 0)));
@@ -904,7 +904,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf138432)
// Set the system locale to Hungarian
SvtSysLocaleOptions aOptions;
OUString sLocaleConfigString = aOptions.GetLanguageTag().getBcp47();
- aOptions.SetLocaleConfigString("hu-HU");
+ aOptions.SetLocaleConfigString(u"hu-HU"_ustr);
aOptions.Commit();
comphelper::ScopeGuard g([&aOptions, &sLocaleConfigString] {
aOptions.SetLocaleConfigString(sLocaleConfigString);
@@ -914,15 +914,15 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf138432)
OUString sExpectedA1 = "12" + OUStringChar(u'\xa0') + "345,67";
CPPUNIT_ASSERT_EQUAL(sExpectedA1, pDoc->GetString(ScAddress(0, 0, 0)));
- goToCell("A1");
+ goToCell(u"A1"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
- goToCell("A2");
+ goToCell(u"A2"_ustr);
typeString(u"=");
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
@@ -932,7 +932,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf138432)
// Without the fix in place, this test would have failed with
// - Expected: 12345,67
// - Actual : Err:509
- CPPUNIT_ASSERT_EQUAL(OUString("12345,67"), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"12345,67"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf143896)
@@ -940,17 +940,17 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf143896)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A2000", u"Test");
+ insertStringToCell(u"A2000"_ustr, u"Test");
- CPPUNIT_ASSERT_EQUAL(OUString("Test"), pDoc->GetString(ScAddress(0, 1999, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Test"_ustr, pDoc->GetString(ScAddress(0, 1999, 0)));
- saveAndReload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
pDoc = getScDoc();
// Without the fix in place, this test would have failed with
// - Expected: Test
// - Actual :
- CPPUNIT_ASSERT_EQUAL(OUString("Test"), pDoc->GetString(ScAddress(0, 1999, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Test"_ustr, pDoc->GetString(ScAddress(0, 1999, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf145085)
@@ -958,14 +958,14 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf145085)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertArrayToCell("A1", u"=HYPERLINK(\"a\";\"b\")");
+ insertArrayToCell(u"A1"_ustr, u"=HYPERLINK(\"a\";\"b\")");
- CPPUNIT_ASSERT_EQUAL(OUString("b"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"b"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
// Without the fix in place, this test would have failed with
// - Expected:
// - Actual : a
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf154125)
@@ -973,14 +973,14 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf154125)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertArrayToCell("A1", u"=INDEX({11;21},0,1)");
+ insertArrayToCell(u"A1"_ustr, u"=INDEX({11;21},0,1)");
- CPPUNIT_ASSERT_EQUAL(OUString("11"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"11"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
// Without the fix in place, this test would have failed with
// - Expected: 21
// - Actual :
- CPPUNIT_ASSERT_EQUAL(OUString("21"), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"21"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf159046)
@@ -996,14 +996,14 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf159046)
aObjects = pDrawLayer->GetObjectsAnchoredToRange(0, 1, 6, 8);
CPPUNIT_ASSERT_EQUAL(size_t(0), aObjects.size());
- goToCell("A2:F10");
- dispatchCommand(mxComponent, ".uno:Cut", {});
+ goToCell(u"A2:F10"_ustr);
+ dispatchCommand(mxComponent, u".uno:Cut"_ustr, {});
- goToCell("B2");
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ goToCell(u"B2"_ustr);
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
// Without the fix in place, this test would have crashed here
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pDoc = getScDoc();
pDrawLayer = pDoc->GetDrawLayer();
@@ -1020,7 +1020,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf148863)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertArrayToCell("A1", u"=TRANSPOSE(IF({0|0|0}=0;RANDBETWEEN.NV(1;1000000)))");
+ insertArrayToCell(u"A1"_ustr, u"=TRANSPOSE(IF({0|0|0}=0;RANDBETWEEN.NV(1;1000000)))");
double nA1 = pDoc->GetValue(ScAddress(0, 0, 0));
double nB1 = pDoc->GetValue(ScAddress(1, 0, 0));
@@ -1043,18 +1043,18 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf144244)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xPage->getCount());
// Select column A and B
- goToCell("A:B");
+ goToCell(u"A:B"_ustr);
- dispatchCommand(mxComponent, ".uno:DeleteColumns", {});
+ dispatchCommand(mxComponent, u".uno:DeleteColumns"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("x"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"x"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
// Without the fix in place, this test would have crashed
- saveAndReload("calc8");
+ saveAndReload(u"calc8"_ustr);
pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("x"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"x"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
xPage.set(pModelObj->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xPage->getCount());
@@ -1072,34 +1072,34 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf153669)
aInputOption.SetReplaceCellsWarn(false);
pMod->SetInputOptions(aInputOption);
- insertStringToCell("E2", u"100");
+ insertStringToCell(u"E2"_ustr, u"100");
- CPPUNIT_ASSERT_EQUAL(OUString("110.00"), pDoc->GetString(ScAddress(5, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"110.00"_ustr, pDoc->GetString(ScAddress(5, 1, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("15.00"), pDoc->GetString(ScAddress(5, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"15.00"_ustr, pDoc->GetString(ScAddress(5, 1, 0)));
- goToCell("E7");
+ goToCell(u"E7"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
- goToCell("F7");
+ goToCell(u"F7"_ustr);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("text"), pDoc->GetString(ScAddress(5, 6, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"text"_ustr, pDoc->GetString(ScAddress(5, 6, 0)));
- insertStringToCell("E2", u"100");
+ insertStringToCell(u"E2"_ustr, u"100");
// Without the fix in place, this test would have failed with
// - Expected: 110.00
// - Actual : 15.00
- CPPUNIT_ASSERT_EQUAL(OUString("110.00"), pDoc->GetString(ScAddress(5, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"110.00"_ustr, pDoc->GetString(ScAddress(5, 1, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("15.00"), pDoc->GetString(ScAddress(5, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"15.00"_ustr, pDoc->GetString(ScAddress(5, 1, 0)));
// Restore previous status
aInputOption.SetReplaceCellsWarn(bOldStatus);
@@ -1118,15 +1118,15 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf100582)
aInputOption.SetReplaceCellsWarn(false);
pMod->SetInputOptions(aInputOption);
- goToCell("C10");
+ goToCell(u"C10"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
- goToCell("C10:H14");
+ goToCell(u"C10:H14"_ustr);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
- saveAndReload("MS Excel 97");
+ saveAndReload(u"MS Excel 97"_ustr);
pDoc = getScDoc();
OUString aFormula = pDoc->GetFormula(3, 10, 0);
@@ -1134,15 +1134,15 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf100582)
// Without the fix in place, this test would have failed with
// - Expected: {=SUM(($B$3:$B$7=$B11)*(D$3:D$7))}
//- Actual :
- CPPUNIT_ASSERT_EQUAL(OUString("{=SUM(($B$3:$B$7=$B11)*(D$3:D$7))}"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"{=SUM(($B$3:$B$7=$B11)*(D$3:D$7))}"_ustr, aFormula);
aFormula = pDoc->GetFormula(4, 10, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("{=SUM(($B$3:$B$7=$B11)*(E$3:E$7))}"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"{=SUM(($B$3:$B$7=$B11)*(E$3:E$7))}"_ustr, aFormula);
aFormula = pDoc->GetFormula(5, 10, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("{=SUM(($B$3:$B$7=$B11)*(F$3:F$7))}"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"{=SUM(($B$3:$B$7=$B11)*(F$3:F$7))}"_ustr, aFormula);
aFormula = pDoc->GetFormula(6, 10, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("{=SUM(($B$3:$B$7=$B11)*(G$3:G$7))}"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"{=SUM(($B$3:$B$7=$B11)*(G$3:G$7))}"_ustr, aFormula);
aFormula = pDoc->GetFormula(7, 10, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("{=SUM(($B$3:$B$7=$B11)*(H$3:H$7))}"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"{=SUM(($B$3:$B$7=$B11)*(H$3:H$7))}"_ustr, aFormula);
// Restore previous status
aInputOption.SetReplaceCellsWarn(bOldStatus);
@@ -1161,20 +1161,20 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf145640)
aInputOption.SetSortRefUpdate(true);
pMod->SetInputOptions(aInputOption);
- goToCell("A2:F17");
+ goToCell(u"A2:F17"_ustr);
- dispatchCommand(mxComponent, ".uno:SortDescending", {});
+ dispatchCommand(mxComponent, u".uno:SortDescending"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A15:B15:C15:D15:E15:F15)"), pDoc->GetFormula(6, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A15:B15:C15:D15:E15:F15)"_ustr, pDoc->GetFormula(6, 3, 0));
// Without the fix in place, this test would have failed with
// - Expected: 10
// - Actual : 0
CPPUNIT_ASSERT_EQUAL(10.0, pDoc->GetValue(ScAddress(6, 3, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A4:B4:C4:D4:E4:F4)"), pDoc->GetFormula(6, 3, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A4:B4:C4:D4:E4:F4)"_ustr, pDoc->GetFormula(6, 3, 0));
CPPUNIT_ASSERT_EQUAL(10.0, pDoc->GetValue(ScAddress(6, 3, 0)));
// Restore previous status
@@ -1194,18 +1194,18 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf97215)
aInputOption.SetSortRefUpdate(true);
pMod->SetInputOptions(aInputOption);
- CPPUNIT_ASSERT_EQUAL(OUString("Inserted at bottom"), pDoc->GetString(ScAddress(0, 23, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Inserted at bottom"_ustr, pDoc->GetString(ScAddress(0, 23, 0)));
- goToCell("A1:M24");
+ goToCell(u"A1:M24"_ustr);
// Without the fix in place, this test would have hung here
- dispatchCommand(mxComponent, ".uno:SortAscending", {});
+ dispatchCommand(mxComponent, u".uno:SortAscending"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("Inserted at bottom"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Inserted at bottom"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("Inserted at bottom"), pDoc->GetString(ScAddress(0, 23, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Inserted at bottom"_ustr, pDoc->GetString(ScAddress(0, 23, 0)));
// Restore previous status
aInputOption.SetSortRefUpdate(bOldStatus);
@@ -1224,15 +1224,15 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf104026)
lcl_AssertConditionalFormatList(*pDoc, 6, aExpectedValues);
- goToCell("A2");
- dispatchCommand(mxComponent, ".uno:DeleteRows", {});
+ goToCell(u"A2"_ustr);
+ dispatchCommand(mxComponent, u".uno:DeleteRows"_ustr, {});
// Without the fix in place, this test would have failed with
// - Expected: Cell value != $Sheet1.$B2
// - Actual : Cell value != $Sheet1.$B#REF!
lcl_AssertConditionalFormatList(*pDoc, 5, aExpectedValues);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
// tdf#140330: Without the fix in place, this test would have failed with
// - Expected: 6
@@ -1257,13 +1257,13 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf92963)
lcl_AssertConditionalFormatList(*pDoc, 3, aExpectedValues);
- goToCell("A3:C4");
+ goToCell(u"A3:C4"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
- goToCell("A1:C1");
+ goToCell(u"A1:C1"_ustr);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
aExpectedValues = { { "C3,C1", "Cell value > 14" }, { "C4,C2", "Cell value > 14" } };
lcl_AssertConditionalFormatList(*pDoc, 2, aExpectedValues);
@@ -1295,7 +1295,9 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf68290)
createScDoc("tdf68290.ods");
ScDocShell* pDocSh = getScDocShell();
- const std::vector<OUString> aExpectedAddresses{ "L3", "L6", "L9", "L10", "L11", "L13", "L15" };
+ const std::vector<OUString> aExpectedAddresses{ u"L3"_ustr, u"L6"_ustr, u"L9"_ustr,
+ u"L10"_ustr, u"L11"_ustr, u"L13"_ustr,
+ u"L15"_ustr };
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
for (const auto& rAddress : aExpectedAddresses)
@@ -1364,7 +1366,8 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf123052)
createScDoc("tdf123052.ods");
ScDocShell* pDocSh = getScDocShell();
- std::vector<OUString> aExpectedAddresses{ "F3", "D5", "E5", "F6", "A8", "E9" };
+ std::vector<OUString> aExpectedAddresses{ u"F3"_ustr, u"D5"_ustr, u"E5"_ustr,
+ u"F6"_ustr, u"A8"_ustr, u"E9"_ustr };
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
for (const auto& rAddress : aExpectedAddresses)
@@ -1402,29 +1405,29 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf120660)
aInputOption.SetReplaceCellsWarn(false);
pMod->SetInputOptions(aInputOption);
- goToCell("A8:E8");
+ goToCell(u"A8:E8"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
- goToCell("A4:E4");
+ goToCell(u"A4:E4"_ustr);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
CPPUNIT_ASSERT_EQUAL(1200.0, pDoc->GetValue(ScAddress(4, 3, 0)));
CPPUNIT_ASSERT_EQUAL(-100.0, pDoc->GetValue(ScAddress(4, 7, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(2200.0, pDoc->GetValue(ScAddress(4, 3, 0)));
CPPUNIT_ASSERT_EQUAL(900.0, pDoc->GetValue(ScAddress(4, 7, 0)));
- goToCell("A8:D8");
+ goToCell(u"A8:D8"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
- goToCell("A4:D4");
+ goToCell(u"A4:D4"_ustr);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
CPPUNIT_ASSERT_EQUAL(1200.0, pDoc->GetValue(ScAddress(4, 3, 0)));
@@ -1433,7 +1436,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf120660)
// - Actual : 900
CPPUNIT_ASSERT_EQUAL(-100.0, pDoc->GetValue(ScAddress(4, 7, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(2200.0, pDoc->GetValue(ScAddress(4, 3, 0)));
CPPUNIT_ASSERT_EQUAL(900.0, pDoc->GetValue(ScAddress(4, 7, 0)));
@@ -1448,10 +1451,10 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf146994)
createScDoc();
ScDocShell* pDocSh = getScDocShell();
- goToCell("B3");
+ goToCell(u"B3"_ustr);
lcl_AssertCurrentCursorPosition(*pDocSh, u"B3");
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RIGHT);
@@ -1460,7 +1463,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf146994)
lcl_AssertCurrentCursorPosition(*pDocSh, u"D3");
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_SHIFT | KEY_DOWN);
Scheduler::ProcessEventsToIdle();
@@ -1474,7 +1477,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf146994)
// Without the fix in place, this test would have failed with
// - Expected: Sheet1.D3:Sheet1.D4
// - Actual : Sheet1.A2:Sheet1.D3
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet1.D3:Sheet1.D4"), aMarkedAreaString);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet1.D3:Sheet1.D4"_ustr, aMarkedAreaString);
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf157897_duplicated_print_ranges)
@@ -1500,14 +1503,14 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf154991)
createScDoc("tdf154991.ods");
ScDocument* pDoc = getScDoc();
- goToCell("A1");
- dispatchCommand(mxComponent, ".uno:SelectColumn", {});
+ goToCell(u"A1"_ustr);
+ dispatchCommand(mxComponent, u".uno:SelectColumn"_ustr, {});
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:HideColumn", {});
+ dispatchCommand(mxComponent, u".uno:HideColumn"_ustr, {});
CPPUNIT_ASSERT(pDoc->ColHidden(0, 0));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT(!pDoc->ColHidden(0, 0));
}
@@ -1516,17 +1519,17 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf151752)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"1");
+ insertStringToCell(u"A1"_ustr, u"1");
- goToCell("A1");
- dispatchCommand(mxComponent, ".uno:SelectUnprotectedCells", {});
+ goToCell(u"A1"_ustr);
+ dispatchCommand(mxComponent, u".uno:SelectUnprotectedCells"_ustr, {});
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
- goToCell("B1");
+ goToCell(u"B1"_ustr);
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(0, 0, 0));
CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(1, 0, 0));
@@ -1538,17 +1541,17 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf95306)
ScDocument* pDoc = getScDoc();
// Use Adding Selection
- dispatchCommand(mxComponent, ".uno:StatusSelectionModeExp", {});
+ dispatchCommand(mxComponent, u".uno:StatusSelectionModeExp"_ustr, {});
- goToCell("B1");
- dispatchCommand(mxComponent, ".uno:SelectColumn", {});
+ goToCell(u"B1"_ustr);
+ dispatchCommand(mxComponent, u".uno:SelectColumn"_ustr, {});
- dispatchCommand(mxComponent, ".uno:GoRight", {});
- dispatchCommand(mxComponent, ".uno:GoRight", {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
- dispatchCommand(mxComponent, ".uno:SelectColumn", {});
+ dispatchCommand(mxComponent, u".uno:SelectColumn"_ustr, {});
- dispatchCommand(mxComponent, ".uno:HideColumn", {});
+ dispatchCommand(mxComponent, u".uno:HideColumn"_ustr, {});
CPPUNIT_ASSERT(!pDoc->ColHidden(0, 0));
CPPUNIT_ASSERT(pDoc->ColHidden(1, 0));
@@ -1556,7 +1559,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf95306)
CPPUNIT_ASSERT(pDoc->ColHidden(3, 0));
CPPUNIT_ASSERT(!pDoc->ColHidden(4, 0));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT(!pDoc->ColHidden(0, 0));
CPPUNIT_ASSERT(!pDoc->ColHidden(1, 0));
@@ -1570,13 +1573,13 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf102525)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"1");
- insertStringToCell("A2", u"2");
- insertStringToCell("A3", u"3");
- insertStringToCell("A4", u"4");
+ insertStringToCell(u"A1"_ustr, u"1");
+ insertStringToCell(u"A2"_ustr, u"2");
+ insertStringToCell(u"A3"_ustr, u"3");
+ insertStringToCell(u"A4"_ustr, u"4");
- insertArrayToCell("B1", u"=IF(A1:A4>2,1,2)");
- goToCell("B1:B4");
+ insertArrayToCell(u"B1"_ustr, u"=IF(A1:A4>2,1,2)");
+ goToCell(u"B1:B4"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_F4);
@@ -1587,16 +1590,16 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf102525)
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(1, 2, 0));
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(1, 3, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("{=IF($A$1:$A$4>2,1,2)}"), pDoc->GetFormula(1, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"{=IF($A$1:$A$4>2,1,2)}"_ustr, pDoc->GetFormula(1, 0, 0));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(1, 0, 0));
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(1, 1, 0));
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(1, 2, 0));
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(1, 3, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("{=IF(A1:A4>2,1,2)}"), pDoc->GetFormula(1, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"{=IF(A1:A4>2,1,2)}"_ustr, pDoc->GetFormula(1, 0, 0));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf39650)
@@ -1606,20 +1609,20 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf39650)
FormulaGrammarSwitch aFGSwitch(pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
- insertStringToCell("R3C3", u"xxx");
- insertStringToCell("R2C2", u"=R[1]C[1]");
+ insertStringToCell(u"R3C3"_ustr, u"xxx");
+ insertStringToCell(u"R2C2"_ustr, u"=R[1]C[1]");
- CPPUNIT_ASSERT_EQUAL(OUString("=R[1]C[1]"), pDoc->GetFormula(1, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("xxx"), pDoc->GetString(1, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=R[1]C[1]"_ustr, pDoc->GetFormula(1, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"xxx"_ustr, pDoc->GetString(1, 1, 0));
- goToCell("B2");
+ goToCell(u"B2"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_F4);
Scheduler::ProcessEventsToIdle();
- CPPUNIT_ASSERT_EQUAL(OUString("=R3C3"), pDoc->GetFormula(1, 1, 0));
- CPPUNIT_ASSERT_EQUAL(OUString("xxx"), pDoc->GetString(1, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=R3C3"_ustr, pDoc->GetFormula(1, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"xxx"_ustr, pDoc->GetString(1, 1, 0));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf45020)
@@ -1627,11 +1630,11 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf45020)
createScDoc();
ScDocument* pDoc = getScDoc();
- goToCell("A2:A3");
+ goToCell(u"A2:A3"_ustr);
- dispatchCommand(mxComponent, ".uno:HideRow", {});
+ dispatchCommand(mxComponent, u".uno:HideRow"_ustr, {});
- goToCell("A1");
+ goToCell(u"A1"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_SHIFT | KEY_DOWN);
@@ -1645,7 +1648,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf45020)
// Without the fix in place, this test would have failed with
// - Expected: Sheet1.A1:Sheet1.A4
// - Actual : Sheet1.A1:Sheet1.A2
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet1.A1:Sheet1.A4"), aMarkedAreaString);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet1.A1:Sheet1.A4"_ustr, aMarkedAreaString);
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf117706)
@@ -1653,35 +1656,35 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf117706)
createScDoc();
ScDocShell* pDocSh = getScDocShell();
- insertStringToCell("A1", u"A1");
- insertStringToCell("A3", u"A3");
+ insertStringToCell(u"A1"_ustr, u"A1");
+ insertStringToCell(u"A3"_ustr, u"A3");
// Use Adding Selection
- dispatchCommand(mxComponent, ".uno:StatusSelectionModeExp", {});
+ dispatchCommand(mxComponent, u".uno:StatusSelectionModeExp"_ustr, {});
- goToCell("A1");
- dispatchCommand(mxComponent, ".uno:SelectRow", {});
+ goToCell(u"A1"_ustr);
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, {});
- dispatchCommand(mxComponent, ".uno:GoDown", {});
- dispatchCommand(mxComponent, ".uno:GoDown", {});
+ dispatchCommand(mxComponent, u".uno:GoDown"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:GoDown"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"A3");
- dispatchCommand(mxComponent, ".uno:SelectRow", {});
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, {});
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// Open a new document
createScDoc();
ScDocument* pDoc = getScDoc();
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
// Without the fix in place, this test would have failed with
// - Expected: A1
// - Actual : A3
- CPPUNIT_ASSERT_EQUAL(OUString("A1"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("A3"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A1"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A3"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf159373)
@@ -1695,11 +1698,11 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf159373)
comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(0)) } }));
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:Remove", aArgs);
+ dispatchCommand(mxComponent, u".uno:Remove"_ustr, aArgs);
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(1), pDoc->GetTableCount());
- dispatchCommand(mxComponent, ".uno:Undo", aArgs);
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, aArgs);
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(2), pDoc->GetTableCount());
}
@@ -1715,7 +1718,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf86166)
comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(0)) } }));
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:Remove", aArgs);
+ dispatchCommand(mxComponent, u".uno:Remove"_ustr, aArgs);
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(1), pDoc->GetTableCount());
}
@@ -1730,12 +1733,12 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf158802)
uno::Sequence<beans::PropertyValue> aArgs(
comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(0)) } }));
- dispatchCommand(mxComponent, ".uno:Remove", aArgs);
+ dispatchCommand(mxComponent, u".uno:Remove"_ustr, aArgs);
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(1), pDoc->GetTableCount());
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:Undo", aArgs);
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, aArgs);
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(2), pDoc->GetTableCount());
}
@@ -1751,7 +1754,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf149502_HangOnDeletingSheet1)
comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(0)) } }));
// Before the fix in place, this test frozen here
- dispatchCommand(mxComponent, ".uno:Remove", aArgs);
+ dispatchCommand(mxComponent, u".uno:Remove"_ustr, aArgs);
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(3), pDoc->GetTableCount());
}
@@ -1761,12 +1764,12 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf149503)
createScDoc("tdf149503.xls");
ScDocument* pDoc = getScDoc();
- dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
- dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, u".uno:Cut"_ustr, {});
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
ScDPCollection* pDPs = pDoc->GetDPCollection();
CPPUNIT_ASSERT_EQUAL(size_t(1), pDPs->GetCount());
@@ -1777,18 +1780,18 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf108292)
createScDoc("tdf108292.ods");
ScDocument* pDoc = getScDoc();
- dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// Open a new document
createScDoc();
pDoc = getScDoc();
// Without the fix in place, this test would have crashed
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("2D"), pDoc->GetString(ScAddress(26, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2D"_ustr, pDoc->GetString(ScAddress(26, 0, 0)));
}
// Inspired from testTdf117706, test columns instead of rows
@@ -1797,32 +1800,32 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testMultiRangeCol)
createScDoc();
ScDocShell* pDocSh = getScDocShell();
- insertStringToCell("A1", u"A1");
- insertStringToCell("C1", u"C1");
+ insertStringToCell(u"A1"_ustr, u"A1");
+ insertStringToCell(u"C1"_ustr, u"C1");
// Use Adding Selection
- dispatchCommand(mxComponent, ".uno:StatusSelectionModeExp", {});
+ dispatchCommand(mxComponent, u".uno:StatusSelectionModeExp"_ustr, {});
- goToCell("A1");
- dispatchCommand(mxComponent, ".uno:SelectColumn", {});
+ goToCell(u"A1"_ustr);
+ dispatchCommand(mxComponent, u".uno:SelectColumn"_ustr, {});
- dispatchCommand(mxComponent, ".uno:GoRight", {});
- dispatchCommand(mxComponent, ".uno:GoRight", {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"C1");
- dispatchCommand(mxComponent, ".uno:SelectColumn", {});
+ dispatchCommand(mxComponent, u".uno:SelectColumn"_ustr, {});
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// Open a new document
createScDoc();
ScDocument* pDoc = getScDoc();
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("A1"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("C1"), pDoc->GetString(ScAddress(1, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(2, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A1"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"C1"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
}
// Test the call of .uno:PasteTransposed (tdf#102255)
@@ -1832,19 +1835,19 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testPasteTransposed)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"1");
- insertStringToCell("A2", u"a");
- insertStringToCell("A3", u"=A1");
+ insertStringToCell(u"A1"_ustr, u"1");
+ insertStringToCell(u"A2"_ustr, u"a");
+ insertStringToCell(u"A3"_ustr, u"=A1");
// Add a note to A1
- goToCell("A1");
+ goToCell(u"A1"_ustr);
uno::Sequence<beans::PropertyValue> aArgs
- = comphelper::InitPropertySequence({ { "Text", uno::Any(OUString("Note in A1")) } });
- dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
+ = comphelper::InitPropertySequence({ { "Text", uno::Any(u"Note in A1"_ustr) } });
+ dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aArgs);
// Set A2 bold
- goToCell("A2");
- dispatchCommand(mxComponent, ".uno:Bold", {});
+ goToCell(u"A2"_ustr);
+ dispatchCommand(mxComponent, u".uno:Bold"_ustr, {});
// Check preconditions
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
@@ -1853,27 +1856,27 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testPasteTransposed)
pPattern->fillFontOnly(aFont);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight());
- goToCell("A1:A3");
+ goToCell(u"A1:A3"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// Open a new document
createScDoc();
pDoc = getScDoc();
- dispatchCommand(mxComponent, ".uno:PasteTransposed", {});
+ dispatchCommand(mxComponent, u".uno:PasteTransposed"_ustr, {});
OUString aFormula;
- CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(0, 0, 0)); // A1
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(0, 0, 0)); // A1
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(0, 0, 0)); // A1
- CPPUNIT_ASSERT_EQUAL(OUString("a"), pDoc->GetString(1, 0, 0)); // B1
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, pDoc->GetString(1, 0, 0)); // B1
aFormula = pDoc->GetFormula(2, 0, 0); // C1
- CPPUNIT_ASSERT_EQUAL(OUString("=A1"), aFormula); // C1
- CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(2, 0, 0)); // C1
+ CPPUNIT_ASSERT_EQUAL(u"=A1"_ustr, aFormula); // C1
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(2, 0, 0)); // C1
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(2, 0, 0)); // C1
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Note in A1"), pDoc->GetNote(ScAddress(0, 0, 0))->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"Note in A1"_ustr, pDoc->GetNote(ScAddress(0, 0, 0))->GetText());
pPattern = pDoc->GetPattern(1, 0, 0);
pPattern->fillFontOnly(aFont);
@@ -1887,19 +1890,19 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testPasteAsLink)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"1");
- insertStringToCell("A2", u"a");
- insertStringToCell("A3", u"=A1");
+ insertStringToCell(u"A1"_ustr, u"1");
+ insertStringToCell(u"A2"_ustr, u"a");
+ insertStringToCell(u"A3"_ustr, u"=A1");
// Add a note to A1
- goToCell("A1");
+ goToCell(u"A1"_ustr);
uno::Sequence<beans::PropertyValue> aArgs
- = comphelper::InitPropertySequence({ { "Text", uno::Any(OUString("Note in A1")) } });
- dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
+ = comphelper::InitPropertySequence({ { "Text", uno::Any(u"Note in A1"_ustr) } });
+ dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aArgs);
// Set A2 bold
- goToCell("A2");
- dispatchCommand(mxComponent, ".uno:Bold", {});
+ goToCell(u"A2"_ustr);
+ dispatchCommand(mxComponent, u".uno:Bold"_ustr, {});
// Check preconditions
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
@@ -1908,20 +1911,20 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testPasteAsLink)
pPattern->fillFontOnly(aFont);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight());
- goToCell("A1:A3");
+ goToCell(u"A1:A3"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
- goToCell("C1");
+ goToCell(u"C1"_ustr);
- dispatchCommand(mxComponent, ".uno:PasteAsLink", {});
+ dispatchCommand(mxComponent, u".uno:PasteAsLink"_ustr, {});
OUString aFormula = pDoc->GetFormula(2, 0, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=$Sheet1.$A$1"), aFormula); // C1
+ CPPUNIT_ASSERT_EQUAL(u"=$Sheet1.$A$1"_ustr, aFormula); // C1
aFormula = pDoc->GetFormula(2, 1, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=$Sheet1.$A$2"), aFormula); // C2
+ CPPUNIT_ASSERT_EQUAL(u"=$Sheet1.$A$2"_ustr, aFormula); // C2
aFormula = pDoc->GetFormula(2, 2, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=$Sheet1.$A$3"), aFormula); // C3
+ CPPUNIT_ASSERT_EQUAL(u"=$Sheet1.$A$3"_ustr, aFormula); // C3
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(2, 0, 0)); // C1
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(2, 2, 0)); // C3
@@ -1938,12 +1941,12 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf119659)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertArrayToCell("A1:C1", u"={1,2,3}");
+ insertArrayToCell(u"A1:C1"_ustr, u"={1,2,3}");
- insertStringToCell("A2", u"=LOOKUP(3; A1:C1; {1,2})");
+ insertStringToCell(u"A2"_ustr, u"=LOOKUP(3; A1:C1; {1,2})");
// Without the fix in place, this test would have crashed here
- CPPUNIT_ASSERT_EQUAL(OUString("#N/A"), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#N/A"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf131442)
@@ -1951,32 +1954,32 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf131442)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertArrayToCell("A1:A5", u"={6;4;2;5;3}");
+ insertArrayToCell(u"A1:A5"_ustr, u"={6;4;2;5;3}");
- CPPUNIT_ASSERT_EQUAL(OUString("6"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("4"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("5"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("3"), pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"6"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"4"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"5"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"3"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
- dispatchCommand(mxComponent, ".uno:SortAscending", {});
+ dispatchCommand(mxComponent, u".uno:SortAscending"_ustr, {});
// Without the fix in place, this test would have failed with
// - Expected: 6
// - Actual : #REF!
- CPPUNIT_ASSERT_EQUAL(OUString("6"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("4"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("5"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("3"), pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"6"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"4"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"5"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"3"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
- dispatchCommand(mxComponent, ".uno:SortDescending", {});
+ dispatchCommand(mxComponent, u".uno:SortDescending"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("6"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("4"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("5"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("3"), pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"6"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"4"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"5"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"3"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf117458)
@@ -2034,18 +2037,18 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf90694)
ScDocument* pDoc = getScDoc();
// Select row 30 to 60
- goToCell("30:60");
+ goToCell(u"30:60"_ustr);
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:DeleteRows", {});
+ dispatchCommand(mxComponent, u".uno:DeleteRows"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 29, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 59, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 29, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 59, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), pDoc->GetString(ScAddress(0, 29, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), pDoc->GetString(ScAddress(0, 59, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#REF!"_ustr, pDoc->GetString(ScAddress(0, 29, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#REF!"_ustr, pDoc->GetString(ScAddress(0, 59, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf138710)
@@ -2053,24 +2056,24 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf138710)
createScDoc("tdf138710.ods");
ScDocument* pDoc = getScDoc();
- dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:DeleteRows", {});
+ dispatchCommand(mxComponent, u".uno:DeleteRows"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 0, 1)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 0, 1)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("Total"), pDoc->GetString(ScAddress(0, 0, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"Total"_ustr, pDoc->GetString(ScAddress(0, 0, 1)));
- dispatchCommand(mxComponent, ".uno:DeleteRows", {});
+ dispatchCommand(mxComponent, u".uno:DeleteRows"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 0, 1)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 0, 1)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("Total"), pDoc->GetString(ScAddress(0, 0, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"Total"_ustr, pDoc->GetString(ScAddress(0, 0, 1)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf128914)
@@ -2080,13 +2083,13 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf128914)
CPPUNIT_ASSERT_EQUAL(6.0, pDoc->GetValue(ScAddress(3, 1, 0)));
- goToCell("D2");
+ goToCell(u"D2"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
- goToCell("D3:D6");
+ goToCell(u"D3:D6"_ustr);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
// Without the fix in place, this test would have failed with
// - Expected: 24
@@ -2098,13 +2101,13 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf128914)
CPPUNIT_ASSERT_EQUAL(6.0, pDoc->GetValue(ScAddress(1, 14, 0)));
- goToCell("B15");
+ goToCell(u"B15"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
- goToCell("C15:F15");
+ goToCell(u"C15:F15"_ustr);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
CPPUNIT_ASSERT_EQUAL(24.0, pDoc->GetValue(ScAddress(2, 14, 0)));
CPPUNIT_ASSERT_EQUAL(60.0, pDoc->GetValue(ScAddress(3, 14, 0)));
@@ -2117,24 +2120,24 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf108654)
createScDoc("tdf108654.ods");
ScDocument* pDoc = getScDoc();
- dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
insertNewSheet(*pDoc);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
OUString aFormula = pDoc->GetFormula(3, 126, 1);
- CPPUNIT_ASSERT_EQUAL(OUString("=VLOOKUP(C127,#REF!,D$1,0)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=VLOOKUP(C127,#REF!,D$1,0)"_ustr, aFormula);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
aFormula = pDoc->GetFormula(3, 126, 1);
- CPPUNIT_ASSERT_EQUAL(OUString(""), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(2), pDoc->GetTableCount());
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(1), pDoc->GetTableCount());
}
@@ -2146,17 +2149,17 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf150219)
insertNewSheet(*pDoc);
- insertStringToCell("A1", u"=$Sheet1.A1");
- goToCell("A1");
+ insertStringToCell(u"A1"_ustr, u"=$Sheet1.A1");
+ goToCell(u"A1"_ustr);
- CPPUNIT_ASSERT_EQUAL(OUString("0"), pDoc->GetString(ScAddress(0, 0, 1)));
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pDoc->GetString(ScAddress(0, 0, 1)));
- dispatchCommand(mxComponent, ".uno:ShowPrecedents", {});
+ dispatchCommand(mxComponent, u".uno:ShowPrecedents"_ustr, {});
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, u".uno:Cut"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 0, 1)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 0, 1)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf153790)
@@ -2164,26 +2167,26 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf153790)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"=SUM($Sheet1.B1:C1)");
+ insertStringToCell(u"A1"_ustr, u"=SUM($Sheet1.B1:C1)");
- CPPUNIT_ASSERT_EQUAL(OUString("0"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
- goToCell("A1");
- dispatchCommand(mxComponent, ".uno:Copy", {});
- goToCell("A2");
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ goToCell(u"A1"_ustr);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+ goToCell(u"A2"_ustr);
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($Sheet1.B2:C2)"), pDoc->GetFormula(0, 1, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($Sheet1.B2:C2)"_ustr, pDoc->GetFormula(0, 1, 0));
- goToCell("A1");
- dispatchCommand(mxComponent, ".uno:Cut", {});
- goToCell("A3");
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ goToCell(u"A1"_ustr);
+ dispatchCommand(mxComponent, u".uno:Cut"_ustr, {});
+ goToCell(u"A3"_ustr);
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
// Without the fix in place, this test would have failed with
// - Expected: =SUM($Sheet1.B1:C1)
// - Actual : =SUM($Sheet1.B1:$Sheet1.C1)
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM($Sheet1.B1:C1)"), pDoc->GetFormula(0, 2, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM($Sheet1.B1:C1)"_ustr, pDoc->GetFormula(0, 2, 0));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf141440)
@@ -2192,33 +2195,33 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf141440)
ScDocument* pDoc = getScDoc();
// Insert a note to cell A1
- goToCell("A1");
+ goToCell(u"A1"_ustr);
uno::Sequence<beans::PropertyValue> aArgs
- = comphelper::InitPropertySequence({ { "Text", uno::Any(OUString("Note in A1")) } });
- dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
+ = comphelper::InitPropertySequence({ { "Text", uno::Any(u"Note in A1"_ustr) } });
+ dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aArgs);
// Insert a formula to cell A2
- insertStringToCell("A2", u"=1+1");
- CPPUNIT_ASSERT_EQUAL(OUString("2"), pDoc->GetString(ScAddress(0, 1, 0)));
+ insertStringToCell(u"A2"_ustr, u"=1+1");
+ CPPUNIT_ASSERT_EQUAL(u"2"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
// Copy content of A2 to A1 using paste special command as a formula (Flags F)
- goToCell("A2");
- dispatchCommand(mxComponent, ".uno:Copy", {});
- goToCell("A1");
+ goToCell(u"A2"_ustr);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+ goToCell(u"A1"_ustr);
aArgs = comphelper::InitPropertySequence(
- { { "Flags", uno::Any(OUString("F")) },
+ { { "Flags", uno::Any(u"F"_ustr) },
{ "FormulaCommand", uno::Any(sal_uInt16(ScPasteFunc::ADD)) },
{ "SkipEmptyCells", uno::Any(false) },
{ "Transpose", uno::Any(false) },
{ "AsLink", uno::Any(false) },
{ "MoveMode", uno::Any(sal_uInt16(InsCellCmd::INS_NONE)) } });
- dispatchCommand(mxComponent, ".uno:InsertContents", aArgs);
+ dispatchCommand(mxComponent, u".uno:InsertContents"_ustr, aArgs);
// Check if string in cell A2 was copied to cell A1
- CPPUNIT_ASSERT_EQUAL(OUString("2"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
// Without the fix in place, there would be no note in cell A1 after using paste special
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Note in A1"), pDoc->GetNote(ScAddress(0, 0, 0))->GetText());
+ CPPUNIT_ASSERT_EQUAL(u"Note in A1"_ustr, pDoc->GetNote(ScAddress(0, 0, 0))->GetText());
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf158551)
@@ -2226,14 +2229,14 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf158551)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"10");
+ insertStringToCell(u"A1"_ustr, u"10");
// Copy content of A1 to B1 using Formula Add
- goToCell("A1");
- dispatchCommand(mxComponent, ".uno:Copy", {});
- goToCell("B1");
+ goToCell(u"A1"_ustr);
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+ goToCell(u"B1"_ustr);
uno::Sequence<beans::PropertyValue> aArgs = comphelper::InitPropertySequence(
- { { "Flags", uno::Any(OUString("SVD")) },
+ { { "Flags", uno::Any(u"SVD"_ustr) },
{ "FormulaCommand", uno::Any(sal_uInt16(ScPasteFunc::ADD)) },
{ "SkipEmptyCells", uno::Any(false) },
{ "Transpose", uno::Any(false) },
@@ -2241,23 +2244,23 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf158551)
{ "MoveMode", uno::Any(sal_uInt16(InsCellCmd::INS_NONE)) } });
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:InsertContents", aArgs);
+ dispatchCommand(mxComponent, u".uno:InsertContents"_ustr, aArgs);
- CPPUNIT_ASSERT_EQUAL(OUString("10"), pDoc->GetString(ScAddress(1, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"10"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf159174)
{
createScDoc();
- dispatchCommand(mxComponent, ".uno:SelectUnprotectedCells", {});
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:SelectUnprotectedCells"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
uno::Sequence<beans::PropertyValue> aPropertyValues = comphelper::InitPropertySequence(
{ { "SelectedFormat", uno::Any(static_cast<sal_uInt32>(SotClipboardFormatId::BITMAP)) } });
// Without the fix in place, this test would have crashed
- dispatchCommand(mxComponent, ".uno:ClipboardFormatItems", aPropertyValues);
+ dispatchCommand(mxComponent, u".uno:ClipboardFormatItems"_ustr, aPropertyValues);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
uno::Reference<drawing::XDrawPage> xPage(pModelObj->getDrawPages()->getByIndex(0),
@@ -2273,15 +2276,15 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testKeyboardMergeRef)
ScTabViewShell* pViewShell = pDocSh->GetBestViewShell(false);
CPPUNIT_ASSERT(pViewShell);
- goToCell("A1:A5");
- dispatchCommand(mxComponent, ".uno:ToggleMergeCells", {});
- goToCell("A6:A10");
- dispatchCommand(mxComponent, ".uno:ToggleMergeCells", {});
+ goToCell(u"A1:A5"_ustr);
+ dispatchCommand(mxComponent, u".uno:ToggleMergeCells"_ustr, {});
+ goToCell(u"A6:A10"_ustr);
+ dispatchCommand(mxComponent, u".uno:ToggleMergeCells"_ustr, {});
- goToCell("B1");
+ goToCell(u"B1"_ustr);
typeString(u"=");
- goToCell("A1");
+ goToCell(u"A1"_ustr);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN | KEY_SHIFT);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DOWN | KEY_SHIFT);
@@ -2290,7 +2293,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testKeyboardMergeRef)
{
const OUString* pInput = pViewShell->GetEditString();
CPPUNIT_ASSERT(pInput);
- CPPUNIT_ASSERT_EQUAL(OUString("=A1:A10"), *pInput);
+ CPPUNIT_ASSERT_EQUAL(u"=A1:A10"_ustr, *pInput);
}
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_UP | KEY_SHIFT);
@@ -2300,7 +2303,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testKeyboardMergeRef)
{
const OUString* pInput = pViewShell->GetEditString();
CPPUNIT_ASSERT(pInput);
- CPPUNIT_ASSERT_EQUAL(OUString("=A1:A5"), *pInput);
+ CPPUNIT_ASSERT_EQUAL(u"=A1:A5"_ustr, *pInput);
}
}
@@ -2312,12 +2315,12 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testMouseMergeRef)
ScTabViewShell* pViewShell = pDocSh->GetBestViewShell(false);
CPPUNIT_ASSERT(pViewShell);
- goToCell("A1:A5");
- dispatchCommand(mxComponent, ".uno:ToggleMergeCells", {});
- goToCell("A6:A10");
- dispatchCommand(mxComponent, ".uno:ToggleMergeCells", {});
+ goToCell(u"A1:A5"_ustr);
+ dispatchCommand(mxComponent, u".uno:ToggleMergeCells"_ustr, {});
+ goToCell(u"A6:A10"_ustr);
+ dispatchCommand(mxComponent, u".uno:ToggleMergeCells"_ustr, {});
- goToCell("B1");
+ goToCell(u"B1"_ustr);
typeString(u"=");
Point aA1 = pViewShell->GetViewData().GetPrintTwipsPos(0, 0);
@@ -2335,7 +2338,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testMouseMergeRef)
{
const OUString* pInput = pViewShell->GetEditString();
CPPUNIT_ASSERT(pInput);
- CPPUNIT_ASSERT_EQUAL(OUString("=A1:A10"), *pInput);
+ CPPUNIT_ASSERT_EQUAL(u"=A1:A10"_ustr, *pInput);
}
}
diff --git a/sc/qa/unit/uicalc/uicalc2.cxx b/sc/qa/unit/uicalc/uicalc2.cxx
index 233555923816..346255a42303 100644
--- a/sc/qa/unit/uicalc/uicalc2.cxx
+++ b/sc/qa/unit/uicalc/uicalc2.cxx
@@ -43,7 +43,7 @@ public:
};
ScUiCalcTest2::ScUiCalcTest2()
- : ScModelTestBase("sc/qa/unit/uicalc/data")
+ : ScModelTestBase(u"sc/qa/unit/uicalc/data"_ustr)
{
}
@@ -83,7 +83,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf150499)
comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(0)) } }));
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:Remove", aArgs);
+ dispatchCommand(mxComponent, u".uno:Remove"_ustr, aArgs);
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(1), pDoc->GetTableCount());
}
@@ -93,9 +93,10 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf158254)
createScDoc();
ScDocument* pDoc = getScDoc();
- goToCell("A:G");
+ goToCell(u"A:G"_ustr);
dispatchCommand(mxComponent,
- ".uno:StyleApply?Style:string=Accent%201&FamilyName:string=CellStyles", {});
+ u".uno:StyleApply?Style:string=Accent%201&FamilyName:string=CellStyles"_ustr,
+ {});
const ScPatternAttr* pPattern = pDoc->GetPattern(5, 0, 0);
ScStyleSheet* pStyleSheet = const_cast<ScStyleSheet*>(pPattern->GetStyleSheet());
@@ -103,13 +104,13 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf158254)
// Without the fix in place, this test would have failed with
// - Expected: Accent 1
// - Actual : Default
- CPPUNIT_ASSERT_EQUAL(OUString("Accent 1"), pStyleSheet->GetName());
+ CPPUNIT_ASSERT_EQUAL(u"Accent 1"_ustr, pStyleSheet->GetName());
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
pPattern = pDoc->GetPattern(5, 0, 0);
pStyleSheet = const_cast<ScStyleSheet*>(pPattern->GetStyleSheet());
- CPPUNIT_ASSERT_EQUAL(OUString("Default"), pStyleSheet->GetName());
+ CPPUNIT_ASSERT_EQUAL(u"Default"_ustr, pStyleSheet->GetName());
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf125030)
@@ -117,22 +118,23 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf125030)
createScDoc();
ScDocument* pDoc = getScDoc();
- goToCell("A1");
+ goToCell(u"A1"_ustr);
dispatchCommand(mxComponent,
- ".uno:StyleApply?Style:string=Accent%201&FamilyName:string=CellStyles", {});
+ u".uno:StyleApply?Style:string=Accent%201&FamilyName:string=CellStyles"_ustr,
+ {});
const ScPatternAttr* pPatternA1 = pDoc->GetPattern(0, 0, 0);
ScStyleSheet* pStyleSheetA1 = const_cast<ScStyleSheet*>(pPatternA1->GetStyleSheet());
- CPPUNIT_ASSERT_EQUAL(OUString("Accent 1"), pStyleSheetA1->GetName());
+ CPPUNIT_ASSERT_EQUAL(u"Accent 1"_ustr, pStyleSheetA1->GetName());
- goToCell("A2");
- dispatchCommand(mxComponent, ".uno:Repeat", {});
+ goToCell(u"A2"_ustr);
+ dispatchCommand(mxComponent, u".uno:Repeat"_ustr, {});
const ScPatternAttr* pPatternA2 = pDoc->GetPattern(0, 1, 0);
ScStyleSheet* pStyleSheetA2 = const_cast<ScStyleSheet*>(pPatternA2->GetStyleSheet());
- CPPUNIT_ASSERT_EQUAL(OUString("Accent 1"), pStyleSheetA2->GetName());
+ CPPUNIT_ASSERT_EQUAL(u"Accent 1"_ustr, pStyleSheetA2->GetName());
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf133326)
@@ -140,42 +142,42 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf133326)
createScDoc("tdf133326.ods");
ScDocument* pDoc = getScDoc();
- dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
insertNewSheet(*pDoc);
OUString aFormula = pDoc->GetFormula(0, 0, 1);
- CPPUNIT_ASSERT_EQUAL(OUString(""), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, aFormula);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
aFormula = pDoc->GetFormula(0, 0, 1);
- CPPUNIT_ASSERT_EQUAL(OUString("=RAND()*1000000"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=RAND()*1000000"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(2), pDoc->GetTableCount());
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
aFormula = pDoc->GetFormula(0, 0, 1);
- CPPUNIT_ASSERT_EQUAL(OUString(""), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(2), pDoc->GetTableCount());
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(1), pDoc->GetTableCount());
- dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(2), pDoc->GetTableCount());
aFormula = pDoc->GetFormula(0, 0, 1);
- CPPUNIT_ASSERT_EQUAL(OUString(""), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, aFormula);
// Without the fix in place, it would have crashed here
- dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
aFormula = pDoc->GetFormula(0, 0, 1);
- CPPUNIT_ASSERT_EQUAL(OUString("=RAND()*1000000"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=RAND()*1000000"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(2), pDoc->GetTableCount());
}
@@ -185,14 +187,14 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf126685)
ScDocument* pDoc = getScDoc();
- dispatchCommand(mxComponent, ".uno:SelectAll", {}); // test should crash here without the fix
+ dispatchCommand(mxComponent, u".uno:SelectAll"_ustr,
+ {}); // test should crash here without the fix
- CPPUNIT_ASSERT_EQUAL(
- OUString("Control Height will change from 0.65 to 0.61 cm with 120dpi ..."),
- pDoc->GetString(ScAddress(3, 1, 1)));
- dispatchCommand(mxComponent, ".uno:Cut", {});
+ CPPUNIT_ASSERT_EQUAL(u"Control Height will change from 0.65 to 0.61 cm with 120dpi ..."_ustr,
+ pDoc->GetString(ScAddress(3, 1, 1)));
+ dispatchCommand(mxComponent, u".uno:Cut"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(3, 1, 1)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(3, 1, 1)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf119793)
@@ -222,12 +224,12 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf119793)
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_ESCAPE);
Scheduler::ProcessEventsToIdle();
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5084), xShape->getPosition().X);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1381), xShape->getPosition().Y);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
// Without the fix in place, this test would have failed with
// - Expected: 4984
@@ -240,7 +242,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf119793)
// - Actual : x
uno::Reference<text::XText> xText
= uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText();
- CPPUNIT_ASSERT_EQUAL(OUString(""), xText->getString());
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, xText->getString());
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf131455)
@@ -251,29 +253,29 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf131455)
ScDocShell* pDocSh = getScDocShell();
lcl_AssertCurrentCursorPosition(*pDocSh, u"A5");
- dispatchCommand(mxComponent, ".uno:GoRight", {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"B5");
- dispatchCommand(mxComponent, ".uno:GoRight", {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"E5");
- dispatchCommand(mxComponent, ".uno:GoRight", {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"F5");
- dispatchCommand(mxComponent, ".uno:GoRight", {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"I5");
- dispatchCommand(mxComponent, ".uno:GoRight", {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"J5");
- dispatchCommand(mxComponent, ".uno:GoRight", {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"M5");
//Cursor can't move forward to the right
for (size_t i = 0; i < 5; ++i)
{
- dispatchCommand(mxComponent, ".uno:GoRight", {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"N5");
}
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getViewShell()->GetViewData().GetTabNo());
- dispatchCommand(mxComponent, ".uno:JumpToNextTable", {});
+ dispatchCommand(mxComponent, u".uno:JumpToNextTable"_ustr, {});
CPPUNIT_ASSERT_EQUAL(sal_Int16(1), getViewShell()->GetViewData().GetTabNo());
lcl_AssertCurrentCursorPosition(*pDocSh, u"A4");
@@ -281,15 +283,15 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf131455)
// Go to row 9
for (size_t i = 0; i < 6; ++i)
{
- dispatchCommand(mxComponent, ".uno:GoDown", {});
+ dispatchCommand(mxComponent, u".uno:GoDown"_ustr, {});
}
lcl_AssertCurrentCursorPosition(*pDocSh, u"A10");
- dispatchCommand(mxComponent, ".uno:SelectRow", {});
- dispatchCommand(mxComponent, ".uno:DeleteRows", {});
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:DeleteRows"_ustr, {});
- dispatchCommand(mxComponent, ".uno:JumpToPrevTable", {});
+ dispatchCommand(mxComponent, u".uno:JumpToPrevTable"_ustr, {});
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getViewShell()->GetViewData().GetTabNo());
lcl_AssertCurrentCursorPosition(*pDocSh, u"N5");
@@ -297,7 +299,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf131455)
//Cursor can't move forward to the right
for (size_t i = 0; i < 5; ++i)
{
- dispatchCommand(mxComponent, ".uno:GoRight", {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"N5");
}
}
@@ -309,7 +311,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf124818)
CPPUNIT_ASSERT_EQUAL(sal_Int16(2), getViewShell()->GetViewData().GetTabNo());
- dispatchCommand(mxComponent, ".uno:JumpToPrevTable", {});
+ dispatchCommand(mxComponent, u".uno:JumpToPrevTable"_ustr, {});
CPPUNIT_ASSERT_EQUAL(sal_Int16(1), getViewShell()->GetViewData().GetTabNo());
@@ -317,13 +319,13 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf124818)
SdrPage* pPage = pDrawLayer->GetPage(1);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pPage->GetObjCount());
- dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
- dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, u".uno:Cut"_ustr, {});
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pPage->GetObjCount());
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pPage->GetObjCount());
}
@@ -342,9 +344,9 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf124816)
CPPUNIT_ASSERT_EQUAL(aExpectedResult, pDoc->GetString(ScAddress(3, 9, 0)));
//Without the fix, it would crash
- dispatchCommand(mxComponent, ".uno:InsertRowsBefore", {});
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(3, 9, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:InsertRowsBefore"_ustr, {});
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(3, 9, 0)));
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(aExpectedResult, pDoc->GetString(ScAddress(3, 9, 0)));
}
@@ -353,13 +355,13 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf124815)
createScDoc("tdf124815.ods");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("Rakennukset"), pDoc->GetString(ScAddress(2, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Rakennukset"_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
//Without the fix, it would crash
- dispatchCommand(mxComponent, ".uno:InsertColumnsBefore", {});
- CPPUNIT_ASSERT_EQUAL(OUString("Rakennukset"), pDoc->GetString(ScAddress(3, 0, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
- CPPUNIT_ASSERT_EQUAL(OUString("Rakennukset"), pDoc->GetString(ScAddress(2, 0, 0)));
+ dispatchCommand(mxComponent, u".uno:InsertColumnsBefore"_ustr, {});
+ CPPUNIT_ASSERT_EQUAL(u"Rakennukset"_ustr, pDoc->GetString(ScAddress(3, 0, 0)));
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
+ CPPUNIT_ASSERT_EQUAL(u"Rakennukset"_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf142010)
@@ -367,26 +369,26 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf142010)
createScDoc("tdf142010.xls");
ScDocument* pDoc = getScDoc();
- goToCell("A1");
+ goToCell(u"A1"_ustr);
OUString aFormula = pDoc->GetFormula(5, 71, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=MOD(F$71+$C72,9)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=MOD(F$71+$C72,9)"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(5.0, pDoc->GetValue(ScAddress(5, 71, 0)));
- dispatchCommand(mxComponent, ".uno:InsertColumnsBefore", {});
+ dispatchCommand(mxComponent, u".uno:InsertColumnsBefore"_ustr, {});
aFormula = pDoc->GetFormula(6, 71, 0);
// Without the fix in place, this test would have failed with
// - Expected: =MOD(G$71+$D72,9)
// - Actual : =MOD(G$71+$K72,9)
- CPPUNIT_ASSERT_EQUAL(OUString("=MOD(G$71+$D72,9)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=MOD(G$71+$D72,9)"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(5.0, pDoc->GetValue(ScAddress(6, 71, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
aFormula = pDoc->GetFormula(5, 71, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=MOD(F$71+$C72,9)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=MOD(F$71+$C72,9)"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(5.0, pDoc->GetValue(ScAddress(5, 71, 0)));
}
@@ -394,15 +396,15 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf154061)
{
createScDoc("simpleTable.xlsx");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("Column2"), pDoc->GetString(ScAddress(1, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Column2"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
- goToCell("B1");
+ goToCell(u"B1"_ustr);
// Without the fix in place, it would crash here due to an out of bounds array access
- dispatchCommand(mxComponent, ".uno:InsertColumnsBefore", {});
- CPPUNIT_ASSERT_EQUAL(OUString("Column2"), pDoc->GetString(ScAddress(2, 0, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
- CPPUNIT_ASSERT_EQUAL(OUString("Column2"), pDoc->GetString(ScAddress(1, 0, 0)));
+ dispatchCommand(mxComponent, u".uno:InsertColumnsBefore"_ustr, {});
+ CPPUNIT_ASSERT_EQUAL(u"Column2"_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
+ CPPUNIT_ASSERT_EQUAL(u"Column2"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf132431)
@@ -411,18 +413,18 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf132431)
ScDocument* pDoc = getScDoc();
OUString aFormula = pDoc->GetFormula(7, 219, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMIFS($H$2:$H$198,B$2:B$198,G220)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUMIFS($H$2:$H$198,B$2:B$198,G220)"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(7, 219, 0)));
// Without the fix in place, it would crash here with
// uncaught exception of type std::exception (or derived).
// - vector::_M_fill_insert
- insertStringToCell("H220", u"=SUMIFS($H$2:$DB$198,B$2:B$198,G220)");
+ insertStringToCell(u"H220"_ustr, u"=SUMIFS($H$2:$DB$198,B$2:B$198,G220)");
aFormula = pDoc->GetFormula(7, 219, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUMIFS($H$2:$DB$198,B$2:B$198,G220)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUMIFS($H$2:$DB$198,B$2:B$198,G220)"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(7, 219, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Err:502"), pDoc->GetString(ScAddress(7, 219, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"Err:502"_ustr, pDoc->GetString(ScAddress(7, 219, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf131073)
@@ -432,17 +434,17 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf131073)
for (SCCOLROW nColRow = 0; nColRow < 3; nColRow++)
{
- pDoc->SetString(ScAddress(0, nColRow, 0), "Hello World");
+ pDoc->SetString(ScAddress(0, nColRow, 0), u"Hello World"_ustr);
pDoc->SetRowHeight(0, nColRow, 1000 * (nColRow + 1));
- pDoc->SetString(ScAddress(nColRow, 0, 0), "Hello World");
+ pDoc->SetString(ScAddress(nColRow, 0, 0), u"Hello World"_ustr);
pDoc->SetColWidth(nColRow, 0, 1000 * (nColRow + 1));
}
// Check rows
pDoc->SetRowHidden(1, 1, 0, true);
- goToCell("A1:A3");
+ goToCell(u"A1:A3"_ustr);
dispatchCommand(
- mxComponent, ".uno:SetOptimalRowHeight",
+ mxComponent, u".uno:SetOptimalRowHeight"_ustr,
comphelper::InitPropertySequence({ { "aExtraHeight", uno::Any(sal_uInt16(0)) } }));
CPPUNIT_ASSERT(!pDoc->RowHidden(0, 0));
@@ -456,9 +458,9 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf131073)
// Check columns
pDoc->SetColHidden(1, 1, 0, true);
- goToCell("A1:C1");
+ goToCell(u"A1:C1"_ustr);
dispatchCommand(
- mxComponent, ".uno:SetOptimalColumnWidth",
+ mxComponent, u".uno:SetOptimalColumnWidth"_ustr,
comphelper::InitPropertySequence({ { "aExtraWidth", uno::Any(sal_uInt16(0)) } }));
CPPUNIT_ASSERT(!pDoc->ColHidden(0, 0));
@@ -482,10 +484,10 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf159938)
const sal_uInt16 nRow2Height = pDoc->GetRowHeight(1, 0);
const sal_uInt16 nRow3Height = pDoc->GetRowHeight(2, 0);
- goToCell("A1");
- dispatchCommand(mxComponent, ".uno:GoDown", {});
- dispatchCommand(mxComponent, ".uno:GoDown", {});
- dispatchCommand(mxComponent, ".uno:GoDown", {});
+ goToCell(u"A1"_ustr);
+ dispatchCommand(mxComponent, u".uno:GoDown"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:GoDown"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:GoDown"_ustr, {});
ScDocShell* pDocSh = getScDocShell();
lcl_AssertCurrentCursorPosition(*pDocSh, u"A4");
@@ -505,18 +507,18 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf83901)
createScDoc();
ScDocShell* pDocSh = getScDocShell();
- insertStringToCell("A2", u"=ROW(A3)");
+ insertStringToCell(u"A2"_ustr, u"=ROW(A3)");
ScDocument* pDoc = getScDoc();
CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(ScAddress(0, 1, 0)));
lcl_AssertCurrentCursorPosition(*pDocSh, u"A3");
- dispatchCommand(mxComponent, ".uno:SelectRow", {});
- dispatchCommand(mxComponent, ".uno:InsertRowsBefore", {});
+ dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:InsertRowsBefore"_ustr, {});
//Without the fix, it would be 3.0
CPPUNIT_ASSERT_EQUAL(4.0, pDoc->GetValue(ScAddress(0, 1, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(ScAddress(0, 1, 0)));
}
@@ -526,17 +528,17 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf124822)
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("X"), pDoc->GetString(ScAddress(0, 0, 2)));
+ CPPUNIT_ASSERT_EQUAL(u"X"_ustr, pDoc->GetString(ScAddress(0, 0, 2)));
- dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
- dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, u".uno:Cut"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 0, 2)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 0, 2)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("X"), pDoc->GetString(ScAddress(0, 0, 2)));
+ CPPUNIT_ASSERT_EQUAL(u"X"_ustr, pDoc->GetString(ScAddress(0, 0, 2)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf118189)
@@ -546,29 +548,29 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf118189)
ScDocument* pDoc = getScDoc();
// Select column A
- goToCell("A:A");
+ goToCell(u"A:A"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// Open a new document
createScDoc();
pDoc = getScDoc();
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
OUString aFormula = pDoc->GetFormula(0, 77, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=FALSE()"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=FALSE()"_ustr, aFormula);
- dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, u".uno:Cut"_ustr, {});
aFormula = pDoc->GetFormula(0, 77, 0);
- CPPUNIT_ASSERT_EQUAL(OUString(""), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, aFormula);
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
aFormula = pDoc->GetFormula(0, 77, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=FALSE()"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=FALSE()"_ustr, aFormula);
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf118207)
@@ -585,45 +587,45 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf118207)
pMod->SetInputOptions(aInputOption);
// Select column A
- goToCell("A:A");
+ goToCell(u"A:A"_ustr);
OUString aFormula = pDoc->GetFormula(0, 77, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=FALSE()"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=FALSE()"_ustr, aFormula);
- dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, u".uno:Cut"_ustr, {});
aFormula = pDoc->GetFormula(0, 77, 0);
- CPPUNIT_ASSERT_EQUAL(OUString(""), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, aFormula);
// Select column B
- goToCell("B:B");
+ goToCell(u"B:B"_ustr);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
aFormula = pDoc->GetFormula(1, 77, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=FALSE()"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=FALSE()"_ustr, aFormula);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
aFormula = pDoc->GetFormula(1, 77, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=FALSE()"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=FALSE()"_ustr, aFormula);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
aFormula = pDoc->GetFormula(1, 77, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=FALSE()"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=FALSE()"_ustr, aFormula);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
aFormula = pDoc->GetFormula(1, 77, 0);
- CPPUNIT_ASSERT_EQUAL(OUString(""), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, aFormula);
aFormula = pDoc->GetFormula(0, 77, 0);
- CPPUNIT_ASSERT_EQUAL(OUString(""), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, aFormula);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
aFormula = pDoc->GetFormula(0, 77, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=FALSE()"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=FALSE()"_ustr, aFormula);
// Restore previous status
aInputOption.SetReplaceCellsWarn(bOldStatus);
@@ -647,19 +649,19 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf124778)
// Add a new comment
uno::Sequence<beans::PropertyValue> aArgs
- = comphelper::InitPropertySequence({ { "Text", uno::Any(OUString("Comment")) } });
- dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
+ = comphelper::InitPropertySequence({ { "Text", uno::Any(u"Comment"_ustr) } });
+ dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aArgs);
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
// Without the fix in place, this test would have crashed
- dispatchCommand(mxComponent, ".uno:ShowAnnotations", {});
+ dispatchCommand(mxComponent, u".uno:ShowAnnotations"_ustr, {});
ScPostIt* pNote = pDoc->GetNote(ScAddress(0, 0, 0));
CPPUNIT_ASSERT(pNote);
CPPUNIT_ASSERT_EQUAL(true, pNote->IsCaptionShown());
- dispatchCommand(mxComponent, ".uno:ShowAnnotations", {});
+ dispatchCommand(mxComponent, u".uno:ShowAnnotations"_ustr, {});
CPPUNIT_ASSERT_EQUAL(false, pNote->IsCaptionShown());
}
@@ -671,40 +673,40 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf138428)
// Add a new comment
uno::Sequence<beans::PropertyValue> aArgs
- = comphelper::InitPropertySequence({ { "Text", uno::Any(OUString("Comment")) } });
- dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
+ = comphelper::InitPropertySequence({ { "Text", uno::Any(u"Comment"_ustr) } });
+ dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aArgs);
ScDocument* pDoc = getScDoc();
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There shouldn't be a note on B1", !pDoc->HasNote(ScAddress(1, 0, 0)));
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
- dispatchCommand(mxComponent, ".uno:GoRight", {});
+ dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"B1");
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on B1", pDoc->HasNote(ScAddress(1, 0, 0)));
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There shouldn't be a note on B1", !pDoc->HasNote(ScAddress(1, 0, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_MESSAGE("There shouldn't be a note on A1", !pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There shouldn't be a note on B1", !pDoc->HasNote(ScAddress(1, 0, 0)));
- dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There shouldn't be a note on B1", !pDoc->HasNote(ScAddress(1, 0, 0)));
- dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on B1", pDoc->HasNote(ScAddress(1, 0, 0)));
@@ -745,14 +747,14 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf130614)
lcl_SelectObjectByName(*getViewShell(), u"Object 1");
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// Open a new document
createScDoc();
pDoc = getScDoc();
// Without the fix in place, this test would have crashed here
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
SdrPage* pPage = pDrawLayer->GetPage(0);
@@ -764,16 +766,16 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf112735)
createScDoc("tdf112735.ods");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("(empty)"), pDoc->GetString(ScAddress(1, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"(empty)"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
- goToCell("B3");
+ goToCell(u"B3"_ustr);
- dispatchCommand(mxComponent, ".uno:RecalcPivotTable", {});
+ dispatchCommand(mxComponent, u".uno:RecalcPivotTable"_ustr, {});
// Without the fix in place, this test would have failed with
// - Expected: (empty)
// - Actual :
- CPPUNIT_ASSERT_EQUAL(OUString("(empty)"), pDoc->GetString(ScAddress(1, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"(empty)"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf112884)
@@ -781,22 +783,22 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf112884)
createScDoc("tdf112884.ods");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("0.5"), pDoc->GetString(ScAddress(6, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("0.666666666666667"), pDoc->GetString(ScAddress(6, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("0.833333333333333"), pDoc->GetString(ScAddress(6, 4, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("#DIV/0!"), pDoc->GetString(ScAddress(6, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0.5"_ustr, pDoc->GetString(ScAddress(6, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0.666666666666667"_ustr, pDoc->GetString(ScAddress(6, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0.833333333333333"_ustr, pDoc->GetString(ScAddress(6, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#DIV/0!"_ustr, pDoc->GetString(ScAddress(6, 5, 0)));
- goToCell("G3");
+ goToCell(u"G3"_ustr);
- dispatchCommand(mxComponent, ".uno:RecalcPivotTable", {});
+ dispatchCommand(mxComponent, u".uno:RecalcPivotTable"_ustr, {});
// Without the fix in place, this test would have failed with
// - Expected: #DIV/0!
// - Actual : 0.5
- CPPUNIT_ASSERT_EQUAL(OUString("#DIV/0!"), pDoc->GetString(ScAddress(6, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("0.5"), pDoc->GetString(ScAddress(6, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("0.666666666666667"), pDoc->GetString(ScAddress(6, 4, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("0.833333333333333"), pDoc->GetString(ScAddress(6, 5, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#DIV/0!"_ustr, pDoc->GetString(ScAddress(6, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0.5"_ustr, pDoc->GetString(ScAddress(6, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0.666666666666667"_ustr, pDoc->GetString(ScAddress(6, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0.833333333333333"_ustr, pDoc->GetString(ScAddress(6, 5, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf133342)
@@ -804,22 +806,22 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf133342)
createScDoc("tdf133342.ods");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("12,35 %"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"12,35 %"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
//Add decimals
- dispatchCommand(mxComponent, ".uno:NumberFormatIncDecimals", {});
+ dispatchCommand(mxComponent, u".uno:NumberFormatIncDecimals"_ustr, {});
//Space should preserved before percent sign
- CPPUNIT_ASSERT_EQUAL(OUString("12,346 %"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"12,346 %"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
//Delete decimals
- dispatchCommand(mxComponent, ".uno:NumberFormatDecDecimals", {});
- dispatchCommand(mxComponent, ".uno:NumberFormatDecDecimals", {});
- dispatchCommand(mxComponent, ".uno:NumberFormatDecDecimals", {});
+ dispatchCommand(mxComponent, u".uno:NumberFormatDecDecimals"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:NumberFormatDecDecimals"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:NumberFormatDecDecimals"_ustr, {});
//Space should preserved before percent sign
- CPPUNIT_ASSERT_EQUAL(OUString("12 %"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"12 %"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
- dispatchCommand(mxComponent, ".uno:NumberFormatDecDecimals", {});
+ dispatchCommand(mxComponent, u".uno:NumberFormatDecDecimals"_ustr, {});
//Space should preserved before percent sign
- CPPUNIT_ASSERT_EQUAL(OUString("12 %"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"12 %"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf71339)
@@ -827,10 +829,10 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf71339)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A2", u"1");
- insertStringToCell("A3", u"1");
+ insertStringToCell(u"A2"_ustr, u"1");
+ insertStringToCell(u"A3"_ustr, u"1");
- goToCell("A1:A3");
+ goToCell(u"A1:A3"_ustr);
executeAutoSum();
@@ -841,7 +843,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf71339)
// Without the fix in place, this test would have failed with
// - Expected: =SUM(A1:A3)
// - Actual : =SUM(A2:A3)
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A1:A3)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A1:A3)"_ustr, aFormula);
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf116421)
@@ -849,11 +851,11 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf116421)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"1");
- insertStringToCell("A2", u"1");
- insertStringToCell("A3", u"1");
+ insertStringToCell(u"A1"_ustr, u"1");
+ insertStringToCell(u"A2"_ustr, u"1");
+ insertStringToCell(u"A3"_ustr, u"1");
- goToCell("A4");
+ goToCell(u"A4"_ustr);
executeAutoSum();
@@ -864,7 +866,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf116421)
OUString aFormula = pDoc->GetFormula(0, 3, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A1:A3)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A1:A3)"_ustr, aFormula);
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf86305)
@@ -873,10 +875,10 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf86305)
ScDocument* pDoc = getScDoc();
OUString aFormula = pDoc->GetFormula(1, 6, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("{=IF(SUM(B2:B4) > 0, SUM(B2:B4*D2:D4/C2:C4), 0)}"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"{=IF(SUM(B2:B4) > 0, SUM(B2:B4*D2:D4/C2:C4), 0)}"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(1, 6, 0)));
- insertStringToCell("B3", u"50");
+ insertStringToCell(u"B3"_ustr, u"50");
CPPUNIT_ASSERT_EQUAL(50.0, pDoc->GetValue(ScAddress(1, 2, 0)));
aFormula = pDoc->GetFormula(1, 6, 0);
@@ -884,7 +886,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf86305)
// Without the fix in place, this test would have failed with
// - Expected: {=IF(SUM(B2:B4) > 0, SUM(B2:B4*D2:D4/C2:C4), 0)}
// - Actual : {=IF(SUM(B2:B4) > 0, SUM(B2:B4*D2:D4/C2:C4), 0.175)}
- CPPUNIT_ASSERT_EQUAL(OUString("{=IF(SUM(B2:B4) > 0, SUM(B2:B4*D2:D4/C2:C4), 0)}"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"{=IF(SUM(B2:B4) > 0, SUM(B2:B4*D2:D4/C2:C4), 0)}"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(0.175, pDoc->GetValue(ScAddress(1, 6, 0)));
}
@@ -893,67 +895,67 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf81351)
createScDoc("tdf81351.ods");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Paste"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Bold"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Save"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Undo"), pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Paste"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Bold"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Save"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Undo"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
- goToCell("A1:F5");
+ goToCell(u"A1:F5"_ustr);
- dispatchCommand(mxComponent, ".uno:SortAscending", {});
- dispatchCommand(mxComponent, ".uno:GoDown", {});
+ dispatchCommand(mxComponent, u".uno:SortAscending"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:GoDown"_ustr, {});
// Without the fix in place, this test would have crashed
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Bold"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Paste"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Save"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Undo"), pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Bold"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Paste"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Save"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Undo"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Paste"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Bold"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Save"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Undo"), pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Paste"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Bold"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Save"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Undo"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
- dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Bold"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Paste"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Save"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Undo"), pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Bold"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Paste"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Save"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Undo"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Paste"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Bold"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Save"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Undo"), pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Paste"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Bold"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Save"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Undo"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
- goToCell("A1:F5");
+ goToCell(u"A1:F5"_ustr);
- dispatchCommand(mxComponent, ".uno:SortDescending", {});
- dispatchCommand(mxComponent, ".uno:GoDown", {});
+ dispatchCommand(mxComponent, u".uno:SortDescending"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:GoDown"_ustr, {});
// Without the fix in place, this test would have crashed
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Undo"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Save"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Paste"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Bold"), pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Undo"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Save"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Paste"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Bold"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Paste"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Bold"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Save"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Undo"), pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Paste"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Bold"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Save"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Undo"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
- dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Undo"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Save"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Paste"), pDoc->GetString(ScAddress(0, 3, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString(".uno:Bold"), pDoc->GetString(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Undo"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Save"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Paste"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u".uno:Bold"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf123202)
@@ -966,29 +968,29 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf123202)
insertStringToCell(u"A3"_ustr, u"3");
insertStringToCell(u"A4"_ustr, u"4");
- goToCell("A3");
+ goToCell(u"A3"_ustr);
- dispatchCommand(mxComponent, ".uno:HideRow", {});
+ dispatchCommand(mxComponent, u".uno:HideRow"_ustr, {});
- goToCell("A1:A4");
+ goToCell(u"A1:A4"_ustr);
- dispatchCommand(mxComponent, ".uno:SortDescending", {});
+ dispatchCommand(mxComponent, u".uno:SortDescending"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("4"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("3"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"4"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"3"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
// This failed, if the "3" is visible.
CPPUNIT_ASSERT(pDoc->RowHidden(1, 0));
CPPUNIT_ASSERT(!pDoc->RowHidden(2, 0));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(ScAddress(0, 0, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("2"), pDoc->GetString(ScAddress(0, 1, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("3"), pDoc->GetString(ScAddress(0, 2, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("4"), pDoc->GetString(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"2"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"3"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"4"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
CPPUNIT_ASSERT(!pDoc->RowHidden(1, 0));
CPPUNIT_ASSERT(pDoc->RowHidden(2, 0));
@@ -998,24 +1000,24 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf134675)
{
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"A");
+ insertStringToCell(u"A1"_ustr, u"A");
// Select column A
- goToCell("A:A");
+ goToCell(u"A:A"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// Select column B to Z
- goToCell("B:Z");
+ goToCell(u"B:Z"_ustr);
- dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
for (size_t i = 1; i < 24; ++i)
{
// Without the fix in place, this test would have failed here with
// - Expected: A
// - Actual :
- CPPUNIT_ASSERT_EQUAL(OUString("A"), pDoc->GetString(ScAddress(i, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"A"_ustr, pDoc->GetString(ScAddress(i, 0, 0)));
}
}
@@ -1023,32 +1025,32 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf116215)
{
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"1");
- insertStringToCell("A2", u"1");
- insertStringToCell("B1", u"1");
- insertStringToCell("B2", u"1");
- goToCell("A1:C3");
+ insertStringToCell(u"A1"_ustr, u"1");
+ insertStringToCell(u"A2"_ustr, u"1");
+ insertStringToCell(u"B1"_ustr, u"1");
+ insertStringToCell(u"B2"_ustr, u"1");
+ goToCell(u"A1:C3"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(0, 2, 0)));
OUString aFormula = pDoc->GetFormula(0, 2, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A1:A2)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A1:A2)"_ustr, aFormula);
// Without the fix in place, this test would have failed with
// - Expected: 2
// - Actual : 4
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(1, 2, 0)));
aFormula = pDoc->GetFormula(1, 2, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B1:B2)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B1:B2)"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(2, 0, 0)));
aFormula = pDoc->GetFormula(2, 0, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A1:B1)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A1:B1)"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(2, 1, 0)));
aFormula = pDoc->GetFormula(2, 1, 0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(A2:B2)"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(A2:B2)"_ustr, aFormula);
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf99913)
@@ -1066,7 +1068,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf126540_GridToggleModifiesTheDocument)
// Toggling the grid of a sheet, must set the document modified state
ScDocShell* pDocSh = getScDocShell();
CPPUNIT_ASSERT(!pDocSh->IsModified());
- dispatchCommand(mxComponent, ".uno:ToggleSheetGrid", {});
+ dispatchCommand(mxComponent, u".uno:ToggleSheetGrid"_ustr, {});
CPPUNIT_ASSERT(pDocSh->IsModified());
}
@@ -1081,19 +1083,19 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf118983)
xGlobalSheetSettings->setExpandReferences(true);
- const ScRangeData* pRD = pDoc->GetRangeName()->findByUpperName("TEST");
+ const ScRangeData* pRD = pDoc->GetRangeName()->findByUpperName(u"TEST"_ustr);
CPPUNIT_ASSERT(pRD);
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$A$3:$D$7"), pRD->GetSymbol());
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$A$3:$D$7"_ustr, pRD->GetSymbol());
//Select columns E to G
- goToCell("E:G");
+ goToCell(u"E:G"_ustr);
- dispatchCommand(mxComponent, ".uno:InsertColumnsBefore", {});
+ dispatchCommand(mxComponent, u".uno:InsertColumnsBefore"_ustr, {});
// Without the fix in place, this test would have failed with
// - Expected: $Test.$A$3:$D$7
// - Actual : $Test.$A$3:$G$7
- CPPUNIT_ASSERT_EQUAL(OUString("$Test.$A$3:$D$7"), pRD->GetSymbol());
+ CPPUNIT_ASSERT_EQUAL(u"$Test.$A$3:$D$7"_ustr, pRD->GetSymbol());
xGlobalSheetSettings->setExpandReferences(bOldValue);
}
@@ -1103,11 +1105,11 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf107952)
createScDoc();
ScDocShell* pDocSh = getScDocShell();
- insertStringToCell("B1", u"=SUM(A1:A2)");
+ insertStringToCell(u"B1"_ustr, u"=SUM(A1:A2)");
- goToCell("D10");
+ goToCell(u"D10"_ustr);
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
// Without the fix in place, this test would have failed with
// - Expected: 1
@@ -1115,9 +1117,9 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf107952)
// - Incorrect Column in position B1
lcl_AssertCurrentCursorPosition(*pDocSh, u"B1");
- goToCell("D10");
+ goToCell(u"D10"_ustr);
- dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"B1");
}
@@ -1127,11 +1129,11 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf150766)
createScDoc("tdf150766.ods");
ScDocument* pDoc = getScDoc();
- goToCell("A3:C6");
+ goToCell(u"A3:C6"_ustr);
- dispatchCommand(mxComponent, ".uno:SortDescending", {});
+ dispatchCommand(mxComponent, u".uno:SortDescending"_ustr, {});
- insertStringToCell("B3", u"10");
+ insertStringToCell(u"B3"_ustr, u"10");
CPPUNIT_ASSERT_EQUAL(12.0, pDoc->GetValue(ScAddress(2, 2, 0)));
CPPUNIT_ASSERT_EQUAL(13.0, pDoc->GetValue(ScAddress(2, 3, 0)));
@@ -1151,14 +1153,14 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf144022)
createScDoc("tdf144022.ods");
ScDocument* pDoc = getScDoc();
- goToCell("A5:B79");
+ goToCell(u"A5:B79"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
- goToCell("D5");
+ goToCell(u"D5"_ustr);
//Without the fix in place, this test would have crashed
- dispatchCommand(mxComponent, ".uno:PasteTransposed", {});
+ dispatchCommand(mxComponent, u".uno:PasteTransposed"_ustr, {});
for (size_t i = 3; i < 76; ++i)
{
@@ -1172,23 +1174,23 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf99386)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("B1", u"This");
- insertStringToCell("B2", u"=B1");
+ insertStringToCell(u"B1"_ustr, u"This");
+ insertStringToCell(u"B2"_ustr, u"=B1");
- goToCell("A1:B1");
+ goToCell(u"A1:B1"_ustr);
- dispatchCommand(mxComponent, ".uno:ToggleMergeCells", {});
+ dispatchCommand(mxComponent, u".uno:ToggleMergeCells"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("0"), pDoc->GetString(ScAddress(1, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pDoc->GetString(ScAddress(1, 1, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("This"), pDoc->GetString(ScAddress(1, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"This"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
// Without the fix in place, this test would have failed with
// - Expected: This
// - Actual : 0
- CPPUNIT_ASSERT_EQUAL(OUString("This"), pDoc->GetString(ScAddress(1, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"This"_ustr, pDoc->GetString(ScAddress(1, 1, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf149378)
@@ -1196,59 +1198,59 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf149378)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"=MINVERSE(A1:C3)");
+ insertStringToCell(u"A1"_ustr, u"=MINVERSE(A1:C3)");
// Without the fix in place, this test would have failed with
// - Expected: {=MINVERSE(A1:C3)}
// - Actual : =MINVERSE(A1:C3)
- CPPUNIT_ASSERT_EQUAL(OUString("{=MINVERSE(A1:C3)}"), pDoc->GetFormula(0, 0, 0));
+ CPPUNIT_ASSERT_EQUAL(u"{=MINVERSE(A1:C3)}"_ustr, pDoc->GetFormula(0, 0, 0));
- insertStringToCell("B1", u"={1;2}");
- CPPUNIT_ASSERT_EQUAL(OUString("{={1;2}}"), pDoc->GetFormula(1, 0, 0));
+ insertStringToCell(u"B1"_ustr, u"={1;2}");
+ CPPUNIT_ASSERT_EQUAL(u"{={1;2}}"_ustr, pDoc->GetFormula(1, 0, 0));
- insertStringToCell("C1", u"={1;2}+3");
- CPPUNIT_ASSERT_EQUAL(OUString("{={1;2}+3}"), pDoc->GetFormula(2, 0, 0));
+ insertStringToCell(u"C1"_ustr, u"={1;2}+3");
+ CPPUNIT_ASSERT_EQUAL(u"{={1;2}+3}"_ustr, pDoc->GetFormula(2, 0, 0));
- insertStringToCell("D1", u"={1;2}+{3;4}");
- CPPUNIT_ASSERT_EQUAL(OUString("{={1;2}+{3;4}}"), pDoc->GetFormula(3, 0, 0));
+ insertStringToCell(u"D1"_ustr, u"={1;2}+{3;4}");
+ CPPUNIT_ASSERT_EQUAL(u"{={1;2}+{3;4}}"_ustr, pDoc->GetFormula(3, 0, 0));
- insertStringToCell("E1", u"={1;2}+A1");
- CPPUNIT_ASSERT_EQUAL(OUString("{={1;2}+A1}"), pDoc->GetFormula(4, 0, 0));
+ insertStringToCell(u"E1"_ustr, u"={1;2}+A1");
+ CPPUNIT_ASSERT_EQUAL(u"{={1;2}+A1}"_ustr, pDoc->GetFormula(4, 0, 0));
- insertStringToCell("F1", u"={1;2}+A1:A2");
- CPPUNIT_ASSERT_EQUAL(OUString("={1;2}+A1:A2"), pDoc->GetFormula(5, 0, 0));
+ insertStringToCell(u"F1"_ustr, u"={1;2}+A1:A2");
+ CPPUNIT_ASSERT_EQUAL(u"={1;2}+A1:A2"_ustr, pDoc->GetFormula(5, 0, 0));
- insertStringToCell("G1", u"=SUM(MUNIT(3))");
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(MUNIT(3))"), pDoc->GetFormula(6, 0, 0));
+ insertStringToCell(u"G1"_ustr, u"=SUM(MUNIT(3))");
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(MUNIT(3))"_ustr, pDoc->GetFormula(6, 0, 0));
- insertStringToCell("H1", u"=SUM({1;2})");
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM({1;2})"), pDoc->GetFormula(7, 0, 0));
+ insertStringToCell(u"H1"_ustr, u"=SUM({1;2})");
+ CPPUNIT_ASSERT_EQUAL(u"=SUM({1;2})"_ustr, pDoc->GetFormula(7, 0, 0));
- insertStringToCell("I1", u"=ABS({-1;-2})");
- CPPUNIT_ASSERT_EQUAL(OUString("{=ABS({-1;-2})}"), pDoc->GetFormula(8, 0, 0));
+ insertStringToCell(u"I1"_ustr, u"=ABS({-1;-2})");
+ CPPUNIT_ASSERT_EQUAL(u"{=ABS({-1;-2})}"_ustr, pDoc->GetFormula(8, 0, 0));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf152014)
{
createScDoc();
- insertStringToCell("A1", u"=MATCH(1,A2,0)");
- insertStringToCell("A2", u"1");
+ insertStringToCell(u"A1"_ustr, u"=MATCH(1,A2,0)");
+ insertStringToCell(u"A2"_ustr, u"1");
ScDocument* pDoc = getScDoc();
- CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(ScAddress(0, 0, 0)));
- goToCell("A1");
+ goToCell(u"A1"_ustr);
- dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// Create a second document
- mxComponent2 = loadFromDesktop("private:factory/scalc");
+ mxComponent2 = loadFromDesktop(u"private:factory/scalc"_ustr);
uno::Reference<frame::XFrames> xFrames = mxDesktop->getFrames();
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xFrames->getCount());
- dispatchCommand(mxComponent2, ".uno:Paste", {});
+ dispatchCommand(mxComponent2, u".uno:Paste"_ustr, {});
ScModelObj* pModelObj2 = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent2);
CPPUNIT_ASSERT(pModelObj2);
@@ -1257,7 +1259,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf152014)
// Without the fix in place, this test would have failed with
// - Expected: #N/A
// - Actual : 1
- CPPUNIT_ASSERT_EQUAL(OUString("#N/A"), pDoc2->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"#N/A"_ustr, pDoc2->GetString(ScAddress(0, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf156286)
@@ -1265,16 +1267,16 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf156286)
createScDoc("tdf156286.ods");
ScDocument* pDoc = getScDoc();
- dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
// Without the fix in place, this test would have crash here
- dispatchCommand(mxComponent, ".uno:DeleteColumns", {});
+ dispatchCommand(mxComponent, u".uno:DeleteColumns"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(12, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(12, 2, 0)));
- dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
- CPPUNIT_ASSERT_EQUAL(OUString("xxxxxxxxxxxx"), pDoc->GetString(ScAddress(12, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(u"xxxxxxxxxxxx"_ustr, pDoc->GetString(ScAddress(12, 2, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf126926)
@@ -1282,19 +1284,19 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf126926)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"1");
- insertStringToCell("A2", u"2");
- insertStringToCell("B1", u"3");
- insertStringToCell("B2", u"4");
+ insertStringToCell(u"A1"_ustr, u"1");
+ insertStringToCell(u"A2"_ustr, u"2");
+ insertStringToCell(u"B1"_ustr, u"3");
+ insertStringToCell(u"B2"_ustr, u"4");
- ScDBData* pDBData = new ScDBData("testDB", 0, 0, 0, 1, 1);
+ ScDBData* pDBData = new ScDBData(u"testDB"_ustr, 0, 0, 0, 1, 1);
bool bInserted
= pDoc->GetDBCollection()->getNamedDBs().insert(std::unique_ptr<ScDBData>(pDBData));
CPPUNIT_ASSERT(bInserted);
- goToCell("A1:B1");
+ goToCell(u"A1:B1"_ustr);
- dispatchCommand(mxComponent, ".uno:DeleteColumns", {});
+ dispatchCommand(mxComponent, u".uno:DeleteColumns"_ustr, {});
ScDBCollection* pDBs = pDoc->GetDBCollection();
CPPUNIT_ASSERT(pDBs->empty());
@@ -1310,7 +1312,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testUnallocatedColumnsAttributes)
// Except for first 1 cell make the entire first row bold.
assert(INITIALCOLCOUNT >= 1);
goToCell("B1:" + pDoc->MaxColAsString() + "1");
- dispatchCommand(mxComponent, ".uno:Bold", {});
+ dispatchCommand(mxComponent, u".uno:Bold"_ustr, {});
// That shouldn't need allocating more columns, just changing the default attribute.
CPPUNIT_ASSERT_EQUAL(INITIALCOLCOUNT, pDoc->GetAllocatedColumnsCount(0));
@@ -1318,8 +1320,8 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testUnallocatedColumnsAttributes)
pDoc->GetPattern(pDoc->MaxCol(), 0, 0)->fillFontOnly(aFont);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight());
- goToCell("A2:CV2"); // first 100 cells in row 2
- dispatchCommand(mxComponent, ".uno:Bold", {});
+ goToCell(u"A2:CV2"_ustr); // first 100 cells in row 2
+ dispatchCommand(mxComponent, u".uno:Bold"_ustr, {});
// These need to be explicitly allocated.
CPPUNIT_ASSERT_EQUAL(SCCOL(100), pDoc->GetAllocatedColumnsCount(0));
pDoc->GetPattern(99, 1, 0)->fillFontOnly(aFont);
@@ -1328,7 +1330,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testUnallocatedColumnsAttributes)
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should not be bold", WEIGHT_NORMAL, aFont.GetWeight());
goToCell("CW3:" + pDoc->MaxColAsString() + "3"); // All but first 100 cells in row 3.
- dispatchCommand(mxComponent, ".uno:Bold", {});
+ dispatchCommand(mxComponent, u".uno:Bold"_ustr, {});
// First 100 columns need to be allocated to not be bold, the rest should be handled
// by the default attribute.
CPPUNIT_ASSERT_EQUAL(SCCOL(100), pDoc->GetAllocatedColumnsCount(0));
@@ -1344,152 +1346,152 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testAutoSum)
ScDocument* pDoc = getScDoc();
//Sum on range and Sum on Sum's
- goToCell("B10");
+ goToCell(u"B10"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(1, 9, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B8:B9)"), pDoc->GetFormula(1, 9, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B8:B9)"_ustr, pDoc->GetFormula(1, 9, 0));
- goToCell("B13");
+ goToCell(u"B13"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(1, 12, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B11:B12)"), pDoc->GetFormula(1, 12, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B11:B12)"_ustr, pDoc->GetFormula(1, 12, 0));
- goToCell("B14");
+ goToCell(u"B14"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(4.0, pDoc->GetValue(ScAddress(1, 13, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B13:B13,B10:B10)"), pDoc->GetFormula(1, 13, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B13:B13,B10:B10)"_ustr, pDoc->GetFormula(1, 13, 0));
- goToCell("F8:F14");
+ goToCell(u"F8:F14"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(4.0, pDoc->GetValue(ScAddress(5, 13, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(F13:F13,F10:F10)"), pDoc->GetFormula(5, 13, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(F13:F13,F10:F10)"_ustr, pDoc->GetFormula(5, 13, 0));
//Sum on Row and Column
- goToCell("E25");
+ goToCell(u"E25"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(ScAddress(4, 24, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(E22:E24)"), pDoc->GetFormula(4, 24, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(E22:E24)"_ustr, pDoc->GetFormula(4, 24, 0));
- goToCell("E26");
+ goToCell(u"E26"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(ScAddress(4, 25, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B26:D26)"), pDoc->GetFormula(4, 25, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B26:D26)"_ustr, pDoc->GetFormula(4, 25, 0));
- goToCell("E27");
+ goToCell(u"E27"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(ScAddress(4, 26, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B27:D27)"), pDoc->GetFormula(4, 26, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B27:D27)"_ustr, pDoc->GetFormula(4, 26, 0));
- goToCell("E28");
+ goToCell(u"E28"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(ScAddress(4, 27, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B28:D28)"), pDoc->GetFormula(4, 27, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B28:D28)"_ustr, pDoc->GetFormula(4, 27, 0));
- goToCell("E29");
+ goToCell(u"E29"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(9.0, pDoc->GetValue(ScAddress(4, 28, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(E26:E28)"), pDoc->GetFormula(4, 28, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(E26:E28)"_ustr, pDoc->GetFormula(4, 28, 0));
- goToCell("E30");
+ goToCell(u"E30"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(12.0, pDoc->GetValue(ScAddress(4, 29, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(E29:E29,E25:E25)"), pDoc->GetFormula(4, 29, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(E29:E29,E25:E25)"_ustr, pDoc->GetFormula(4, 29, 0));
//Subtotals on Autosum
- goToCell("C49");
+ goToCell(u"C49"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(20.0, pDoc->GetValue(ScAddress(2, 48, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUBTOTAL(9,C38:C48)"), pDoc->GetFormula(2, 48, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUBTOTAL(9,C38:C48)"_ustr, pDoc->GetFormula(2, 48, 0));
//Autosum on column with selected empty cell for result
- goToCell("B59:B64");
+ goToCell(u"B59:B64"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(1, 63, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B59:B63)"), pDoc->GetFormula(1, 63, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B59:B63)"_ustr, pDoc->GetFormula(1, 63, 0));
//Autosum on rows with selected empty cell for result
- goToCell("B76:E80");
+ goToCell(u"B76:E80"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(30.0, pDoc->GetValue(ScAddress(4, 75, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B76:D76)"), pDoc->GetFormula(4, 75, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B76:D76)"_ustr, pDoc->GetFormula(4, 75, 0));
CPPUNIT_ASSERT_EQUAL(60.0, pDoc->GetValue(ScAddress(4, 76, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B77:D77)"), pDoc->GetFormula(4, 76, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B77:D77)"_ustr, pDoc->GetFormula(4, 76, 0));
CPPUNIT_ASSERT_EQUAL(90.0, pDoc->GetValue(ScAddress(4, 77, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B78:D78)"), pDoc->GetFormula(4, 77, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B78:D78)"_ustr, pDoc->GetFormula(4, 77, 0));
CPPUNIT_ASSERT_EQUAL(120.0, pDoc->GetValue(ScAddress(4, 78, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B79:D79)"), pDoc->GetFormula(4, 78, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B79:D79)"_ustr, pDoc->GetFormula(4, 78, 0));
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(4, 79, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B80:D80)"), pDoc->GetFormula(4, 79, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B80:D80)"_ustr, pDoc->GetFormula(4, 79, 0));
//Subtotal on column with selected empty cell for result
- goToCell("C92:C101");
+ goToCell(u"C92:C101"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(19.0, pDoc->GetValue(ScAddress(2, 100, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUBTOTAL(9,C92:C100)"), pDoc->GetFormula(2, 100, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUBTOTAL(9,C92:C100)"_ustr, pDoc->GetFormula(2, 100, 0));
//Autosum on column without selected empty cell for result
- goToCell("B109:B113");
+ goToCell(u"B109:B113"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(1, 113, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B109:B113)"), pDoc->GetFormula(1, 113, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B109:B113)"_ustr, pDoc->GetFormula(1, 113, 0));
//Subtotal on column without selected empty cell for result
- goToCell("C142:C149");
+ goToCell(u"C142:C149"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(19.0, pDoc->GetValue(ScAddress(2, 150, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUBTOTAL(9,C142:C149)"), pDoc->GetFormula(2, 150, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUBTOTAL(9,C142:C149)"_ustr, pDoc->GetFormula(2, 150, 0));
//Autosum on multiselected columns without selected empty cell for result
- goToCell("B160:D164");
+ goToCell(u"B160:D164"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(1, 164, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B160:B164)"), pDoc->GetFormula(1, 164, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B160:B164)"_ustr, pDoc->GetFormula(1, 164, 0));
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(2, 164, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C160:C164)"), pDoc->GetFormula(2, 164, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C160:C164)"_ustr, pDoc->GetFormula(2, 164, 0));
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(3, 164, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(D160:D164)"), pDoc->GetFormula(3, 164, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(D160:D164)"_ustr, pDoc->GetFormula(3, 164, 0));
//Autosum on columns with formula results without selected empty cell for result
- goToCell("B173:D177");
+ goToCell(u"B173:D177"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(2.54, std::floor(pDoc->GetValue(ScAddress(1, 177, 0)) * 100.0) / 100.0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B173:B177)"), pDoc->GetFormula(1, 177, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B173:B177)"_ustr, pDoc->GetFormula(1, 177, 0));
CPPUNIT_ASSERT_EQUAL(-4.91, std::floor(pDoc->GetValue(ScAddress(2, 177, 0)) * 100.0) / 100.0);
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C173:C177)"), pDoc->GetFormula(2, 177, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C173:C177)"_ustr, pDoc->GetFormula(2, 177, 0));
CPPUNIT_ASSERT_EQUAL(5500.0, pDoc->GetValue(ScAddress(3, 177, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(D173:D177)"), pDoc->GetFormula(3, 177, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(D173:D177)"_ustr, pDoc->GetFormula(3, 177, 0));
//Autosum on column with filled cell under selected area
- goToCell("B186:D190");
+ goToCell(u"B186:D190"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(1, 191, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B186:B190)"), pDoc->GetFormula(1, 191, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B186:B190)"_ustr, pDoc->GetFormula(1, 191, 0));
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(2, 191, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C186:C190)"), pDoc->GetFormula(2, 191, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C186:C190)"_ustr, pDoc->GetFormula(2, 191, 0));
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(3, 191, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(D186:D190)"), pDoc->GetFormula(3, 191, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(D186:D190)"_ustr, pDoc->GetFormula(3, 191, 0));
//Autosum on column and rows with empty cells selected for row and column
- goToCell("B203:E208");
+ goToCell(u"B203:E208"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(1, 207, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B203:B207)"), pDoc->GetFormula(1, 207, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B203:B207)"_ustr, pDoc->GetFormula(1, 207, 0));
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(2, 207, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C203:C207)"), pDoc->GetFormula(2, 207, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(C203:C207)"_ustr, pDoc->GetFormula(2, 207, 0));
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(3, 207, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(D203:D207)"), pDoc->GetFormula(3, 207, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(D203:D207)"_ustr, pDoc->GetFormula(3, 207, 0));
CPPUNIT_ASSERT_EQUAL(450.0, pDoc->GetValue(ScAddress(4, 207, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B208:D208)"), pDoc->GetFormula(4, 207, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B208:D208)"_ustr, pDoc->GetFormula(4, 207, 0));
CPPUNIT_ASSERT_EQUAL(30.0, pDoc->GetValue(ScAddress(4, 202, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B203:D203)"), pDoc->GetFormula(4, 202, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B203:D203)"_ustr, pDoc->GetFormula(4, 202, 0));
CPPUNIT_ASSERT_EQUAL(60.0, pDoc->GetValue(ScAddress(4, 203, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B204:D204)"), pDoc->GetFormula(4, 203, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B204:D204)"_ustr, pDoc->GetFormula(4, 203, 0));
CPPUNIT_ASSERT_EQUAL(90.0, pDoc->GetValue(ScAddress(4, 204, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B205:D205)"), pDoc->GetFormula(4, 204, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B205:D205)"_ustr, pDoc->GetFormula(4, 204, 0));
CPPUNIT_ASSERT_EQUAL(120.0, pDoc->GetValue(ScAddress(4, 205, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B206:D206)"), pDoc->GetFormula(4, 205, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B206:D206)"_ustr, pDoc->GetFormula(4, 205, 0));
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(4, 206, 0)));
- CPPUNIT_ASSERT_EQUAL(OUString("=SUM(B207:D207)"), pDoc->GetFormula(4, 206, 0));
+ CPPUNIT_ASSERT_EQUAL(u"=SUM(B207:D207)"_ustr, pDoc->GetFormula(4, 206, 0));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf152577)
@@ -1497,12 +1499,12 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf152577)
createScDoc();
ScDocument* pDoc = getScDoc();
- insertStringToCell("A1", u"1");
- insertStringToCell("A2", u"2");
- insertStringToCell("B1", u"3");
- insertStringToCell("B2", u"4");
+ insertStringToCell(u"A1"_ustr, u"1");
+ insertStringToCell(u"A2"_ustr, u"2");
+ insertStringToCell(u"B1"_ustr, u"3");
+ insertStringToCell(u"B2"_ustr, u"4");
- ScDBData* pDBData = new ScDBData("testDB", 0, 0, 0, 1, 1);
+ ScDBData* pDBData = new ScDBData(u"testDB"_ustr, 0, 0, 0, 1, 1);
bool bInserted
= pDoc->GetDBCollection()->getNamedDBs().insert(std::unique_ptr<ScDBData>(pDBData));
CPPUNIT_ASSERT(bInserted);
@@ -1510,7 +1512,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf152577)
insertNewSheet(*pDoc);
uno::Sequence<beans::PropertyValue> aArgs(
comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(2)) } }));
- dispatchCommand(mxComponent, ".uno:Remove", aArgs);
+ dispatchCommand(mxComponent, u".uno:Remove"_ustr, aArgs);
ScDBCollection* pDBs = pDoc->GetDBCollection();
CPPUNIT_ASSERT(!pDBs->empty());
@@ -1520,12 +1522,12 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf155796)
{
createScDoc();
- goToCell("A1:A3");
- dispatchCommand(mxComponent, ".uno:ToggleMergeCells", {});
- goToCell("A4:A6");
- dispatchCommand(mxComponent, ".uno:ToggleMergeCells", {});
+ goToCell(u"A1:A3"_ustr);
+ dispatchCommand(mxComponent, u".uno:ToggleMergeCells"_ustr, {});
+ goToCell(u"A4:A6"_ustr);
+ dispatchCommand(mxComponent, u".uno:ToggleMergeCells"_ustr, {});
- goToCell("A1:A6");
+ goToCell(u"A1:A6"_ustr);
ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_SHIFT | KEY_UP);
@@ -1540,7 +1542,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf155796)
// Without the fix in place, this test would have failed with
// - Expected: Sheet1.A1:Sheet1.A3
// - Actual : Sheet1.A1:Sheet1.A5
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet1.A1:Sheet1.A3"), aMarkedAreaString);
+ CPPUNIT_ASSERT_EQUAL(u"Sheet1.A1:Sheet1.A3"_ustr, aMarkedAreaString);
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf156174)
@@ -1550,12 +1552,12 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf156174)
insertNewSheet(*pDoc);
- insertStringToCell("A1", u"1");
- insertStringToCell("A2", u"2");
- insertStringToCell("B1", u"3");
- insertStringToCell("B2", u"4");
+ insertStringToCell(u"A1"_ustr, u"1");
+ insertStringToCell(u"A2"_ustr, u"2");
+ insertStringToCell(u"B1"_ustr, u"3");
+ insertStringToCell(u"B2"_ustr, u"4");
- ScDBData* pDBData = new ScDBData("testDB", 1, 0, 0, 1, 1);
+ ScDBData* pDBData = new ScDBData(u"testDB"_ustr, 1, 0, 0, 1, 1);
bool bInserted
= pDoc->GetDBCollection()->getNamedDBs().insert(std::unique_ptr<ScDBData>(pDBData));
CPPUNIT_ASSERT(bInserted);
@@ -1563,7 +1565,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf156174)
insertNewSheet(*pDoc);
uno::Sequence<beans::PropertyValue> aArgs(
comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(3)) } }));
- dispatchCommand(mxComponent, ".uno:Remove", aArgs);
+ dispatchCommand(mxComponent, u".uno:Remove"_ustr, aArgs);
ScDBCollection* pDBs = pDoc->GetDBCollection();
CPPUNIT_ASSERT(!pDBs->empty());
@@ -1590,8 +1592,8 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf154044)
// Set the background color of A1:CV1
auto aColorArg(
comphelper::InitPropertySequence({ { "BackgroundColor", uno::Any(COL_LIGHTBLUE) } }));
- goToCell("A1:CV1");
- dispatchCommand(mxComponent, ".uno:BackgroundColor", aColorArg);
+ goToCell(u"A1:CV1"_ustr);
+ dispatchCommand(mxComponent, u".uno:BackgroundColor"_ustr, aColorArg);
// Partial row range allocates necessary columns
CPPUNIT_ASSERT_EQUAL(SCCOL(100), pDoc->GetAllocatedColumnsCount(0));
@@ -1623,7 +1625,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf154044)
// See commit 3db91487e57277f75d64d95d06d4ddcc29f1c4e0 (set properly attributes for cells in
// unallocated Calc columns, 2022-03-04).
goToCell("A1:" + pDoc->MaxColAsString() + "1");
- dispatchCommand(mxComponent, ".uno:BackgroundColor", aColorArg);
+ dispatchCommand(mxComponent, u".uno:BackgroundColor"_ustr, aColorArg);
// Check that settings are applied
for (SCCOL i = 0; i <= pDoc->MaxCol(); ++i)