diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Library_test.mk | 1 | ||||
-rw-r--r-- | test/qa/cppunit/test_xpath.cxx | 5 | ||||
-rw-r--r-- | test/source/beans/xpropertyset.cxx | 18 | ||||
-rw-r--r-- | test/source/bootstrapfixture.cxx | 13 | ||||
-rw-r--r-- | test/source/diff/diff.cxx | 3 | ||||
-rw-r--r-- | test/source/helper/form.cxx | 2 | ||||
-rw-r--r-- | test/source/helper/transferable.cxx | 5 | ||||
-rw-r--r-- | test/source/sheet/globalsheetsettings.cxx | 2 | ||||
-rw-r--r-- | test/source/sheet/spreadsheetviewsettings.cxx | 10 | ||||
-rw-r--r-- | test/source/table/tablecolumn.cxx | 2 | ||||
-rw-r--r-- | test/source/text/baseindex.cxx | 4 | ||||
-rw-r--r-- | test/source/text/textcontent.cxx | 4 | ||||
-rw-r--r-- | test/source/xmltesttools.cxx | 2 | ||||
-rw-r--r-- | test/user-template/registry/modifications.xcd | 61 |
14 files changed, 107 insertions, 25 deletions
diff --git a/test/Library_test.mk b/test/Library_test.mk index bee378ff34f5..268a68744eaf 100644 --- a/test/Library_test.mk +++ b/test/Library_test.mk @@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_libraries,test,\ unotest \ vcl \ drawinglayer \ + drawinglayercore \ )) $(eval $(call gb_Library_add_exception_objects,test,\ diff --git a/test/qa/cppunit/test_xpath.cxx b/test/qa/cppunit/test_xpath.cxx index 87d6a7ac177e..c622e59617ec 100644 --- a/test/qa/cppunit/test_xpath.cxx +++ b/test/qa/cppunit/test_xpath.cxx @@ -9,7 +9,10 @@ #include <sal/types.h> #include <test/xmltesttools.hxx> -#include <unotest/bootstrapfixturebase.hxx> + +#include <cppunit/TestFixture.h> +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/plugin/TestPlugIn.h> class TestXPath : public CppUnit::TestFixture, public XmlTestTools { diff --git a/test/source/beans/xpropertyset.cxx b/test/source/beans/xpropertyset.cxx index 33c0398650db..00c3378106d9 100644 --- a/test/source/beans/xpropertyset.cxx +++ b/test/source/beans/xpropertyset.cxx @@ -184,63 +184,63 @@ bool XPropertySet::isPropertyValueChangeable(const OUString& rName) { // boolean type bool bOld = any.get<bool>(); - xPropSet->setPropertyValue(rName, makeAny(!bOld)); + xPropSet->setPropertyValue(rName, Any(!bOld)); } else if (type == cppu::UnoType<sal_Int8>::get()) { // 8-bit integer sal_Int8 nOld = any.get<sal_Int8>(); sal_Int8 nNew = nOld + 1; - xPropSet->setPropertyValue(rName, makeAny(nNew)); + xPropSet->setPropertyValue(rName, Any(nNew)); } else if (type == cppu::UnoType<sal_Int16>::get()) { // 16-bit integer sal_Int16 nOld = any.get<sal_Int16>(); sal_Int16 nNew = nOld + 1; - xPropSet->setPropertyValue(rName, makeAny(nNew)); + xPropSet->setPropertyValue(rName, Any(nNew)); } else if (type == cppu::UnoType<sal_Int32>::get()) { // 32-bit integer sal_Int32 nOld = any.get<sal_Int32>(); sal_Int32 nNew = nOld + 3; - xPropSet->setPropertyValue(rName, makeAny(nNew)); + xPropSet->setPropertyValue(rName, Any(nNew)); } else if (type == cppu::UnoType<sal_Int64>::get()) { // 64-bit integer sal_Int64 nOld = any.get<sal_Int64>(); sal_Int64 nNew = nOld + 4; - xPropSet->setPropertyValue(rName, makeAny(nNew)); + xPropSet->setPropertyValue(rName, Any(nNew)); } else if (type == cppu::UnoType<float>::get()) { // single precision float fOld = any.get<float>(); float fNew = fOld + 1.2; - xPropSet->setPropertyValue(rName, makeAny(fNew)); + xPropSet->setPropertyValue(rName, Any(fNew)); } else if (type == cppu::UnoType<double>::get()) { // double precision double fOld = any.get<double>(); double fNew = fOld + 1.3; - xPropSet->setPropertyValue(rName, makeAny(fNew)); + xPropSet->setPropertyValue(rName, Any(fNew)); } else if (type == cppu::UnoType<OUString>::get()) { // string type OUString aOld = any.get<OUString>(); OUString aNew = aOld + "foo"; - xPropSet->setPropertyValue(rName, makeAny(aNew)); + xPropSet->setPropertyValue(rName, Any(aNew)); } else if (type == cppu::UnoType<util::DateTime>::get()) { // date time type util::DateTime aDT = any.get<util::DateTime>(); aDT.Year += 1; - xPropSet->setPropertyValue(rName, makeAny(aDT)); + xPropSet->setPropertyValue(rName, Any(aDT)); } else { diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx index 4d933a3fc5d2..d9048b39465d 100644 --- a/test/source/bootstrapfixture.cxx +++ b/test/source/bootstrapfixture.cxx @@ -7,7 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <config_features.h> +#include <config_validation.h> #include <test/bootstrapfixture.hxx> #include <vcl/errinf.hxx> @@ -29,6 +29,7 @@ #include <vcl/salgtype.hxx> #include <vcl/scheduler.hxx> #include <vcl/virdev.hxx> +#include <o3tl/string_view.hxx> #include <memory> #include <cstring> @@ -223,8 +224,8 @@ void test::BootstrapFixture::validate(const OUString& rPath, test::ValidationFor else { sal_Int32 nStartOfNumber = nIndex + std::strlen("Grand total of errors in submitted package: "); - OUString aNumber = aContentOUString.copy(nStartOfNumber); - sal_Int32 nErrors = aNumber.toInt32(); + std::u16string_view aNumber = aContentOUString.subView(nStartOfNumber); + sal_Int32 nErrors = o3tl::toInt32(aNumber); OString aMsg = "validation error in OOXML export: Errors: " + OString::number(nErrors); if(nErrors) { @@ -264,6 +265,12 @@ bool test::BootstrapFixture::IsDefaultDPI() && Application::GetDefaultDevice()->GetDPIY() == 96); } +std::pair<double, double> test::BootstrapFixture::getDPIScaling() +{ + return { Application::GetDefaultDevice()->GetDPIX() / 96.0, + Application::GetDefaultDevice()->GetDPIY() / 96.0 }; +} + sal_uInt16 test::BootstrapFixture::getDefaultDeviceBitCount() { ScopedVclPtr<VirtualDevice> device diff --git a/test/source/diff/diff.cxx b/test/source/diff/diff.cxx index e0ba939d4964..097452665308 100644 --- a/test/source/diff/diff.cxx +++ b/test/source/diff/diff.cxx @@ -17,14 +17,13 @@ #include <set> #include <sstream> #include <cassert> +#include <cmath> #include <vector> #if USE_CPPUNIT #include <cppunit/TestAssert.h> #endif -#include <rtl/math.hxx> - namespace { struct tolerance diff --git a/test/source/helper/form.cxx b/test/source/helper/form.cxx index c610070a1372..5727909a603a 100644 --- a/test/source/helper/form.cxx +++ b/test/source/helper/form.cxx @@ -46,7 +46,7 @@ uno::Reference<drawing::XControlShape> OOO_DLLPUBLIC_TEST createControlShape( uno::UNO_SET_THROW); uno::Reference<beans::XPropertySet> xPropertySet(aComponent, uno::UNO_QUERY_THROW); xPropertySet->setPropertyValue( - "DefaultControl", uno::makeAny(OUString::Concat("com.sun.star.form.control.") + r_aKind)); + "DefaultControl", uno::Any(OUString::Concat("com.sun.star.form.control.") + r_aKind)); uno::Reference<awt::XControlModel> xControlModel(aComponent, uno::UNO_QUERY_THROW); xControlShape->setSize(awt::Size(nHeight, nWidth)); diff --git a/test/source/helper/transferable.cxx b/test/source/helper/transferable.cxx index e8990d925d18..201b3c50e442 100644 --- a/test/source/helper/transferable.cxx +++ b/test/source/helper/transferable.cxx @@ -9,6 +9,7 @@ #include <test/helper/transferable.hxx> #include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp> +#include <o3tl/string_view.hxx> using namespace css; @@ -23,9 +24,9 @@ OString OOO_DLLPUBLIC_TEST getTextSelection( // Take care of UTF-8 text here. bool bConvert = false; sal_Int32 nIndex = 0; - if (mimeType.getToken(0, ';', nIndex) == "text/plain") + if (o3tl::getToken(mimeType, 0, ';', nIndex) == "text/plain") { - if (mimeType.getToken(0, ';', nIndex) == "charset=utf-8") + if (o3tl::getToken(mimeType, 0, ';', nIndex) == "charset=utf-8") { mimeType = "text/plain;charset=utf-16"; bConvert = true; diff --git a/test/source/sheet/globalsheetsettings.cxx b/test/source/sheet/globalsheetsettings.cxx index c1e527158794..3e796fc58efe 100644 --- a/test/source/sheet/globalsheetsettings.cxx +++ b/test/source/sheet/globalsheetsettings.cxx @@ -38,7 +38,7 @@ void GlobalSheetSettings::testGlobalSheetSettingsProperties() css::uno::Any aOrigValue(origValue), aNewValue(newValue); css::uno::Sequence<css::uno::Any> args{ css::uno::Any( - css::beans::NamedValue("nodepath", css::uno::makeAny(regNodeName))) }; + css::beans::NamedValue("nodepath", css::uno::Any(regNodeName))) }; css::uno::Reference<beans::XPropertySet> xRegNodeRO( configProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", args), diff --git a/test/source/sheet/spreadsheetviewsettings.cxx b/test/source/sheet/spreadsheetviewsettings.cxx index b77bcb4c6921..1a5916dcfe39 100644 --- a/test/source/sheet/spreadsheetviewsettings.cxx +++ b/test/source/sheet/spreadsheetviewsettings.cxx @@ -235,6 +235,16 @@ void SpreadsheetViewSettings::testSpreadsheetViewSettingsProperties() xSpreadsheetViewSettings->setPropertyValue(propName, aNewValue); CPPUNIT_ASSERT(xSpreadsheetViewSettings->getPropertyValue(propName) >>= aZoomValue); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue ZoomValue", sal_Int16(1), aZoomValue); + + propName = "FormulaBarHeight"; + sal_Int16 aFormulaBarHeight; + CPPUNIT_ASSERT(xSpreadsheetViewSettings->getPropertyValue(propName) >>= aFormulaBarHeight); + + aNewValue <<= sal_Int16(15); + xSpreadsheetViewSettings->setPropertyValue(propName, aNewValue); + CPPUNIT_ASSERT(xSpreadsheetViewSettings->getPropertyValue(propName) >>= aFormulaBarHeight); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue FormulaBarHeight", sal_Int16(15), + aFormulaBarHeight); } } diff --git a/test/source/table/tablecolumn.cxx b/test/source/table/tablecolumn.cxx index 9f25c39355e4..08a008ce8823 100644 --- a/test/source/table/tablecolumn.cxx +++ b/test/source/table/tablecolumn.cxx @@ -36,7 +36,7 @@ void TableColumn::testTableColumnProperties() uno::Reference<table::XCellRange> xCR(m_xSheet, uno::UNO_QUERY_THROW); xCR->getCellByPosition(0, 0)->setFormula("That's a pretty long text."); const sal_Int64 nWidthBefore = ::comphelper::getINT64(xPS->getPropertyValue("Width")); - xPS->setPropertyValue(aPropName, uno::makeAny(true)); + xPS->setPropertyValue(aPropName, uno::Any(true)); CPPUNIT_ASSERT(::comphelper::getBOOL(xPS->getPropertyValue(aPropName))); const sal_Int64 nWidthAfter = ::comphelper::getINT64(xPS->getPropertyValue("Width")); CPPUNIT_ASSERT(nWidthBefore != nWidthAfter); diff --git a/test/source/text/baseindex.cxx b/test/source/text/baseindex.cxx index 79ec57270af5..683a24221bb8 100644 --- a/test/source/text/baseindex.cxx +++ b/test/source/text/baseindex.cxx @@ -76,7 +76,7 @@ void BaseIndex::testBaseIndexProperties() CPPUNIT_ASSERT(xBaseIndex->getPropertyValue(name) >>= xGetTextColumns); xGetTextColumns->setColumnCount(xGetTextColumns->getColumnCount() + 1); - xBaseIndex->setPropertyValue(name, css::uno::makeAny(xGetTextColumns)); + xBaseIndex->setPropertyValue(name, css::uno::Any(xGetTextColumns)); css::uno::Reference<css::text::XTextColumns> xSetTextColumns; CPPUNIT_ASSERT(xBaseIndex->getPropertyValue(name) >>= xSetTextColumns); @@ -108,7 +108,7 @@ void BaseIndex::testBaseIndexProperties() CPPUNIT_ASSERT(xBaseIndex->getPropertyValue("BackGraphic") >>= xGraphic); CPPUNIT_ASSERT(!xGraphic.is()); - xBaseIndex->setPropertyValue(name, css::uno::makeAny(aTempFile.GetURL())); + xBaseIndex->setPropertyValue(name, css::uno::Any(aTempFile.GetURL())); CPPUNIT_ASSERT(xBaseIndex->getPropertyValue("BackGraphic") >>= xGraphic); CPPUNIT_ASSERT(xGraphic.is()); diff --git a/test/source/text/textcontent.cxx b/test/source/text/textcontent.cxx index 132981b2ac65..61990d869f97 100644 --- a/test/source/text/textcontent.cxx +++ b/test/source/text/textcontent.cxx @@ -32,7 +32,7 @@ void TextContent::testTextContentProperties() try { - xPS->setPropertyValue("AnchorType", uno::makeAny(m_aNewTCAT)); + xPS->setPropertyValue("AnchorType", uno::Any(m_aNewTCAT)); text::TextContentAnchorType aNewTCAT; CPPUNIT_ASSERT(xPS->getPropertyValue("AnchorType") >>= aNewTCAT); CPPUNIT_ASSERT_EQUAL(m_aNewTCAT, aNewTCAT); @@ -52,7 +52,7 @@ void TextContent::testTextContentProperties() try { - xPS->setPropertyValue("TextWrap", uno::makeAny(m_aNewWTM)); + xPS->setPropertyValue("TextWrap", uno::Any(m_aNewWTM)); text::WrapTextMode aNewWTM; CPPUNIT_ASSERT(xPS->getPropertyValue("TextWrap") >>= aNewWTM); CPPUNIT_ASSERT_EQUAL(m_aNewWTM, aNewWTM); diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index f92c380d9bf8..ab9e5dcff8b8 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -440,6 +440,8 @@ void XmlTestTools::registerOOXMLNamespaces(xmlXPathContextPtr& pXmlXpathCtx) BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/diagram")); xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("c15"), BAD_CAST("http://schemas.microsoft.com/office/drawing/2012/chart")); + xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("xr2"), + BAD_CAST("http://schemas.microsoft.com/office/spreadsheetml/2015/revision2")); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/user-template/registry/modifications.xcd b/test/user-template/registry/modifications.xcd index dcccd94b69d5..61a1a85b4fa8 100644 --- a/test/user-template/registry/modifications.xcd +++ b/test/user-template/registry/modifications.xcd @@ -7,7 +7,66 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. * --> -<oor:data xmlns:oor="http://openoffice.org/2001/registry"> +<oor:data xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:oor="http://openoffice.org/2001/registry"> + <oor:component-data xmlns:install="http://openoffice.org/2004/installation" oor:name="VCL" oor:package="org.openoffice"> + <node oor:name="DefaultFonts"> + <node oor:name="ar"> + <prop oor:name="CTL_HEADING" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + <prop oor:name="CTL_TEXT" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + </node> + <node oor:name="en"> + <prop oor:name="CJK_HEADING" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + <prop oor:name="CTL_HEADING" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + <prop oor:name="CTL_TEXT" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + <prop oor:name="UI_SANS" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + </node> + <node oor:name="hi"> + <prop oor:name="CTL_HEADING" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + <prop oor:name="CTL_SPREADSHEET" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + <prop oor:name="CTL_TEXT" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + </node> + <node oor:name="zh-cn"> + <prop oor:name="CJK_HEADING" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + <prop oor:name="CJK_SPREADSHEET" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + <prop oor:name="CJK_TEXT" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + </node> + <node oor:name="zh-tw"> + <prop oor:name="CJK_HEADING" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + <prop oor:name="CJK_SPREADSHEET" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + <prop oor:name="CJK_TEXT" oor:type="xs:string"> + <value>DejaVu Sans</value> + </prop> + </node> + </node> + </oor:component-data> <oor:component-data oor:name="Common" oor:package="org.openoffice.Office"> <node oor:name="Misc"> <prop oor:name="UseDocumentSystemFileLocking"> |