[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/data/ods/miscemptyrepeatedrowheights.ods |binary sc/qa/unit/data/xlsx/miscrowheights.xlsx|binary sc/qa/unit/subsequent_export-test.cxx | 74 ++ sc/source/filter/excel/xetable.cxx | 81 ++-- sc/source/filter/inc/xetable.hxx|4 5 files changed, 138 insertions(+), 21 deletions(-) New commits: commit b75bf09a5b905a3ed9c251869983a400c70c7fc6 Author: Noel Power noel.po...@suse.com Date: Tue Jan 29 14:51:49 2013 + correctly handle repeated row heights for empty rows ( fdo#59973 ) it seems both xls xlsx export suffer from problems with multiple row heights repeated ( if those rows are empty ) Change-Id: I3ed68a81517a3e55d1de1954fcb99e7cb39be337 diff --git a/sc/qa/unit/data/ods/miscemptyrepeatedrowheights.ods b/sc/qa/unit/data/ods/miscemptyrepeatedrowheights.ods new file mode 100644 index 000..5511ad9 Binary files /dev/null and b/sc/qa/unit/data/ods/miscemptyrepeatedrowheights.ods differ diff --git a/sc/qa/unit/data/xlsx/miscrowheights.xlsx b/sc/qa/unit/data/xlsx/miscrowheights.xlsx new file mode 100755 index 000..dbdbc13 Binary files /dev/null and b/sc/qa/unit/data/xlsx/miscrowheights.xlsx differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 7b0fde8..05c4873 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -77,6 +77,7 @@ public: void test(); void testPasswordExport(); void testConditionalFormatExportXLSX(); +void testMiscRowHeightExport(); CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); @@ -84,6 +85,7 @@ public: CPPUNIT_TEST(testPasswordExport); #endif CPPUNIT_TEST(testConditionalFormatExportXLSX); +CPPUNIT_TEST(testMiscRowHeightExport); CPPUNIT_TEST_SUITE_END(); private: @@ -297,6 +299,78 @@ void ScExportTest::testConditionalFormatExportXLSX() testCondFile(aCSVPath, pDoc, 0); } +void ScExportTest::testMiscRowHeightExport() +{ + +struct TestParam +{ +struct RowData +{ +SCROW nStartRow; +SCROW nEndRow; +SCTAB nTab; +int nExpectedHeight; +}; +const char* sTestDoc; +int nImportType; +int nExportType; +int nRowData; +RowData* pData; +}; + +TestParam::RowData DfltRowData[] = +{ +{ 0, 4, 0, 529 }, +{ 5, 10, 0, 1058 }, +{ 17, 20, 0, 1767 }, +{ 1048573, 1048575, 0, 529 }, +}; + +TestParam::RowData EmptyRepeatRowData[] = +{ +{ 0, 4, 0, 529 }, +{ 5, 10, 0, 1058 }, +{ 17, 20, 0, 1767 }, +}; + +TestParam aTestValues[] = +{ +{ miscrowheights., XLSX, XLSX, SAL_N_ELEMENTS(DfltRowData), DfltRowData }, +{ miscrowheights., XLSX, XLS, SAL_N_ELEMENTS(DfltRowData), DfltRowData }, +{ miscemptyrepeatedrowheights., ODS, XLSX, SAL_N_ELEMENTS(EmptyRepeatRowData), EmptyRepeatRowData }, +{ miscemptyrepeatedrowheights., ODS, XLS, SAL_N_ELEMENTS(EmptyRepeatRowData), EmptyRepeatRowData }, +}; + +for ( unsigned int index=0; indexSAL_N_ELEMENTS(aTestValues); ++index ) +{ +OUString sFileName = OUString::createFromAscii( aTestValues[ index ].sTestDoc ); +printf(aTestValues[%d] %s\n, index, OUStringToOString( sFileName, RTL_TEXTENCODING_UTF8 ).getStr() ); +int nImportType = aTestValues[ index ].nImportType; +int nExportType = aTestValues[ index ].nExportType; +ScDocShellRef xShell = loadDocument( sFileName, nImportType ); +CPPUNIT_ASSERT(xShell.Is()); + +ScDocShellRef xDocSh = saveAndReload((*xShell), nExportType ); +CPPUNIT_ASSERT(xDocSh.Is()); + +ScDocument* pDoc = xDocSh-GetDocument(); + +for (int i=0; iaTestValues[ index ].nRowData; ++i) +{ +SCROW nRow = aTestValues[ index ].pData[ i].nStartRow; +SCROW nEndRow = aTestValues[ index ].pData[ i ].nEndRow; +SCTAB nTab = aTestValues[ index ].pData[ i ].nTab; +int nExpectedHeight = aTestValues[ index ].pData[ i ].nExpectedHeight; +for ( ; nRow = nEndRow; ++nRow ) +{ +printf(\t checking row %d for height %d\n, nRow, nExpectedHeight ); +int nHeight = sc::TwipsToHMM( pDoc-GetRowHeight(nRow, nTab, false) ); +CPPUNIT_ASSERT_EQUAL(nExpectedHeight, nHeight); +} +} +} +} + ScExportTest::ScExportTest() : m_aBaseString(RTL_CONSTASCII_USTRINGPARAM(/sc/qa/unit/data)) { diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 178acd9..c44b32c 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1709,6 +1709,7 @@ XclExpRow::XclExpRow( const XclExpRoot rRoot, sal_uInt32 nXclRow, mnXFIndex( EXC_XF_DEFAULTCELL
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/subsequent_filters-test.cxx |4 ++-- sc/source/core/tool/formularesult.cxx |6 ++ 2 files changed, 4 insertions(+), 6 deletions(-) New commits: commit b1d0fd4f969976e2133f8eaa37c1fb8360c20f68 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Thu Jan 24 01:18:59 2013 +0100 small improvement of the code Change-Id: I2ac599fa2897dc4fe3256b50300cb467c647e320 diff --git a/sc/source/core/tool/formularesult.cxx b/sc/source/core/tool/formularesult.cxx index 9139c9a..9602c44 100644 --- a/sc/source/core/tool/formularesult.cxx +++ b/sc/source/core/tool/formularesult.cxx @@ -268,9 +268,8 @@ bool ScFormulaResult::IsEmptyDisplayedAsString() const bool ScFormulaResult::IsValue() const { formula::StackVar sv = GetCellResultType(); -if( sv == formula::svHybridValueCell ) -return true; -return sv == formula::svDouble || sv == formula::svError || sv == formula::svEmptyCell; +return sv == formula::svDouble || sv == formula::svError +|| sv == formula::svEmptyCell || sv == formula::svHybridValueCell; } bool ScFormulaResult::IsMultiline() const @@ -335,7 +334,6 @@ double ScFormulaResult::GetDouble() const case formula::svHybridCell: case formula::svHybridValueCell: return mpToken-GetDouble(); -return mpToken-GetDouble(); case formula::svMatrixCell: { const ScMatrixCellResultToken* p = commit 0ab1b83271e8e0d1ee9fa2ade4bd1dda63c5f5f3 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Thu Jan 24 01:18:25 2013 +0100 disable these two tests for now Change-Id: I579694780b64e532b0e61017783bc4e72f8d2936 diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 72dabde..d934ce9 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -184,8 +184,8 @@ public: CPPUNIT_TEST(testHardRecalcODS); CPPUNIT_TEST(testFunctionsODS); CPPUNIT_TEST(testCachedFormulaResultsODS); -CPPUNIT_TEST(testVolatileFunctionsODS); -CPPUNIT_TEST(testCachedMatrixFormulaResultsODS); +//CPPUNIT_TEST(testVolatileFunctionsODS); +//CPPUNIT_TEST(testCachedMatrixFormulaResultsODS); CPPUNIT_TEST(testDatabaseRangesODS); CPPUNIT_TEST(testDatabaseRangesXLS); CPPUNIT_TEST(testDatabaseRangesXLSX); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa sd/source
sc/qa/unit/subsequent_filters-test.cxx | 10 ++ sd/source/ui/dlg/prltempl.cxx |3 ++- sd/source/ui/func/fuprobjs.cxx |2 +- 3 files changed, 13 insertions(+), 2 deletions(-) New commits: commit 004c72330a132bbff09267459b35decdea3d8cf6 Author: Michael Meeks michael.me...@suse.com Date: Wed Jan 9 13:02:42 2013 + lame_OUString_valueOf_sal_Int32_casts += 2; diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx index 787d717..625c191 100644 --- a/sd/source/ui/dlg/prltempl.cxx +++ b/sd/source/ui/dlg/prltempl.cxx @@ -213,7 +213,8 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, case PO_OUTLINE_7: case PO_OUTLINE_8: case PO_OUTLINE_9: -aTitle = OUString(SdResId( STR_PSEUDOSHEET_OUTLINE )) + + OUString::valueOf( ePO - PO_OUTLINE_1 + 1 ); +aTitle = OUString(SdResId( STR_PSEUDOSHEET_OUTLINE )) + + +OUString::valueOf( static_castsal_Int32( ePO - PO_OUTLINE_1 + 1 ) ); break; case PO_NOTES: diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx index 0f46566..5ce8eb5 100644 --- a/sd/source/ui/func/fuprobjs.cxx +++ b/sd/source/ui/func/fuprobjs.cxx @@ -138,7 +138,7 @@ void FuPresentationObjects::DoExecute( SfxRequest ) String aStr(SdResId( STR_LAYOUT_OUTLINE )); aStyleName.Append( aStr ); aStyleName.Append( sal_Unicode(' ') ); -aStyleName.Append( OUString::valueOf( nDepth ) ); +aStyleName.Append( OUString::valueOf( static_castsal_Int32( nDepth ) ) ); } SfxStyleSheetBasePool* pStyleSheetPool = mpDocSh-GetStyleSheetPool(); commit 2be3423657ddb067d17b4af0869b2300a0f0bc3e Author: Michael Meeks michael.me...@suse.com Date: Wed Jan 9 12:44:25 2013 + re-apply calc /tmp unit test file leakage. diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index f56bd66..a7ec15b 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -926,6 +926,8 @@ void ScFiltersTest::testBordersOoo33() } } } + +xDocSh-DoClose(); } void ScFiltersTest::testBugFixesODS() @@ -1768,6 +1770,8 @@ void ScFiltersTest::testColorScaleODS() rtl::OUStringBuffer aBuffer(getSrcRootPath()); aBuffer.append(m_aBaseString).append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(/reference/))); testColorScale_Impl(pDoc, aBuffer.makeStringAndClear()); + +xDocSh-DoClose(); } void ScFiltersTest::testColorScaleXLSX() @@ -1792,6 +1796,8 @@ void ScFiltersTest::testColorScaleXLSX() rtl::OUStringBuffer aBuffer(getSrcRootPath()); aBuffer.append(m_aBaseString).append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(/reference/))); testColorScale_Impl(pDoc, aBuffer.makeStringAndClear()); + +xDocSh-DoClose(); } void ScFiltersTest::testDataBarODS() @@ -1821,6 +1827,8 @@ void ScFiltersTest::testNewCondFormat() rtl::OUString aCSVPath; createCSVPath( aCSVFile, aCSVPath ); testCondFile(aCSVPath, pDoc, 0); + +xDocSh-DoClose(); } void ScFiltersTest::testFormulaDependency() @@ -1849,6 +1857,8 @@ void ScFiltersTest::testFormulaDependency() // check that the number format is implicity inherited // CPPUNIT_ASSERT_EQUAL(pDoc-GetString(0,4,0), pDoc-GetString(0,5,0)); + +xDocSh-DoClose(); } ScFiltersTest::ScFiltersTest() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/subsequent_filters-test.cxx |2 +- sc/source/filter/xml/xmlrowi.cxx |7 --- sc/source/filter/xml/xmlrowi.hxx |2 -- 3 files changed, 1 insertion(+), 10 deletions(-) New commits: commit 3e102b36977a62931b0de4176bcd92a307408d8b Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sat Jan 5 00:18:21 2013 +0100 enable the unit test diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 5acbfb8..618e627 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -213,7 +213,7 @@ public: CPPUNIT_TEST(testCellAnchoredShapesODS); CPPUNIT_TEST(testPivotTableBasicODS); -// CPPUNIT_TEST(testRowHeight); +CPPUNIT_TEST(testRowHeight); CPPUNIT_TEST(testFormulaDependency); //disable testPassword on MacOSX due to problems with libsqlite3 commit 9ddd869873603f929d7c342d62a8d52d19de83ec Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sat Jan 5 00:14:47 2013 +0100 Revert workaround problems with row import, fdo#58539 This reverts commit 119483d9b0af6b4830733161fcf56cea10ed01d7. diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx index a4434e1..ec4c5a5 100644 --- a/sc/source/filter/xml/xmlrowi.cxx +++ b/sc/source/filter/xml/xmlrowi.cxx @@ -98,7 +98,6 @@ ScXMLTableRowContext::ScXMLTableRowContext( ScXMLImport rImport, break;*/ } } -mnLastRow = GetScImport().GetTables().GetCurrentRow() + nRepeatedRows; GetScImport().GetTables().AddRow(); GetScImport().GetTables().SetRowStyle(sCellStyleName); } @@ -156,12 +155,6 @@ void ScXMLTableRowContext::EndElement() } SCTAB nSheet = rXMLImport.GetTables().GetCurrentSheet(); sal_Int32 nCurrentRow(rXMLImport.GetTables().GetCurrentRow()); -if(nCurrentRow != mnLastRow) -{ -// this document is most likely invalid in some way -SAL_WARN(sc, we did not generate enough rows in the cell import!!); -nCurrentRow = mnLastRow; -} uno::Referencesheet::XSpreadsheet xSheet(rXMLImport.GetTables().GetCurrentXSheet()); if(xSheet.is()) { diff --git a/sc/source/filter/xml/xmlrowi.hxx b/sc/source/filter/xml/xmlrowi.hxx index 02c5255..a900ff7 100644 --- a/sc/source/filter/xml/xmlrowi.hxx +++ b/sc/source/filter/xml/xmlrowi.hxx @@ -29,8 +29,6 @@ class ScXMLTableRowContext : public SvXMLImportContext rtl::OUString sStyleName; rtl::OUString sVisibility; sal_Int32 nRepeatedRows; -sal_Int32 mnLastRow; // to workaround problems with the cell import, can be removed when the cell -// always adds enough rows bool bHasCell; const ScXMLImport GetScImport() const { return (const ScXMLImport)GetImport(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/rangelst_test.cxx | 33 + sc/source/core/data/conditio.cxx |5 - 2 files changed, 37 insertions(+), 1 deletion(-) New commits: commit ef48f2fd617aad8a19c2d5613db8fa513b2ef455 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Wed Dec 26 04:10:50 2012 +0100 add a unit test for new method in ScRangeList Change-Id: Id27973cc82c71daffec62cbaccba30777c08612b diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx index b5381ec..62d9002 100644 --- a/sc/qa/unit/rangelst_test.cxx +++ b/sc/qa/unit/rangelst_test.cxx @@ -38,6 +38,7 @@ public: void testDeleteArea_0Ranges(); void testJoin_Case1(); void testJoin_Case2(); +void testGetIntersectedRange(); void testUpdateReference_DeleteRow(); void testUpdateReference_DeleteCol(); @@ -63,6 +64,7 @@ public: CPPUNIT_TEST(testJoin_Case2); CPPUNIT_TEST(testUpdateReference_DeleteRow); CPPUNIT_TEST(testUpdateReference_DeleteCol); +CPPUNIT_TEST(testGetIntersectedRange); CPPUNIT_TEST_SUITE_END(); @@ -71,6 +73,30 @@ private: ScDocShellRef m_xDocShRef; }; +namespace { + +std::ostream operator(std::ostream rStrm, const ScAddress rAddr) +{ +rStrm Col: rAddr.Col() Row: rAddr.Row() Tab: rAddr.Tab() \n; +return rStrm; +} + +std::ostream operator(std::ostream rStrm, const ScRange rRange) +{ +rStrm ScRange: rRange.aStart rRange.aEnd \n; +return rStrm; +} + +std::ostream operator(std::ostream rStrm, const ScRangeList rList) +{ +rStrm ScRangeList: \n; +for(size_t i = 0; i rList.size(); ++i) +rStrm *rList[i]; +return rStrm; +} + +} + void Test::setUp() { @@ -449,6 +475,13 @@ void Test::testUpdateReference_DeleteCol() CPPUNIT_ASSERT_EQUAL(static_castsize_t(12), aList.GetCellCount()); } +void Test::testGetIntersectedRange() +{ +ScRangeList aList(ScRange(2, 2, 0, 5, 5, 0)); +ScRangeList aIntersecting = aList.GetIntersectedRange(ScRange(0, 0, 0, 3, 3, 0)); +CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(2,2,0,3,3,0)), aIntersecting); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); commit 7c528f40e0aea9386d175b007974c02d265f96c6 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Wed Dec 26 04:09:31 2012 +0100 one more improvement around cond format rendering, fdo#57896 Change-Id: I5eb267ec2d1666edd53f5b9d58fd2a0cec044aa1 diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 3dcc3be..016c5e9 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1973,7 +1973,10 @@ void ScConditionalFormat::dumpInfo(rtl::OUStringBuffer rBuf) const void ScConditionalFormat::DoRepaint( const ScRange* pModified ) { if(pModified) -pDoc-RepaintRange(*pModified); +{ +if(maRanges.Intersects(*pModified)) +pDoc-RepaintRange(*pModified); +} else { // all conditional format cells ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/ucalc.cxx | 27 +++ sc/source/core/tool/interpr5.cxx |6 +++--- 2 files changed, 30 insertions(+), 3 deletions(-) New commits: commit 70ec826eeb8f0b311095869e23be1db95fc9d109 Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Thu Nov 8 19:50:02 2012 -0500 New unit test to ensure correct matrix creation. See fdo#56829 for what inspired this test case. Change-Id: Iee15d85a35ae96769d21ce7061b352860a5b587b diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 5b48f25..0606562 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -125,6 +125,7 @@ public: void testNamedRange(); void testCSV(); void testMatrix(); +void testEnterMixedMatrix(); /** * Basic test for pivot tables. @@ -250,6 +251,7 @@ public: CPPUNIT_TEST(testNamedRange); CPPUNIT_TEST(testCSV); CPPUNIT_TEST(testMatrix); +CPPUNIT_TEST(testEnterMixedMatrix); CPPUNIT_TEST(testPivotTable); CPPUNIT_TEST(testPivotTableLabels); CPPUNIT_TEST(testPivotTableDateLabels); @@ -1513,6 +1515,31 @@ void Test::testMatrix() checkMatrixElementsPartiallyFilledEmptyMatrix(*pMat); } +void Test::testEnterMixedMatrix() +{ +m_pDoc-InsertTab(0, foo); + +// Insert the source values in A1:B2. +m_pDoc-SetString(0, 0, 0, A); +m_pDoc-SetString(1, 0, 0, B); +double val = 1.0; +m_pDoc-SetValue(0, 1, 0, val); +val = 2.0; +m_pDoc-SetValue(1, 1, 0, val); + +// Create a matrix range in A4:B5 referencing A1:B2. +ScMarkData aMark; +aMark.SelectOneTable(0); +m_pDoc-InsertMatrixFormula(0, 3, 1, 4, aMark, =A1:B2, NULL); + +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)); +CPPUNIT_ASSERT_EQUAL(m_pDoc-GetValue(0,1,0), m_pDoc-GetValue(0,4,0)); +CPPUNIT_ASSERT_EQUAL(m_pDoc-GetValue(1,1,0), m_pDoc-GetValue(1,4,0)); + +m_pDoc-DeleteTab(0); +} + namespace { struct DPFieldDef commit 78bf3c9abd4a8cd939e7ba4399ae4aab9f3b2982 Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Thu Nov 8 19:49:10 2012 -0500 fdo#56829: Correctly pass element values to matrix. Change-Id: I20045ae0ddcec228b153c4005855dca9c4ddbfca diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 46fd6fc..faa0db5 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -453,7 +453,7 @@ ScMatrixRef ScInterpreter::CreateMatrixFromDoubleRef( const FormulaToken* pToken nGlobalError = 0; } -if (nThisRow == nPrevRow + 1) +if (!aBucket.maNumVals.empty() nThisRow == nPrevRow + 1) { // Secondary numbers. aBucket.maNumVals.push_back(fVal); @@ -475,7 +475,7 @@ ScMatrixRef ScInterpreter::CreateMatrixFromDoubleRef( const FormulaToken* pToken double fVal = CreateDoubleError( nGlobalError); nGlobalError = 0; -if (nThisRow == nPrevRow + 1) +if (!aBucket.maNumVals.empty() nThisRow == nPrevRow + 1) { // Secondary numbers. aBucket.maNumVals.push_back(fVal); @@ -490,7 +490,7 @@ ScMatrixRef ScInterpreter::CreateMatrixFromDoubleRef( const FormulaToken* pToken } else { -if (nThisRow == nPrevRow + 1) +if (!aBucket.maStrVals.empty() nThisRow == nPrevRow + 1) { // Secondary numbers. aBucket.maStrVals.push_back(aStr); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/ucalc.cxx | 12 +++- sc/source/core/data/table2.cxx | 16 2 files changed, 23 insertions(+), 5 deletions(-) New commits: commit d3344dd85ee31b195a3709d16e734245e1d0a4b6 Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Fri Nov 2 13:27:31 2012 -0400 Correctly handle cell note shifting when immediate row/column is deleted. Currently, having a note e.g. at D5, and deleting cell D4 and shifting the cells below upward will remove the note at D5. But the correct behavior is to shift that note up to D4. This change fixes it. Change-Id: Ia37f1ce67a003deab424f2b805a2ce333fc10ed4 diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 8bfb0e6..69e2f02 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -261,7 +261,8 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE if (nStartRow = nRow nStartCol = nCol nCol = nEndCol) { -if(nRow - nStartRow static_castSCROW(nSize)) +SCROW nEndRow = nStartRow + nSize - 1; // last row of deleted region +if (nEndRow nRow) { // This note will get shifted. aNotes.insert(nCol, nRow - nSize, pPostIt); @@ -365,6 +366,7 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE aCol[MAXCOL - nSize - i].MoveTo(nStartRow, nEndRow, aCol[MAXCOL - i]); } +// Transfer those notes that will get shifted into another container. ScNotes aNotes(pDocument); ScNotes::iterator itr = maNotes.begin(); while( itr != maNotes.end() ) @@ -374,13 +376,14 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE ScPostIt* pPostIt = itr-second; ++itr; -if (nCol = nStartCol) +if (nStartCol = nCol nStartRow = nRow nRow = nEndRow) { aNotes.insert(nCol + nSize, nRow, pPostIt); maNotes.ReleaseNote(nCol, nRow); } } +// Re-insert the shifted notes. itr = aNotes.begin(); while( itr != aNotes.end() ) { @@ -471,6 +474,7 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE aCol[nStartCol + nSize + i].MoveTo(nStartRow, nEndRow, aCol[nStartCol + i]); } +// Transfer those notes that will get shifted into another container. ScNotes aNotes(pDocument); ScNotes::iterator itr = maNotes.begin(); while( itr != maNotes.end() ) @@ -480,18 +484,22 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE ScPostIt* pPostIt = itr-second; ++itr; -if (nCol = nStartCol) +if (nStartCol = nCol nStartRow = nRow nRow = nEndRow) { -if(nCol - nStartCol static_castSCCOL(nSize)) +SCCOL nEndCol = nStartCol + nSize - 1; +if (nEndCol nCol) { +// This note will get shifted. aNotes.insert(nCol - nSize, nRow, pPostIt); maNotes.ReleaseNote(nCol, nRow); } else +// The note is in the deleted region. Remove it. maNotes.erase(nCol, nRow); } } +// Re-insert the shifted notes. itr = aNotes.begin(); while( itr != aNotes.end() ) { commit 6bac39f309e11a515a2b2ecdf43a4b49ccd53502 Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Fri Nov 2 13:23:58 2012 -0400 More test cases for cell notes that currently fail. Change-Id: I23a5a39ab13106a27a02adbec0ff1ab64a43abef diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 62e98c6..ce8ea86 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -4258,7 +4258,7 @@ void Test::testPostIts() rAddr.IncRow(); // cell C4 CPPUNIT_ASSERT_MESSAGE(note not there, m_pDoc-GetNotes(rAddr.Tab())-findByAddress(rAddr) == pNote); -// Insert column at column 1. +// Insert column at column A. bool bInsertCol = m_pDoc-InsertCol(0, 0, MAXROW, 0, 1, 1); CPPUNIT_ASSERT_MESSAGE(failed to insert column, bInsertCol ); @@ -4285,6 +4285,16 @@ void Test::testPostIts() m_pDoc-DeleteRow(2, 0, 2, 0, 3, 1); CPPUNIT_ASSERT_MESSAGE(Note shouldn't have moved but it has., m_pDoc-GetNotes(rAddr.Tab())-findByAddress(rAddr) == pNote); +// Now, with the note at D4, delete cell D3. This should shift the note one cell up. +m_pDoc-DeleteRow(3, 0, 3, 0, 2, 1); +rAddr.IncRow(-1); // cell D3 +CPPUNIT_ASSERT_MESSAGE(Note at D4 should have shifted up to D3., m_pDoc-GetNotes(rAddr.Tab())-findByAddress(rAddr) == pNote); + +// Delete column C. This should shift the note one cell left. +m_pDoc-DeleteCol(0, 0, MAXROW, 0, 2, 1); +rAddr.IncCol(-1); // cell C3 +CPPUNIT_ASSERT_MESSAGE(Note at D3 should have shifted left to C3.,
[Libreoffice-commits] .: 2 commits - sc/qa
sc/qa/unit/helper/csv_handler.hxx | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) New commits: commit a05cfc077aebd71c8e882ec2c83cd7bd2b818401 Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Wed Oct 31 20:37:03 2012 -0400 fdo#56627: Handle empty cell values separately in filters test. Perhaps this will make valgrind happy? Change-Id: I11f965d13f8d71b2ab9f9624367fd70713644f10 diff --git a/sc/qa/unit/helper/csv_handler.hxx b/sc/qa/unit/helper/csv_handler.hxx index 8b4e545..4d16576 100644 --- a/sc/qa/unit/helper/csv_handler.hxx +++ b/sc/qa/unit/helper/csv_handler.hxx @@ -117,7 +117,16 @@ public: #if DEBUG_CSV_HANDLER std::cout Col: mnCol Row: mnRow std::endl; #endif //DEBUG_CSV_HANDLER -if (meStringType == PureString) +if (n == 0) +{ +// Empty cell. +if (!mpDoc-GetString(mnCol, mnRow, mnTab).isEmpty()) +{ +// cell in the document is not empty. +CPPUNIT_ASSERT_MESSAGE(createErrorMessage(mnCol, mnRow, mnTab).getStr(), false); +} +} +else if (meStringType == PureString) { rtl::OUString aCSVString(p, n, RTL_TEXTENCODING_UTF8); rtl::OUString aString; commit 117e87ffda86623825b0a6715ed754e721c09200 Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Wed Oct 31 20:07:07 2012 -0400 Use 'e' prefix for enum values. Change-Id: Iae3eceb38a6f9bc53805445799534ec8ee44a9a9 diff --git a/sc/qa/unit/helper/csv_handler.hxx b/sc/qa/unit/helper/csv_handler.hxx index dbb68cd..8b4e545 100644 --- a/sc/qa/unit/helper/csv_handler.hxx +++ b/sc/qa/unit/helper/csv_handler.hxx @@ -93,14 +93,12 @@ enum StringType { PureString, FormulaValue, StringValue }; class csv_handler { public: - - -csv_handler(ScDocument* pDoc, SCTAB nTab, StringType aType = StringValue): +csv_handler(ScDocument* pDoc, SCTAB nTab, StringType eType = StringValue): mpDoc(pDoc), mnCol(0), mnRow(0), mnTab(nTab), -maStringType(aType) {} +meStringType(eType) {} void begin_parse() {} @@ -119,7 +117,7 @@ public: #if DEBUG_CSV_HANDLER std::cout Col: mnCol Row: mnRow std::endl; #endif //DEBUG_CSV_HANDLER -if (maStringType == PureString) +if (meStringType == PureString) { rtl::OUString aCSVString(p, n, RTL_TEXTENCODING_UTF8); rtl::OUString aString; @@ -141,7 +139,7 @@ public: if (*pRemainingChars) { rtl::OUString aString; -switch (maStringType) +switch (meStringType) { case StringValue: mpDoc-GetString(mnCol, mnRow, mnTab, aString); @@ -174,7 +172,6 @@ public: } } ++mnCol; - } private: @@ -182,7 +179,7 @@ private: SCCOL mnCol; SCROW mnRow; SCTAB mnTab; -StringType maStringType; +StringType meStringType; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/subsequent_filters-test.cxx | 48 +++-- sc/source/core/data/colorscale.cxx |4 +- 2 files changed, 18 insertions(+), 34 deletions(-) New commits: commit 4c2a87d6e70040182d328c25d561b0de69e96a2b Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sun Sep 23 21:22:29 2012 +0200 int to sal_Int32 Change-Id: I44c5027c15b4f77a3ee76b62673641cc200fbefe diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 4ca1bc7..257ff1b 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -176,7 +176,7 @@ void ScColorScaleEntry::dumpInfo(rtl::OUStringBuffer rBuf) const default: rBuf.append( Unsupported Type\n ); } -rBuf.append( Color: ).append( (int)maColor.GetRed() ).append( , ).append( (int)maColor.GetGreen() ).append( , ).append( (int)maColor.GetBlue() ).append( \n ); +rBuf.append( Color: ).append( (sal_Int32)maColor.GetRed() ).append( , ).append( (sal_Int32)maColor.GetGreen() ).append( , ).append( (sal_Int32)maColor.GetBlue() ).append( \n ); if(meType == COLORSCALE_FORMULA) rBuf.append( Formula: ).append( GetFormula( formula::FormulaGrammar::GRAM_DEFAULT ) ).append(\n); else if( meType != COLORSCALE_MIN meType != COLORSCALE_MAX ) @@ -549,7 +549,7 @@ void ScColorScaleFormat::dumpInfo(rtl::OUStringBuffer rBuf) const { boost::scoped_ptrColor pColor( GetColor(ScAddress(nCol, nRow, nTab)) ); rBuf.append(nCol).append(,).append(nRow).append(,).append(nTab).append(,); - rBuf.append(((int)pColor-GetRed())).append(,).append(((int)pColor-GetGreen())).append(,).append(((int)pColor-GetBlue())).append(\n); + rBuf.append(((sal_Int32)pColor-GetRed())).append(,).append(((sal_Int32)pColor-GetGreen())).append(,).append(((sal_Int32)pColor-GetBlue())).append(\n); } } } commit 1245c2a7daba66e78a8548b0e5193d7e2b1f2a92 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sun Sep 23 21:22:01 2012 +0200 little refactoring and code simplification Change-Id: I41c7507d668eb0853b97c24217ff04f7dd4acd40 diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 8670345..2b6193f 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -1489,62 +1489,46 @@ void ScFiltersTest::testPivotTableBasicODS() namespace { +void testColorScaleFormat_Impl(ScDocument* pDoc, const rtl::OUString rFilePath, const ScConditionalFormat* pFormat) +{ +rtl::OUStringBuffer aBuf; +CPPUNIT_ASSERT(pFormat); +pFormat-dumpInfo(aBuf); +rtl::OUString aString = aBuf.makeStringAndClear(); +std::string aStdString; +loadFile(rFilePath, aStdString); +rtl::OUString aRefString = rtl::OUString::createFromAscii(aStdString.c_str()); +CPPUNIT_ASSERT_EQUAL(aRefString, aString); +} + void testColorScale_Impl(ScDocument* pDoc, const rtl::OUString aBaseString) { // first color scale { -rtl::OUStringBuffer aBuf; const ScConditionalFormat* pFormat = pDoc-GetCondFormat(1,1,0); -CPPUNIT_ASSERT(pFormat); -pFormat-dumpInfo(aBuf); -rtl::OUString aString = aBuf.makeStringAndClear(); rtl::OUString aFilePath = aBaseString + rtl::OUString(colorScale_1.txt); -std::string aStdString; -loadFile(aFilePath, aStdString); -rtl::OUString aRefString = rtl::OUString::createFromAscii(aStdString.c_str()); -CPPUNIT_ASSERT_EQUAL(aRefString, aString); +testColorScaleFormat_Impl(pDoc, aFilePath, pFormat); } // second cond format { -rtl::OUStringBuffer aBuf; const ScConditionalFormat* pFormat = pDoc-GetCondFormat(4,1,0); -CPPUNIT_ASSERT(pFormat); -pFormat-dumpInfo(aBuf); -rtl::OUString aString = aBuf.makeStringAndClear(); rtl::OUString aFilePath = aBaseString + rtl::OUString(colorScale_2.txt); -std::string aStdString; -loadFile(aFilePath, aStdString); -rtl::OUString aRefString = rtl::OUString::createFromAscii(aStdString.c_str()); -CPPUNIT_ASSERT_EQUAL(aRefString, aString); +testColorScaleFormat_Impl(pDoc, aFilePath, pFormat); } // third cond format { -rtl::OUStringBuffer aBuf; const ScConditionalFormat* pFormat = pDoc-GetCondFormat(7,1,0); -CPPUNIT_ASSERT(pFormat); -pFormat-dumpInfo(aBuf); -rtl::OUString aString = aBuf.makeStringAndClear(); rtl::OUString aFilePath = aBaseString + rtl::OUString(colorScale_3.txt); -std::string aStdString; -loadFile(aFilePath, aStdString); -rtl::OUString aRefString = rtl::OUString::createFromAscii(aStdString.c_str()); -CPPUNIT_ASSERT_EQUAL(aRefString, aString); +testColorScaleFormat_Impl(pDoc, aFilePath, pFormat);
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/rangelst_test.cxx |4 sc/source/core/tool/rangelst.cxx |4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) New commits: commit 16f1e6eddf457d03ece9f5e5967ad553730a44c0 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Sep 21 13:38:18 2012 +0200 add test case for deleting the only row in ScRangeList::UpdateReference Change-Id: I88cf1e679dc83e051e27a1d20775cc161cb9e3c5 diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx index b447dc1..7079166 100644 --- a/sc/qa/unit/rangelst_test.cxx +++ b/sc/qa/unit/rangelst_test.cxx @@ -184,6 +184,10 @@ void Test::testUpdateReference_DeleteRow() CPPUNIT_ASSERT(!aList.In(ScRange(nCol, 4, 0))); } CPPUNIT_ASSERT_EQUAL(static_castsize_t(12), aList.GetCellCount()); + +ScRangeList aList2(ScRange(2,2,0,2,2,0)); +aList2.UpdateReference(URM_INSDEL, m_pDoc, ScRange(0,3,0,MAXCOL,MAXROW,0), 0, -1, 0); +CPPUNIT_ASSERT(aList2.empty()); } void Test::testUpdateReference_DeleteCol() commit 1e3919f040ade5d0f7f9fa854b3ed23366080c0c Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Sep 21 13:37:31 2012 +0200 fix problem in ScRangeList::UpdateReference when deleting one row/col Change-Id: I588565f65be5c9de54b9f038cf297fda4022fd9b diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index 7a874e8..393d0f0 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -424,11 +424,11 @@ bool ScRangeList::UpdateReference( { if(nDx 0) { -DeleteArea(nCol1+nDx, nRow1, nTab1, nCol1-1, nRow1, nTab2); +DeleteArea(nCol1+nDx, nRow1, nTab1, nCol1-1, nRow2, nTab2); } if(nDy 0) { -DeleteArea(nCol1, nRow1+nDy, nTab1, nCol1, nRow1-1, nTab2); +DeleteArea(nCol1, nRow1+nDy, nTab1, nCol2, nRow1-1, nTab2); } SAL_WARN_IF(nDx 0 nDy 0, sc, nDx and nDy are negative, check why); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/rangelst_test.cxx | 87 +++ sc/source/core/tool/rangelst.cxx | 442 +++ 2 files changed, 404 insertions(+), 125 deletions(-) New commits: commit cb7ee824dc0b9dcc2fd466f190945de01a9d1fa5 Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Fri Sep 21 20:20:18 2012 -0400 Fixed all discovered errors and extra unit tests to cover them. Change-Id: I1f91d66caed7fd3839f68f1e4495f0c05ee49acc diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx index 7079166..f6e1d53 100644 --- a/sc/qa/unit/rangelst_test.cxx +++ b/sc/qa/unit/rangelst_test.cxx @@ -22,8 +22,12 @@ public: void testDeleteArea_4Ranges(); void testDeleteArea_3Ranges(); +void testDeleteArea_3Ranges_Case2(); +void testDeleteArea_3Ranges_Case3(); void testDeleteArea_2Ranges(); void testDeleteArea_2Ranges_Case2(); +void testDeleteArea_2Ranges_Case3(); +void testDeleteArea_2Ranges_Case4(); void testDeleteArea_1Range(); void testDeleteArea_0Ranges(); @@ -33,8 +37,12 @@ public: CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testDeleteArea_4Ranges); CPPUNIT_TEST(testDeleteArea_3Ranges); +CPPUNIT_TEST(testDeleteArea_3Ranges_Case2); +CPPUNIT_TEST(testDeleteArea_3Ranges_Case3); CPPUNIT_TEST(testDeleteArea_2Ranges); CPPUNIT_TEST(testDeleteArea_2Ranges_Case2); +CPPUNIT_TEST(testDeleteArea_2Ranges_Case3); +CPPUNIT_TEST(testDeleteArea_2Ranges_Case4); CPPUNIT_TEST(testDeleteArea_1Range); CPPUNIT_TEST(testDeleteArea_0Ranges); CPPUNIT_TEST(testUpdateReference_DeleteRow); @@ -105,6 +113,47 @@ void Test::testDeleteArea_3Ranges() CPPUNIT_ASSERT_EQUAL(static_castsize_t(28), aList.GetCellCount()); } +void Test::testDeleteArea_3Ranges_Case2() +{ +ScRangeList aList(ScRange(1,1,0,6,6,0)); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(1), aList.size()); +aList.DeleteArea(0,2,0,2,4,0); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(3), aList.size()); + +// Column 1-2 Row 2-4 should not be in the range list. The rest should +// be in the list. +for (SCCOL nCol = 1; nCol = 6; ++nCol) +{ +for (SCROW nRow = 1; nRow = 6; ++nRow) +{ +if ((1 = nCol nCol = 2) (2 = nRow nRow = 4)) +CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0))); +else +CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0))); +} +} +} + +void Test::testDeleteArea_3Ranges_Case3() +{ +ScRangeList aList(ScRange(1,5,0,6,11,0)); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(1), aList.size()); +aList.DeleteArea(3,2,0,4,8,0); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(3), aList.size()); + +// Column 3-4 Row 5-8 should not be in the range list. +for (SCCOL nCol = 1; nCol = 6; ++nCol) +{ +for (SCROW nRow = 5; nRow = 11; ++nRow) +{ +if ((3 = nCol nCol = 4) (5 = nRow nRow = 8)) +CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0))); +else +CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0))); +} +} +} + void Test::testDeleteArea_2Ranges() { ScRangeList aList(ScRange(0,0,0,5,5,5)); @@ -142,6 +191,44 @@ void Test::testDeleteArea_2Ranges_Case2() CPPUNIT_ASSERT_EQUAL(static_castsize_t(4), aList.GetCellCount()); } +void Test::testDeleteArea_2Ranges_Case3() +{ +ScRangeList aList(ScRange(0,5,0,2,10,0)); +aList.DeleteArea(2,3,0,3,7,0); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(2), aList.size()); + +// Column 2 Row 5-7 shouldn't be in the list. +for (SCCOL nCol = 0; nCol = 2; ++nCol) +{ +for (SCROW nRow = 5; nRow = 10; ++nRow) +{ +if (nCol == 2 (5 = nRow nRow = 7)) +CPPUNIT_ASSERT(!aList.In(ScRange(nCol,nRow,0))); +else +CPPUNIT_ASSERT(aList.In(ScRange(nCol,nRow,0))); +} +} +} + +void Test::testDeleteArea_2Ranges_Case4() +{ +ScRangeList aList(ScRange(2,3,0,4,7,0)); +aList.DeleteArea(0,1,0,2,5,0); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(2), aList.size()); + +// Column 2 Row 3-5 shouldn't be in the list. +for (SCCOL nCol = 2; nCol = 4; ++nCol) +{ +for (SCROW nRow = 3; nRow = 7; ++nRow) +{ +if (nCol == 2 (3 = nRow nRow = 5)) +CPPUNIT_ASSERT(!aList.In(ScRange(nCol,nRow,0))); +else +CPPUNIT_ASSERT(aList.In(ScRange(nCol,nRow,0))); +} +} +} + void Test::testDeleteArea_1Range() { ScRangeList aList(ScRange(1,1,0,3,3,0)); diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index b4b8732..96f7de5 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -517,6 +517,7 @@ bool handleOneRange( const ScRange rDeleteRange, ScRange* p ) // +--+ (xxx) = deleted region p-aStart.SetRow(nDeleteRow1+1); +return true; }
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/rangelst_test.cxx | 128 +++ sc/source/core/tool/rangelst.cxx | 12 +-- 2 files changed, 134 insertions(+), 6 deletions(-) New commits: commit fc0aa44b9d6aab7af68b00e4e26f3d9300e30fc2 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sat Sep 22 04:45:10 2012 +0200 test cases for the changes to ScRangeList::DeleteArea Change-Id: Iaf64a4cdceed76ba37e4486cfded18bd7e49b196 diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx index f6e1d53..2c618a5 100644 --- a/sc/qa/unit/rangelst_test.cxx +++ b/sc/qa/unit/rangelst_test.cxx @@ -24,10 +24,16 @@ public: void testDeleteArea_3Ranges(); void testDeleteArea_3Ranges_Case2(); void testDeleteArea_3Ranges_Case3(); +void testDeleteArea_3Ranges_Case4(); +void testDeleteArea_3Ranges_Case5(); void testDeleteArea_2Ranges(); void testDeleteArea_2Ranges_Case2(); void testDeleteArea_2Ranges_Case3(); void testDeleteArea_2Ranges_Case4(); +void testDeleteArea_2Ranges_Case5(); +void testDeleteArea_2Ranges_Case6(); +void testDeleteArea_2Ranges_Case7(); +void testDeleteArea_2Ranges_Case8(); void testDeleteArea_1Range(); void testDeleteArea_0Ranges(); @@ -39,10 +45,16 @@ public: CPPUNIT_TEST(testDeleteArea_3Ranges); CPPUNIT_TEST(testDeleteArea_3Ranges_Case2); CPPUNIT_TEST(testDeleteArea_3Ranges_Case3); +CPPUNIT_TEST(testDeleteArea_3Ranges_Case4); +CPPUNIT_TEST(testDeleteArea_3Ranges_Case5); CPPUNIT_TEST(testDeleteArea_2Ranges); CPPUNIT_TEST(testDeleteArea_2Ranges_Case2); CPPUNIT_TEST(testDeleteArea_2Ranges_Case3); CPPUNIT_TEST(testDeleteArea_2Ranges_Case4); +CPPUNIT_TEST(testDeleteArea_2Ranges_Case5); +CPPUNIT_TEST(testDeleteArea_2Ranges_Case6); +CPPUNIT_TEST(testDeleteArea_2Ranges_Case7); +CPPUNIT_TEST(testDeleteArea_2Ranges_Case8); CPPUNIT_TEST(testDeleteArea_1Range); CPPUNIT_TEST(testDeleteArea_0Ranges); CPPUNIT_TEST(testUpdateReference_DeleteRow); @@ -154,6 +166,46 @@ void Test::testDeleteArea_3Ranges_Case3() } } +void Test::testDeleteArea_3Ranges_Case4() +{ +ScRangeList aList(ScRange(1,5,0,6,11,0)); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(1), aList.size()); +aList.DeleteArea(3,5,0,4,5,0); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(3), aList.size()); + +// Column 3-4 Row 5 should not be in the range list. +for (SCCOL nCol = 1; nCol = 6; ++nCol) +{ +for (SCROW nRow = 5; nRow = 11; ++nRow) +{ +if ((3 = nCol nCol = 4) 5 == nRow ) +CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0))); +else +CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0))); +} +} +} + +void Test::testDeleteArea_3Ranges_Case5() +{ +ScRangeList aList(ScRange(1,5,0,6,11,0)); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(1), aList.size()); +aList.DeleteArea(6,7,0,6,9,0); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(3), aList.size()); + +// Column 6 Row 7-9 should not be in the range list. +for (SCCOL nCol = 1; nCol = 6; ++nCol) +{ +for (SCROW nRow = 5; nRow = 11; ++nRow) +{ +if ( nCol == 6 (7 = nRow nRow = 9)) +CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0))); +else +CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0))); +} +} +} + void Test::testDeleteArea_2Ranges() { ScRangeList aList(ScRange(0,0,0,5,5,5)); @@ -229,6 +281,82 @@ void Test::testDeleteArea_2Ranges_Case4() } } +void Test::testDeleteArea_2Ranges_Case5() +{ +ScRangeList aList(ScRange(2,2,0,5,5,0)); +aList.DeleteArea(4,5,0,5,5,0); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(2), aList.size()); + +// Column 4 and 5 Row 5 shouldn't be in the list. +for(SCCOL nCol = 2; nCol = 5; ++nCol) +{ +for(SCROW nRow = 2; nRow = 5; ++nRow) +{ +if(nRow == 5 4 = nCol) +CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0))); +else +CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0))); +} +} +} + +void Test::testDeleteArea_2Ranges_Case6() +{ +ScRangeList aList(ScRange(2,2,0,5,5,0)); +aList.DeleteArea(4,2,0,5,2,0); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(2), aList.size()); + +// Column 4 and 5 Row 2 shouldn't be in the list. +for(SCCOL nCol = 2; nCol = 5; ++nCol) +{ +for(SCROW nRow = 2; nRow = 5; ++nRow) +{ +if(nRow == 2 4 = nCol) +CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0))); +else +CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0))); +} +} +} + +void Test::testDeleteArea_2Ranges_Case7() +{ +ScRangeList aList(ScRange(2,2,0,5,5,0)); +aList.DeleteArea(2,5,0,2,5,0); +CPPUNIT_ASSERT_EQUAL(static_castsize_t(2), aList.size()); + +// Column 2 Row 5 shouldn't be in the list. +for(SCCOL nCol =
[Libreoffice-commits] .: 2 commits - sc/qa
sc/qa/unit/filters-test.cxx | 44 ++-- 1 file changed, 26 insertions(+), 18 deletions(-) New commits: commit 24761a6fd7ec028ad94f5b0c9993e0ac804bdee7 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Wed Sep 19 01:10:49 2012 +0200 use the defines instead of hard coded numbers Change-Id: Id410cd758f325b9c7011ae1b7b911914a5822e0d diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 2126a45..dc6df6d 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -373,7 +373,7 @@ void testContentImpl(ScDocument* pDoc, sal_Int32 nFormat ) //same code for ods, void ScFiltersTest::testContentODS() { const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM(universal-content.)); -ScDocShellRef xDocSh = loadDoc(aFileNameBase, 0); +ScDocShellRef xDocSh = loadDoc(aFileNameBase, ODS); xDocSh-DoHardRecalc(true); ScDocument* pDoc = xDocSh-GetDocument(); @@ -384,7 +384,7 @@ void ScFiltersTest::testContentODS() void ScFiltersTest::testContentXLS() { const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM(universal-content.)); -ScDocShellRef xDocSh = loadDoc(aFileNameBase, 1); +ScDocShellRef xDocSh = loadDoc(aFileNameBase, XLS); xDocSh-DoHardRecalc(true); ScDocument* pDoc = xDocSh-GetDocument(); @@ -395,7 +395,7 @@ void ScFiltersTest::testContentXLS() void ScFiltersTest::testContentXLSX() { const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM(universal-content.)); -ScDocShellRef xDocSh = loadDoc(aFileNameBase, 2); +ScDocShellRef xDocSh = loadDoc(aFileNameBase, XLSX); xDocSh-DoHardRecalc(true); ScDocument* pDoc = xDocSh-GetDocument(); @@ -406,7 +406,7 @@ void ScFiltersTest::testContentXLSX() void ScFiltersTest::testContentLotus123() { const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM(universal-content.)); -ScDocShellRef xDocSh = loadDoc(aFileNameBase, 3); +ScDocShellRef xDocSh = loadDoc(aFileNameBase, LOTUS123); xDocSh-DoHardRecalc(true); ScDocument* pDoc = xDocSh-GetDocument(); commit 1b6314f81cc4d6c29dd83b0009e3d3cd7b419c08 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Wed Sep 19 01:10:17 2012 +0200 enable the content test for lotus 123 files Change-Id: I8819b99b1eb1ea27d7e242d329f1e4fc878bdb2b diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 15d5f7b..2126a45 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -324,7 +324,7 @@ void ScFiltersTest::testRangeNameODS() namespace { -void testContentImpl(ScDocument* pDoc ) //same code for ods, xls, xlsx +void testContentImpl(ScDocument* pDoc, sal_Int32 nFormat ) //same code for ods, xls, xlsx { double fValue; //check value import @@ -334,10 +334,12 @@ void testContentImpl(ScDocument* pDoc ) //same code for ods, xls, xlsx CPPUNIT_ASSERT_MESSAGE(value not imported correctly, fValue == 2); rtl::OUString aString; pDoc-GetString(1,0,0,aString); + //check string import CPPUNIT_ASSERT_MESSAGE(string imported not correctly, aString == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(String1))); pDoc-GetString(1,1,0,aString); CPPUNIT_ASSERT_MESSAGE(string not imported correctly, aString == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(String2))); + //check basic formula import pDoc-GetValue(2,0,0,fValue); CPPUNIT_ASSERT_MESSAGE(=2*3, fValue == 6); @@ -347,16 +349,22 @@ void testContentImpl(ScDocument* pDoc ) //same code for ods, xls, xlsx CPPUNIT_ASSERT_MESSAGE(=2-3, fValue == -1); pDoc-GetValue(2,3,0,fValue); CPPUNIT_ASSERT_MESSAGE(=C1+C2, fValue == 11); + //check merged cells import -SCCOL nCol = 4; -SCROW nRow = 1; -pDoc-ExtendMerge(4, 1, nCol, nRow, 0, false); -CPPUNIT_ASSERT_MESSAGE(merged cells are not imported, nCol == 5 nRow == 2); -//check notes import -ScAddress aAddress(7, 2, 0); -ScPostIt* pNote = pDoc-GetNotes(aAddress.Tab())-findByAddress(aAddress); -CPPUNIT_ASSERT_MESSAGE(note not imported, pNote); -CPPUNIT_ASSERT_MESSAGE(note text not imported correctly, pNote-GetText() == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(Test))); +if(nFormat != LOTUS123) +{ +SCCOL nCol = 4; +SCROW nRow = 1; +pDoc-ExtendMerge(4, 1, nCol, nRow, 0, false); +CPPUNIT_ASSERT_MESSAGE(merged cells are not imported, nCol == 5 nRow == 2); + +//check notes import +ScAddress aAddress(7, 2, 0); +ScPostIt* pNote = pDoc-GetNotes(aAddress.Tab())-findByAddress(aAddress); +CPPUNIT_ASSERT_MESSAGE(note not imported, pNote); +CPPUNIT_ASSERT_EQUAL_MESSAGE(note text not imported correctly, pNote-GetText(), rtl::OUString(Test)); +} + //add additional checks here } @@ -369,7 +377,7 @@ void ScFiltersTest::testContentODS() xDocSh-DoHardRecalc(true); ScDocument*
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/rangelst_test.cxx | 33 + sc/source/core/tool/rangelst.cxx | 17 + 2 files changed, 50 insertions(+) New commits: commit 764e7e71038d5ae66061f44bc0cd51ce33ae96ed Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Mon Sep 17 17:58:27 2012 +0200 hopefully a corect way to deal with deleting rows and cols, fdo#54842 Change-Id: I4ec1a8225ae3c84352643876065fb4cc7073b9f4 diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index e81ec82..c6b3bfc 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -417,6 +417,23 @@ bool ScRangeList::UpdateReference( SCTAB nTab2; rWhere.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ); +if(eUpdateRefMode == URM_INSDEL) +{ +// right now this only works for nTab1 == nTab2 +if(nTab1 == nTab2) +{ +if(nDx 0) +{ +DeleteArea(nCol1+nDx, nRow1, nTab1, nCol1-1, nRow1, nTab2); +} +if(nDy 0) +{ +DeleteArea(nCol1, nRow1+nDy, nTab1, nCol1, nRow1-1, nTab2); +} +SAL_WARN_IF(nDx 0 nDy 0, sc, nDx and nDy are negative, check why); +} +} + vectorScRange*::iterator itr = maRanges.begin(), itrEnd = maRanges.end(); for (; itr != itrEnd; ++itr) { commit f165111cf4f62353a674bd3497d8cf4a0480a3ab Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Mon Sep 17 16:07:19 2012 +0200 one more test for ScRangeList::DeleteArea Change-Id: I42d31f6653990a81eff815d3d0feffad84b1379e diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx index 2901965..41d4590 100644 --- a/sc/qa/unit/rangelst_test.cxx +++ b/sc/qa/unit/rangelst_test.cxx @@ -22,11 +22,16 @@ public: void testDeleteArea_4Ranges(); void testDeleteArea_2Ranges(); +void testDeleteArea_2Ranges_Case2(); void testDeleteArea_0Ranges(); +void testUpdateReference_DeleteRow(); +void testUpdateReference_DeleteCol(); + CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testDeleteArea_4Ranges); CPPUNIT_TEST(testDeleteArea_2Ranges); +CPPUNIT_TEST(testDeleteArea_2Ranges_Case2); CPPUNIT_TEST(testDeleteArea_0Ranges); CPPUNIT_TEST_SUITE_END(); @@ -96,6 +101,21 @@ void Test::testDeleteArea_2Ranges() } } +void Test::testDeleteArea_2Ranges_Case2() +{ +ScRangeList aList(ScRange(1,1,0,1,5,0)); +aList.DeleteArea(0,3,0,MAXCOL,3,0); + +for(SCROW nRow = 1; nRow = 5; ++nRow) +{ +if(nRow == 3) +CPPUNIT_ASSERT(!aList.Intersects(ScRange(1,3,0))); +else +CPPUNIT_ASSERT(aList.Intersects(ScRange(1,nRow,0))); +} +CPPUNIT_ASSERT_EQUAL(static_castsize_t(4), aList.GetCellCount()); +} + void Test::testDeleteArea_0Ranges() { ScRangeList aList(ScRange(1,1,0,3,3,0)); @@ -109,6 +129,19 @@ void Test::testDeleteArea_0Ranges() CPPUNIT_ASSERT(aList.empty()); } +void Test::testUpdateReference_DeleteRow() +{ +ScRangeList aList(ScRange(1,1,0,4,4,0)); +bool bUpdated = aList.UpdateReference(URM_INSDEL, m_pDoc, ScRange(0,3,0,MAXCOL,MAXROW,0), 0, -1, 0); +CPPUNIT_ASSERT(bUpdated); + +} + +void Test::testUpdateReference_DeleteCol() +{ + +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/data/ods/cell-anchored-shapes.ods |binary sc/qa/unit/subsequent_filters-test.cxx | 41 +++ sc/source/filter/xml/xmlimprt.cxx|3 + 3 files changed, 44 insertions(+) New commits: commit a7a12bd3dee32db44a6b50a68ab700dc8ce437df Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Tue Aug 14 17:16:18 2012 -0400 New unit test for importing cell-anchored shapes from ods. Change-Id: I3cedafaf1862c69a40a7973ed056bf595f9e7d20 diff --git a/sc/qa/unit/data/ods/cell-anchored-shapes.ods b/sc/qa/unit/data/ods/cell-anchored-shapes.ods new file mode 100644 index 000..5a006f6 Binary files /dev/null and b/sc/qa/unit/data/ods/cell-anchored-shapes.ods differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 8d6a804..95009ac 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -38,6 +38,7 @@ #include sfx2/docfile.hxx #include sfx2/sfxmodelfactory.hxx #include svl/stritem.hxx +#include svx/svdpage.hxx #include editeng/brshitem.hxx #include editeng/justifyitem.hxx @@ -45,6 +46,8 @@ #include dbdata.hxx #include validat.hxx #include cell.hxx +#include drwlayer.hxx +#include userdat.hxx #include com/sun/star/drawing/XDrawPageSupplier.hpp #include com/sun/star/drawing/XControlShape.hpp @@ -151,6 +154,8 @@ public: void testNumberFormatHTML(); void testNumberFormatCSV(); +void testCellAnchoredShapesODS(); + CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST(testRangeNameXLS); CPPUNIT_TEST(testRangeNameXLSX); @@ -187,6 +192,8 @@ public: CPPUNIT_TEST(testNumberFormatHTML); CPPUNIT_TEST(testNumberFormatCSV); +CPPUNIT_TEST(testCellAnchoredShapesODS); + //disable testPassword on MacOSX due to problems with libsqlite3 //also crashes on DragonFly due to problems with nss/nspr headers #if !defined(MACOSX) !defined(DRAGONFLY) !defined(WNT) @@ -1243,6 +1250,40 @@ void ScFiltersTest::testNumberFormatCSV() xDocSh-DoClose(); } +void ScFiltersTest::testCellAnchoredShapesODS() +{ +OUString aFileNameBase(cell-anchored-shapes.); +OUString aFileExt = OUString::createFromAscii(aFileFormats[ODS].pName); +OUString aFilterName = OUString::createFromAscii(aFileFormats[ODS].pFilterName); +OUString aFilterType = OUString::createFromAscii(aFileFormats[ODS].pTypeName); + +rtl::OUString aFileName; +createFileURL(aFileNameBase, aFileExt, aFileName); +ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[ODS].nFormatType); +CPPUNIT_ASSERT_MESSAGE(Failed to load cell-anchored-shapes.ods, xDocSh.Is()); + +// There are two cell-anchored objects on the first sheet. +ScDocument* pDoc = xDocSh-GetDocument(); + +CPPUNIT_ASSERT_MESSAGE(There should be at least one sheet., pDoc-GetTableCount() 0); + +ScDrawLayer* pDrawLayer = pDoc-GetDrawLayer(); +SdrPage* pPage = pDrawLayer-GetPage(0); +CPPUNIT_ASSERT_MESSAGE(draw page for sheet 1 should exist., pPage); +sal_uIntPtr nCount = pPage-GetObjCount(); +CPPUNIT_ASSERT_MESSAGE(There should be 2 objects., nCount == 2); +for (sal_uIntPtr i = 0; i nCount; ++i) +{ +SdrObject* pObj = pPage-GetObj(i); +CPPUNIT_ASSERT_MESSAGE(Failed to get drawing object., pObj); +ScDrawObjData* pData = ScDrawLayer::GetObjData(pObj, false); +CPPUNIT_ASSERT_MESSAGE(Failed to retrieve user data for this object., pData); +CPPUNIT_ASSERT_MESSAGE(Bounding rectangle should have been calculated upon import., !pData-maLastRect.IsEmpty()); +} + +xDocSh-DoClose(); +} + void ScFiltersTest::testColorScale() { const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM(colorScale.)); commit 4606ca07de17c930b658206a19446516cf0d4eb7 Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Tue Aug 14 16:46:44 2012 -0400 Calculate positions of cell-anchored objects upon ods import. Since we no longer re-calc row heights on ods import, we need to do this manually, in order to position cell-anchored objects correctly. Previously we were getting this for free since the row height recalc code path did it as part of it. Change-Id: I8ab5dd1fe7cd8a45b7968e101c893b442d7ce132 diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index dcf37b4..4f2ff59 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -3101,8 +3101,11 @@ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeE SCTAB nTabCount = pDoc-GetTableCount(); for (SCTAB nTab=0; nTabnTabCount; ++nTab) +{ +pDoc-SetDrawPageSize(nTab); if (!pSheetData-IsSheetBlocked( nTab )) pDoc-SetStreamValid( nTab, true ); +} } aTables.FixupOLEs(); }
[Libreoffice-commits] .: 2 commits - sc/qa
sc/qa/unit/ucalc.cxx | 142 +++ 1 file changed, 142 insertions(+) New commits: commit d039b0070d62a54740b3f88d52debe3d5f4d664c Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Jul 20 23:46:00 2012 +0200 second test for ScDocument::FindAreaPos Change-Id: I215a33d6a1e38ad3edcb92e160e90f7d04db08f1 diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 6a479f0..8753a40 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -216,6 +216,7 @@ public: void testCopyPasteFormulasExternalDoc(); void testFindAreaPosRowDown(); +void testFindAreaPosColRight(); CPPUNIT_TEST_SUITE(Test); #if 0 @@ -262,6 +263,7 @@ public: CPPUNIT_TEST(testCopyPasteFormulasExternalDoc); #endif CPPUNIT_TEST(testFindAreaPosRowDown); +CPPUNIT_TEST(testFindAreaPosColRight); CPPUNIT_TEST_SUITE_END(); private: @@ -4593,7 +4595,7 @@ void Test::testCopyPasteFormulasExternalDoc() void Test::testFindAreaPosRowDown() { const char* aData[][2] = { -{ , }, +{ , 1 }, { 1, }, { 1, 1 }, { , 1 }, @@ -4660,6 +4662,71 @@ void Test::testFindAreaPosRowDown() pDoc-DeleteTab(0); } +void Test::testFindAreaPosColRight() +{ +const char* aData[][7] = { +{ , 1, 1, , 1, 1, 1 }, +{ , , 1, 1, 1, , 1 }, }; + +ScDocument* pDoc = m_xDocShRef-GetDocument(); +rtl::OUString aTabName1(test1); +pDoc-InsertTab(0, aTabName1); +clearRange( pDoc, ScRange(0, 0, 0, 7, SAL_N_ELEMENTS(aData), 0)); +ScAddress aPos(0,0,0); +ScRange aDataRange = insertRangeData( pDoc, aPos, aData, SAL_N_ELEMENTS(aData)); +CPPUNIT_ASSERT_MESSAGE(failed to insert range data at correct position, aDataRange.aStart == aPos); + +pDoc-SetColHidden(4,4,0,true); +bool bHidden = pDoc-ColHidden(4,0); +CPPUNIT_ASSERT(bHidden); + +SCCOL nCol = 0; +SCROW nRow = 0; +pDoc-FindAreaPos(nCol, nRow, 0, 1, 0); + +CPPUNIT_ASSERT_EQUAL(static_castSCROW(0), nRow); +CPPUNIT_ASSERT_EQUAL(static_castSCCOL(1), nCol); + +pDoc-FindAreaPos(nCol, nRow, 0, 1, 0); + +CPPUNIT_ASSERT_EQUAL(static_castSCROW(0), nRow); +CPPUNIT_ASSERT_EQUAL(static_castSCCOL(2), nCol); + +pDoc-FindAreaPos(nCol, nRow, 0, 1, 0); + +CPPUNIT_ASSERT_EQUAL(static_castSCROW(0), nRow); +// BUG! This returns right now 4 because FindAreaPos does +// not yet work correctly with hidden rows +//CPPUNIT_ASSERT_EQUAL(static_castSCCOL(5), nCol); + +pDoc-FindAreaPos(nCol, nRow, 0, 1, 0); + +CPPUNIT_ASSERT_EQUAL(static_castSCROW(0), nRow); +CPPUNIT_ASSERT_EQUAL(static_castSCCOL(6), nCol); + +pDoc-FindAreaPos(nCol, nRow, 0, 1, 0); + +CPPUNIT_ASSERT_EQUAL(static_castSCROW(0), nRow); +CPPUNIT_ASSERT_EQUAL(static_castSCCOL(MAXCOL), nCol); + +nCol = 2; +nRow = 1; + +pDoc-FindAreaPos(nCol, nRow, 0, 1, 0); + +CPPUNIT_ASSERT_EQUAL(static_castSCROW(1), nRow); +// BUG! This returns right now 4 because FindAreaPos does +// not yet work correctly with hidden rows +//CPPUNIT_ASSERT_EQUAL(static_castSCCOL(3), nCol); + +pDoc-FindAreaPos(nCol, nRow, 0, 1, 0); + +CPPUNIT_ASSERT_EQUAL(static_castSCROW(1), nRow); +CPPUNIT_ASSERT_EQUAL(static_castSCCOL(6), nCol); + +pDoc-DeleteTab(0); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } commit 40cfaaa73887045230f9508e8330ce267390fe6b Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Jul 20 22:59:10 2012 +0200 first test for ScDocument::FindAreaPos This is the first step into fixing the cursor navigation. ScDocument::FindAreaPos contains still bugs in the handling of hidden rows and hidden columns. This test checks only problems with rows and moving downwards. Change-Id: I204064a96a1abdb8ab5f46e395f8f7c391fb4824 diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 79cda88..6a479f0 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -215,7 +215,10 @@ public: void testCopyPasteFormulas(); void testCopyPasteFormulasExternalDoc(); +void testFindAreaPosRowDown(); + CPPUNIT_TEST_SUITE(Test); +#if 0 CPPUNIT_TEST(testCollator); CPPUNIT_TEST(testInput); CPPUNIT_TEST(testCellFunctions); @@ -257,6 +260,8 @@ public: CPPUNIT_TEST(testAutoFill); CPPUNIT_TEST(testCopyPasteFormulas); CPPUNIT_TEST(testCopyPasteFormulasExternalDoc); +#endif +CPPUNIT_TEST(testFindAreaPosRowDown); CPPUNIT_TEST_SUITE_END(); private: @@ -4585,6 +4590,76 @@ void Test::testCopyPasteFormulasExternalDoc() CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString(=$ExtSheet2.$B$2)); } +void Test::testFindAreaPosRowDown() +{ +const char* aData[][2] = { +{ , }, +{ 1, }, +{ 1, 1 }, +{ , 1 }, +{ 1, 1 }, +{ 1, }, +{ 1, 1 }, }; + +ScDocument* pDoc = m_xDocShRef-GetDocument(); +rtl::OUString aTabName1(test1); +
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/data/contentCSV/matrix2.csv |1 + sc/qa/unit/data/ods/matrix.ods |binary sc/qa/unit/subsequent_filters-test.cxx | 11 ++- sc/source/filter/xml/xmlcelli.cxx | 24 +++- 4 files changed, 30 insertions(+), 6 deletions(-) New commits: commit 61c39eae570d6d6040b65bfe93127b30e6080cc8 Author: Daniel Bankston daniel.e.banks...@gmail.com Date: Thu Jul 19 17:26:35 2012 -0500 Display blank cell instead of zero in matrix cells with blank text result Change-Id: Id9d17403717e42b91b1f45b0a081e2fb5a27c06e diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index ede4131..26d01aa 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -189,7 +189,8 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport rImport, bIsEmpty = false; //if office:value=0, treat like text in case the formula -//result is Err:### or #N/A until we confirm otherwise +//result is Err:###, #N/A, or matrix reference cell with +//blank text result until we confirm otherwise. if(fValue == 0.0) bFormulaTextResult = true; } @@ -1109,9 +1110,21 @@ void ScXMLTableRowCellContext::AddFormulaCell( const ScAddress rCellPos ) namespace{ -bool isErrOrNA(const rtl::OUString rStr) +bool isSpecialValue(const rtl::OUString rStr, sal_Int16 rnCellType) { -return (rStr.indexOf(Err:) -1) || (rStr.indexOf(#N/A) -1); +if( (rStr.indexOf(Err:) -1) || (rStr.indexOf(#N/A) -1) ) +return true; +//If a matrix formula has a matrix reference cell that is intended to have +//a blank text result, the matrix reference cell is actually saved(export) +//as a float cell with 0 as the value and empty text:p/. +//Import works around this by setting these cells as text cells so that +//the blank text is used for display instead of the number 0. +if( rStr.isEmpty() ) +{ +rnCellType = util::NumberFormat::TEXT; +return true; +} +return false; } } @@ -1132,8 +1145,9 @@ void ScXMLTableRowCellContext::EndElement() } } -//if this is an Err:### or #N/A then use text:p value -if( bFormulaTextResult pOUTextContent isErrOrNA(*pOUTextContent) ) +//if this is a blank matrix formula result, Err:###, or #N/A then +//use text:p string because of the way export saves these types of cells. +if( bFormulaTextResult pOUTextContent isSpecialValue(*pOUTextContent, nCellType) ) pOUTextValue.reset(*pOUTextContent); ScAddress aCellPos = rXMLImport.GetTables().GetCurrentCellPos(); commit abdffd2e442356782ee6bd947936afc7fb9e4287 Author: Daniel Bankston daniel.e.banks...@gmail.com Date: Thu Jul 19 17:23:06 2012 -0500 Add test case for matrix reference cells with blank text result Change-Id: If00d424ebe0d82284c3281c3362f2a9e52ee384e diff --git a/sc/qa/unit/data/contentCSV/matrix2.csv b/sc/qa/unit/data/contentCSV/matrix2.csv index 955d345..2effd61 100644 --- a/sc/qa/unit/data/contentCSV/matrix2.csv +++ b/sc/qa/unit/data/contentCSV/matrix2.csv @@ -3,3 +3,4 @@ Err:502,Err:502,Err:502,,error result #N/A,#N/A,#N/A,,n/a TRUE,TRUE,TRUE,,Display TRUE instead of 1 FALSE,FALSE,FALSE,,Display FALSE instead of 0 +42,,42,,Display blank cell instead of 0 diff --git a/sc/qa/unit/data/ods/matrix.ods b/sc/qa/unit/data/ods/matrix.ods index 2a8c4ab..7d26c2f 100644 Binary files a/sc/qa/unit/data/ods/matrix.ods and b/sc/qa/unit/data/ods/matrix.ods differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 9a3c5dd..6688e0f 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -44,6 +44,7 @@ #include editeng/borderline.hxx #include dbdata.hxx #include validat.hxx +#include cell.hxx #include com/sun/star/drawing/XDrawPageSupplier.hpp #include com/sun/star/drawing/XControlShape.hpp @@ -423,9 +424,17 @@ void ScFiltersTest::testCachedMatrixFormulaResultsODS() rtl::OUString aCSVFileName; createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(matrix.)), aCSVFileName); testFile(aCSVFileName, pDoc, 0); -//test matrix with errors +//test matrices with special cases createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(matrix2.)), aCSVFileName); testFile(aCSVFileName, pDoc, 1); +//The above testFile() does not catch the below case. +//If a matrix formula has a matrix reference cell that is intended to have +//a blank text result, the matrix reference cell is actually saved(export) +//as a float cell with 0 as the value and an empty text:p/. +//Import works around this by setting these cells as text cells so that +//the blank text is used for display instead of the number 0. +//If this is working properly,
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/ucalc.cxx | 15 +++ sc/source/core/tool/interpr4.cxx | 15 +++ 2 files changed, 30 insertions(+) New commits: commit 123fa79cb24dced9adea7ef4d007a4516c1555d4 Author: Eike Rathke er...@redhat.com Date: Wed Jul 18 17:24:08 2012 +0200 unit test fdo#50345 accept empty string as scalar numeric 0 argument Change-Id: Ie04cb8d32e9328212d41fedb63cf81b235aa69de diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index b816f5c..7ea887c 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -1042,6 +1042,21 @@ void Test::testFuncParam() m_pDoc-GetValue(0, 0, 0, val); CPPUNIT_ASSERT_MESSAGE(incorrect result, val == 0.25); +// Conversion of string to numeric argument. +m_pDoc-SetString(0, 0, 0, OUString(=\\+3));// empty string +m_pDoc-SetString(0, 1, 0, OUString(=\ \+3)); // only blank +m_pDoc-SetString(0, 2, 0, OUString(=\ 4 \+3)); // number in blanks +m_pDoc-SetString(0, 3, 0, OUString(=\ x \+3)); // non-numeric = #VALUE! error +m_pDoc-CalcFormulaTree(false, true); +m_pDoc-GetValue(0, 0, 0, val); +CPPUNIT_ASSERT_MESSAGE(incorrect result, val == 3); +m_pDoc-GetValue(0, 1, 0, val); +CPPUNIT_ASSERT_MESSAGE(incorrect result, val == 3); +m_pDoc-GetValue(0, 2, 0, val); +CPPUNIT_ASSERT_MESSAGE(incorrect result, val == 7); +rtl::OUString aVal = m_pDoc-GetString( 0, 3, 0); +CPPUNIT_ASSERT_MESSAGE(incorrect result, aVal == #VALUE!); + m_pDoc-DeleteTab(0); } commit a439cb5aba49d01df20f67a2c84b68542e4d3d5a Author: Eike Rathke er...@redhat.com Date: Wed Jul 18 17:04:33 2012 +0200 resolved fdo#50345 accept empty string as scalar numeric 0 argument For OOo/AOOi interoperability convert an empty string or string containing only spaces to numeric 0 for scalar numeric arguments. Change-Id: I551d10b647c961df08ca8c936ca8fed5de14d99f diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index bca2977..566d0b3 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -243,6 +243,21 @@ double ScInterpreter::ConvertStringToValue( const String rStr ) SetError( mnStringNoValueError); return fValue; } +// The number scanner does not accept empty strings or strings containing +// only spaces, be on par in these cases with what was accepted in OOo and +// is in AOO (see also the #else branch below) and convert to 0 to prevent +// interoperability nightmares. +if (!rStr.Len()) +return fValue; +else if (rStr.GetChar(0) == ' ') +{ +const sal_Unicode* p = rStr.GetBuffer() + 1; +const sal_Unicode* const pStop = p - 1 + rStr.Len(); +while (p pStop *p == ' ') +++p; +if (p == pStop) +return fValue; +} sal_uInt32 nFIndex = 0; if (!pFormatter-IsNumberFormat(rStr, nFIndex, fValue)) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/data/ods/formats.ods|binary sc/qa/unit/subsequent_filters-test.cxx | 14 +- sc/source/filter/xml/xmlcoli.cxx | 10 +- sc/source/filter/xml/xmlsubti.cxx |8 sc/source/filter/xml/xmlsubti.hxx |4 ++-- 5 files changed, 20 insertions(+), 16 deletions(-) New commits: commit 68eb65f19d4f3fb564ac993e8b2f37fb33d685c3 Author: Daniel Bankston daniel.e.banks...@gmail.com Date: Thu Jul 12 22:37:39 2012 -0500 Fix broken ODS column width import fdo#51446 Change-Id: I43b6558de6e92b0fe40a38b5f2417bebad2b7f8b diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx index 624fa1d..81d0b6a 100644 --- a/sc/source/filter/xml/xmlcoli.cxx +++ b/sc/source/filter/xml/xmlcoli.cxx @@ -118,7 +118,7 @@ void ScXMLTableColContext::EndElement() { ScXMLImport rXMLImport = GetScImport(); SCTAB nSheet = rXMLImport.GetTables().GetCurrentSheet(); -sal_Int32 nCurrentColumn = rXMLImport.GetTables().GetCurrentColumn(); +sal_Int32 nCurrentColumn = rXMLImport.GetTables().GetCurrentColCount(); uno::Referencesheet::XSpreadsheet xSheet(rXMLImport.GetTables().GetCurrentXSheet()); if(xSheet.is()) { @@ -187,10 +187,10 @@ ScXMLTableColsContext::ScXMLTableColsContext( ScXMLImport rImport, { // don't have any attributes if (bHeader) -nHeaderStartCol = rImport.GetTables().GetCurrentColumn(); +nHeaderStartCol = rImport.GetTables().GetCurrentColCount(); else if (bGroup) { -nGroupStartCol = rImport.GetTables().GetCurrentColumn(); +nGroupStartCol = rImport.GetTables().GetCurrentColCount(); sal_Int16 nAttrCount = xAttrList.is() ? xAttrList-getLength() : 0; for( sal_Int16 i=0; i nAttrCount; ++i ) { @@ -257,7 +257,7 @@ void ScXMLTableColsContext::EndElement() ScXMLImport rXMLImport = GetScImport(); if (bHeader) { -nHeaderEndCol = rXMLImport.GetTables().GetCurrentColumn(); +nHeaderEndCol = rXMLImport.GetTables().GetCurrentColCount(); nHeaderEndCol--; if (nHeaderStartCol = nHeaderEndCol) { @@ -284,7 +284,7 @@ void ScXMLTableColsContext::EndElement() else if (bGroup) { SCTAB nSheet = rXMLImport.GetTables().GetCurrentSheet(); -nGroupEndCol = rXMLImport.GetTables().GetCurrentColumn(); +nGroupEndCol = rXMLImport.GetTables().GetCurrentColCount(); nGroupEndCol--; if (nGroupStartCol = nGroupEndCol) { diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index c5a5eeb..87cd34e 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -75,7 +75,7 @@ ScMyTables::ScMyTables(ScXMLImport rTempImport) : rImport(rTempImport), aFixupOLEs(rTempImport), maCurrentCellPos(ScAddress::INITIALIZE_INVALID), -nCurrentColStylePos(0), +nCurrentColCount(0), nCurrentDrawPage( -1 ), nCurrentXShapes( -1 ) { @@ -113,7 +113,7 @@ void ScMyTables::NewSheet(const rtl::OUString sTableName, const rtl::OUString { if (rImport.GetModel().is()) { -nCurrentColStylePos = 0; +nCurrentColCount = 0; sCurrentSheetName = sTableName; //reset cols and rows for new sheet, but increment tab maCurrentCellPos.SetCol(-1); @@ -227,8 +227,8 @@ void ScMyTables::DeleteTable() void ScMyTables::AddColStyle(const sal_Int32 nRepeat, const rtl::OUString rCellStyleName) { -rImport.GetStylesImportHelper()-AddColumnStyle(rCellStyleName, nCurrentColStylePos, nRepeat); -nCurrentColStylePos += nRepeat; +rImport.GetStylesImportHelper()-AddColumnStyle(rCellStyleName, nCurrentColCount, nRepeat); +nCurrentColCount += nRepeat; } uno::Reference drawing::XDrawPage ScMyTables::GetCurrentXDrawPage() diff --git a/sc/source/filter/xml/xmlsubti.hxx b/sc/source/filter/xml/xmlsubti.hxx index e080cfd..b57f682 100644 --- a/sc/source/filter/xml/xmlsubti.hxx +++ b/sc/source/filter/xml/xmlsubti.hxx @@ -71,7 +71,7 @@ private: ScAddress maCurrentCellPos; ScRangeList maMatrixRangeList; ScXMLTabProtectionData maProtectionData; -sal_Int32 nCurrentColStylePos; +sal_Int32 nCurrentColCount; sal_Int16 nCurrentDrawPage; sal_Int16 nCurrentXShapes; @@ -96,7 +96,7 @@ public: ScXMLTabProtectionData GetCurrentProtectionData() { return maProtectionData; } rtl::OUString GetCurrentSheetName() const { return sCurrentSheetName; } SCTAB GetCurrentSheet() const { return (maCurrentCellPos.Tab() = 0) ? maCurrentCellPos.Tab() : 0; } -SCCOL GetCurrentColumn() const { return (maCurrentCellPos.Col() = 0) ? maCurrentCellPos.Col() : 0; } +
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/data/xlsx/singlecontrol.xlsx |binary sc/qa/unit/subsequent_filters-test.cxx | 33 sc/source/ui/view/gridwin.cxx |9 ++-- 3 files changed, 40 insertions(+), 2 deletions(-) New commits: commit c433fa0639ccf5caeb0c128c8a3794322e2a1c81 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Jul 6 02:04:44 2012 +0200 adjust the calculation of the cursor pos if ALT is used, fdo#48869 Change-Id: I6316717c860d999270aa7f0fb50af5f6dfc7efd7 diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 6187397..c98b89e 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -4113,6 +4113,9 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos String aUndo = ScGlobal::GetRscString( bIsMove ? STR_UNDO_MOVE : STR_UNDO_COPY ); pDocSh-GetUndoManager()-EnterListAction( aUndo, aUndo ); +SCsCOL nCorrectCursorPosCol = 0; +SCsROW nCorrectCursorPosRow = 0; + bDone = sal_True; if ( meDragInsertMode != INS_NONE ) { @@ -4126,11 +4129,13 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos nDestPosX == aSource.aStart.Col() nDestPosY aSource.aStart.Row() ) { bDone = aSource.Move( 0, nSizeY, 0, pSourceDoc ); +nCorrectCursorPosRow = nSizeY; } else if ( meDragInsertMode == INS_CELLSRIGHT nDestPosY == aSource.aStart.Row() nDestPosX aSource.aStart.Col() ) { bDone = aSource.Move( nSizeX, 0, 0, pSourceDoc ); +nCorrectCursorPosCol = nSizeX; } } pDocSh-UpdateOle( pViewData ); @@ -4189,8 +4194,8 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos { pView-MarkRange( aDest, false, false ); -SCCOL nDCol = pViewData-GetCurX() - aSource.aStart.Col(); -SCROW nDRow = pViewData-GetCurY() - aSource.aStart.Row(); +SCCOL nDCol = pViewData-GetCurX() - aSource.aStart.Col() + nCorrectCursorPosCol; +SCROW nDRow = pViewData-GetCurY() - aSource.aStart.Row() + nCorrectCursorPosRow; pView-SetCursor( aDest.aStart.Col() + nDCol, aDest.aStart.Row() + nDRow ); } commit dd209b77391903cb6f9f04c44e10a05f31076f4a Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Jul 6 02:04:21 2012 +0200 add a import test for control shapes Change-Id: I2ac5e1bdd1c681c8ba58edded3ab1b57ac30c512 diff --git a/sc/qa/unit/data/xlsx/singlecontrol.xlsx b/sc/qa/unit/data/xlsx/singlecontrol.xlsx new file mode 100644 index 000..513c05b Binary files /dev/null and b/sc/qa/unit/data/xlsx/singlecontrol.xlsx differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 62a9970..2fab37a 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -45,6 +45,12 @@ #include dbdata.hxx #include validat.hxx +#include com/sun/star/drawing/XDrawPageSupplier.hpp +#include com/sun/star/drawing/XControlShape.hpp +#include com/sun/star/sheet/XSpreadsheetDocument.hpp +#include com/sun/star/container/XIndexAccess.hpp +#include com/sun/star/frame/XModel.hpp + #define CALC_DEBUG_OUTPUT 0 #define TEST_BUG_FILES 0 @@ -127,6 +133,8 @@ public: void testPasswordNew(); void testPasswordOld(); +//test shape import +void testControlImport(); CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST(testRangeNameXLS); @@ -154,6 +162,7 @@ public: #endif CPPUNIT_TEST(testSharedFormulaXLSX); CPPUNIT_TEST(testCellValueXLSX); +CPPUNIT_TEST(testControlImport); //disable testPassword on MacOSX due to problems with libsqlite3 //also crashes on DragonFly due to problems with nss/nspr headers @@ -1060,6 +1069,30 @@ void ScFiltersTest::testPasswordOld() testPassword_Impl(aFileNameBase); } +void ScFiltersTest::testControlImport() +{ +const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM(singlecontrol.)); +rtl::OUString aFileExtension(aFileFormats[XLSX].pName, strlen(aFileFormats[XLSX].pName), RTL_TEXTENCODING_UTF8 ); +rtl::OUString aFilterName(aFileFormats[XLSX].pFilterName, strlen(aFileFormats[XLSX].pFilterName), RTL_TEXTENCODING_UTF8) ; +rtl::OUString aFileName; +createFileURL(aFileNameBase, aFileExtension, aFileName); +rtl::OUString aFilterType(aFileFormats[XLSX].pTypeName,
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/ucalc.cxx | 32 +++ sc/source/core/tool/interpr1.cxx | 45 ++- sc/source/core/tool/interpr4.cxx |8 ++ sc/source/core/tool/parclass.cxx | 11 ++--- 4 files changed, 48 insertions(+), 48 deletions(-) New commits: commit d822c6afe6c1a676e9b86d67e599dbcf75512a7c Author: Eike Rathke er...@redhat.com Date: Tue Jun 26 20:51:22 2012 +0200 resolved fdo#51442 N() inconsistent argument handling 5743e7b36220e9689091812cef7a4396dd48c4e6 introduced a different handling of arguments in the N() spreadsheet function. That lost the ability to use position dependent range intersections and suppressed every error instead of propagating it. Previous versions suppressed only the #N/A error. Excel propagates all errors instead. Note that Excel for N() does not use position dependent range intersection (SingleRef of DoubleRef) when a range reference is passed and does not handle evaluation in array context (instead top left value is always used), which both is inconsistent with other functions taking a scalar value parameter. ODFF does not specify this function different. This change re-enables range intersection and adds array evaluation. Gnumeric does the same. Change-Id: Ice35271e40f1a27cea384226e25945108003841a diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 1db6294..a86a3a0 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -433,25 +433,37 @@ void testFuncN(ScDocument* pDoc) pDoc-SetString(1, 13, 0, OUString(=N(\foo\))); // Range references -pDoc-SetString(1, 14, 0, OUString(=N(A1:A8))); -pDoc-SetString(1, 15, 0, OUString(=N(A4:B8))); -pDoc-SetString(1, 16, 0, OUString(=N(A6:B8))); -pDoc-SetString(1, 17, 0, OUString(=N(A2:B8))); +pDoc-SetString(2, 2, 0, OUString(=N(A1:A8))); +pDoc-SetString(2, 3, 0, OUString(=N(A1:A8))); +pDoc-SetString(2, 4, 0, OUString(=N(A1:A8))); +pDoc-SetString(2, 5, 0, OUString(=N(A1:A8))); // Calculate and check the results. pDoc-CalcAll(); -double checks[] = { +double checks1[] = { 0, 0, 0,1, -1, 12.3, 0, // cell reference -0, 1, -1, 123, 0,0, 0, // in-line values -0, 1, 12.3, 0// range references +0, 1, -1, 123, 0,0, 0 // in-line values }; -for (size_t i = 0; i SAL_N_ELEMENTS(checks); ++i) +for (size_t i = 0; i SAL_N_ELEMENTS(checks1); ++i) { pDoc-GetValue(1, i, 0, result); -bool bGood = result == checks[i]; +bool bGood = result == checks1[i]; if (!bGood) { -cerr row (i+1) : expected= checks[i] actual= result endl; +cerr row (i+1) : expected= checks1[i] actual= result endl; +CPPUNIT_ASSERT_MESSAGE(Unexpected result for N, false); +} +} +double checks2[] = { +0, 1, -1, 12.3 // range references +}; +for (size_t i = 0; i SAL_N_ELEMENTS(checks2); ++i) +{ +pDoc-GetValue(1, i+2, 0, result); +bool bGood = result == checks2[i]; +if (!bGood) +{ +cerr row (i+2+1) : expected= checks2[i] actual= result endl; CPPUNIT_ASSERT_MESSAGE(Unexpected result for N, false); } } diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 42f6457..f3090bf 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2952,40 +2952,19 @@ void ScInterpreter::ScIsOdd() void ScInterpreter::ScN() { -switch (GetRawStackType()) -{ -case svSingleRef: -case svDoubleRef: -case svMatrix: -case svExternalSingleRef: -case svExternalDoubleRef: -{ -ScMatrixRef pMat = GetMatrix(); -SCSIZE nC, nR; -pMat-GetDimensions(nC, nR); -if (!nC || !nR) -PushDouble(0); -else -PushDouble(pMat-GetDouble(0, 0)); -return; -} -case svString: -PopError(); -PushDouble(0); -return; -default: -; -} - -// Default action +RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, sc, er, ScInterpreter::ScN ); +sal_uInt16 nErr = nGlobalError; +nGlobalError = 0; +// Temporarily override the ConvertStringToValue() error for +// GetCellValue() / GetCellValueOrZero() +sal_uInt16 nSErr = mnStringNoValueError; +mnStringNoValueError = errCellNoValue; double fVal = GetDouble(); -if (nGlobalError) -{ -// Don't propagate the error. Push 0 instead. -nGlobalError = 0; -PushDouble(0); -return; -} +mnStringNoValueError = nSErr; +if (nErr) +nGlobalError = nErr;// preserve previous error if any +else if (nGlobalError ==
[Libreoffice-commits] .: 2 commits - sc/qa sd/qa sot/source svtools/qa sw/qa writerfilter/qa
sc/qa/unit/data/README |7 + sd/qa/unit/data/README |7 + sot/source/sdstor/stgstrms.cxx | 127 + sot/source/sdstor/stgstrms.hxx |2 svtools/qa/cppunit/data/README |7 + sw/qa/core/data/README |7 + writerfilter/qa/cppunittests/rtftok/README |7 + 7 files changed, 94 insertions(+), 70 deletions(-) New commits: commit 1d32c56f36adbd0d5801f0fedec3111011ea4d65 Author: Michael Meeks michael.me...@suse.com Date: Mon May 14 09:41:02 2012 +0100 sot: re-work OLE2 offset-to-page computation The gotcha here is that if we get ahead of ourselves, and read to the end of the stream, we detect bad chains too early, so instead incrementally build the page chain cache, which is also quicker and behaves more similarly to the previous code. diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index f8b9776..7bef243 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -340,38 +340,40 @@ void StgStrm::SetEntry( StgDirEntry r ) * for this each time build a simple flat in-memory vector list * of pages. */ -bool StgStrm::buildPageChainCache() +void StgStrm::scanBuildPageChainCache(sal_Int32 *pOptionalCalcSize) { if (nSize 0) m_aPagesCache.reserve(nSize/nPageSize); +bool bError = false; sal_Int32 nBgn = nStart; -while (nBgn = 0) +sal_Int32 nOldBgn = -1; +sal_Int32 nOptSize = 0; +while( nBgn = 0 nBgn != nOldBgn ) { -m_aPagesCache.push_back(nBgn); -sal_Int32 nOldBgn = nBgn; -nBgn = pFat-GetNextPage(nBgn); -if (nBgn == nOldBgn) -return false; +if( nBgn = 0 ) +m_aPagesCache.push_back(nBgn); +nOldBgn = nBgn; +nBgn = pFat-GetNextPage( nBgn ); +if( nBgn == nOldBgn ) +bError = true; +nOptSize += nPageSize; } - -return true; +if (bError) +{ +if (pOptionalCalcSize) +rIo.SetError( ERRCODE_IO_WRONGFORMAT ); +m_aPagesCache.clear(); +} +if (pOptionalCalcSize) +*pOptionalCalcSize = nOptSize; } -//See fdo#47644 for a .doc with a vast amount of pages where seeking around the -//document takes a colossal amount of time -// -//There's a cost to building a page cache, so only build one if the number of -//pages to seek through hits some sufficiently high value where it's worth it. -#define ARBITRARY_LARGE_AMOUNT_OF_PAGES 8 * 512 - // Compute page number and offset for the given byte position. // If the position is behind the size, set the stream right // behind the EOF. - sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos ) { -sal_Int32 nRel, nBgn; // Values 0 seek to the end if( nBytePos 0 || nBytePos = nSize ) nBytePos = nSize; @@ -385,69 +387,59 @@ sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos ) if( nOld == nNew ) return sal_True; -if (m_aPagesCache.empty() nNew ARBITRARY_LARGE_AMOUNT_OF_PAGES) +// See fdo#47644 for a .doc with a vast amount of pages where seeking around the +// document takes a colossal amount of time +// +// Please Note: we build the pagescache incrementally as we go if necessary, +// so that a corrupted FAT doesn't poison the stream state for earlier reads +size_t nIdx = nNew / nPageSize; +if( nIdx = m_aPagesCache.size() ) { -SAL_WARN(sot, kicking off large seek helper\n); -buildPageChainCache(); -} +// Extend the FAT cache ! ... +size_t nToAdd = nIdx + 1; -if (!m_aPagesCache.empty()) -{ -size_t nIdx = nNew / nPageSize; +if (m_aPagesCache.empty()) +m_aPagesCache.push_back( nStart ); -// special case: seek to 1st byte of new, unallocated page -// (in case the file size is a multiple of the page size) -if( nBytePos == nSize !nOffset nIdx == m_aPagesCache.size() ) -{ -nIdx--; -nOffset = nPageSize; -} +nToAdd -= m_aPagesCache.size(); + +sal_Int32 nBgn = m_aPagesCache.back(); -if (nIdx m_aPagesCache.size()) +// Start adding pages while we can +while( nToAdd 0 nBgn = 0 ) { -nPage = m_aPagesCache[ nIdx ]; -return sal_Bool( nPage = 0 ); +nBgn = pFat-GetNextPage( nBgn ); +if( nBgn = 0 ) +{ +m_aPagesCache.push_back( nBgn ); +nToAdd--; +} } } -if( nNew nOld ) +if ( nIdx m_aPagesCache.size() ) { -// the new position is after the current, so an incremental -// positioning is OK. Set the page relative position -nRel = nNew - nOld; -nBgn = nPage; +rIo.SetError( SVSTREAM_FILEFORMAT_ERROR ); +nPage = STG_EOF; +nOffset =
[Libreoffice-commits] .: 2 commits - sc/qa test/inc test/Library_subsequenttest.mk test/Package_inc.mk test/source
sc/qa/extras/sceditfieldobj-cell.cxx | 11 + sc/qa/extras/sceditfieldobj-header.cxx | 10 + test/Library_subsequenttest.mk |1 test/Package_inc.mk|1 test/inc/test/beans/xpropertyset.hxx | 86 + test/source/beans/xpropertyset.cxx | 211 + 6 files changed, 316 insertions(+), 4 deletions(-) New commits: commit 8ac758d5490c53df5e8ec539c37af062bedc72fa Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Mon Apr 30 16:17:05 2012 -0400 Test for XPropertySet. This is still work-in-progress. Change-Id: Icf8b9a45435968bc43d8bc7a033ce5cfd702 diff --git a/sc/qa/extras/sceditfieldobj-cell.cxx b/sc/qa/extras/sceditfieldobj-cell.cxx index e7ad2ed..ab3217a 100644 --- a/sc/qa/extras/sceditfieldobj-cell.cxx +++ b/sc/qa/extras/sceditfieldobj-cell.cxx @@ -27,6 +27,7 @@ */ #include test/unoapi_test.hxx +#include test/beans/xpropertyset.hxx #include test/text/xtextfield.hxx #include test/text/xtextcontent.hxx @@ -38,11 +39,11 @@ #include com/sun/star/sheet/XSpreadsheetDocument.hpp #include com/sun/star/sheet/XSpreadsheet.hpp -#define NUMBER_OF_TESTS 3 +#define NUMBER_OF_TESTS 5 namespace sc_apitest { -class ScEditFieldObj_Cell : public UnoApiTest, apitest::XTextField, apitest::XTextContent +class ScEditFieldObj_Cell : public UnoApiTest, apitest::XTextField, apitest::XTextContent, apitest::XPropertySet { public: ScEditFieldObj_Cell(); @@ -55,8 +56,14 @@ public: virtual bool isAttachSupported() { return true; } CPPUNIT_TEST_SUITE(ScEditFieldObj_Cell); + +// XPropertySet +CPPUNIT_TEST(testGetPropertySetInfo); +CPPUNIT_TEST(testGetPropertyValue); + // XTextField CPPUNIT_TEST(testGetPresentation); + // XTextContent CPPUNIT_TEST(testGetAnchor); CPPUNIT_TEST(testAttach); diff --git a/sc/qa/extras/sceditfieldobj-header.cxx b/sc/qa/extras/sceditfieldobj-header.cxx index 44bdeb5..e11dfde 100644 --- a/sc/qa/extras/sceditfieldobj-header.cxx +++ b/sc/qa/extras/sceditfieldobj-header.cxx @@ -27,6 +27,7 @@ */ #include test/unoapi_test.hxx +#include test/beans/xpropertyset.hxx #include test/text/xtextfield.hxx #include test/text/xtextcontent.hxx @@ -41,11 +42,11 @@ #include com/sun/star/sheet/XSpreadsheet.hpp #include com/sun/star/sheet/XHeaderFooterContent.hpp -#define NUMBER_OF_TESTS 2 +#define NUMBER_OF_TESTS 4 namespace sc_apitest { -class ScEditFieldObj_Header : public UnoApiTest, apitest::XTextContent +class ScEditFieldObj_Header : public UnoApiTest, apitest::XTextContent, apitest::XPropertySet { public: ScEditFieldObj_Header(); @@ -58,6 +59,11 @@ public: virtual bool isAttachSupported() { return false; } CPPUNIT_TEST_SUITE(ScEditFieldObj_Header); + +// XPropertySet +CPPUNIT_TEST(testGetPropertySetInfo); +CPPUNIT_TEST(testGetPropertyValue); + // XTextContent CPPUNIT_TEST(testGetAnchor); CPPUNIT_TEST(testAttach); commit 8bffba8222f1edecd4664ea0ef5e686a369ca72f Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Mon Apr 30 16:15:29 2012 -0400 Started porting the XPropertySet test code. Not all its tests have been converted. This is work-in-progress. Change-Id: I90a789852e05a214440e4f87011b6de3d3d4d08a diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk index a7c5e41..e10df28 100644 --- a/test/Library_subsequenttest.mk +++ b/test/Library_subsequenttest.mk @@ -62,6 +62,7 @@ $(eval $(call gb_Library_use_external,subsequenttest,cppunit)) $(eval $(call gb_Library_add_exception_objects,subsequenttest,\ test/source/unoapi_test \ +test/source/beans/xpropertyset \ test/source/container/xelementaccess \ test/source/container/xindexaccess \ test/source/container/xnamecontainer \ diff --git a/test/Package_inc.mk b/test/Package_inc.mk index aac4b38..474eb6d 100644 --- a/test/Package_inc.mk +++ b/test/Package_inc.mk @@ -30,6 +30,7 @@ $(eval $(call gb_Package_add_file,test_inc,inc/test/xmldiff.hxx,test/xmldiff.hxx $(eval $(call gb_Package_add_file,test_inc,inc/test/bootstrapfixture.hxx,test/bootstrapfixture.hxx)) $(eval $(call gb_Package_add_file,test_inc,inc/test/testdllapi.hxx,test/testdllapi.hxx)) $(eval $(call gb_Package_add_file,test_inc,inc/test/unoapi_test.hxx,test/unoapi_test.hxx)) +$(eval $(call gb_Package_add_file,test_inc,inc/test/beans/xpropertyset.hxx,test/beans/xpropertyset.hxx)) $(eval $(call gb_Package_add_file,test_inc,inc/test/sheet/xdatapilotdescriptor.hxx,test/sheet/xdatapilotdescriptor.hxx)) $(eval $(call gb_Package_add_file,test_inc,inc/test/sheet/xcellrangesquery.hxx,test/sheet/xcellrangesquery.hxx)) $(eval $(call gb_Package_add_file,test_inc,inc/test/sheet/xnamedranges.hxx,test/sheet/xnamedranges.hxx)) diff --git a/test/inc/test/beans/xpropertyset.hxx b/test/inc/test/beans/xpropertyset.hxx new file mode 100644 index 000..7479541 --- /dev/null +++
[Libreoffice-commits] .: 2 commits - sc/qa test/inc test/source
sc/qa/extras/sceditfieldobj-cell.cxx |3 ++- sc/qa/extras/sceditfieldobj-header.cxx |3 ++- test/inc/test/beans/xpropertyset.hxx |2 +- test/source/beans/xpropertyset.cxx |5 +++-- 4 files changed, 8 insertions(+), 5 deletions(-) New commits: commit 4712cd34531f1f257238b5ededaa5f130db2abec Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Mon Apr 30 16:31:23 2012 -0400 Test setPropertyValue(). Change-Id: Idbad933cf5e3b297e7131e66202a0250b4c3def8 diff --git a/sc/qa/extras/sceditfieldobj-cell.cxx b/sc/qa/extras/sceditfieldobj-cell.cxx index ab3217a..0f582cf 100644 --- a/sc/qa/extras/sceditfieldobj-cell.cxx +++ b/sc/qa/extras/sceditfieldobj-cell.cxx @@ -39,7 +39,7 @@ #include com/sun/star/sheet/XSpreadsheetDocument.hpp #include com/sun/star/sheet/XSpreadsheet.hpp -#define NUMBER_OF_TESTS 5 +#define NUMBER_OF_TESTS 6 namespace sc_apitest { @@ -60,6 +60,7 @@ public: // XPropertySet CPPUNIT_TEST(testGetPropertySetInfo); CPPUNIT_TEST(testGetPropertyValue); +CPPUNIT_TEST(testSetPropertyValue); // XTextField CPPUNIT_TEST(testGetPresentation); diff --git a/sc/qa/extras/sceditfieldobj-header.cxx b/sc/qa/extras/sceditfieldobj-header.cxx index e11dfde..69a62b8 100644 --- a/sc/qa/extras/sceditfieldobj-header.cxx +++ b/sc/qa/extras/sceditfieldobj-header.cxx @@ -42,7 +42,7 @@ #include com/sun/star/sheet/XSpreadsheet.hpp #include com/sun/star/sheet/XHeaderFooterContent.hpp -#define NUMBER_OF_TESTS 4 +#define NUMBER_OF_TESTS 5 namespace sc_apitest { @@ -63,6 +63,7 @@ public: // XPropertySet CPPUNIT_TEST(testGetPropertySetInfo); CPPUNIT_TEST(testGetPropertyValue); +CPPUNIT_TEST(testSetPropertyValue); // XTextContent CPPUNIT_TEST(testGetAnchor); commit 5c03dca7a983b40e2870f9b72850a80e8766b157 Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Mon Apr 30 16:26:07 2012 -0400 More descriptive method name. Change-Id: I7f0d68ee59e7a36254267d652de398cc371c7f8c diff --git a/test/inc/test/beans/xpropertyset.hxx b/test/inc/test/beans/xpropertyset.hxx index 7479541..c69024c 100644 --- a/test/inc/test/beans/xpropertyset.hxx +++ b/test/inc/test/beans/xpropertyset.hxx @@ -57,7 +57,7 @@ public: void testRemoveVetoableChangeListener(); protected: -virtual bool isChangeable(const rtl::OUString rName); +virtual bool isPropertyValueChangeable(const rtl::OUString rName); private: void fillPropsToTest(const uno::Referencebeans::XPropertySetInfo xPropInfo); diff --git a/test/source/beans/xpropertyset.cxx b/test/source/beans/xpropertyset.cxx index 1c83390..ffa1a01 100644 --- a/test/source/beans/xpropertyset.cxx +++ b/test/source/beans/xpropertyset.cxx @@ -69,6 +69,7 @@ void XPropertySet::testAddVetoableChangeListener() void XPropertySet::testSetPropertyValue() { testGetPropertySetInfo(); +uno::Referencebeans::XPropertySet xPropSet(init(), UNO_QUERY_THROW); // TODO: implement this. } @@ -103,7 +104,7 @@ void XPropertySet::testRemoveVetoableChangeListener() // TODO: implement this. } -bool XPropertySet::isChangeable(const rtl::OUString rName) +bool XPropertySet::isPropertyValueChangeable(const rtl::OUString rName) { uno::Referencebeans::XPropertySet xPropSet(init(), UNO_QUERY_THROW); try @@ -177,7 +178,7 @@ void XPropertySet::fillPropsToTest(const uno::Referencebeans::XPropertySetInfo bool bBound = (aProp.Attributes beans::PropertyAttribute::BOUND) != 0; bool bConstrained = (aProp.Attributes beans::PropertyAttribute::CONSTRAINED) != 0; -bool bCanChange = isChangeable(aProp.Name); +bool bCanChange = isPropertyValueChangeable(aProp.Name); if (bBound bCanChange) maPropsToTest.bound.push_back(aProp.Name); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa
sc/qa/unit/ucalc.cxx | 23 +-- 1 file changed, 21 insertions(+), 2 deletions(-) New commits: commit 7d65dd728ca2b7dea073ef085110dccdf22c2d5c Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Mon Apr 23 02:18:14 2012 +0200 add test case for copy/paste formulas, related fdo#48482 diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 07782da..9542320 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -209,6 +209,7 @@ public: void testRenameTable(); void testAutoFill(); +void testCopyPasteFormulas(); CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testCollator); @@ -249,6 +250,7 @@ public: CPPUNIT_TEST(testSetBackgroundColor); CPPUNIT_TEST(testRenameTable); CPPUNIT_TEST(testAutoFill); +CPPUNIT_TEST(testCopyPasteFormulas); CPPUNIT_TEST_SUITE_END(); private: @@ -4221,6 +4223,25 @@ void Test::testAutoFill() m_pDoc-DeleteTab(0); } +void Test::testCopyPasteFormulas() +{ +m_pDoc-InsertTab(0, Sheet1); +m_pDoc-InsertTab(1, Sheet2); + +m_pDoc-SetString(0,0,0, =COLUMN($A$1)); +m_pDoc-SetInTest(); +CPPUNIT_ASSERT_DOUBLES_EQUAL(m_pDoc-GetValue(0,0,0), 1.0, 1e-08); +ScDocFunc rDocFunc = m_xDocShRef-GetDocFunc(); +bool bMoveDone = rDocFunc.MoveBlock(ScRange(0,0,0), ScAddress( 10, 10, 0), false, false, false, true); + +// check that moving was succesful, mainly for editable tester +CPPUNIT_ASSERT(bMoveDone); +CPPUNIT_ASSERT_DOUBLES_EQUAL(m_pDoc-GetValue(10,10,0), 1.0, 1e-8); +rtl::OUString aFormula; +m_pDoc-GetFormula(10,10,0, aFormula); +CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString(=COLUMN($A$1))); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } commit 0d3d836ec6541b7a1e0a7fa48195ebb678e2951e Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Mon Apr 23 01:34:47 2012 +0200 I did not want to disable these tests diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index c743e68..07782da 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -211,7 +211,6 @@ public: void testAutoFill(); CPPUNIT_TEST_SUITE(Test); -#if 0 CPPUNIT_TEST(testCollator); CPPUNIT_TEST(testInput); CPPUNIT_TEST(testCellFunctions); @@ -249,7 +248,6 @@ public: CPPUNIT_TEST(testJumpToPrecedentsDependents); CPPUNIT_TEST(testSetBackgroundColor); CPPUNIT_TEST(testRenameTable); -#endif CPPUNIT_TEST(testAutoFill); CPPUNIT_TEST_SUITE_END(); ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa
sc/qa/unit/filters-test.cxx| 21 - sc/qa/unit/subsequent_filters-test.cxx | 21 + sc/qa/unit/ucalc.cxx | 23 ++- 3 files changed, 43 insertions(+), 22 deletions(-) New commits: commit d8ff1a579ff5ac9250aa052ef1a17fce51959cb0 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Apr 13 17:18:14 2012 +0200 improve autofill test case diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 130ad67..78fe168 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -4179,7 +4179,28 @@ void Test::testAutoFill() for (SCROW i = 3; i 8; ++i) CPPUNIT_ASSERT_DOUBLES_EQUAL(static_castdouble(i-1.0), m_pDoc-GetValue(0, i, 0), 0.0001); - +m_pDoc-Fill( 0, 0, 0, 8, NULL, aMarkData, 5, FILL_TO_RIGHT ); +for (SCCOL i = 0; i 5; ++i) +{ +for(SCROW j = 0; j 8; ++j) +{ +if (j 2) +{ +CPPUNIT_ASSERT_DOUBLES_EQUAL(static_castdouble(j-1+i), m_pDoc-GetValue(i, j, 0), 1e-8); +} +else if (j == 0) +{ +CPPUNIT_ASSERT_DOUBLES_EQUAL(static_castdouble(i+1), m_pDoc-GetValue(i, 0, 0), 1e-8); +} +else if (j == 1 || j== 2) +{ +if(i == 0) +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, m_pDoc-GetValue(0,j,0), 1e-8); +else +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, m_pDoc-GetValue(i,j,0), 1e-8); +} +} +} m_pDoc-DeleteTab(0); commit 97fe16f4dc5582be597971b6e17431b8d353b8ba Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Apr 13 17:04:46 2012 +0200 move testCVE into slowcheck speed up rebuild of sc diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index de17ced..417b842 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -96,11 +96,6 @@ public: virtual void setUp(); virtual void tearDown(); -/** - * Ensure CVEs remain unbroken - */ -void testCVEs(); - //ods, xls, xlsx filter tests void testRangeNameODS(); // only test ods here, xls and xlsx in subsequent_filters-test void testContentODS(); @@ -117,7 +112,6 @@ public: #endif CPPUNIT_TEST_SUITE(ScFiltersTest); -CPPUNIT_TEST(testCVEs); CPPUNIT_TEST(testRangeNameODS); CPPUNIT_TEST(testContentODS); CPPUNIT_TEST(testContentXLS); @@ -189,21 +183,6 @@ void ScFiltersTest::createCSVPath(const rtl::OUString aFileBase, rtl::OUString rCSVPath = aBuffer.makeStringAndClear(); } -void ScFiltersTest::testCVEs() -{ -testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(Quattro Pro 6.0)), -getURLFromSrc(/sc/qa/unit/data/qpro/), rtl::OUString()); - -//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(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SYLK)), -getURLFromSrc(/sc/qa/unit/data/slk/), rtl::OUString()); - -testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MS Excel 97)), -getURLFromSrc(/sc/qa/unit/data/xls/), rtl::OUString()); -} - #if TEST_BUG_FILES void ScFiltersTest::testDir(osl::Directory rDir, sal_uInt32 nType) diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 1d8a8b6..f2ed04b 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -93,6 +93,11 @@ public: virtual void setUp(); virtual void tearDown(); +/** + * Ensure CVEs remain unbroken + */ +void testCVEs(); + //ods, xls, xlsx filter tests void testRangeNameXLS(); void testRangeNameXLSX(); @@ -115,6 +120,7 @@ public: CPPUNIT_TEST_SUITE(ScFiltersTest); +CPPUNIT_TEST(testCVEs); CPPUNIT_TEST(testRangeNameXLS); CPPUNIT_TEST(testRangeNameXLSX); CPPUNIT_TEST(testFunctionsODS); @@ -216,6 +222,21 @@ void ScFiltersTest::createCSVPath(const rtl::OUString aFileBase, rtl::OUString rCSVPath = aBuffer.makeStringAndClear(); } +void ScFiltersTest::testCVEs() +{ +testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(Quattro Pro 6.0)), +getURLFromSrc(/sc/qa/unit/data/qpro/), rtl::OUString()); + +//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(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SYLK)), +getURLFromSrc(/sc/qa/unit/data/slk/), rtl::OUString()); + +testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MS Excel 97)), +getURLFromSrc(/sc/qa/unit/data/xls/), rtl::OUString()); +} + namespace { void testRangeNameImpl(ScDocument* pDoc) ___ Libreoffice-commits mailing list
[Libreoffice-commits] .: 2 commits - sc/qa
sc/qa/unit/ucalc.cxx | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) New commits: commit 98a5031b225d0ba62454e14ed719fd2c7c32aa84 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sun Apr 1 04:26:08 2012 +0200 with SetInTest it is possible to use some more ScDocFunc methods diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 080bf3c..9132395 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3903,11 +3903,11 @@ void Test::testMergedCells() ScRange aRange(0,2,0,MAXCOL,2,0); ScMarkData aMark; aMark.SetMarkArea(aRange); +m_pDoc-SetInTest(); aDocFunc.InsertCells(aRange, aMark, INS_INSROWS, true, true); m_pDoc-ExtendMerge( 1, 1, nEndCol, nEndRow, 0, false); cout nEndRow nEndCol; -//ScEditableTester won't work without an SfxMedium/XStorage -//CPPUNIT_ASSERT_MESSAGE(did not increase merge area, nEndCol == 3 nEndRow == 4); +CPPUNIT_ASSERT_MESSAGE(did not increase merge area, nEndCol == 3 nEndRow == 4); m_pDoc-DeleteTab(0); } commit 0034110ca6e68e2d3bd6fef11f1b0698738f24b0 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sun Apr 1 04:23:55 2012 +0200 it does not make sense to get ColorData which is converted back to Color diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 1bdfe9d..080bf3c 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3922,20 +3922,20 @@ void Test::testSetBackgroundColor() //test yellow aColor=Color(COL_YELLOW); m_xDocShRef-GetDocFunc().SetTabBgColor(0,aColor,false, true); -CPPUNIT_ASSERT_MESSAGE(the correct color is not set, m_pDoc-GetTabBgColor(0)!= aColor.GetColor()); +CPPUNIT_ASSERT_MESSAGE(the correct color is not set, m_pDoc-GetTabBgColor(0)!= aColor); Color aOldTabBgColor=m_pDoc-GetTabBgColor(0); aColor.SetColor(COL_BLUE);//set BLUE m_xDocShRef-GetDocFunc().SetTabBgColor(0,aColor,false, true); -CPPUNIT_ASSERT_MESSAGE(the correct color is not set the second time, m_pDoc-GetTabBgColor(0)!= aColor.GetColor()); +CPPUNIT_ASSERT_MESSAGE(the correct color is not set the second time, m_pDoc-GetTabBgColor(0)!= aColor); //now check for undo SfxUndoAction* pUndo = new ScUndoTabColor(m_xDocShRef,0, aOldTabBgColor, aColor); pUndo-Undo(); -CPPUNIT_ASSERT_MESSAGE(the correct color is not set after undo, m_pDoc-GetTabBgColor(0)== aOldTabBgColor.GetColor()); +CPPUNIT_ASSERT_MESSAGE(the correct color is not set after undo, m_pDoc-GetTabBgColor(0)== aOldTabBgColor); pUndo-Redo(); -CPPUNIT_ASSERT_MESSAGE(the correct color is not set after undo, m_pDoc-GetTabBgColor(0)== aColor.GetColor()); +CPPUNIT_ASSERT_MESSAGE(the correct color is not set after undo, m_pDoc-GetTabBgColor(0)== aColor); m_pDoc-DeleteTab(0); } ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa
sc/qa/unit/ucalc.cxx | 226 ++- 1 file changed, 225 insertions(+), 1 deletion(-) New commits: commit a3d71e97eaf1958a4d5ab41a6b8788c95d85d2bb Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Thu Mar 22 21:26:26 2012 -0400 New unit test for pivot table with date grouping. diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 89315af..cb6ab44 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -75,6 +75,7 @@ #include sfx2/docfile.hxx #include com/sun/star/sheet/DataPilotFieldOrientation.hpp +#include com/sun/star/sheet/DataPilotFieldGroupBy.hpp #include com/sun/star/sheet/GeneralFunction.hpp #include ucbhelper/contentbroker.hxx @@ -161,8 +162,8 @@ public: void testPivotTableDuplicateDataFields(); void testPivotTableNormalGrouping(); - void testPivotTableNumberGrouping(); +void testPivotTableDateGrouping(); void testSheetCopy(); void testSheetMove(); @@ -222,6 +223,7 @@ public: CPPUNIT_TEST(testPivotTableDuplicateDataFields); CPPUNIT_TEST(testPivotTableNormalGrouping); CPPUNIT_TEST(testPivotTableNumberGrouping); +CPPUNIT_TEST(testPivotTableDateGrouping); CPPUNIT_TEST(testSheetCopy); CPPUNIT_TEST(testSheetMove); CPPUNIT_TEST(testExternalRef); @@ -1245,7 +1247,6 @@ ScDPObject* createDPFromSourceDesc( ScDPSaveDimension* pDim = aSaveData.GetNewDimensionByName(aDimName); pDim-SetOrientation(static_castsal_uInt16(aFields[i].eOrient)); pDim-SetUsedHierarchy(0); -pDim-SetShowEmpty(true); if (aFields[i].eOrient == sheet::DataPilotFieldOrientation_DATA) { @@ -2424,6 +2425,123 @@ void Test::testPivotTableNumberGrouping() m_pDoc-DeleteTab(0); } +void Test::testPivotTableDateGrouping() +{ +m_pDoc-InsertTab(0, OUString(RTL_CONSTASCII_USTRINGPARAM(Data))); +m_pDoc-InsertTab(1, OUString(RTL_CONSTASCII_USTRINGPARAM(Table))); + +// Raw data +const char* aData[][2] = { +{ Date, Value }, +{ 2011-01-01, 1 }, +{ 2011-03-02, 2 }, +{ 2012-01-04, 3 }, +{ 2012-02-23, 4 }, +{ 2012-02-24, 5 }, +{ 2012-03-15, 6 }, +{ 2011-09-03, 7 }, +{ 2012-12-25, 8 } +}; + +// Dimension definition +DPFieldDef aFields[] = { +{ Date, sheet::DataPilotFieldOrientation_ROW, 0 }, +{ Value, sheet::DataPilotFieldOrientation_DATA, sheet::GeneralFunction_SUM }, +}; + +ScAddress aPos(1,1,0); +ScRange aDataRange = insertRangeData(m_pDoc, aPos, aData, SAL_N_ELEMENTS(aData)); +CPPUNIT_ASSERT_MESSAGE(failed to insert range data at correct position, aDataRange.aStart == aPos); + +ScDPObject* pDPObj = createDPFromRange( +m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false); + +ScDPCollection* pDPs = m_pDoc-GetDPCollection(); +bool bSuccess = pDPs-InsertNewTable(pDPObj); + +CPPUNIT_ASSERT_MESSAGE(failed to insert a new pivot table object into document., bSuccess); +CPPUNIT_ASSERT_MESSAGE(there should be only one data pilot table., + pDPs-GetCount() == 1); +pDPObj-SetName(pDPs-CreateNewName()); + +ScDPSaveData* pSaveData = pDPObj-GetSaveData(); +CPPUNIT_ASSERT_MESSAGE(No save data !?, pSaveData); +ScDPDimensionSaveData* pDimData = pSaveData-GetDimensionData(); +CPPUNIT_ASSERT_MESSAGE(No dimension data !?, pDimData); + +rtl::OUString aBaseDimName(RTL_CONSTASCII_USTRINGPARAM(Date)); + +ScDPNumGroupInfo aInfo; +aInfo.mbEnable = true; +aInfo.mbAutoStart = true; +aInfo.mbAutoEnd = true; +{ +// Turn the Date dimension into months. The first of the date +// dimensions is always a number-group dimension which replaces the +// original dimension. +ScDPSaveNumGroupDimension aGroup(aBaseDimName, aInfo, sheet::DataPilotFieldGroupBy::MONTHS); +pDimData-AddNumGroupDimension(aGroup); +} + +{ +// Add quarter dimension. This will be an additional dimension. +rtl::OUString aGroupDimName = +pDimData-CreateDateGroupDimName( +sheet::DataPilotFieldGroupBy::QUARTERS, *pDPObj, true, NULL); +ScDPSaveGroupDimension aGroupDim(aBaseDimName, aGroupDimName); +aGroupDim.SetDateInfo(aInfo, sheet::DataPilotFieldGroupBy::QUARTERS); +pDimData-AddGroupDimension(aGroupDim); + +// Set orientation. +ScDPSaveDimension* pDim = pSaveData-GetDimensionByName(aGroupDimName); +pDim-SetOrientation(sheet::DataPilotFieldOrientation_ROW); +pSaveData-SetPosition(pDim, 0); // set it to the left end. +} + +{ +// Add year dimension. This is a new dimension also. +rtl::OUString aGroupDimName = +pDimData-CreateDateGroupDimName( +sheet::DataPilotFieldGroupBy::YEARS, *pDPObj, true, NULL); +ScDPSaveGroupDimension aGroupDim(aBaseDimName, aGroupDimName); +
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/data/ods/bug-fixes.ods |binary sc/qa/unit/subsequent_filters-test.cxx | 21 ++--- sc/source/ui/app/transobj.cxx | 26 +- 3 files changed, 31 insertions(+), 16 deletions(-) New commits: commit d58421c2cc5199e9892627b894eaab64265c82e7 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sun Mar 18 19:20:06 2012 +0100 add test case for fdo#40426 diff --git a/sc/qa/unit/data/ods/bug-fixes.ods b/sc/qa/unit/data/ods/bug-fixes.ods index 6864235..b7c0539 100644 Binary files a/sc/qa/unit/data/ods/bug-fixes.ods and b/sc/qa/unit/data/ods/bug-fixes.ods differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index f5f1eaf..4aac0fc 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -41,6 +41,7 @@ #include editeng/brshitem.hxx #include editeng/justifyitem.hxx +#include dbdata.hxx #define CALC_DEBUG_OUTPUT 0 #define TEST_BUG_FILES 0 @@ -483,9 +484,23 @@ void ScFiltersTest::testBugFixesODS() CPPUNIT_ASSERT_MESSAGE(Failed to load bugFixes.ods, xDocSh.Is()); ScDocument* pDoc = xDocSh-GetDocument(); -rtl::OUString aCSVFileName; - createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(bugFix_Sheet2.)), aCSVFileName); -testFile(aCSVFileName, pDoc, 1); +{ +// fdo +rtl::OUString aCSVFileName; + createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(bugFix_Sheet2.)), aCSVFileName); +testFile(aCSVFileName, pDoc, 1); +} + +{ +// fdo#40426 +ScDBData* pDBData = pDoc-GetDBCollection()-getNamedDBs().findByName(DBRange1); +CPPUNIT_ASSERT(pDBData); +CPPUNIT_ASSERT(pDBData-HasHeader()); +// no header +pDBData = pDoc-GetDBCollection()-getNamedDBs().findByName(DBRange2); +CPPUNIT_ASSERT(pDBData); +CPPUNIT_ASSERT(!pDBData-HasHeader()); +} xDocSh-DoClose(); } commit 521456068d8a848e4e5a358b1ff7e8659c94a353 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sun Mar 18 19:19:43 2012 +0100 some sal_Bool to bool in transobj.cxx diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index cb1fa54..dbcfc54 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -150,7 +150,7 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDesc SCCOL nCol2; SCROW nRow2; pDoc-GetClipStart( nCol1, nRow1 ); -pDoc-GetClipArea( nCol2, nRow2, sal_True );// real source area - include filtered rows +pDoc-GetClipArea( nCol2, nRow2, true );// real source area - include filtered rows nCol2 = sal::static_int_castSCCOL( nCol2 + nCol1 ); nRow2 = sal::static_int_castSCROW( nRow2 + nRow1 ); @@ -161,7 +161,7 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDesc SCTAB nTab1=0; SCTAB nTab2=0; -sal_Bool bFirst = sal_True; +bool bFirst = true; for (SCTAB i=0; i pDoc-GetTableCount(); i++) if (pDoc-HasTable(i)) { @@ -260,7 +260,7 @@ void ScTransferObj::AddSupportedFormats() sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor rFlavor ) { sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor ); -sal_BoolbOK = false; +boolbOK = false; if( HasFormat( nFormat ) ) { @@ -308,7 +308,7 @@ sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor rFlavor ) if ( nFormat == SOT_FORMATSTR_ID_LINK ) bUsedForLink = true; -sal_Bool bIncludeFiltered = pDoc-IsCutMode() || bUsedForLink; +bool bIncludeFiltered = pDoc-IsCutMode() || bUsedForLink; ScRange aReducedBlock = aBlock; if ( nFormat == SOT_FORMATSTR_ID_HTML (aBlock.aEnd.Col() == MAXCOL || aBlock.aEnd.Row() == MAXROW) aBlock.aStart.Tab() == aBlock.aEnd.Tab() ) @@ -481,7 +481,7 @@ sal_Bool ScTransferObj::WriteObject( SotStorageStreamRef rxOStm, void* pUserObj delete pSrcStm; } -bRet = sal_True; +bRet = true; xWorkStore-dispose(); xWorkStore = uno::Reference embed::XStorage (); @@ -558,7 +558,7 @@ void ScTransferObj::SetDragSourceFlags( sal_uInt16 nFlags ) void ScTransferObj::SetDragWasInternal() { -bDragWasInternal = sal_True; +bDragWasInternal = true; } void ScTransferObj::SetUseInApi( bool bSet ) @@ -610,7 +610,7 @@ void ScTransferObj::InitDocShell() ScDocument* pDestDoc = pDocSh-GetDocument(); ScMarkData aDestMark; -aDestMark.SelectTable( 0, sal_True ); +aDestMark.SelectTable( 0, true ); pDestDoc-SetDocOptions( pDoc-GetDocOptions() ); // #i42666# @@ -663,16 +663,16 @@ void ScTransferObj::InitDocShell() // pDoc is always a Clipboard-document ScRange aDestRange(
[Libreoffice-commits] .: 2 commits - sc/qa test/inc test/Library_subsequenttest.mk test/Package_inc.mk test/source
sc/qa/extras/sccellrangeobj.cxx | 28 +++ sc/qa/extras/testdocuments/xcellrangesquery.ods |binary test/Library_subsequenttest.mk |1 test/Package_inc.mk |1 test/inc/test/sheet/xcellrangedata.hxx | 48 test/source/sheet/xcellrangedata.cxx| 89 6 files changed, 165 insertions(+), 2 deletions(-) New commits: commit 7b91c6d1c0686b06de4d2e87b02df10aa9afbf4c Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Feb 17 01:59:32 2012 +0100 add test for ScCellRangeObj::setDataArray and getDataArray diff --git a/sc/qa/extras/sccellrangeobj.cxx b/sc/qa/extras/sccellrangeobj.cxx index 050724d..2152a2d 100644 --- a/sc/qa/extras/sccellrangeobj.cxx +++ b/sc/qa/extras/sccellrangeobj.cxx @@ -31,6 +31,7 @@ #include test/sheet/cellproperties.hxx #include test/util/xreplaceable.hxx #include test/util/xsearchable.hxx +#include test/sheet/xcellrangedata.hxx #include com/sun/star/sheet/XSpreadsheetDocument.hpp #include com/sun/star/sheet/XSpreadsheet.hpp @@ -38,10 +39,10 @@ namespace sc_apitest { -#define NUMBER_OF_TESTS 12 +#define NUMBER_OF_TESTS 14 class ScCellRangeObj : public UnoApiTest, apitest::XCellRangesQuery, apitest::CellProperties, -apitest::XSearchable, apitest::XReplaceable +apitest::XSearchable, apitest::XReplaceable, apitest::XCellRangeData { public: ScCellRangeObj(); @@ -49,6 +50,7 @@ public: virtual void setUp(); virtual void tearDown(); virtual uno::Reference uno::XInterface init(); +virtual uno::Reference uno::XInterface getXCellRangeData(); CPPUNIT_TEST_SUITE(ScCellRangeObj); CPPUNIT_TEST(testQueryColumnDifference); @@ -64,6 +66,8 @@ public: CPPUNIT_TEST(testFindFirst); CPPUNIT_TEST(testReplaceAll); CPPUNIT_TEST(testCreateReplaceDescriptor); +CPPUNIT_TEST(testGetDataArray); +CPPUNIT_TEST(testSetDataArray); CPPUNIT_TEST_SUITE_END(); private: @@ -101,6 +105,26 @@ uno::Reference uno::XInterface ScCellRangeObj::init() return xReturn; } +uno::Reference uno::XInterface ScCellRangeObj::getXCellRangeData() +{ +rtl::OUString aFileURL; +const rtl::OUString aFileBase(RTL_CONSTASCII_USTRINGPARAM(xcellrangesquery.ods)); +createFileURL(aFileBase, aFileURL); +std::cout rtl::OUStringToOString(aFileURL, RTL_TEXTENCODING_UTF8).getStr() std::endl; +if( !mxComponent.is()) +mxComponent = loadFromDesktop(aFileURL); +uno::Reference sheet::XSpreadsheetDocument xDoc (mxComponent, UNO_QUERY_THROW); +uno::Reference container::XIndexAccess xIndex (xDoc-getSheets(), UNO_QUERY_THROW); +uno::Reference sheet::XSpreadsheet xSheet( xIndex-getByIndex(1), UNO_QUERY_THROW); + +CPPUNIT_ASSERT_MESSAGE(Could not create interface of type XSpreadsheet, xSheet.is()); + +uno::Referencetable::XCellRange xReturn(xSheet-getCellRangeByPosition(0,0,3,3), UNO_QUERY_THROW); + +CPPUNIT_ASSERT_MESSAGE(Could not create object of type XCellRangesQuery, xReturn.is()); +return xReturn; +} + void ScCellRangeObj::setUp() { nTest++; diff --git a/sc/qa/extras/testdocuments/xcellrangesquery.ods b/sc/qa/extras/testdocuments/xcellrangesquery.ods index 562229c..ec7335f 100644 Binary files a/sc/qa/extras/testdocuments/xcellrangesquery.ods and b/sc/qa/extras/testdocuments/xcellrangesquery.ods differ commit 4e1e72dc346e732ff5693e5428e39710ca3b78a5 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Feb 17 01:41:04 2012 +0100 add test code for XCellRangeData diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk index 6c1556f..53cc8e4 100644 --- a/test/Library_subsequenttest.mk +++ b/test/Library_subsequenttest.mk @@ -69,6 +69,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\ test/source/container/xnamed \ test/source/sheet/cellproperties \ test/source/sheet/datapilotfield \ +test/source/sheet/xcellrangedata \ test/source/sheet/xcellrangesquery \ test/source/sheet/xdatabaserange \ test/source/sheet/xdatapilotdescriptor \ diff --git a/test/Package_inc.mk b/test/Package_inc.mk index 55a50af..768c6a8 100644 --- a/test/Package_inc.mk +++ b/test/Package_inc.mk @@ -40,6 +40,7 @@ $(eval $(call gb_Package_add_file,test_inc,inc/test/container/xindexaccess.hxx,t $(eval $(call gb_Package_add_file,test_inc,inc/test/container/xnamecontainer.hxx,test/container/xnamecontainer.hxx)) $(eval $(call gb_Package_add_file,test_inc,inc/test/container/xnamereplace.hxx,test/container/xnamereplace.hxx)) $(eval $(call gb_Package_add_file,test_inc,inc/test/sheet/cellproperties.hxx,test/sheet/cellproperties.hxx)) +$(eval $(call gb_Package_add_file,test_inc,inc/test/sheet/xcellrangedata.hxx,test/sheet/xcellrangedata.hxx)) $(eval $(call
[Libreoffice-commits] .: 2 commits - sc/qa
sc/qa/unit/data/contentCSV/mathematical-functions.csv |3 +++ sc/qa/unit/data/ods/functions.ods |binary 2 files changed, 3 insertions(+) New commits: commit 01ea91efd98e398e6998837c6bb45a9efea43cdc Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sun Feb 5 16:01:16 2012 +0100 add some more test cases diff --git a/sc/qa/unit/data/contentCSV/mathematical-functions.csv b/sc/qa/unit/data/contentCSV/mathematical-functions.csv index 5be0251..cebf207 100644 --- a/sc/qa/unit/data/contentCSV/mathematical-functions.csv +++ b/sc/qa/unit/data/contentCSV/mathematical-functions.csv @@ -15,3 +15,6 @@ 8 12 5 +1.2, 1, 0, 1000 +2, 4, Err:502 + diff --git a/sc/qa/unit/data/ods/functions.ods b/sc/qa/unit/data/ods/functions.ods index e9426fe..a90a224 100644 Binary files a/sc/qa/unit/data/ods/functions.ods and b/sc/qa/unit/data/ods/functions.ods differ commit 7ee0b42f7cad15abca7218d001ea1b3b4cac028e Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sun Feb 5 15:51:25 2012 +0100 add some helpful entries to test file diff --git a/sc/qa/unit/data/ods/functions.ods b/sc/qa/unit/data/ods/functions.ods index 9ccb67f..e9426fe 100644 Binary files a/sc/qa/unit/data/ods/functions.ods and b/sc/qa/unit/data/ods/functions.ods differ ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa vcl/unx
sc/qa/unit/macros-test.cxx |6 +++--- vcl/unx/generic/fontmanager/fontmanager.cxx |4 2 files changed, 7 insertions(+), 3 deletions(-) New commits: commit 1a76bb7161d0a892b6998f404d3922421a89db9b Author: Michael Stahl mst...@redhat.com Date: Mon Oct 24 21:23:23 2011 +0200 macros-test.cxx: fix syntax error diff --git a/sc/qa/unit/macros-test.cxx b/sc/qa/unit/macros-test.cxx index e97156f..28f5d49 100644 --- a/sc/qa/unit/macros-test.cxx +++ b/sc/qa/unit/macros-test.cxx @@ -269,8 +269,8 @@ struct TestMacroInfo }; void ScMacrosTest::testVba() { -TestMacroInfo testInfo[] { -{ +TestMacroInfo testInfo[] = { +{ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(TestAddress.)), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(vnd.sun.Star.script:VBAProject.Sheet1.test?language=Basiclocation=document)) }, @@ -282,7 +282,7 @@ void ScMacrosTest::testVba() } */ }; - + rtl::OUString aFileExtension(aFileFormats[1].pName, strlen(aFileFormats[1].pName), RTL_TEXTENCODING_UTF8 ); rtl::OUString aFilterName(aFileFormats[1].pFilterName, strlen(aFileFormats[1].pFilterName), RTL_TEXTENCODING_UTF8) ; rtl::OUString aFilterType(aFileFormats[1].pTypeName, strlen(aFileFormats[1].pTypeName), RTL_TEXTENCODING_UTF8); commit 95550e469b5b0fa90401235be8398ecd73dec11d Author: Michael Stahl mst...@redhat.com Date: Mon Oct 24 21:22:17 2011 +0200 PrintFontManager: don't look at empty path entires diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index 0028f04..80cddee 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -2190,6 +2190,10 @@ void PrintFontManager::initialize() { OString aToken = aPath.getToken( 0, ';', nIndex ); normPath( aToken ); +if (!aToken.getLength()) +{ +continue; +} // if registering an app-specific fontdir with fontconfig fails // and fontconfig-based substitutions are enabled // then trying to use these app-specific fonts doesn't make sense ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa sc/source
sc/qa/unit/ucalc.cxx | 57 +- sc/source/core/data/cell2.cxx |2 - 2 files changed, 52 insertions(+), 7 deletions(-) New commits: commit 16cf673187679b3f45f2623bc6e3a52bf7dbba45 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Thu Oct 20 19:16:06 2011 +0200 improve unit test for UpdateReference check InsertTabs/InsertTab/DeleteTabs too diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 19741ed..232a62e 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -237,7 +237,7 @@ public: void testAutofilter(); void testCopyPaste(); void testMergedCells(); -void testSheetDelete(); +void testUpdateReference(); /** * Make sure the sheet streams are invalidated properly. @@ -282,7 +282,7 @@ public: CPPUNIT_TEST(testAutofilter); CPPUNIT_TEST(testCopyPaste); CPPUNIT_TEST(testMergedCells); -CPPUNIT_TEST(testSheetDelete); +CPPUNIT_TEST(testUpdateReference); CPPUNIT_TEST_SUITE_END(); private: @@ -2312,32 +2312,77 @@ void Test::testMergedCells() m_pDoc-DeleteTab(0); } -void Test::testSheetDelete() +void Test::testUpdateReference() { //test that formulas are correctly updated during sheet delete //TODO: add test cases for InsertTabs/InsertTab and DeleteTabs //TODO: add tests for references to other sheets, relative references, updating of named ranges, ... //TODO: maybe rename then to testUpdateReference -m_pDoc-InsertTab(0, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(Sheet1))); -m_pDoc-InsertTab(1, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(Sheet2))); -m_pDoc-InsertTab(2, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(Sheet3))); +rtl::OUString aSheet1(RTL_CONSTASCII_USTRINGPARAM(Sheet1)); +rtl::OUString aSheet2(RTL_CONSTASCII_USTRINGPARAM(Sheet2)); +rtl::OUString aSheet3(RTL_CONSTASCII_USTRINGPARAM(Sheet3)); +rtl::OUString aSheet4(RTL_CONSTASCII_USTRINGPARAM(Sheet4)); +m_pDoc-InsertTab(0, aSheet1); +m_pDoc-InsertTab(1, aSheet2); +m_pDoc-InsertTab(2, aSheet3); +m_pDoc-InsertTab(3, aSheet4); 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, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(=A1+B1))); +m_pDoc-SetString(2,1,2, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(=Sheet4.B2+A1))); double aValue; m_pDoc-GetValue(2,0,2, aValue); CPPUNIT_ASSERT_MESSAGE(formula does not return correct result, aValue == 3); +m_pDoc-GetValue(2,1,2, aValue); +CPPUNIT_ASSERT_MESSAGE(formula does not return correct result, aValue == 5); //test deleting both sheets: one is not directly before the sheet, the other one is m_pDoc-DeleteTab(0); m_pDoc-GetValue(2,0,1, aValue); CPPUNIT_ASSERT_MESSAGE(after deleting first sheet formula does not return correct result, aValue == 3); +m_pDoc-GetValue(2,1,1, aValue); +CPPUNIT_ASSERT_MESSAGE(after deleting first sheet formula does not return correct result, aValue == 5); m_pDoc-DeleteTab(0); m_pDoc-GetValue(2,0,0, aValue); CPPUNIT_ASSERT_MESSAGE(after deleting second sheet formula does not return correct result, aValue == 3); +m_pDoc-GetValue(2,1,0, aValue); +CPPUNIT_ASSERT_MESSAGE(after deleting second sheet formula does not return correct result, aValue == 5); + +//test adding two sheets +m_pDoc-InsertTab(0, aSheet2); +m_pDoc-GetValue(2,0,1, aValue); +CPPUNIT_ASSERT_MESSAGE(after inserting first sheet formula does not return correct result, aValue == 3); +m_pDoc-GetValue(2,1,1, aValue); +CPPUNIT_ASSERT_MESSAGE(after inserting first sheet formula does not return correct result, aValue == 5); + +m_pDoc-InsertTab(0, aSheet1); +m_pDoc-GetValue(2,0,2, aValue); +CPPUNIT_ASSERT_MESSAGE(after inserting second sheet formula does not return correct result, aValue == 3); +m_pDoc-GetValue(2,1,2, aValue); +CPPUNIT_ASSERT_MESSAGE(after inserting second sheet formula does not return correct result, aValue == 5); + +m_pDoc-DeleteTabs(0, 2); +m_pDoc-GetValue(2, 0, 0, aValue); +CPPUNIT_ASSERT_MESSAGE(after deleting sheets formula does not return correct result, aValue == 3); +m_pDoc-GetValue(2, 1, 0, aValue); +CPPUNIT_ASSERT_MESSAGE(after deleting sheets formula does not return correct result, aValue == 5); + +std::vectorrtl::OUString aSheets; +aSheets.push_back(aSheet1); +aSheets.push_back(aSheet2); +m_pDoc-InsertTabs(0, aSheets, false, true); +m_pDoc-GetValue(2, 0, 2, aValue); +rtl::OUString aFormula; +m_pDoc-GetFormula(2,0,2, aFormula); +std::cout formel: rtl::OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8).getStr() std::endl; +std::cout std::endl aValue std::endl; +CPPUNIT_ASSERT_MESSAGE(after inserting sheets formula does not return correct result, aValue == 3); +m_pDoc-GetValue(2, 1, 2, aValue); +
[Libreoffice-commits] .: 2 commits - sc/qa
sc/qa/unit/filters-test.cxx | 23 + sc/qa/unit/helper/debughelper.hxx | 170 ++ sc/qa/unit/ucalc.cxx | 124 --- 3 files changed, 195 insertions(+), 122 deletions(-) New commits: commit d9604fa1b4123da145fc9b52901b42888d25ca3b Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Thu Oct 20 20:23:15 2011 +0200 add more debug output to see why windows has problems with sc's filters-test diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 8292c38..71a4339 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -43,7 +43,10 @@ #include editeng/justifyitem.hxx #include basic/sbxdef.hxx +#define CALC_DEBUG_OUTPUT 1 + #include helper/csv_handler.hxx +#include helper/debughelper.hxx #include orcus/csv_parser.hpp #include fstream #include string @@ -465,6 +468,26 @@ void ScFiltersTest::testFormats() CPPUNIT_ASSERT_MESSAGE(Failed to load formats.*, xDocSh.Is()); ScDocument* pDoc = xDocSh-GetDocument(); +SheetPrinter StringPrinter( 8, 3); +SheetPrinter ValuePrinter( 8, 3); +for (SCROW nRow = 0; nRow 8; ++nRow) +{ +for (SCCOL nCol = 0; nCol 3; ++nCol) +{ +String aString; +double aVal; +pDoc-GetValue(nCol, nRow, 0, aVal); +pDoc-GetString(nCol, nRow, 0, aString); +ValuePrinter.set(nRow, nCol, rtl::OUString::valueOf(aVal)); +StringPrinter.set(nRow, nCol, aString); +} +} +ValuePrinter.print(Data sheet content: Value); +ValuePrinter.clear(); +StringPrinter.print(Data sheet content: String); +StringPrinter.clear(); + + //output this just for debugging, should make it easier to see which local the numberformatter really used //it helps to understand why some windows build fails in this test LanguageType aLang, aCjkLang, aCtlLang; diff --git a/sc/qa/unit/helper/debughelper.hxx b/sc/qa/unit/helper/debughelper.hxx index ac3e31a..65dc3c2 100644 --- a/sc/qa/unit/helper/debughelper.hxx +++ b/sc/qa/unit/helper/debughelper.hxx @@ -77,7 +77,7 @@ public: maMatrix.set_string(row, col, new OUString(aStr)); } -#if UCALC_DEBUG_OUTPUT +#if CALC_DEBUG_OUTPUT void print(const char* header) const { if (header) @@ -138,7 +138,7 @@ public: */ void printArray() const { -#if UCALC_DEBUG_OUTPUT +#if CALC_DEBUG_OUTPUT MatrixType::size_pair_type ns = maMatrix.size(); for (size_t row = 0; row ns.first; ++row) { diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 9abe9f7..a251360 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -71,7 +71,7 @@ #include iostream #include vector -#define UCALC_DEBUG_OUTPUT 0 +#define CALC_DEBUG_OUTPUT 0 #include helper/debughelper.hxx commit cda653d7d9038fdcab72cfcae37d3d20463693d5 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Thu Oct 20 20:05:33 2011 +0200 extract helper methods for debuging calc tests diff --git a/sc/qa/unit/helper/debughelper.hxx b/sc/qa/unit/helper/debughelper.hxx new file mode 100644 index 000..ac3e31a --- /dev/null +++ b/sc/qa/unit/helper/debughelper.hxx @@ -0,0 +1,170 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the License); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * [ Copyright (C) 2011 Markus Mohrhard markus.mohrh...@googlemail.com (initial developer) ] + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the GPLv3+), or + * the GNU Lesser General Public License Version 3 or later (the LGPLv3+), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +/** + * Print nicely formatted sheet content to stdout. Indispensable when + * debugging the unit test code involving testing of sheet contents. + */ + +#include rtl/strbuf.hxx +#include rtl/ustring.hxx +#include document.hxx + +#ifdef WNT +#define NOMINMAX +#include prewin.h +#include postwin.h +#undef NOMINMAX +#endif + +#define MDDS_HASH_CONTAINER_BOOST 1 +#include mdds/mixed_type_matrix.hpp + +#include iostream + +using namespace ::com::sun::star; +using ::rtl::OUString;
[Libreoffice-commits] .: 2 commits - sc/qa
sc/qa/unit/data/contentCSV/mathematical-functions.csv |4 sc/qa/unit/data/contentCSV/spreadsheet-functions.csv |6 -- sc/qa/unit/data/ods/functions.ods |binary sc/qa/unit/filters-test.cxx |3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) New commits: commit bb549e2d50e548c2deda3af77ac444a4dde35700 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sat Oct 8 23:30:09 2011 +0200 add unit test cases for mathematical functions diff --git a/sc/qa/unit/data/contentCSV/mathematical-functions.csv b/sc/qa/unit/data/contentCSV/mathematical-functions.csv new file mode 100644 index 000..106e570 --- /dev/null +++ b/sc/qa/unit/data/contentCSV/mathematical-functions.csv @@ -0,0 +1,4 @@ +0, 1, 10 +1.5707963268, 0, 3.1415926536 +0, Err:502 +1.5707963268, 2.3561944902, 0.7853981634 diff --git a/sc/qa/unit/data/ods/functions.ods b/sc/qa/unit/data/ods/functions.ods index 10ddcea..4c09824 100644 Binary files a/sc/qa/unit/data/ods/functions.ods and b/sc/qa/unit/data/ods/functions.ods differ diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 525a917..38eb940 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -394,6 +394,9 @@ void ScFiltersTest::testFunctions() //test spreadsheet functions createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(spreadsheet-functions.)), aCSVFileName); testFile(aCSVFileName, pDoc, 1); +//test mathematical functions + createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(mathematical-functions.)), aCSVFileName); +testFile(aCSVFileName, pDoc, 2, PureString); xDocSh-DoClose(); } commit c85b929b532c56c061df4fcfe32734d5db3bd5b8 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sat Oct 8 23:13:01 2011 +0200 extend test for spreadsheet functions diff --git a/sc/qa/unit/data/contentCSV/spreadsheet-functions.csv b/sc/qa/unit/data/contentCSV/spreadsheet-functions.csv index 412ca58..da53433 100644 --- a/sc/qa/unit/data/contentCSV/spreadsheet-functions.csv +++ b/sc/qa/unit/data/contentCSV/spreadsheet-functions.csv @@ -1,2 +1,4 @@ -$C$2, $A$1 -1, 3, 4 +$C$2, $A$1, Sheet.B$2, Sheet!R2C2 +2, 4, 4, 5, 6, 15, 15, 6 +1, 3, 4, 4, 2, 2 +2, 4, 7, 8 diff --git a/sc/qa/unit/data/ods/functions.ods b/sc/qa/unit/data/ods/functions.ods index 4b8c55a..10ddcea 100644 Binary files a/sc/qa/unit/data/ods/functions.ods and b/sc/qa/unit/data/ods/functions.ods differ ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/qa test/user-template
sc/qa/unit/filters-test.cxx |4 ++-- test/user-template/user/basic/dialog.xlc | 10 -- test/user-template/user/basic/script.xlc | 10 -- 3 files changed, 2 insertions(+), 22 deletions(-) New commits: commit eea06c00ab4ea0e26259a1e9f732076709d1026c Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Sep 30 00:43:50 2011 +0200 enable the registration for vba unit test again diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 03a1f5e..8611df0 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -195,8 +195,8 @@ ScDocShellRef FiltersTest::load(const rtl::OUString rFilter, const rtl::OUStrin if (!xDocShRef-DoLoad(aSrcMed)) // load failed. xDocShRef.Clear(); -//else if (nFormatType) -//SfxObjectShell::SetCurrentComponent( xDocShRef-GetModel() ); +else if (nFormatType) +SfxObjectShell::SetCurrentComponent( xDocShRef-GetModel() ); return xDocShRef; } commit 5e733c781fb1344d1906c6b4f3d9c4f032305bbd Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Sep 30 00:42:04 2011 +0200 remove library entries for now maybe add them later and adapt path to something useful diff --git a/test/user-template/user/basic/dialog.xlc b/test/user-template/user/basic/dialog.xlc index b63ebd6..aed4ac2 100644 --- a/test/user-template/user/basic/dialog.xlc +++ b/test/user-template/user/basic/dialog.xlc @@ -1,13 +1,4 @@ ?xml version=1.0 encoding=UTF-8? !DOCTYPE library:libraries PUBLIC -//OpenOffice.org//DTD OfficeDocument 1.0//EN libraries.dtd library:libraries xmlns:library=http://openoffice.org/2000/library; xmlns:xlink=http://www.w3.org/1999/xlink; - library:library library:name=FormWizard xlink:href=$(INST)/share/basic/FormWizard/dialog.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=Template xlink:href=$(INST)/share/basic/Template/dialog.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=Tools xlink:href=$(INST)/share/basic/Tools/dialog.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=Schedule xlink:href=$(INST)/share/basic/Schedule/dialog.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=Gimmicks xlink:href=$(INST)/share/basic/Gimmicks/dialog.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=ImportWizard xlink:href=$(INST)/share/basic/ImportWizard/dialog.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=Euro xlink:href=$(INST)/share/basic/Euro/dialog.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=Depot xlink:href=$(INST)/share/basic/Depot/dialog.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=ScriptBindingLibrary xlink:href=$(INST)/share/basic/ScriptBindingLibrary/dialog.xlb/ xlink:type=simple library:link=true library:readonly=false/ -/library:libraries \ No newline at end of file +/library:libraries diff --git a/test/user-template/user/basic/script.xlc b/test/user-template/user/basic/script.xlc index aaf1b0d..aed4ac2 100644 --- a/test/user-template/user/basic/script.xlc +++ b/test/user-template/user/basic/script.xlc @@ -1,13 +1,4 @@ ?xml version=1.0 encoding=UTF-8? !DOCTYPE library:libraries PUBLIC -//OpenOffice.org//DTD OfficeDocument 1.0//EN libraries.dtd library:libraries xmlns:library=http://openoffice.org/2000/library; xmlns:xlink=http://www.w3.org/1999/xlink; - library:library library:name=FormWizard xlink:href=$(INST)/share/basic/FormWizard/script.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=Template xlink:href=$(INST)/share/basic/Template/script.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=Tools xlink:href=$(INST)/share/basic/Tools/script.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=Schedule xlink:href=$(INST)/share/basic/Schedule/script.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=Gimmicks xlink:href=$(INST)/share/basic/Gimmicks/script.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=ImportWizard xlink:href=$(INST)/share/basic/ImportWizard/script.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=Euro xlink:href=$(INST)/share/basic/Euro/script.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=Depot xlink:href=$(INST)/share/basic/Depot/script.xlb/ xlink:type=simple library:link=true library:readonly=false/ - library:library library:name=ScriptBindingLibrary