[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/qa sc/source
sc/qa/unit/ucalc.cxx | 53 ++ sc/qa/unit/ucalc.hxx |2 + sc/source/core/data/column.cxx|9 -- sc/source/ui/docshell/docfunc.cxx | 18 +--- 4 files changed, 68 insertions(+), 14 deletions(-) New commits: commit 6ce4e50fe452ded99dac075eeaacc7ac03daf383 Author: Laurent Godard lgodard.li...@laposte.net Date: Mon Sep 23 18:08:42 2013 +0200 transport attached notes when moving a block of cell Change-Id: I608be1197cf4177aa67870ff34b61cf1fd67204c diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index fb0d07f..de928da 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3067,6 +3067,59 @@ void Test::testCopyPasteTranspose() m_pDoc-DeleteTab(0); } +void Test::testMoveBlock() +{ +m_pDoc-InsertTab(0, Sheet1); + +m_pDoc-SetValue(0, 0, 0, 1); +m_pDoc-SetString(1, 0, 0, OUString(=A1+1)); +m_pDoc-SetString(2, 0, 0, OUString(test)); + +// add notes to A1:C1 +ScAddress aAdrA1 (0, 0, 0); // numerical cell content +OUString aHelloA1(Hello world in A1); +ScPostIt *pNoteA1 = m_pDoc-GetOrCreateNote(aAdrA1); +pNoteA1-SetText(aAdrA1, aHelloA1); +ScAddress aAdrB1 (1, 0, 0); // formula cell content +OUString aHelloB1(Hello world in B1); +ScPostIt *pNoteB1 = m_pDoc-GetOrCreateNote(aAdrB1); +pNoteB1-SetText(aAdrB1, aHelloB1); +ScAddress aAdrC1 (2, 0, 0); // string cell content +OUString aHelloC1(Hello world in C1); +ScPostIt *pNoteC1 = m_pDoc-GetOrCreateNote(aAdrC1); +pNoteC1-SetText(aAdrC1, aHelloC1); + +// move notes to B1:D1 +bool bCut = true; +ScDocFunc rDocFunc = getDocShell().GetDocFunc(); +bool bMoveDone = rDocFunc.MoveBlock(ScRange(0,0,0,2,0,0), ScAddress( 1, 0, 0), bCut, false, false, false); + +CPPUNIT_ASSERT_MESSAGE(Cells not moved, bMoveDone); + +//check cell content +OUString aString = m_pDoc-GetString(3, 0, 0); +CPPUNIT_ASSERT_MESSAGE(Cell D1 should contain: test, aString.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(test))); +m_pDoc-GetFormula(2, 0, 0, aString); +CPPUNIT_ASSERT_MESSAGE(Cell C1 should contain an updated formula, aString.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(=B1+1))); +double fValue = m_pDoc-GetValue(ScAddress(1, 0, 0)); +ASSERT_DOUBLES_EQUAL_MESSAGE(Cell B1 should contain 1, fValue, 1); + +// cell notes has been moved 1 cell right (event when overlapping) +CPPUNIT_ASSERT_MESSAGE(There should be NO note on A1, !m_pDoc-HasNote(ScAddress(0, 0, 0))); +CPPUNIT_ASSERT_MESSAGE(There should be a note on B1, m_pDoc-HasNote(ScAddress(1, 0, 0))); +CPPUNIT_ASSERT_MESSAGE(There should be a note on C1, m_pDoc-HasNote(ScAddress(2, 0, 0))); +CPPUNIT_ASSERT_MESSAGE(There should be a note on D1, m_pDoc-HasNote(ScAddress(3, 0, 0))); +/* still failing, wrong content ??? +OUString sNoteText; +sNoteText = m_pDoc-GetNote(ScAddress(1, 0, 0))-GetText(); +CPPUNIT_ASSERT_MESSAGE(Note content in B1, sNoteText == aHelloA1); +sNoteText = m_pDoc-GetNote(ScAddress(2, 0, 0))-GetText(); +CPPUNIT_ASSERT_MESSAGE(Note content in C1, sNoteText == aHelloB1); +sNoteText = m_pDoc-GetNote(ScAddress(3, 0, 0))-GetText(); +CPPUNIT_ASSERT_MESSAGE(Note content in D1, sNoteText == aHelloC1); +*/ +m_pDoc-DeleteTab(0); +} void Test::testCopyPasteRelativeFormula() { diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx index 1273241..0a141a3 100644 --- a/sc/qa/unit/ucalc.hxx +++ b/sc/qa/unit/ucalc.hxx @@ -215,6 +215,7 @@ public: void testAutofilter(); void testCopyPaste(); void testCopyPasteTranspose(); +void testMoveBlock(); void testCopyPasteRelativeFormula(); void testMergedCells(); void testUpdateReference(); @@ -348,6 +349,7 @@ public: CPPUNIT_TEST(testAutofilter); CPPUNIT_TEST(testCopyPaste); CPPUNIT_TEST(testCopyPasteTranspose); +CPPUNIT_TEST(testMoveBlock); CPPUNIT_TEST(testCopyPasteRelativeFormula); CPPUNIT_TEST(testMergedCells); CPPUNIT_TEST(testUpdateReference); diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 193c8d3..70df4d0 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1670,7 +1670,7 @@ class CopyAsLinkHandler void duplicateNotes(SCROW nStartRow, size_t nDataSize ) // TODO : notes suboptimal { -// the link status is only for cell content as it is not possible to un-link a note +// the link status is only for cell content as it is not possible to un-link a note -- the note is copied sc::CellNoteStoreType maSrcCellNotes = mrSrcCol.GetCellNoteStore(); SCROW nRowMax = nStartRow + nDataSize; @@ -1885,6 +1885,7 @@ class CopyByCloneHandler aDestPos, true ); mrDestCol.GetDoc().ReleaseNote(aDestPos); mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); +pClonedNote
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/inc sc/qa sc/source
sc/inc/document.hxx|4 sc/inc/postit.hxx | 56 - sc/qa/unit/ucalc.cxx |4 sc/source/core/data/document.cxx | 10 - sc/source/core/data/postit.cxx | 170 - sc/source/filter/excel/excdoc.cxx |2 sc/source/filter/xml/XMLExportIterator.cxx |3 7 files changed, 5 insertions(+), 244 deletions(-) New commits: commit 496dbe3371eb40ab8870413ff36671858d13d1c0 Author: Laurent Godard lgodard.li...@laposte.net Date: Fri Sep 20 11:14:44 2013 +0200 remove ScNotes class Change-Id: I01ed9556ccb2c1f37bcacebe6378eae13d3be8e7 diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 825d83c..b266b2d 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -158,7 +158,6 @@ struct ScColWidthParam; class ScSheetEvents; class ScProgress; class SvtListener; -class ScNotes; class ScEditDataArray; class EditTextObject; struct ScRefCellValue; @@ -893,9 +892,6 @@ public: /** Returns true, if there is any data to create a selection list for rPos. */ boolHasSelectionData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; -/** Returns a table notes container. */ -//SC_DLLPUBLIC ScNotes* GetNotes(SCTAB nTab); - /** Notes **/ SC_DLLPUBLIC ScPostIt* GetNote(const ScAddress rPos); SC_DLLPUBLIC ScPostIt* GetNote(SCCOL nCol, SCROW nRow, SCTAB nTab); diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx index 2b3fe01..8640ebf 100644 --- a/sc/inc/postit.hxx +++ b/sc/inc/postit.hxx @@ -245,62 +245,6 @@ public: bool bAlwaysCreateCaption ); }; -class SC_DLLPUBLIC ScNotes -{ -private: -typedef std::pairSCCOL, SCROW ScAddress2D; -typedef std::mapScAddress2D, ScPostIt* ScNoteMap; -ScNoteMap maNoteMap; - -ScNotes(const ScNotes rNotes); -ScNotes operator=(const ScNotes rNotes); -ScDocument* mpDoc; -public: -ScNotes(ScDocument* pDoc); -~ScNotes(); - -typedef ScNoteMap::iterator iterator; -typedef ScNoteMap::const_iterator const_iterator; - -iterator begin(); -iterator end(); - -const_iterator begin() const; -const_iterator end() const; - -size_t size() const; -bool empty() const; - -//ScPostIt* findByAddress(SCCOL nCol, SCROW nRow); -//const ScPostIt* findByAddress(SCCOL nCol, SCROW nRow) const; -//ScPostIt* findByAddress(const ScAddress rAddress); -//const ScPostIt* findByAddress(const ScAddress rAddress) const; - -/** - * takes ownership of the - */ -bool insert( SCCOL nCol, SCROW nRow, ScPostIt* ); -bool insert( const ScAddress rPos, ScPostIt* ); - -void erase(SCCOL, SCROW, bool bForgetCaption = false); -void erase(const ScAddress rPos); - -/** Returns and forgets the cell note object at the passed cell address. */ -ScPostIt* ReleaseNote( const ScAddress rPos ); -ScPostIt* ReleaseNote( SCCOL nCol, SCROW nRow ); -/** Returns the pointer to an existing or created cell note object at the passed cell address. */ -ScPostIt* GetOrCreateNote( const ScAddress rPos ); - -void clear(); - -void clone(ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bCloneNoteCaption, SCTAB nTab, ScNotes rTarget); -void CopyFromClip(const ScNotes maNotes, ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCsCOL nDx, SCsROW nDy, SCTAB nTab, bool bCloneCaption); - -void erase(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bForgetCaption = false); - -void CreateAllNoteCaptions(SCTAB nTab); -}; - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index b66f0d4..139e7c6f 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3004,10 +3004,10 @@ void Test::testCopyPaste() m_pDoc-CopyFromClip(aRange, aMark, IDF_ALL, NULL, pTransposedClip); //check values after transposed copy/paste - +/* aString = m_pDoc-GetString(3, 3, 2); CPPUNIT_ASSERT_MESSAGE(Cell Sheet3.D4 should contain: test, aString.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(test))); -/* + fValue = m_pDoc-GetValue(ScAddress(3,1,2)); m_pDoc-GetFormula(3,1,2, aString); ASSERT_DOUBLES_EQUAL_MESSAGE(transposed copied formula should return 2, fValue, 2); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 824bb3b..139f679 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -6080,16 +6080,6 @@ bool ScDocument::IsInVBAMode() const return false; } -/* -ScNotes* ScDocument::GetNotes(SCTAB nTab) -{ -if (ValidTab(nTab) nTab static_castSCTAB(maTabs.size())) -return maTabs[nTab]-GetNotes(); - -return NULL; -} -*/ - ScPostIt* ScDocument::GetNote(const ScAddress rPos) { return GetNote(rPos.Col(), rPos.Row(), rPos.Tab()); diff
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source
sc/source/core/data/column.cxx | 20 1 file changed, 20 insertions(+) New commits: commit 515c69a812b3c43d87310157ce30dc7cc51aa0d5 Author: Laurent Godard lgodard.li...@laposte.net Date: Fri Sep 20 12:52:30 2013 +0200 notes clipboard - as link option - not functionnal Change-Id: Ib28d995e2966c04ae845e3b0d112ec08bcc34b59 diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 3438165..08d1a6e 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1666,6 +1666,23 @@ class CopyAsLinkHandler setDefaultAttrsToDest(nTopRow, nDataSize); } +void linkNotes(SCROW nStartRow, size_t nDataSize ) // TODO : notes suboptimal +{ +sc::CellNoteStoreType maSrcCellNotes = mrSrcCol.GetCellNoteStore(); +SCROW nRowMax = nStartRow + nDataSize; + +for (SCROW nRow = nStartRow; nRow nRowMax; ++nRow) +{ +ScPostIt* pSrcNote = maSrcCellNotes.getScPostIt*(nRow); +if (pSrcNote) +{ +ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab()); +mrDestCol.GetDoc().ReleaseNote(aDestPos); +mrDestCol.GetDoc().SetNote(aDestPos, pSrcNote); +} +} +} + public: CopyAsLinkHandler(const ScColumn rSrcCol, ScColumn rDestCol, sc::ColumnBlockPosition* pDestPos, sal_uInt16 nCopyFlags) : mrSrcCol(rSrcCol), mrDestCol(rDestCol), mpDestPos(pDestPos), mnCopyFlags(nCopyFlags) @@ -1684,6 +1701,9 @@ public: { size_t nRow = aNode.position + nOffset; +if (mnCopyFlags (IDF_NOTE|IDF_ADDNOTES)) // +linkNotes(nRow, nDataSize ); // TODO : notes not actually working + switch (aNode.type) { case sc::element_type_numeric: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/qa
sc/qa/unit/ucalc.cxx | 68 --- sc/qa/unit/ucalc.hxx |2 + 2 files changed, 51 insertions(+), 19 deletions(-) New commits: commit 76fc361a4804298084cf5ad99abf373d4132b44c Author: Laurent Godard lgodard.li...@laposte.net Date: Fri Sep 20 13:55:17 2013 +0200 isolate testCopyPasteTranspose Change-Id: I0f01b5785e45371d856f3c2c94706a6f3af652e9 diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 139e7c6f..8488c20 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -2987,42 +2987,72 @@ void Test::testCopyPaste() m_pDoc-GetNote(ScAddress(2, 0, 0))-GetText() == m_pDoc-GetNote(ScAddress(2, 1, 1))-GetText()); -// transpose clipboard, paste and check on Sheet3 -m_pDoc-InsertTab(2, OUString(Sheet3)); +m_pDoc-DeleteTab(1); +m_pDoc-DeleteTab(0); +} + +void Test::testCopyPasteTranspose() +{ + +m_pDoc-InsertTab(0, OUString(Sheet1)); +m_pDoc-InsertTab(1, OUString(Sheet2)); + +m_pDoc-SetValue(0, 0, 0, 1); +m_pDoc-SetValue(1, 0, 0, 2); +m_pDoc-SetString(2, 0, 0, OUString(test)); -aRange = ScRange(0,0,0,2,0,0); +// add notes to A1:C1 +ScAddress aAdrA1 (0, 0, 0); // empty cell content +OUString aHelloA1(Hello world in A1); +ScPostIt *pNoteA1 = m_pDoc-GetOrCreateNote(aAdrA1); +pNoteA1-SetText(aAdrA1, aHelloA1); +ScAddress aAdrB1 (1, 0, 0); // formula cell content +OUString aHelloB1(Hello world in B1); +ScPostIt *pNoteB1 = m_pDoc-GetOrCreateNote(aAdrB1); +pNoteB1-SetText(aAdrB1, aHelloB1); +ScAddress aAdrC1 (2, 0, 0); // string cell content +OUString aHelloC1(Hello world in C1); +ScPostIt *pNoteC1 = m_pDoc-GetOrCreateNote(aAdrC1); +pNoteC1-SetText(aAdrC1, aHelloC1); + +// transpose clipboard, paste and check on Sheet2 +m_pDoc-InsertTab(1, OUString(Sheet2)); + +ScRange aSrcRange = ScRange(0,0,0,2,0,0); ScDocument aNewClipDoc(SCDOCMODE_CLIP); -copyToClip(m_pDoc, aRange, aNewClipDoc); +copyToClip(m_pDoc, aSrcRange, aNewClipDoc); ::std::auto_ptrScDocument pTransClip; pTransClip.reset(new ScDocument(SCDOCMODE_CLIP)); aNewClipDoc.TransposeClip(pTransClip.get(), IDF_ALL, false); ScDocument* pTransposedClip = pTransClip.release(); -aRange = ScRange(3,1,2,3,3,2);//target: Sheet3.D2:D4 -aMark.SetMarkArea(aRange); -m_pDoc-CopyFromClip(aRange, aMark, IDF_ALL, NULL, pTransposedClip); +ScRange aDestRange = ScRange(3,1,1,3,3,1);//target: Sheet2.D2:D4 +ScMarkData aMark; +aMark.SetMarkArea(aSrcRange); +m_pDoc-CopyFromClip(aDestRange, aMark, IDF_ALL, NULL, pTransposedClip); //check values after transposed copy/paste -/* -aString = m_pDoc-GetString(3, 3, 2); + +OUString aString = m_pDoc-GetString(3, 3, 1); CPPUNIT_ASSERT_MESSAGE(Cell Sheet3.D4 should contain: test, aString.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(test))); -fValue = m_pDoc-GetValue(ScAddress(3,1,2)); -m_pDoc-GetFormula(3,1,2, aString); +// check notes after transposed copy/paste +CPPUNIT_ASSERT_MESSAGE(There should be a note on Sheet2.D2, m_pDoc-HasNote(ScAddress(3, 1, 1))); +CPPUNIT_ASSERT_MESSAGE(There should be a note on Sheet2.D3, m_pDoc-HasNote(ScAddress(3, 2, 1))); +CPPUNIT_ASSERT_MESSAGE(There should be a note on Sheet2.D4, m_pDoc-HasNote(ScAddress(3, 3, 1))); + +/* +double fValue = m_pDoc-GetValue(ScAddress(3,1,1)); +m_pDoc-GetFormula(3,1,1, aString); ASSERT_DOUBLES_EQUAL_MESSAGE(transposed copied formula should return 2, fValue, 2); -CPPUNIT_ASSERT_MESSAGE(transposed formula string was not copied correctly, aString == aFormulaString); -fValue = m_pDoc-GetValue(ScAddress(3,2,3)); + // CPPUNIT_ASSERT_MESSAGE(transposed formula string was not copied correctly, aString == aFormulaString); +fValue = m_pDoc-GetValue(ScAddress(3,2,1)); CPPUNIT_ASSERT_MESSAGE(transposed copied value should be 1, fValue == 1); - -// check notes after transposed copy/paste -CPPUNIT_ASSERT_MESSAGE(There should be a note on Sheet3.D2, m_pDoc-HasNote(ScAddress(3, 1, 2))); -CPPUNIT_ASSERT_MESSAGE(There should be a note on Sheet3.D3, m_pDoc-HasNote(ScAddress(3, 2, 2))); -CPPUNIT_ASSERT_MESSAGE(There should be a note on Sheet3.D4, m_pDoc-HasNote(ScAddress(3, 3, 2))); */ -m_pDoc-DeleteTab(2); m_pDoc-DeleteTab(1); m_pDoc-DeleteTab(0); + } void Test::testCopyPasteRelativeFormula() diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx index e97bb8d..bb48533 100644 --- a/sc/qa/unit/ucalc.hxx +++ b/sc/qa/unit/ucalc.hxx @@ -214,6 +214,7 @@ public: void testDataArea(); void testAutofilter(); void testCopyPaste(); +void testCopyPasteTranspose(); void testCopyPasteRelativeFormula(); void testMergedCells(); void testUpdateReference(); @@ -345,6 +346,7 @@ public: CPPUNIT_TEST(testToggleRefFlag); CPPUNIT_TEST(testAutofilter); CPPUNIT_TEST(testCopyPaste
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source
sc/source/core/data/column.cxx | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) New commits: commit 23b581c56f84824f07244107792d062b6b777cf2 Author: Laurent Godard lgodard.li...@laposte.net Date: Fri Sep 20 15:16:57 2013 +0200 Notes are hard copied on paste special as link Change-Id: Ie5fb136f151396faeb386ce40e9bee473f491841 diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 08d1a6e..aea68e0 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1597,13 +1597,10 @@ void ScColumn::CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn rDes if (bSet) { rDestCol.maCellTextAttrs.set(nDestRow, maCellTextAttrs.getsc::CellTextAttr(nSrcRow)); -ScPostIt* pPostIt = maCellNotes.getScPostIt*(nSrcRow); -rDestCol.maCellNotes.set(nDestRow, pPostIt); } else { rDestCol.maCellTextAttrs.set_empty(nDestRow, nDestRow); -rDestCol.maCellNotes.set_empty(nDestRow, nDestRow); } rDestCol.CellStorageModified(); @@ -1666,8 +1663,9 @@ class CopyAsLinkHandler setDefaultAttrsToDest(nTopRow, nDataSize); } -void linkNotes(SCROW nStartRow, size_t nDataSize ) // TODO : notes suboptimal +void duplicateNotes(SCROW nStartRow, size_t nDataSize ) // TODO : notes suboptimal { +// the link status is only for cell content as it is not possible to un-link a note sc::CellNoteStoreType maSrcCellNotes = mrSrcCol.GetCellNoteStore(); SCROW nRowMax = nStartRow + nDataSize; @@ -1677,8 +1675,11 @@ class CopyAsLinkHandler if (pSrcNote) { ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab()); +ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab() ), + mrDestCol.GetDoc(), + aDestPos, true ); mrDestCol.GetDoc().ReleaseNote(aDestPos); -mrDestCol.GetDoc().SetNote(aDestPos, pSrcNote); +mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); } } } @@ -1701,8 +1702,8 @@ public: { size_t nRow = aNode.position + nOffset; -if (mnCopyFlags (IDF_NOTE|IDF_ADDNOTES)) // -linkNotes(nRow, nDataSize ); // TODO : notes not actually working +if (mnCopyFlags (IDF_NOTE|IDF_ADDNOTES)) +duplicateNotes(nRow, nDataSize ); switch (aNode.type) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/qa
sc/qa/unit/ucalc.cxx | 22 -- sc/qa/unit/ucalc.hxx |8 2 files changed, 16 insertions(+), 14 deletions(-) New commits: commit afe78dd8eb43157dc334613b498e876384b38521 Author: Laurent Godard lgodard.li...@laposte.net Date: Fri Sep 20 16:13:24 2013 +0200 rename enable tests deleting Column and Row regarding notes Change-Id: I2b276b0ccbed80d3c2dcf9bb73b507098f3dc671 diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 8488c20..69f44c6 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3033,7 +3033,7 @@ void Test::testCopyPasteTranspose() m_pDoc-CopyFromClip(aDestRange, aMark, IDF_ALL, NULL, pTransposedClip); //check values after transposed copy/paste - +/* OUString aString = m_pDoc-GetString(3, 3, 1); CPPUNIT_ASSERT_MESSAGE(Cell Sheet3.D4 should contain: test, aString.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(test))); @@ -3042,7 +3042,7 @@ void Test::testCopyPasteTranspose() CPPUNIT_ASSERT_MESSAGE(There should be a note on Sheet2.D3, m_pDoc-HasNote(ScAddress(3, 2, 1))); CPPUNIT_ASSERT_MESSAGE(There should be a note on Sheet2.D4, m_pDoc-HasNote(ScAddress(3, 3, 1))); -/* + double fValue = m_pDoc-GetValue(ScAddress(3,1,1)); m_pDoc-GetFormula(3,1,1, aString); ASSERT_DOUBLES_EQUAL_MESSAGE(transposed copied formula should return 2, fValue, 2); @@ -3931,7 +3931,7 @@ void Test::testShiftCells() m_pDoc-DeleteTab(0); } -void Test::testDeleteRow() +void Test::testNoteDeleteRow() { ScDocument* pDoc = getDocShell().GetDocument(); OUString aSheet1(Sheet1); @@ -3944,15 +3944,16 @@ void Test::testDeleteRow() pNote-SetText(rAddr, aHello); pNote-SetAuthor(aJimBob); +CPPUNIT_ASSERT_MESSAGE(there should be a note, m_pDoc-HasNote(1, 1, 0)); + pDoc-DeleteRow(0, 0, MAXCOL, 0, 1, 1); -/* TODO GetNotes -CPPUNIT_ASSERT(m_pDoc-GetNotes(0)-empty()); -*/ +CPPUNIT_ASSERT_MESSAGE(there should be no more note, !m_pDoc-HasNote(1, 1, 0)); + pDoc-DeleteTab(0); } -void Test::testDeleteCol() +void Test::testNoteDeleteCol() { ScDocument* pDoc = getDocShell().GetDocument(); OUString aSheet1(Sheet1); @@ -3965,11 +3966,12 @@ void Test::testDeleteCol() pNote-SetText(rAddr, aHello); pNote-SetAuthor(aJimBob); +CPPUNIT_ASSERT_MESSAGE(there should be a note, m_pDoc-HasNote(1, 1, 0)); + pDoc-DeleteCol(0, 0, MAXROW, 0, 1, 1); -/* TODO GetNotes -CPPUNIT_ASSERT(m_pDoc-GetNotes(0)-empty()); -*/ +CPPUNIT_ASSERT_MESSAGE(there should be no more note, !m_pDoc-HasNote(1, 1, 0)); + pDoc-DeleteTab(0); } diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx index bb48533..31e1ddc 100644 --- a/sc/qa/unit/ucalc.hxx +++ b/sc/qa/unit/ucalc.hxx @@ -266,8 +266,8 @@ public: void testSort(); void testSortWithFormulaRefs(); void testShiftCells(); -void testDeleteRow(); -void testDeleteCol(); +void testNoteDeleteRow(); +void testNoteDeleteCol(); void testAnchoredRotatedShape(); void testCellTextWidth(); void testEditTextIterator(); @@ -367,8 +367,8 @@ public: CPPUNIT_TEST(testSort); CPPUNIT_TEST(testSortWithFormulaRefs); CPPUNIT_TEST(testShiftCells); -CPPUNIT_TEST(testDeleteRow); -CPPUNIT_TEST(testDeleteCol); +CPPUNIT_TEST(testNoteDeleteRow); +CPPUNIT_TEST(testNoteDeleteCol); CPPUNIT_TEST(testAnchoredRotatedShape); CPPUNIT_TEST(testCellTextWidth); CPPUNIT_TEST(testEditTextIterator); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/qa
sc/qa/unit/ucalc.cxx | 83 +-- 1 file changed, 81 insertions(+), 2 deletions(-) New commits: commit 212305239c1df0b8142c73b554e0f89bcc59b29b Author: Laurent Godard lgodard.li...@laposte.net Date: Thu Sep 19 16:30:34 2013 +0200 unit test notes copy/paste clipboard transpose - test on clipboard transpose fails Change-Id: I3d2ecd43a3aab86639cb01d9eeb7c0d0d5a1de5d diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 4891e13..b66f0d4 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -1497,11 +1497,18 @@ void Test::testSheetCopy() bool bHidden = m_pDoc-RowHidden(0, 0, nRow1, nRow2); CPPUNIT_ASSERT_MESSAGE(new sheet should have all rows visible, !bHidden nRow1 == 0 nRow2 == MAXROW); +// insert a note +ScAddress aAdrA1 (0, 0, 0); // empty cell content +OUString aHelloA1(Hello world in A1); +ScPostIt *pNoteA1 = m_pDoc-GetOrCreateNote(aAdrA1); +pNoteA1-SetText(aAdrA1, aHelloA1); + // Copy and test the result. m_pDoc-CopyTab(0, 1); CPPUNIT_ASSERT_MESSAGE(document now should have two sheets., m_pDoc-GetTableCount() == 2); bHidden = m_pDoc-RowHidden(0, 1, nRow1, nRow2); CPPUNIT_ASSERT_MESSAGE(copied sheet should also have all rows visible as the original., !bHidden nRow1 == 0 nRow2 == MAXROW); +CPPUNIT_ASSERT_MESSAGE(There should be note on A1 in new sheet, m_pDoc-HasNote(ScAddress (0, 0, 1))); m_pDoc-DeleteTab(1); m_pDoc-SetRowHidden(5, 10, 0, true); @@ -2895,6 +2902,20 @@ void Test::testCopyPaste() double fValue = m_pDoc-GetValue(ScAddress(1,0,0)); ASSERT_DOUBLES_EQUAL_MESSAGE(formula should return 8, fValue, 8); +// add notes to A1:C1 +ScAddress aAdrA1 (0, 0, 0); // empty cell content +OUString aHelloA1(Hello world in A1); +ScPostIt *pNoteA1 = m_pDoc-GetOrCreateNote(aAdrA1); +pNoteA1-SetText(aAdrA1, aHelloA1); +ScAddress aAdrB1 (1, 0, 0); // formula cell content +OUString aHelloB1(Hello world in B1); +ScPostIt *pNoteB1 = m_pDoc-GetOrCreateNote(aAdrB1); +pNoteB1-SetText(aAdrB1, aHelloB1); +ScAddress aAdrC1 (2, 0, 0); // string cell content +OUString aHelloC1(Hello world in C1); +ScPostIt *pNoteC1 = m_pDoc-GetOrCreateNote(aAdrC1); +pNoteC1-SetText(aAdrC1, aHelloC1); + //copy Sheet1.A1:C1 to Sheet2.A2:C2 ScRange aRange(0,0,0,2,0,0); ScDocument aClipDoc(SCDOCMODE_CLIP); @@ -2917,7 +2938,7 @@ void Test::testCopyPaste() fValue = m_pDoc-GetValue(ScAddress(0,1,1)); CPPUNIT_ASSERT_MESSAGE(copied value should be 1, fValue == 1); -//chack local range name after copying +//check local range name after copying pLocal1 = m_pDoc-GetRangeName(1)-findByUpperName(OUString(LOCAL1)); CPPUNIT_ASSERT_MESSAGE(local range name 1 should be copied, pLocal1); ScRange aRangeLocal1; @@ -2926,13 +2947,26 @@ void Test::testCopyPaste() pLocal2 = m_pDoc-GetRangeName(1)-findByUpperName(OUString(LOCAL2)); CPPUNIT_ASSERT_MESSAGE(local2 should not be copied, pLocal2 == NULL); +// check notes after copying +CPPUNIT_ASSERT_MESSAGE(There should be a note on Sheet2.A2, m_pDoc-HasNote(ScAddress(0, 1, 1))); +CPPUNIT_ASSERT_MESSAGE(There should be a note on Sheet2.B2, m_pDoc-HasNote(ScAddress(1, 1, 1))); +CPPUNIT_ASSERT_MESSAGE(There should be a note on Sheet2.C2, m_pDoc-HasNote(ScAddress(2, 1, 1))); +CPPUNIT_ASSERT_MESSAGE(Note content on Sheet1.A1 not copied to Sheet2.A2, empty cell content, +m_pDoc-GetNote(ScAddress(0, 0, 0))-GetText() == m_pDoc-GetNote(ScAddress(0, 1, 1))-GetText()); +CPPUNIT_ASSERT_MESSAGE(Note content on Sheet1.B1 not copied to Sheet2.B2, formula cell content, +m_pDoc-GetNote(ScAddress(1, 0, 0))-GetText() == m_pDoc-GetNote(ScAddress(1, 1, 1))-GetText()); +CPPUNIT_ASSERT_MESSAGE(Note content on Sheet1.C1 not copied to Sheet2.C2, string cell content, +m_pDoc-GetNote(ScAddress(2, 0, 0))-GetText() == m_pDoc-GetNote(ScAddress(2, 1, 1))-GetText()); //check undo and redo pUndo-Undo(); fValue = m_pDoc-GetValue(ScAddress(1,1,1)); ASSERT_DOUBLES_EQUAL_MESSAGE(after undo formula should return nothing, fValue, 0); aString = m_pDoc-GetString(2, 1, 1); -CPPUNIT_ASSERT_MESSAGE(after undo string should be removed, aString.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM())); +CPPUNIT_ASSERT_MESSAGE(after undo, string should be removed, aString.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM())); +CPPUNIT_ASSERT_MESSAGE(after undo, note on A2 should be removed, !m_pDoc-HasNote(ScAddress(0, 1, 1))); +CPPUNIT_ASSERT_MESSAGE(after undo, note on B2 should be removed, !m_pDoc-HasNote(ScAddress(1, 1, 1))); +CPPUNIT_ASSERT_MESSAGE(after undo, note on C2 should be removed, !m_pDoc-HasNote(ScAddress(2, 1, 1))); pUndo-Redo(); fValue = m_pDoc-GetValue(ScAddress(1,1,1)); @@ -2942,6 +2976,51 @@ void Test::testCopyPaste() m_pDoc
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - 2 commits - sc/source
sc/source/core/data/column.cxx | 25 --- sc/source/core/data/column3.cxx | 43 +--- 2 files changed, 45 insertions(+), 23 deletions(-) New commits: commit ba1b6e1b8fad4cc0aec1a346498ff86608264809 Author: Laurent Godard lgodard.li...@laposte.net Date: Wed Sep 18 11:15:48 2013 +0200 notes clipboard : notes on empty cells are not copied still not working Change-Id: Ic377d4d8626a058508f0a2abf635f593f48adee4 diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 18592fd..bbeafdc 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1322,7 +1322,7 @@ public: { size_t nTopRow = aNode.position + nOffset; -bool isSupportedNodeType = false; +bool bSet = true; switch (aNode.type) { @@ -1333,9 +1333,6 @@ public: sc::numeric_block::const_iterator itEnd = it; std::advance(itEnd, nDataSize); maDestPos.miCellPos = mrDestCol.GetCellStore().set(maDestPos.miCellPos, nTopRow, it, itEnd); - -isSupportedNodeType = true; - } break; case sc::element_type_string: @@ -1345,9 +1342,6 @@ public: sc::string_block::const_iterator itEnd = it; std::advance(itEnd, nDataSize); maDestPos.miCellPos = mrDestCol.GetCellStore().set(maDestPos.miCellPos, nTopRow, it, itEnd); - -isSupportedNodeType = true; - } break; case sc::element_type_edittext: @@ -1364,9 +1358,6 @@ public: maDestPos.miCellPos = mrDestCol.GetCellStore().set( maDestPos.miCellPos, nTopRow, aCloned.begin(), aCloned.end()); - -isSupportedNodeType = true; - } break; case sc::element_type_formula: @@ -1407,19 +1398,16 @@ public: aPos = rDestCells.position(maDestPos.miCellPos, nLastRow+1); sc::SharedFormulaUtil::joinFormulaCellAbove(aPos); } - -isSupportedNodeType = true; - } break; default: +bSet = true; ; } -if (isSupportedNodeType) +if (bSet) { setDefaultAttrsToDest(nTopRow, nDataSize); - if (mbCopyNotes) { //maDestPos.miCellNotePos = mrDestCol.GetCellNoteStore().set(maDestPos.miCellNotePos, nTopRow, it, itEnd); @@ -1439,8 +1427,9 @@ public: mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); } } -} + } } + } }; @@ -1605,6 +1594,10 @@ void ScColumn::CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn rDes bSet = false; } +// copy notes even on empty cells +//ScPostIt* pPostIt = maCellNotes.getScPostIt*(nSrcRow); +//rDestCol.maCellNotes.set(nDestRow, pPostIt); + if (bSet) { rDestCol.maCellTextAttrs.set(nDestRow, maCellTextAttrs.getsc::CellTextAttr(nSrcRow)); diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index d240970..ed3c382 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -972,7 +972,36 @@ public: } break; default: -; +/* TODO : notes - notes of empty cell are note copied */ +/* the following code does not solve it */ +{ +if (bCopyCellNotes) +{ +sc::formula_block::const_iterator it = sc::formula_block::begin(*node.data); +std::advance(it, nOffset); +sc::formula_block::const_iterator itEnd = it; +std::advance(itEnd, nDataSize); +for (SCROW nSrcRow = nSrcRow1; it != itEnd; ++it, ++nSrcRow) +{ +sc::CellNoteStoreType maCellNotesSrc = mrSrcCol.GetCellNoteStore(); +sc::CellNoteStoreType::position_type aPos = maCellNotesSrc.position(nSrcRow); +sc::CellNoteStoreType::iterator itNotes = aPos.first; +if (itNotes-type == sc::element_type_cellnote) +{ +ScPostIt* pSrcNote = maCellNotesSrc.getScPostIt*(nSrcRow); +if (pSrcNote) +{ +ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nSrcRow+mnRowOffset, mrDestCol.GetTab()); +ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nSrcRow, mrSrcCol.GetTab() ), + mrDestCol.GetDoc
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source
sc/source/core/data/column.cxx | 159 +--- sc/source/core/data/column3.cxx | 143 --- 2 files changed, 166 insertions(+), 136 deletions(-) New commits: commit aba27154d984f0793bef38ab19bb64b2f92bbb25 Author: Laurent Godard lgodard.li...@laposte.net Date: Wed Sep 18 14:26:55 2013 +0200 notes clipboard : copyTo an copyFrom clipboards handler refactoring a unit test segfault though Change-Id: I90623a2ed127e84b14eeb8f909b41d921b82cb8f diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index bbeafdc..2d67b27 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1302,6 +1302,35 @@ class CopyToClipHandler } } +void duplicateNotes(SCROW nStartRow, size_t nOffset, size_t nDataSize ) +{ +sc::CellNoteStoreType maSrcCellNotes = mrSrcCol.GetCellNoteStore(); +std::vectorScPostIt* aNotes; +aNotes.reserve(nDataSize); +SCROW nRow = nStartRow; + +sc::CellNoteStoreType::const_iterator itNote = maSrcCellNotes.begin(); +std::advance(itNote, nOffset); +sc::CellNoteStoreType::const_iterator itNoteEnd = itNote; +std::advance(itNoteEnd, nDataSize); + +for (; itNote != itNoteEnd; ++itNote, ++nRow) +{ +ScPostIt* pSrcNote = maSrcCellNotes.getScPostIt*(nRow); +if (pSrcNote) +{ +ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab()); +ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab() ), + mrDestCol.GetDoc(), + aDestPos, true ); +aNotes.push_back(pClonedNote); +} +} + +maDestPos.miCellNotePos = mrDestCol.GetCellNoteStore().set( +maDestPos.miCellNotePos, nStartRow, aNotes.begin(), aNotes.end()); +} + public: CopyToClipHandler(const ScColumn rSrcCol, ScColumn rDestCol, sc::ColumnBlockPosition* pDestPos, bool bCopyNotes) : mrSrcCol(rSrcCol), mrDestCol(rDestCol), mpDestPos(pDestPos), mbCopyNotes(bCopyNotes) @@ -1342,6 +1371,7 @@ public: sc::string_block::const_iterator itEnd = it; std::advance(itEnd, nDataSize); maDestPos.miCellPos = mrDestCol.GetCellStore().set(maDestPos.miCellPos, nTopRow, it, itEnd); + } break; case sc::element_type_edittext: @@ -1401,35 +1431,14 @@ public: } break; default: -bSet = true; -; +bSet = false; } if (bSet) -{ setDefaultAttrsToDest(nTopRow, nDataSize); -if (mbCopyNotes) -{ -//maDestPos.miCellNotePos = mrDestCol.GetCellNoteStore().set(maDestPos.miCellNotePos, nTopRow, it, itEnd); -sc::CellNoteStoreType maSrcCellNotes = mrSrcCol.GetCellNoteStore(); -sc::CellNoteStoreType::position_type aPosNotes = maSrcCellNotes.position(nTopRow); -sc::CellNoteStoreType::iterator itNotes = aPosNotes.first; -if (itNotes-type == sc::element_type_cellnote) -{ -ScPostIt* pSrcNote = maSrcCellNotes.getScPostIt*(nTopRow); -if (pSrcNote) -{ -ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nTopRow, mrDestCol.GetTab()); -ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nTopRow, mrSrcCol.GetTab() ), - mrDestCol.GetDoc(), - aDestPos, true ); -mrDestCol.GetDoc().ReleaseNote(aDestPos); -mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); -} -} - } -} +if (mbCopyNotes) +duplicateNotes(nTopRow, nOffset, nDataSize ); } }; @@ -1885,6 +1894,31 @@ public: maDestPos.miCellPos = mrDestCol.GetCellStore().set(maDestPos.miCellPos, nRow, *it); setDefaultAttrToDest(nRow); + +// TODO : notes - copy notes +bool mbCopyNotes = true; +if (mbCopyNotes) +{ +//maDestPos.miCellNotePos = mrDestCol.GetCellNoteStore().set(maDestPos.miCellNotePos, nTopRow, it, itEnd); +sc::CellNoteStoreType maSrcCellNotes = mrSrcCol.GetCellNoteStore(); +sc::CellNoteStoreType::position_type aPosNotes = maSrcCellNotes.position(nRow); +sc::CellNoteStoreType::iterator itNotes = aPosNotes.first
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source
sc/source/core/data/column3.cxx | 12 1 file changed, 8 insertions(+), 4 deletions(-) New commits: commit 12a2fd49f988f3d7e3a2ea5edf32a8f8cde10949 Author: Laurent Godard lgodard.li...@laposte.net Date: Wed Sep 18 14:33:34 2013 +0200 notes : notes of empty cells are now copied Change-Id: I7562e67232f57702d4ba6aad4b6a97351b3ea4af diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index e8076fb..4112ed5 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -753,10 +753,16 @@ public: void operator() (const sc::CellStoreType::value_type node, size_t nOffset, size_t nDataSize) { -if (node.type == sc::element_type_empty) -return; SCROW nSrcRow1 = node.position + nOffset; +bool bCopyCellNotes = mrCxt.isCloneNotes(); + +if (node.type == sc::element_type_empty) +{ +if (bCopyCellNotes) +duplicateNotes(nSrcRow1, nOffset, nDataSize ); +return; +} sal_uInt16 nFlags = mrCxt.getInsertFlag(); bool bNumeric = (nFlags IDF_VALUE) != 0; @@ -767,8 +773,6 @@ public: bool bAsLink = mrCxt.isAsLink(); -bool bCopyCellNotes = mrCxt.isCloneNotes(); - switch (node.type) { case sc::element_type_numeric: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source
sc/source/core/data/table2.cxx | 13 - 1 file changed, 13 deletions(-) New commits: commit 06830e9af19d14a32c95c71cabe3104bad6b6dd5 Author: Laurent Godard lgodard.li...@laposte.net Date: Wed Sep 18 14:35:33 2013 +0200 clean unsused code : notes are now handled at column level in CopyToColumn Change-Id: I91d544f66cbad85ff17fc5adb392781c021a94ac diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 1ac668b..d4f2ece 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1039,19 +1039,6 @@ void ScTable::CopyToTable( if (!bColRowFlags) // Spaltenbreiten/Zeilenhoehen/Flags return; -/* TODO : notes clipboard -//remove old notes -if (nFlags IDF_NOTE) -pDestTab-maNotes.erase(nCol1, nRow1, nCol2, nRow2); - -bool bAddNotes = nFlags (IDF_NOTE | IDF_ADDNOTES); -if (bAddNotes) -{ -bool bCloneCaption = (nFlags IDF_NOCAPTIONS) == 0; -pDestTab-maNotes.CopyFromClip(maNotes, pDestTab-pDocument, nCol1, nRow1, nCol2, nRow2, 0, 0, pDestTab-nTab, bCloneCaption); -} -*/ - if(pDestTab-pDocument-IsUndo() (nFlags IDF_ATTRIB)) { pDestTab-mpCondFormatList.reset(new ScConditionalFormatList(pDestTab-pDocument, *mpCondFormatList)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source
sc/source/core/data/column.cxx | 128 +++- sc/source/core/data/column3.cxx |5 - 2 files changed, 27 insertions(+), 106 deletions(-) New commits: commit 9c085920fdaf3b9dd7769ec2816d5caa6d44a818 Author: Laurent Godard lgodard.li...@laposte.net Date: Wed Sep 18 16:31:11 2013 +0200 copy a sheet now transfers notes + minor changes Change-Id: Ib7cff176f5b4fe12a8edb4ccc5cb65acf6054338 diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 2d67b27..4cdcf9a 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1603,10 +1603,6 @@ void ScColumn::CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn rDes bSet = false; } -// copy notes even on empty cells -//ScPostIt* pPostIt = maCellNotes.getScPostIt*(nSrcRow); -//rDestCol.maCellNotes.set(nDestRow, pPostIt); - if (bSet) { rDestCol.maCellTextAttrs.set(nDestRow, maCellTextAttrs.getsc::CellTextAttr(nSrcRow)); @@ -1856,6 +1852,27 @@ class CopyByCloneHandler } } +void duplicateNotes(SCROW nStartRow, size_t nOffset, size_t nDataSize ) // TODO : notes suboptimal +{ +sc::CellNoteStoreType maSrcCellNotes = mrSrcCol.GetCellNoteStore(); + +for (SCROW nRow = nStartRow; nRow nStartRow + nDataSize; ++nRow) +{ +ScPostIt* pSrcNote = maSrcCellNotes.getScPostIt*(nRow); +ScPostIt* pClonedNote; +if (pSrcNote) +{ +ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab()); +pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab() ), + mrDestCol.GetDoc(), + aDestPos, true ); +mrDestCol.GetDoc().ReleaseNote(aDestPos); +mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); +} +} + +} + public: CopyByCloneHandler(const ScColumn rSrcCol, ScColumn rDestCol, sc::ColumnBlockPosition* pDestPos, sal_uInt16 nCopyFlags) : mrSrcCol(rSrcCol), mrDestCol(rDestCol), mpDestPos(pDestPos), mnCopyFlags(nCopyFlags) @@ -1874,6 +1891,9 @@ public: { size_t nRow = aNode.position + nOffset; +if (mnCopyFlags (IDF_NOTE|IDF_ADDNOTES)) +duplicateNotes(nRow, nOffset, nDataSize ); + switch (aNode.type) { case sc::element_type_numeric: @@ -1894,31 +1914,6 @@ public: maDestPos.miCellPos = mrDestCol.GetCellStore().set(maDestPos.miCellPos, nRow, *it); setDefaultAttrToDest(nRow); - -// TODO : notes - copy notes -bool mbCopyNotes = true; -if (mbCopyNotes) -{ -//maDestPos.miCellNotePos = mrDestCol.GetCellNoteStore().set(maDestPos.miCellNotePos, nTopRow, it, itEnd); -sc::CellNoteStoreType maSrcCellNotes = mrSrcCol.GetCellNoteStore(); -sc::CellNoteStoreType::position_type aPosNotes = maSrcCellNotes.position(nRow); -sc::CellNoteStoreType::iterator itNotes = aPosNotes.first; -if (itNotes-type == sc::element_type_cellnote) -{ -ScPostIt* pSrcNote = maSrcCellNotes.getScPostIt*(nRow); -if (pSrcNote) -{ -ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab()); -ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab() ), - mrDestCol.GetDoc(), - aDestPos, true ); -mrDestCol.GetDoc().ReleaseNote(aDestPos); -mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); -} -} - } - - } } break; @@ -1949,30 +1944,6 @@ public: mrDestCol.GetCellStore().set(maDestPos.miCellPos, nRow, rStr); setDefaultAttrToDest(nRow); } - -// TODO : notes - copy notes -bool mbCopyNotes = true; -if (mbCopyNotes) -{ -//maDestPos.miCellNotePos = mrDestCol.GetCellNoteStore().set(maDestPos.miCellNotePos, nTopRow, it, itEnd); -sc::CellNoteStoreType maSrcCellNotes = mrSrcCol.GetCellNoteStore(); -sc::CellNoteStoreType::position_type aPosNotes = maSrcCellNotes.position(nRow); -sc
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source
sc/source/core/data/column.cxx | 66 sc/source/core/data/column3.cxx | 39 +-- 2 files changed, 43 insertions(+), 62 deletions(-) New commits: commit 7cc10ff6cac7fdac9fcc258cbaaf0fcd8bd890ed Author: Laurent Godard lgodard.li...@laposte.net Date: Wed Sep 18 17:22:32 2013 +0200 refactor copy handlers - no more segfault in unit test - loop on rows is suboptimal Change-Id: I40ce1babc8e54807545a34bd2719df90088b75c2 diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 4cdcf9a..3438165 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1302,33 +1302,24 @@ class CopyToClipHandler } } -void duplicateNotes(SCROW nStartRow, size_t nOffset, size_t nDataSize ) +void duplicateNotes(SCROW nStartRow, size_t nDataSize ) // TODO : notes suboptimal { sc::CellNoteStoreType maSrcCellNotes = mrSrcCol.GetCellNoteStore(); -std::vectorScPostIt* aNotes; -aNotes.reserve(nDataSize); -SCROW nRow = nStartRow; +SCROW nRowMax = nStartRow + nDataSize; -sc::CellNoteStoreType::const_iterator itNote = maSrcCellNotes.begin(); -std::advance(itNote, nOffset); -sc::CellNoteStoreType::const_iterator itNoteEnd = itNote; -std::advance(itNoteEnd, nDataSize); - -for (; itNote != itNoteEnd; ++itNote, ++nRow) +for (SCROW nRow = nStartRow; nRow nRowMax; ++nRow) +{ +ScPostIt* pSrcNote = maSrcCellNotes.getScPostIt*(nRow); +if (pSrcNote) { -ScPostIt* pSrcNote = maSrcCellNotes.getScPostIt*(nRow); -if (pSrcNote) -{ -ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab()); -ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab() ), - mrDestCol.GetDoc(), - aDestPos, true ); -aNotes.push_back(pClonedNote); -} +ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab()); +ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab() ), + mrDestCol.GetDoc(), + aDestPos, true ); +mrDestCol.GetDoc().ReleaseNote(aDestPos); +mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); } - -maDestPos.miCellNotePos = mrDestCol.GetCellNoteStore().set( -maDestPos.miCellNotePos, nStartRow, aNotes.begin(), aNotes.end()); +} } public: @@ -1438,7 +1429,7 @@ public: setDefaultAttrsToDest(nTopRow, nDataSize); if (mbCopyNotes) -duplicateNotes(nTopRow, nOffset, nDataSize ); +duplicateNotes(nTopRow, nDataSize ); } }; @@ -1852,25 +1843,24 @@ class CopyByCloneHandler } } -void duplicateNotes(SCROW nStartRow, size_t nOffset, size_t nDataSize ) // TODO : notes suboptimal +void duplicateNotes(SCROW nStartRow, size_t nDataSize ) // TODO : notes suboptimal { sc::CellNoteStoreType maSrcCellNotes = mrSrcCol.GetCellNoteStore(); +SCROW nRowMax = nStartRow + nDataSize; -for (SCROW nRow = nStartRow; nRow nStartRow + nDataSize; ++nRow) +for (SCROW nRow = nStartRow; nRow nRowMax; ++nRow) +{ +ScPostIt* pSrcNote = maSrcCellNotes.getScPostIt*(nRow); +if (pSrcNote) { -ScPostIt* pSrcNote = maSrcCellNotes.getScPostIt*(nRow); -ScPostIt* pClonedNote; -if (pSrcNote) -{ -ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab()); -pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab() ), - mrDestCol.GetDoc(), - aDestPos, true ); -mrDestCol.GetDoc().ReleaseNote(aDestPos); -mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); -} +ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab()); +ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab() ), + mrDestCol.GetDoc(), + aDestPos, true ); +mrDestCol.GetDoc().ReleaseNote(aDestPos); +mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); } - +} } public: @@ -1892,7 +1882,7 @@ public: size_t nRow = aNode.position + nOffset; if (mnCopyFlags (IDF_NOTE|IDF_ADDNOTES)) -duplicateNotes(nRow
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source
sc/source/core/data/column3.cxx |6 ++- sc/source/core/data/table2.cxx | 61 +++- 2 files changed, 16 insertions(+), 51 deletions(-) New commits: commit a5067431d5e369f6c4bea2241be6e9d6f235c00a Author: Laurent Godard lgodard.li...@laposte.net Date: Wed Sep 18 18:36:19 2013 +0200 clean table notes management - partial - move treatments to column - Transpose clipboard Change-Id: I59d36fcbc440605052cc50f342bf1d091c74ea18 diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index f8ef4c5..0a1127a 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -705,14 +705,16 @@ class CopyCellsFromClipHandler for (SCROW nRow = nStartRow; nRow nRowMax; ++nRow) { + +ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow+mnRowOffset, mrDestCol.GetTab()); +mrDestCol.GetDoc().ReleaseNote(aDestPos); + ScPostIt* pSrcNote = maSrcCellNotes.getScPostIt*(nRow); if (pSrcNote) { -ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow+mnRowOffset, mrDestCol.GetTab()); ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab() ), mrDestCol.GetDoc(), aDestPos, true ); -mrDestCol.GetDoc().ReleaseNote(aDestPos); mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); } } diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index d4f2ece..f1e4035 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -504,16 +504,10 @@ void ScTable::CopyToClip( if (!pTable-mpRangeName mpRangeName) pTable-mpRangeName = new ScRangeName(*mpRangeName); -/* TODO : notes -- move at column level -// notes -maNotes.clone( -pTable-pDocument, nCol1, nRow1, nCol2, nRow2, rCxt.isCloneNotes(), nTab, pTable-maNotes); -*/ - SCCOL i; for ( i = nCol1; i = nCol2; i++) -aCol[i].CopyToClip(rCxt, nRow1, nRow2, pTable-aCol[i]); +aCol[i].CopyToClip(rCxt, nRow1, nRow2, pTable-aCol[i]); // notes are handled at column level // copy widths/heights, and only hidden, filtered and manual flags // also for all preceding columns/rows, to have valid positions for drawing objects @@ -666,8 +660,7 @@ void ScTable::CopyFromClip( if (ValidColRow(nCol1, nRow1) ValidColRow(nCol2, nRow2)) { for ( SCCOL i = nCol1; i = nCol2; i++) -aCol[i].CopyFromClip(rCxt, nRow1, nRow2, nDy, pTable-aCol[i - nDx]); - +aCol[i].CopyFromClip(rCxt, nRow1, nRow2, nDy, pTable-aCol[i - nDx]); // notes are handles at column level if (rCxt.getInsertFlag() == IDF_ATTRIB) { @@ -679,19 +672,6 @@ void ScTable::CopyFromClip( aCol[i].ClearItems(nRow1, nRow2, nWhichArray); } -/* TODO : notes clipboard -//remove old notes -if (rCxt.getInsertFlag() (IDF_NOTE|IDF_ADDNOTES)) -maNotes.erase(nCol1, nRow1, nCol2, nRow2); - -bool bAddNotes = rCxt.getInsertFlag() (IDF_NOTE | IDF_ADDNOTES); -if (bAddNotes) -{ -bool bCloneCaption = (rCxt.getInsertFlag() IDF_NOCAPTIONS) == 0; -maNotes.CopyFromClip(pTable-maNotes, pDocument, nCol1, nRow1, nCol2, nRow2, nDx, nDy, nTab, bCloneCaption); -} -*/ - if ((rCxt.getInsertFlag() IDF_ATTRIB) != 0) { if (nRow1==0 nRow2==MAXROW pColWidth pTable-pColWidth) @@ -950,40 +930,24 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, // Cell Notes - fdo#68381 paste cell notes on Transpose bool bCloneCaption = true; -if ( pDestDoc-HasColNotes(nCol, nTab) ) +if ( pDocument-HasColNotes(nCol, nTab) ) { -sc::CellNoteStoreType maCellNotes = pDestDoc-GetColNotes(nCol, nTab); +sc::CellNoteStoreType maCellNotes = pDocument-GetColNotes(nCol, nTab); for (nRow=nRow1; nRow = nRow2; nRow++) // TODO : notes suboptimal ? { -sc::CellNoteStoreType::position_type aPos = maCellNotes.position(nRow); -sc::CellNoteStoreType::iterator it = aPos.first; -ScPostIt* pNote = maCellNotes.getScPostIt*(nRow); ScAddress aDestPos( static_castSCCOL(nRow-nRow1), static_castSCROW(nCol-nCol1), pTransClip-nTab ); -ScPostIt* pClonedNote = pNote-Clone( ScAddress(nCol, nRow, nTab), *pTransClip-pDocument, aDestPos, bCloneCaption ); - pTransClip-pDocument-ReleaseNote(aDestPos); -pTransClip-pDocument-SetNote(aDestPos, pClonedNote); -} -} -} -/* -// TODO : notes clipboard -// fdo#68381 paste
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source
Rebased ref, commits from common ancestor: commit dc7c410e8a2ed4074cedd6beea4c134cc098c2dc Author: Laurent Godard lgodard.li...@laposte.net Date: Wed Sep 18 18:36:19 2013 +0200 clean table notes management - partial - move treatments to column - Transpose clipboard Change-Id: I59d36fcbc440605052cc50f342bf1d091c74ea18 diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index f8ef4c5..0a1127a 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -705,14 +705,16 @@ class CopyCellsFromClipHandler for (SCROW nRow = nStartRow; nRow nRowMax; ++nRow) { + +ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow+mnRowOffset, mrDestCol.GetTab()); +mrDestCol.GetDoc().ReleaseNote(aDestPos); + ScPostIt* pSrcNote = maSrcCellNotes.getScPostIt*(nRow); if (pSrcNote) { -ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nRow+mnRowOffset, mrDestCol.GetTab()); ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab() ), mrDestCol.GetDoc(), aDestPos, true ); -mrDestCol.GetDoc().ReleaseNote(aDestPos); mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); } } diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index d4f2ece..433f61d 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -504,16 +504,10 @@ void ScTable::CopyToClip( if (!pTable-mpRangeName mpRangeName) pTable-mpRangeName = new ScRangeName(*mpRangeName); -/* TODO : notes -- move at column level -// notes -maNotes.clone( -pTable-pDocument, nCol1, nRow1, nCol2, nRow2, rCxt.isCloneNotes(), nTab, pTable-maNotes); -*/ - SCCOL i; for ( i = nCol1; i = nCol2; i++) -aCol[i].CopyToClip(rCxt, nRow1, nRow2, pTable-aCol[i]); +aCol[i].CopyToClip(rCxt, nRow1, nRow2, pTable-aCol[i]); // notes are handled at column level // copy widths/heights, and only hidden, filtered and manual flags // also for all preceding columns/rows, to have valid positions for drawing objects @@ -666,8 +660,7 @@ void ScTable::CopyFromClip( if (ValidColRow(nCol1, nRow1) ValidColRow(nCol2, nRow2)) { for ( SCCOL i = nCol1; i = nCol2; i++) -aCol[i].CopyFromClip(rCxt, nRow1, nRow2, nDy, pTable-aCol[i - nDx]); - +aCol[i].CopyFromClip(rCxt, nRow1, nRow2, nDy, pTable-aCol[i - nDx]); // notes are handles at column level if (rCxt.getInsertFlag() == IDF_ATTRIB) { @@ -679,19 +672,6 @@ void ScTable::CopyFromClip( aCol[i].ClearItems(nRow1, nRow2, nWhichArray); } -/* TODO : notes clipboard -//remove old notes -if (rCxt.getInsertFlag() (IDF_NOTE|IDF_ADDNOTES)) -maNotes.erase(nCol1, nRow1, nCol2, nRow2); - -bool bAddNotes = rCxt.getInsertFlag() (IDF_NOTE | IDF_ADDNOTES); -if (bAddNotes) -{ -bool bCloneCaption = (rCxt.getInsertFlag() IDF_NOCAPTIONS) == 0; -maNotes.CopyFromClip(pTable-maNotes, pDocument, nCol1, nRow1, nCol2, nRow2, nDx, nDy, nTab, bCloneCaption); -} -*/ - if ((rCxt.getInsertFlag() IDF_ATTRIB) != 0) { if (nRow1==0 nRow2==MAXROW pColWidth pTable-pColWidth) @@ -950,40 +930,23 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, // Cell Notes - fdo#68381 paste cell notes on Transpose bool bCloneCaption = true; -if ( pDestDoc-HasColNotes(nCol, nTab) ) +if ( pDocument-HasColNotes(nCol, nTab) ) { -sc::CellNoteStoreType maCellNotes = pDestDoc-GetColNotes(nCol, nTab); +sc::CellNoteStoreType maCellNotes = pDocument-GetColNotes(nCol, nTab); for (nRow=nRow1; nRow = nRow2; nRow++) // TODO : notes suboptimal ? { -sc::CellNoteStoreType::position_type aPos = maCellNotes.position(nRow); -sc::CellNoteStoreType::iterator it = aPos.first; -ScPostIt* pNote = maCellNotes.getScPostIt*(nRow); - ScAddress aDestPos( static_castSCCOL(nRow-nRow1), static_castSCROW(nCol-nCol1), pTransClip-nTab ); -ScPostIt* pClonedNote = pNote-Clone( ScAddress(nCol, nRow, nTab), *pTransClip-pDocument, aDestPos, bCloneCaption ); - pTransClip-pDocument-ReleaseNote(aDestPos); -pTransClip-pDocument-SetNote(aDestPos, pClonedNote); -} -} -} -/* -// TODO : notes clipboard -// fdo#68381 paste cell notes on Transpose -bool bCloneCaption = true; -for (ScNotes::const_iterator itr = maNotes.begin(); itr != maNotes.end(); ++itr
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/inc sc/source
sc/inc/clipcontext.hxx |2 + sc/inc/column.hxx | 30 +++ sc/inc/mtvelements.hxx |3 + sc/source/core/data/clipcontext.cxx | 10 - sc/source/core/data/column.cxx | 48 sc/source/core/data/column3.cxx | 70 sc/source/core/data/table2.cxx | 45 ++- 7 files changed, 159 insertions(+), 49 deletions(-) New commits: commit 01b9b4e09fdd9b306d617cdb37d82f48df6d60fe Author: Laurent Godard lgodard.li...@laposte.net Date: Tue Sep 17 12:40:47 2013 +0200 notes clipboard still not working at this stage, at least it builds Change-Id: Ic2deabe2e35ff9e09146a75396f1dda76929864b diff --git a/sc/inc/clipcontext.hxx b/sc/inc/clipcontext.hxx index 8a847bd..dd63ba6 100644 --- a/sc/inc/clipcontext.hxx +++ b/sc/inc/clipcontext.hxx @@ -46,6 +46,7 @@ class CopyFromClipContext : public ClipContextBase sal_uInt16 mnInsertFlag; boolmbAsLink:1; boolmbSkipAttrForEmptyCells:1; +boolmbCloneNotes; CopyFromClipContext(); // disabled @@ -66,6 +67,7 @@ public: sal_uInt16 getInsertFlag() const; bool isAsLink() const; bool isSkipAttrForEmptyCells() const; +bool isCloneNotes() const; }; class CopyToClipContext : public ClipContextBase diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 75270d6..6c01bb2 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -208,22 +208,20 @@ public: boolIsAllAttrEqual( const ScColumn rCol, SCROW nStartRow, SCROW nEndRow ) const; boolTestInsertCol( SCROW nStartRow, SCROW nEndRow) const; -bool TestInsertRow( SCROW nStartRow, SCSIZE nSize ) const; -voidInsertRow( SCROW nStartRow, SCSIZE nSize ); -voidDeleteRow( SCROW nStartRow, SCSIZE nSize ); -voidDeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag ); -void CopyToClip( -sc::CopyToClipContext rCxt, SCROW nRow1, SCROW nRow2, ScColumn rColumn ) const; -void CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn rDestCol); -void CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn rDestCol ); -bool InitBlockPosition( sc::ColumnBlockPosition rBlockPos ); -bool InitBlockPosition( sc::ColumnBlockConstPosition rBlockPos ) const; -void CopyFromClip( -sc::CopyFromClipContext rCxt, SCROW nRow1, SCROW nRow2, long nDy, ScColumn rColumn ); - -void StartListeningInArea( sc::StartListeningContext rCxt, SCROW nRow1, SCROW nRow2 ); - -voidRemoveEditAttribs( SCROW nStartRow, SCROW nEndRow ); +boolTestInsertRow( SCROW nStartRow, SCSIZE nSize ) const; +voidInsertRow( SCROW nStartRow, SCSIZE nSize ); +voidDeleteRow( SCROW nStartRow, SCSIZE nSize ); +voidDeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag ); +voidCopyToClip( sc::CopyToClipContext rCxt, SCROW nRow1, SCROW nRow2, ScColumn rColumn ) const; +voidCopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn rDestCol); +voidCopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn rDestCol ); +boolInitBlockPosition( sc::ColumnBlockPosition rBlockPos ); +boolInitBlockPosition( sc::ColumnBlockConstPosition rBlockPos ) const; +voidCopyFromClip( sc::CopyFromClipContext rCxt, SCROW nRow1, SCROW nRow2, long nDy, ScColumn rColumn ); + +voidStartListeningInArea( sc::StartListeningContext rCxt, SCROW nRow1, SCROW nRow2 ); + +voidRemoveEditAttribs( SCROW nStartRow, SCROW nEndRow ); // Selection (?) of this document void MixMarked( diff --git a/sc/inc/mtvelements.hxx b/sc/inc/mtvelements.hxx index f7dd3cb..818be1b 100644 --- a/sc/inc/mtvelements.hxx +++ b/sc/inc/mtvelements.hxx @@ -118,6 +118,7 @@ struct ColumnBlockPosition CellStoreType::iterator miCellPos; ColumnBlockPosition(): miCellPos() {} + }; struct ColumnBlockConstPosition @@ -128,6 +129,7 @@ struct ColumnBlockConstPosition CellStoreType::const_iterator miCellPos; ColumnBlockConstPosition(): miCellPos() {} + }; class ColumnBlockPositionSet @@ -142,6 +144,7 @@ public: ColumnBlockPositionSet(ScDocument rDoc); ColumnBlockPosition* getBlockPosition(SCTAB nTab, SCCOL nCol); + }; } diff --git a/sc/source/core/data/clipcontext.cxx b/sc/source/core/data/clipcontext.cxx index 782c0f9..8013684 100644 --- a/sc/source/core/data/clipcontext.cxx +++ b/sc/source/core/data/clipcontext.cxx @@ -29,7 +29,10 @@ CopyFromClipContext::CopyFromClipContext(ScDocument rDoc, ClipContextBase(rDoc), mnTabStart(-1), mnTabEnd(-1), mpRefUndoDoc(pRefUndoDoc), mpClipDoc(pClipDoc), mnInsertFlag(nInsertFlag), -mbAsLink(bAsLink), mbSkipAttrForEmptyCells(bSkipAttrForEmptyCells) {} +mbAsLink(bAsLink), mbSkipAttrForEmptyCells(bSkipAttrForEmptyCells), +mbCloneNotes (mnInsertFlag (IDF_NOTE
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source
sc/source/core/data/column.cxx |9 ++-- sc/source/core/data/column3.cxx | 41 2 files changed, 36 insertions(+), 14 deletions(-) New commits: commit 0a09abdf5f33b9d4a283af26b00c8ee8ad8dde14 Author: Laurent Godard lgodard.li...@laposte.net Date: Tue Sep 17 12:57:13 2013 +0200 notes clipboard a note is now copied, but at wrong line Change-Id: Idc3f4ec64007ba4b8430353c0e33c1d8fdbc1b96 diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 1ade76b..18592fd 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1430,9 +1430,14 @@ public: { ScPostIt* pSrcNote = maSrcCellNotes.getScPostIt*(nTopRow); if (pSrcNote) -pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nTopRow, mrSrcCol.GetTab() ), +{ +ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nTopRow, mrDestCol.GetTab()); +ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nTopRow, mrSrcCol.GetTab() ), mrDestCol.GetDoc(), - ScAddress(mrDestCol.GetCol(), nTopRow, mrDestCol.GetTab()), true ); + aDestPos, true ); +mrDestCol.GetDoc().ReleaseNote(aDestPos); +mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); +} } } } diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index d7a6014..19f2aa7 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -769,14 +769,19 @@ public: { ScPostIt* pSrcNote = maCellNotesSrc.getScPostIt*(nSrcRow); if (pSrcNote) -pSrcNote-Clone( ScAddress(mnSrcCol, nSrcRow, mnSrcTab ), +{ +ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nSrcRow, mrDestCol.GetTab()); +ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nSrcRow, mrSrcCol.GetTab() ), mrDestCol.GetDoc(), - ScAddress(mnCol , nSrcRow, mnTab), - true ); + aDestPos, true ); +mrDestCol.GetDoc().ReleaseNote(aDestPos); +mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); +} } } } } + break; case sc::element_type_string: { @@ -803,10 +808,14 @@ public: { ScPostIt* pSrcNote = maCellNotesSrc.getScPostIt*(nSrcRow); if (pSrcNote) -pSrcNote-Clone( ScAddress(mnSrcCol, nSrcRow, mnSrcTab ), +{ +ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nSrcRow, mrDestCol.GetTab()); +ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nSrcRow, mrSrcCol.GetTab() ), mrDestCol.GetDoc(), - ScAddress(mnCol , nSrcRow, mnTab), - true ); + aDestPos, true ); +mrDestCol.GetDoc().ReleaseNote(aDestPos); +mrDestCol.GetDoc().SetNote(aDestPos, pClonedNote); +} } } } @@ -838,10 +847,14 @@ public: { ScPostIt* pSrcNote = maCellNotesSrc.getScPostIt*(nSrcRow); if (pSrcNote) -pSrcNote-Clone( ScAddress(mnSrcCol, nSrcRow, mnSrcTab ), +{ +ScAddress aDestPos = ScAddress(mrDestCol.GetCol(), nSrcRow, mrDestCol.GetTab()); +ScPostIt* pClonedNote = pSrcNote-Clone( ScAddress(mrSrcCol.GetCol(), nSrcRow, mrSrcCol.GetTab() ), mrDestCol.GetDoc(), - ScAddress(mnCol , nSrcRow, mnTab), - true ); + aDestPos, true ); +mrDestCol.GetDoc
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/qa
sc/qa/unit/ucalc.cxx | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) New commits: commit fd3908d780aae8c14769b12f27c6577593c33487 Author: Laurent Godard lgodard.li...@laposte.net Date: Mon Sep 16 10:06:41 2013 +0200 correctly comment failing unit test to be re-worked Change-Id: Ic688c2c2975d2240edb9a7899908a9acd77d973c diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 91cfafd..4891e13 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3693,9 +3693,7 @@ void Test::testSortWithFormulaRefs() aSortData.maKeyState[0].bDoSort = true; aSortData.maKeyState[0].nField = 0; -std::cout Sort std::endl; pDoc-Sort(0, aSortData, false, NULL); -std::cout Sort done std::endl; nEnd = SAL_N_ELEMENTS( aResults ); for ( SCROW i = nStart; i nEnd; ++i ) @@ -3744,18 +3742,16 @@ void Test::testSort() aSortData.maKeyState[0].nField = 1; aSortData.maKeyState[0].bAscending = true; -std::cout Sort test std::endl; -//m_pDoc-Sort(0, aSortData, false, NULL); // TODO : notes crash -std::cout skipped std::endl; +/* TODO : notes crash +m_pDoc-Sort(0, aSortData, false, NULL); // TODO : notes crash + double nVal = m_pDoc-GetValue(1,0,0); ASSERT_DOUBLES_EQUAL(nVal, 1.0); -// check that note is also moved -/* TODO : notes GetNotes -pNote = m_pDoc-GetNote(1, 0, 0); +// check that note is also moved after sorting +pNote = m_pDoc-GetNote(1, 0, 0); //TODO : notes GetNotes CPPUNIT_ASSERT(pNote); */ - clearRange(m_pDoc, ScRange(0, 0, 0, 1, 9, 0)); // Clear A1:B10. { // 0 = empty cell ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/inc sc/source
sc/inc/column.hxx|2 - sc/inc/document.hxx |1 sc/source/core/data/column2.cxx |2 - sc/source/core/data/document.cxx |6 ++- sc/source/core/data/table1.cxx | 62 +--- sc/source/core/data/table2.cxx | 24 - sc/source/ui/navipi/content.cxx | 67 ++- 7 files changed, 105 insertions(+), 59 deletions(-) New commits: commit 0827d9ee3838d10feceea720bf54a2d6299b8353 Author: Laurent Godard lgodard.li...@laposte.net Date: Mon Sep 16 12:24:17 2013 +0200 optim cell notes loops Change-Id: I08a8a85a4353f7c1b3edada947110d49cfc7dddf diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 76f5127..75270d6 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -495,7 +495,7 @@ public: const ScPostIt* GetCellNote( SCROW nRow ) const; void DeleteCellNotes( sc::ColumnBlockPosition rBlockPos, SCROW nRow1, SCROW nRow2 ); void DeleteCellNote( SCROW nRow ); -bool HasCellNote() const; +bool HasCellNotes() const; void SetCellNote( SCROW nRow, ScPostIt* pNote); void SwapCellNotes( SCROW nRow1, SCROW nRow2 ); diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 971b377..825d83c 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -904,6 +904,7 @@ public: void SetNote(SCCOL nCol, SCROW nRow, SCTAB nTab, ScPostIt* pNote); bool HasNote(const ScAddress rPos); bool HasNote(SCCOL nCol, SCROW nRow, SCTAB nTab); +bool HasColNotes(SCCOL nCol, SCTAB nTab); SC_DLLPUBLIC ScPostIt* ReleaseNote(const ScAddress rPos); SC_DLLPUBLIC ScPostIt* ReleaseNote(SCCOL nCol, SCROW nRow, SCTAB nTab); SC_DLLPUBLIC ScPostIt* GetOrCreateNote(const ScAddress rPos); diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index c87a8a2..d7433a4 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1807,7 +1807,7 @@ void ScColumn::DeleteCellNotes( sc::ColumnBlockPosition rBlockPos, SCROW nRow1, maCellNotes.set_empty(rBlockPos.miCellNotePos, nRow1, nRow2); } -bool ScColumn::HasCellNote() const +bool ScColumn::HasCellNotes() const { sc::CellNoteStoreType::const_iterator it = maCellNotes.begin(), itEnd = maCellNotes.end(); for (; it != itEnd; ++it) diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 91b1ccc..824bb3b 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -6121,12 +6121,16 @@ bool ScDocument::HasNote(const ScAddress rPos) { return HasNote(rPos.Col(), rPos.Row(), rPos.Tab()); } - bool ScDocument::HasNote(SCCOL nCol, SCROW nRow, SCTAB nTab) { ScPostIt* pNote = maTabs[nTab]-aCol[nCol].GetCellNote(nRow); return pNote != NULL; } +bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab) +{ +return maTabs[nTab]-aCol[nCol].HasCellNotes(); +} + ScPostIt* ScDocument::ReleaseNote(const ScAddress rPos) { return ReleaseNote(rPos.Col(), rPos.Row(), rPos.Tab()); diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 8ca5d88..8823d6c 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -528,17 +528,20 @@ bool ScTable::GetCellArea( SCCOL rEndCol, SCROW rEndRow ) const if (nRow nMaxY) nMaxY = nRow; } +if ( pDocument-HasColNotes(i, nTab) ) +{ sc::CellNoteStoreType maCellNotes = pDocument-GetColNotes(i, nTab); -for (SCROW r=nMaxY; r =MAXROW; r++) // TODO : notes suboptimal +for (SCROW r=nMaxY; r =MAXROW; r++) // TODO : notes suboptimal ? { ScPostIt* pNote = maCellNotes.getScPostIt*(r); if (pNote) -{ -nMaxY = r; -if (inMaxX) -nMaxX = i; -} +{ +nMaxY = r; +if (inMaxX) +nMaxX = i; +} } + } } rEndCol = nMaxX; @@ -581,15 +584,18 @@ bool ScTable::GetPrintArea( SCCOL rEndCol, SCROW rEndRow, bool bNotes, bool bF } if (bNotes) { -sc::CellNoteStoreType maCellNotes = pDocument-GetColNotes(i, nTab); -for (SCROW r=nMaxY; r =MAXROW; r++) // TODO : notes suboptimal +if ( pDocument-HasColNotes(i, nTab) ) { -ScPostIt* pNote = maCellNotes.getScPostIt*(r); -if (pNote) +sc::CellNoteStoreType maCellNotes = pDocument-GetColNotes(i, nTab); +for (SCROW r=nMaxY
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/inc sc/source
sc/inc/postit.hxx |8 sc/source/core/data/postit.cxx | 29 + 2 files changed, 5 insertions(+), 32 deletions(-) New commits: commit 4f3275fc48a7aa22311b9824ed62276e450df8c2 Author: Laurent Godard lgodard.li...@laposte.net Date: Mon Sep 16 17:28:07 2013 +0200 clean unused methods Change-Id: I249fa9acf2cab8217f859254a34b9073e7280b1d diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx index 26536a1..2b3fe01 100644 --- a/sc/inc/postit.hxx +++ b/sc/inc/postit.hxx @@ -271,11 +271,11 @@ public: size_t size() const; bool empty() const; -ScPostIt* findByAddress(SCCOL nCol, SCROW nRow); -const ScPostIt* findByAddress(SCCOL nCol, SCROW nRow) const; +//ScPostIt* findByAddress(SCCOL nCol, SCROW nRow); +//const ScPostIt* findByAddress(SCCOL nCol, SCROW nRow) const; +//ScPostIt* findByAddress(const ScAddress rAddress); +//const ScPostIt* findByAddress(const ScAddress rAddress) const; -ScPostIt* findByAddress(const ScAddress rAddress); -const ScPostIt* findByAddress(const ScAddress rAddress) const; /** * takes ownership of the */ diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index f72da35..dc0ce56 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -992,34 +992,6 @@ bool ScNotes::empty() const return maNoteMap.empty(); } -ScPostIt* ScNotes::findByAddress(SCCOL nCol, SCROW nRow) -{ -ScNoteMap::iterator itr = maNoteMap.find(std::pairSCCOL, SCROW(nCol, nRow)); -if (itr != maNoteMap.end()) -return itr-second; - -return NULL; -} - -const ScPostIt* ScNotes::findByAddress(SCCOL nCol, SCROW nRow) const -{ -ScNoteMap::const_iterator itr = maNoteMap.find(std::pairSCCOL, SCROW(nCol, nRow)); -if (itr != maNoteMap.end()) -return itr-second; - -return NULL; -} - -ScPostIt* ScNotes::findByAddress(const ScAddress rPos) -{ -return findByAddress(rPos.Col(), rPos.Row()); -} - -const ScPostIt* ScNotes::findByAddress(const ScAddress rPos) const -{ -return findByAddress(rPos.Col(), rPos.Row()); -} - bool ScNotes::insert(SCCOL nCol, SCROW nRow, ScPostIt* pPostIt) { std::pairiterator, bool aResult = maNoteMap.insert(std::pairScAddress2D, ScPostIt*(std::pairSCCOL, SCROW(nCol, nRow), pPostIt)); @@ -1121,6 +1093,7 @@ void ScNotes::CopyFromClip(const ScNotes rNotes, ScDocument* pDoc, SCCOL nCol1, } } + void ScNotes::erase(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bForgetCaption) { ScNotes::iterator itr = maNoteMap.begin(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - 0 commits -
Rebased ref, commits from common ancestor: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source
sc/source/ui/navipi/content.cxx | 57 +--- 1 file changed, 19 insertions(+), 38 deletions(-) New commits: commit 565cf66b93f264e4f6ef65184472c48abe7a9997 Author: Laurent Godard lgodard.li...@laposte.net Date: Fri Sep 13 09:42:58 2013 +0200 notes navigator do not crash anymore these loops are suboptimal - need to refactor using iterator Change-Id: I26507a19b6acc0d319449a455c558bca3c444255 diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index c09baeb..73ec095 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -867,18 +867,12 @@ void ScContentTree::GetNoteStrings() { for (SCCOL nCol=0; nColMAXCOLCOUNT; nCol++) { -sc::CellNoteStoreType maNotes = pDoc-GetColNotes(nCol, nTab); -std::pairsc::CellNoteStoreType::const_iterator,size_t aPos = maNotes.position(0); -sc::CellNoteStoreType::const_iterator it = aPos.first; -size_t nOffset = aPos.second; -size_t nDataSize = 0; -size_t nCurRow = 0; -for (; it != maNotes.end(); ++it, nOffset = 0, nCurRow += nDataSize) +sc::CellNoteStoreType maCellNotes = pDoc-GetColNotes(nCol, nTab); +for (SCROW nRow=0; nRow MAXROWCOUNT; nRow++) // TODO : suboptimal { -nDataSize = it-size - nOffset; -sc::cellnote_block::const_iterator itData = sc::cellnote_block::begin(*it-data); -std::advance(itData, nOffset); -InsertContent(SC_CONTENT_NOTE, lcl_NoteString( **itData )); +ScPostIt* pNote = maCellNotes.getScPostIt*(nRow); +if (pNote) +InsertContent(SC_CONTENT_NOTE, lcl_NoteString( *pNote )); } } } @@ -898,23 +892,19 @@ ScAddress ScContentTree::GetNotePos( sal_uLong nIndex ) for (SCCOL nCol=0; nColMAXCOLCOUNT; nCol++) { sc::CellNoteStoreType maNotes = pDoc-GetColNotes(nCol, nTab); -std::pairsc::CellNoteStoreType::const_iterator,size_t aPos = maNotes.position(0); -sc::CellNoteStoreType::const_iterator it = aPos.first; -size_t nOffset = aPos.second; -size_t nDataSize = 0; -size_t nRow = 0; if (nFound + maNotes.size() = nIndex) { -for (; it != maNotes.end(); ++it, nOffset = 0, nRow += nDataSize) +for (SCROW nRow=0; nRow MAXROWCOUNT; nRow++) // TODO : suboptimal { -nDataSize = it-size - nOffset; if (nFound == nIndex) return ScAddress(nCol, nRow, nTab); ++nFound; } } else +{ nFound += maNotes.size(); +} } } @@ -941,31 +931,22 @@ sal_Bool ScContentTree::NoteStringsChanged() { for (SCCOL nCol=0; nColMAXCOLCOUNT; nCol++) { -sc::CellNoteStoreType maNotes = pDoc-GetColNotes(nCol, nTab); -std::pairsc::CellNoteStoreType::const_iterator,size_t aPos = maNotes.position(0); -sc::CellNoteStoreType::const_iterator it = aPos.first; -size_t nOffset = aPos.second; -size_t nDataSize = 0; -size_t nCurRow = 0; -for (; it != maNotes.end(); ++it, nOffset = 0, nCurRow += nDataSize) +sc::CellNoteStoreType maCellNotes = pDoc-GetColNotes(nCol, nTab); +for (SCROW nRow=0; nRowMAXROWCOUNT; nRow++) // TODO : suboptimal { -nDataSize = it-size - nOffset; -sc::cellnote_block::const_iterator itData = sc::cellnote_block::begin(*it-data); -std::advance(itData, nOffset); -const ScPostIt* pNote = *itData; -if (pNote) -{ -if ( !pEntry ) -bEqual = false; -else +ScPostIt* pNote = maCellNotes.getScPostIt*(nRow); +if (pNote) { -if ( lcl_NoteString( *pNote ) != GetEntryText(pEntry) ) +if ( !pEntry ) bEqual = false; +else +{ +if ( lcl_NoteString( *pNote ) != GetEntryText(pEntry) ) +bEqual = false; -pEntry = NextSibling( pEntry ); +pEntry = NextSibling( pEntry ); +} } -} - } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/source
sc/source/ui/navipi/content.cxx | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) New commits: commit 2df476cc1c48c9e8df559dd0bc4c9d6807fad6df Author: Laurent Godard lgodard.li...@laposte.net Date: Fri Sep 13 10:16:45 2013 +0200 notes navigator : reach correct cell Change-Id: I66ec8db438c0ed22bc8bdf469830fbb839b08e14 diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 73ec095..0afe65d 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -868,7 +868,7 @@ void ScContentTree::GetNoteStrings() for (SCCOL nCol=0; nColMAXCOLCOUNT; nCol++) { sc::CellNoteStoreType maCellNotes = pDoc-GetColNotes(nCol, nTab); -for (SCROW nRow=0; nRow MAXROWCOUNT; nRow++) // TODO : suboptimal +for (SCROW nRow=0; nRow MAXROWCOUNT; nRow++) // TODO : notes suboptimal { ScPostIt* pNote = maCellNotes.getScPostIt*(nRow); if (pNote) @@ -891,20 +891,18 @@ ScAddress ScContentTree::GetNotePos( sal_uLong nIndex ) { for (SCCOL nCol=0; nColMAXCOLCOUNT; nCol++) { -sc::CellNoteStoreType maNotes = pDoc-GetColNotes(nCol, nTab); -if (nFound + maNotes.size() = nIndex) -{ -for (SCROW nRow=0; nRow MAXROWCOUNT; nRow++) // TODO : suboptimal +sc::CellNoteStoreType maCellNotes = pDoc-GetColNotes(nCol, nTab); + +for (SCROW nRow=0; nRow MAXROWCOUNT; nRow++) // TODO : notes suboptimal { -if (nFound == nIndex) -return ScAddress(nCol, nRow, nTab); -++nFound; +ScPostIt* pNote = maCellNotes.getScPostIt*(nRow); +if (pNote) +{ +if (nFound == nIndex) +return ScAddress(nCol, nRow, nTab); +++nFound; +} } -} -else -{ -nFound += maNotes.size(); -} } } @@ -932,7 +930,7 @@ sal_Bool ScContentTree::NoteStringsChanged() for (SCCOL nCol=0; nColMAXCOLCOUNT; nCol++) { sc::CellNoteStoreType maCellNotes = pDoc-GetColNotes(nCol, nTab); -for (SCROW nRow=0; nRowMAXROWCOUNT; nRow++) // TODO : suboptimal +for (SCROW nRow=0; nRowMAXROWCOUNT; nRow++) // TODO : notes suboptimal { ScPostIt* pNote = maCellNotes.getScPostIt*(nRow); if (pNote) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/inc sc/qa sc/source
sc/inc/column.hxx |1 sc/inc/mtvelements.hxx |2 sc/inc/table.hxx|7 -- sc/qa/unit/ucalc.cxx|8 ++- sc/source/core/data/column.cxx |4 + sc/source/core/data/column2.cxx | 55 - sc/source/core/data/column3.cxx |7 +- sc/source/core/data/table1.cxx | 101 ++-- sc/source/core/data/table2.cxx | 64 + sc/source/core/data/table3.cxx |5 + 10 files changed, 204 insertions(+), 50 deletions(-) New commits: commit 0be833c05a05b81e72bcddc91463ebaba3e790b9 Author: Laurent Godard lgodard.li...@laposte.net Date: Fri Sep 13 16:48:21 2013 +0200 remove maNotes from ScTable - changed cellnote_block to default_element_block - also cleaned obsolet PositionType in ScColumn::SwapCellTextAttrs - some ucalc tests still not working -- commented out for the moment Change-Id: Ib6e2f425fec0ee0a0393cfab42f8b0699396bcc6 diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 8c5aaeb..76f5127 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -497,6 +497,7 @@ public: void DeleteCellNote( SCROW nRow ); bool HasCellNote() const; void SetCellNote( SCROW nRow, ScPostIt* pNote); +void SwapCellNotes( SCROW nRow1, SCROW nRow2 ); void InterpretDirtyCells( SCROW nRow1, SCROW nRow2 ); diff --git a/sc/inc/mtvelements.hxx b/sc/inc/mtvelements.hxx index c61d0f3..f7dd3cb 100644 --- a/sc/inc/mtvelements.hxx +++ b/sc/inc/mtvelements.hxx @@ -62,7 +62,7 @@ const mdds::mtv::element_t element_type_empty = mdds::mtv::element_type_empty; /// Custom element blocks. -typedef mdds::mtv::noncopyable_managed_element_blockelement_type_cellnote, ScPostIt cellnote_block; +typedef mdds::mtv::default_element_blockelement_type_cellnote, ScPostIt* cellnote_block; typedef mdds::mtv::noncopyable_managed_element_blockelement_type_broadcaster, SvtBroadcaster broadcaster_block; typedef mdds::mtv::default_element_blockelement_type_celltextattr, CellTextAttr celltextattr_block; typedef mdds::mtv::default_element_blockelement_type_string, rtl::OUString string_block; diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index fc8ae3a..9856a5e 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -160,8 +160,6 @@ private: mutable OUString aUpperName; // #i62977# filled only on demand, reset in SetName -boost::scoped_ptrScAddress2DVec mxUninitNotes; - // sort parameter to minimize stack size of quicksort ScSortParam aSortParam; CollatorWrapper*pSortCollator; @@ -182,8 +180,6 @@ private: boost::scoped_ptrScConditionalFormatList mpCondFormatList; -ScNotes maNotes; - boolbScenario:1; boolbLayoutRTL:1; boolbLoadingRTL:1; @@ -377,7 +373,8 @@ public: voidGetFirstDataPos(SCCOL rCol, SCROW rRow) const; voidGetLastDataPos(SCCOL rCol, SCROW rRow) const; -ScNotes*GetNotes(); + // ScNotes*GetNotes(); +ScPostIt* GetNote(const SCCOL nCol, const SCROW nRow); /** Creates the captions of all uninitialized cell notes. @param bForced True = always create all captions, false = skip when Undo is disabled. */ voidInitializeNoteCaptions( bool bForced = false ); diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 07c4d90..91cfafd 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3693,7 +3693,9 @@ void Test::testSortWithFormulaRefs() aSortData.maKeyState[0].bDoSort = true; aSortData.maKeyState[0].nField = 0; +std::cout Sort std::endl; pDoc-Sort(0, aSortData, false, NULL); +std::cout Sort done std::endl; nEnd = SAL_N_ELEMENTS( aResults ); for ( SCROW i = nStart; i nEnd; ++i ) @@ -3742,12 +3744,14 @@ void Test::testSort() aSortData.maKeyState[0].nField = 1; aSortData.maKeyState[0].bAscending = true; -m_pDoc-Sort(0, aSortData, false, NULL); +std::cout Sort test std::endl; +//m_pDoc-Sort(0, aSortData, false, NULL); // TODO : notes crash +std::cout skipped std::endl; double nVal = m_pDoc-GetValue(1,0,0); ASSERT_DOUBLES_EQUAL(nVal, 1.0); // check that note is also moved -/* TODO GetNotes +/* TODO : notes GetNotes pNote = m_pDoc-GetNote(1, 0, 0); CPPUNIT_ASSERT(pNote); */ diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 381dc98..3018747 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -887,6 +887,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2) } SwapCellTextAttrs(nRow1, nRow2); +SwapCellNotes(nRow1, nRow2); CellStorageModified(); BroadcastCells(aRows); return; @@ -934,6 +935,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2) } SwapCellTextAttrs(nRow1, nRow2); +SwapCellNotes(nRow1
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - sc/inc sc/qa sc/source
Rebased ref, commits from common ancestor: commit 8a1936654e42750780ee0271b1abf1941024fdac Author: Laurent Godard lgodard.li...@laposte.net Date: Fri Sep 13 16:48:21 2013 +0200 remove maNotes from ScTable - many action reported at column level (swap, insert, delete...) - changed cellnote_block to default_element_block - also cleaned obsolet PositionType in ScColumn::SwapCellTextAttrs - some ucalc tests still not working -- commented out for the moment Change-Id: Ib6e2f425fec0ee0a0393cfab42f8b0699396bcc6 diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 8c5aaeb..76f5127 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -497,6 +497,7 @@ public: void DeleteCellNote( SCROW nRow ); bool HasCellNote() const; void SetCellNote( SCROW nRow, ScPostIt* pNote); +void SwapCellNotes( SCROW nRow1, SCROW nRow2 ); void InterpretDirtyCells( SCROW nRow1, SCROW nRow2 ); diff --git a/sc/inc/mtvelements.hxx b/sc/inc/mtvelements.hxx index c61d0f3..f7dd3cb 100644 --- a/sc/inc/mtvelements.hxx +++ b/sc/inc/mtvelements.hxx @@ -62,7 +62,7 @@ const mdds::mtv::element_t element_type_empty = mdds::mtv::element_type_empty; /// Custom element blocks. -typedef mdds::mtv::noncopyable_managed_element_blockelement_type_cellnote, ScPostIt cellnote_block; +typedef mdds::mtv::default_element_blockelement_type_cellnote, ScPostIt* cellnote_block; typedef mdds::mtv::noncopyable_managed_element_blockelement_type_broadcaster, SvtBroadcaster broadcaster_block; typedef mdds::mtv::default_element_blockelement_type_celltextattr, CellTextAttr celltextattr_block; typedef mdds::mtv::default_element_blockelement_type_string, rtl::OUString string_block; diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index fc8ae3a..3679c89 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -160,8 +160,6 @@ private: mutable OUString aUpperName; // #i62977# filled only on demand, reset in SetName -boost::scoped_ptrScAddress2DVec mxUninitNotes; - // sort parameter to minimize stack size of quicksort ScSortParam aSortParam; CollatorWrapper*pSortCollator; @@ -182,8 +180,6 @@ private: boost::scoped_ptrScConditionalFormatList mpCondFormatList; -ScNotes maNotes; - boolbScenario:1; boolbLayoutRTL:1; boolbLoadingRTL:1; @@ -377,7 +373,7 @@ public: voidGetFirstDataPos(SCCOL rCol, SCROW rRow) const; voidGetLastDataPos(SCCOL rCol, SCROW rRow) const; -ScNotes*GetNotes(); +ScPostIt* GetNote(const SCCOL nCol, const SCROW nRow); /** Creates the captions of all uninitialized cell notes. @param bForced True = always create all captions, false = skip when Undo is disabled. */ voidInitializeNoteCaptions( bool bForced = false ); diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 07c4d90..91cfafd 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3693,7 +3693,9 @@ void Test::testSortWithFormulaRefs() aSortData.maKeyState[0].bDoSort = true; aSortData.maKeyState[0].nField = 0; +std::cout Sort std::endl; pDoc-Sort(0, aSortData, false, NULL); +std::cout Sort done std::endl; nEnd = SAL_N_ELEMENTS( aResults ); for ( SCROW i = nStart; i nEnd; ++i ) @@ -3742,12 +3744,14 @@ void Test::testSort() aSortData.maKeyState[0].nField = 1; aSortData.maKeyState[0].bAscending = true; -m_pDoc-Sort(0, aSortData, false, NULL); +std::cout Sort test std::endl; +//m_pDoc-Sort(0, aSortData, false, NULL); // TODO : notes crash +std::cout skipped std::endl; double nVal = m_pDoc-GetValue(1,0,0); ASSERT_DOUBLES_EQUAL(nVal, 1.0); // check that note is also moved -/* TODO GetNotes +/* TODO : notes GetNotes pNote = m_pDoc-GetNote(1, 0, 0); CPPUNIT_ASSERT(pNote); */ diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 381dc98..3018747 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -887,6 +887,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2) } SwapCellTextAttrs(nRow1, nRow2); +SwapCellNotes(nRow1, nRow2); CellStorageModified(); BroadcastCells(aRows); return; @@ -934,6 +935,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2) } SwapCellTextAttrs(nRow1, nRow2); +SwapCellNotes(nRow1, nRow2); CellStorageModified(); BroadcastCells(aRows); return; @@ -978,6 +980,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2) } SwapCellTextAttrs(nRow1, nRow2); +SwapCellNotes(nRow1, nRow2); CellStorageModified(); BroadcastCells(aRows); return; @@ -,6 +1114,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2) } SwapCellTextAttrs(nRow1, nRow2); +SwapCellNotes(nRow1, nRow2
[Libreoffice-commits] core.git: Branch 'feature/sc-notes-storage' - 2 commits - sc/Library_vbaobj.mk sc/qa sc/source
sc/Library_vbaobj.mk|5 - sc/qa/unit/filters-test.cxx |2 +- sc/qa/unit/ucalc.cxx| 40 +++- sc/source/ui/navipi/content.cxx | 19 --- 4 files changed, 28 insertions(+), 38 deletions(-) New commits: commit 1132ea0a7c5a5b97a155b1bb65468242fc484da8 Author: Laurent Godard lgodard.li...@laposte.net Date: Thu Sep 12 18:30:35 2013 +0200 GetNotes removal - last initial changes Change-Id: I419dd8671f40fdfce5f181cda35415526c72844f diff --git a/sc/Library_vbaobj.mk b/sc/Library_vbaobj.mk index 9146a11..00f31ad 100644 --- a/sc/Library_vbaobj.mk +++ b/sc/Library_vbaobj.mk @@ -21,7 +21,10 @@ $(eval $(call gb_Library_set_precompiled_header,vbaobj,$(SRCDIR)/sc/inc/pch/prec $(eval $(call gb_Library_set_componentfile,vbaobj,sc/util/vbaobj)) -$(eval $(call gb_Library_use_external,vbaobj,boost_headers)) +$(eval $(call gb_Library_use_externals,vbaobj,\ + boost_headers \ + mdds_headers \ +)) $(eval $(call gb_Library_use_api,vbaobj,\ offapi \ diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 23e8675..07c4d90 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3747,8 +3747,10 @@ void Test::testSort() ASSERT_DOUBLES_EQUAL(nVal, 1.0); // check that note is also moved +/* TODO GetNotes pNote = m_pDoc-GetNote(1, 0, 0); CPPUNIT_ASSERT(pNote); +*/ clearRange(m_pDoc, ScRange(0, 0, 0, 1, 9, 0)); // Clear A1:B10. { diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 17e92ad..c09baeb 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -968,25 +968,6 @@ sal_Bool ScContentTree::NoteStringsChanged() } } - -/* -ScNotes* pNotes = pDoc-GetNotes(nTab); -for (ScNotes::const_iterator itr = pNotes-begin(); itr != pNotes-end(); ++itr) -{ -if( const ScPostIt* pNote = itr-second ) -{ -if ( !pEntry ) -bEqual = false; -else -{ -if ( lcl_NoteString( *pNote ) != GetEntryText(pEntry) ) -bEqual = false; - -pEntry = NextSibling( pEntry ); -} -} -} -*/ } if ( pEntry ) commit 0b3822c0efb544d77539eaca097a19f03a04a957 Author: Laurent Godard lgodard.li...@laposte.net Date: Thu Sep 12 18:01:37 2013 +0200 remove GetNotes use - unit tests Change-Id: I6f466b3d5424f8f39c56827e3a70ab205e6ac4cb diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index f6b9b0b..45cd1b2 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -275,7 +275,7 @@ void testContentImpl(ScDocument* pDoc, sal_Int32 nFormat ) //same code for ods, //check notes import ScAddress aAddress(7, 2, 0); -ScPostIt* pNote = pDoc-GetNotes(aAddress.Tab())-findByAddress(aAddress); +ScPostIt* pNote = pDoc-GetNote(aAddress); CPPUNIT_ASSERT_MESSAGE(note not imported, pNote); CPPUNIT_ASSERT_EQUAL_MESSAGE(note text not imported correctly, pNote-GetText(), OUString(Test)); } diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 11b7c0e..23e8675 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -2573,58 +2573,58 @@ void Test::testPostIts() m_pDoc-InsertTab(0, aTabName); ScAddress rAddr(2, 2, 0); // cell C3 -ScPostIt *pNote = m_pDoc-GetNotes(rAddr.Tab())-GetOrCreateNote(rAddr); +ScPostIt *pNote = m_pDoc-GetOrCreateNote(rAddr); pNote-SetText(rAddr, aHello); pNote-SetAuthor(aJimBob); -ScPostIt *pGetNote = m_pDoc-GetNotes(rAddr.Tab())-findByAddress(rAddr); +ScPostIt *pGetNote = m_pDoc-GetNote(rAddr); CPPUNIT_ASSERT_MESSAGE(note should be itself, pGetNote == pNote ); // Insert one row at row 1. bool bInsertRow = m_pDoc-InsertRow(0, 0, MAXCOL, 0, 1, 1); CPPUNIT_ASSERT_MESSAGE(failed to insert row, bInsertRow ); -CPPUNIT_ASSERT_MESSAGE(note hasn't moved, m_pDoc-GetNotes(rAddr.Tab())-findByAddress(rAddr) == NULL); +CPPUNIT_ASSERT_MESSAGE(note hasn't moved, m_pDoc-GetNote(rAddr) == NULL); rAddr.IncRow(); // cell C4 -CPPUNIT_ASSERT_MESSAGE(note not there, m_pDoc-GetNotes(rAddr.Tab())-findByAddress(rAddr) == pNote); +CPPUNIT_ASSERT_MESSAGE(note not there, m_pDoc-GetNote(rAddr) == pNote); // Insert column at column A. bool bInsertCol = m_pDoc-InsertCol(0, 0, MAXROW, 0, 1, 1); CPPUNIT_ASSERT_MESSAGE(failed to insert column, bInsertCol ); -CPPUNIT_ASSERT_MESSAGE(note hasn't moved, m_pDoc-GetNotes(rAddr.Tab())-findByAddress(rAddr) == NULL); +CPPUNIT_ASSERT_MESSAGE(note hasn't moved, m_pDoc-GetNote(rAddr) == NULL); rAddr.IncCol(); // cell D4 -CPPUNIT_ASSERT_MESSAGE(note not there, m_pDoc-GetNotes(rAddr.Tab())-findByAddress(rAddr) == pNote
[Libreoffice-commits] core.git: Changes to 'feature/sc-notes-storage'
New branch 'feature/sc-notes-storage' available with the following commits: commit 6d4756f77abc7d134d47ee92c2cd2a91ff4608b6 Author: Laurent Godard lgodard.li...@laposte.net Date: Wed Sep 11 09:06:24 2013 +0200 first dummy commit on that branch Change-Id: I34ea91e360e2a6b85d65f970c6e43db687d213ca ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/qa
sc/qa/unit/subsequent_export-test.cxx | 80 ++ 1 file changed, 80 insertions(+) New commits: commit 673881b8fbdc3e0b66d7042221ff9532a49fc044 Author: Laurent Godard lgodard.li...@laposte.net Date: Fri Aug 30 17:19:11 2013 +0200 calc export test on cell values, strings formulas Change-Id: I5e55da683423a461638b2235e25d5556fd77221a Reviewed-on: https://gerrit.libreoffice.org/5698 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index c26d115..bd69cc1 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -29,6 +29,8 @@ #include formulacell.hxx #include tokenarray.hxx #include editutil.hxx +#include scopetools.hxx +#include cellvalue.hxx #include svx/svdoole2.hxx #include tabprotection.hxx @@ -64,6 +66,8 @@ public: void testNamedRangeBugfdo62729(); void testRichTextExportODS(); +void testCellValuesExportODS(); + void testInlineArrayXLS(); void testEmbeddedChartXLS(); void testFormulaReferenceXLS(); @@ -81,6 +85,7 @@ public: CPPUNIT_TEST(testMiscRowHeightExport); CPPUNIT_TEST(testNamedRangeBugfdo62729); CPPUNIT_TEST(testRichTextExportODS); +CPPUNIT_TEST(testCellValuesExportODS); CPPUNIT_TEST(testInlineArrayXLS); CPPUNIT_TEST(testEmbeddedChartXLS); CPPUNIT_TEST(testFormulaReferenceXLS); @@ -564,6 +569,81 @@ void ScExportTest::testRichTextExportODS() xNewDocSh3-DoClose(); } +void ScExportTest::testCellValuesExportODS() +{ +// Start with an empty document +ScDocShellRef xOrigDocSh = loadDoc(empty., ODS); +ScDocument* pDoc = xOrigDocSh-GetDocument(); +CPPUNIT_ASSERT(pDoc); +CPPUNIT_ASSERT_MESSAGE(This document should at least have one sheet., pDoc-GetTableCount() 0); + +// set a value double +pDoc-SetValue(ScAddress(0,0,0), 2.0); // A1 + +// set a formula +pDoc-SetValue(ScAddress(2,0,0), 3.0); // C1 +pDoc-SetValue(ScAddress(3,0,0), 3); // D1 +pDoc-SetString(ScAddress(4,0,0), =10*C1/4); // E1 +pDoc-SetValue(ScAddress(5,0,0), 3.0); // F1 +pDoc-SetString(ScAddress(7,0,0), =SUM(C1:F1)); //H1 + +// set a string +pDoc-SetString(ScAddress(0,2,0), a simple line); //A3 + +// set a digit string +pDoc-SetString(ScAddress(0,4,0), '12); //A5 +// set a contiguous value +pDoc-SetValue(ScAddress(0,5,0), 12.0); //A6 +// set acontiguous string +pDoc-SetString(ScAddress(0,6,0), a string); //A7 +// set a contiguous formula +pDoc-SetString(ScAddress(0,7,0), =$A$6); //A8 + +// save and reload +ScDocShellRef xNewDocSh = saveAndReload(xOrigDocSh, ODS); +xOrigDocSh-DoClose(); +CPPUNIT_ASSERT(xNewDocSh.Is()); +pDoc = xNewDocSh-GetDocument(); +CPPUNIT_ASSERT(pDoc); +CPPUNIT_ASSERT_MESSAGE(Reloaded document should at least have one sheet., pDoc-GetTableCount() 0); + +// check value +CPPUNIT_ASSERT_EQUAL(2.0, pDoc-GetValue(0,0,0)); +CPPUNIT_ASSERT_EQUAL(3.0, pDoc-GetValue(2,0,0)); +CPPUNIT_ASSERT_EQUAL(3.0, pDoc-GetValue(3,0,0)); +CPPUNIT_ASSERT_EQUAL(7.5, pDoc-GetValue(4,0,0)); +CPPUNIT_ASSERT_EQUAL(3.0, pDoc-GetValue(5,0,0)); + +// check formula +if (!checkFormula(*pDoc, ScAddress(4,0,0), 10*C1/4)) +CPPUNIT_FAIL(Wrong formula =10*C1/4); +if (!checkFormula(*pDoc, ScAddress(7,0,0), SUM(C1:F1))) +CPPUNIT_FAIL(Wrong formula =SUM(C1:F1)); +CPPUNIT_ASSERT_EQUAL(16.5, pDoc-GetValue(7,0,0)); + +// check string +ScRefCellValue aCell; +aCell.assign(*pDoc, ScAddress(0,2,0)); +CPPUNIT_ASSERT_EQUAL( CELLTYPE_STRING, aCell.meType ); + +// check for an empty cell +aCell.assign(*pDoc, ScAddress(0,3,0)); +CPPUNIT_ASSERT_EQUAL( CELLTYPE_NONE, aCell.meType); + +// check a digit string +aCell.assign(*pDoc, ScAddress(0,4,0)); +CPPUNIT_ASSERT_EQUAL( CELLTYPE_STRING, aCell.meType); + +//check contiguous values +CPPUNIT_ASSERT_EQUAL( 12.0, pDoc-GetValue(0,5,0) ); +CPPUNIT_ASSERT_EQUAL( OUString(a string), pDoc-GetString(0,6,0) ); +if (!checkFormula(*pDoc, ScAddress(0,7,0), $A$6)) +CPPUNIT_FAIL(Wrong formula =$A$6); +CPPUNIT_ASSERT_EQUAL( pDoc-GetValue(0,5,0), pDoc-GetValue(0,7,0) ); + +xNewDocSh-DoClose(); +} + namespace { void checkMatrixRange(ScDocument rDoc, const ScRange rRange) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/filter/xml/xmlexprt.hxx |2 -- 1 file changed, 2 deletions(-) New commits: commit 89c2136fa093c9d8e21ecaad56329711c8c25079 Author: Laurent Godard lgodard.li...@laposte.net Date: Fri Aug 30 15:12:13 2013 +0200 clean no more used header declaration Change-Id: Id4253c51d43c788310c93acd91ed49fa2fe68c4b Reviewed-on: https://gerrit.libreoffice.org/5695 Reviewed-by: Kohei Yoshida kohei.yosh...@suse.de Tested-by: Kohei Yoshida kohei.yosh...@suse.de diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx index 6c93827..ad5e2b9 100644 --- a/sc/source/filter/xml/xmlexprt.hxx +++ b/sc/source/filter/xml/xmlexprt.hxx @@ -176,8 +176,6 @@ class ScXMLExport : public SvXMLExport bool GetMerged (const com::sun::star::table::CellRangeAddress* pCellRange, const com::sun::star::uno::Reference com::sun::star::sheet::XSpreadsheet xTable); -void GetCellText (ScMyCell rMyCell, const ScAddress aPos) const; - void WriteTable(sal_Int32 nTable, const ::com::sun::star::uno::Reference ::com::sun::star::sheet::XSpreadsheet xTable); void WriteCell(ScMyCell aCell, sal_Int32 nEqualCellCount); void WriteEditCell(const EditTextObject* pText); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/filter/xml/XMLExportIterator.cxx | 13 +- sc/source/filter/xml/XMLExportIterator.hxx |9 sc/source/filter/xml/xmlexprt.cxx | 58 ++--- 3 files changed, 15 insertions(+), 65 deletions(-) New commits: commit f5bafb295559bc3e673ab2aa35e84cb42b9e5f1e Author: Laurent Godard lgodard.li...@laposte.net Date: Thu Aug 29 10:24:14 2013 +0200 clean obsolete parts of ScMyCell Change-Id: Ic7775d376a6089d7795514081ca4f912e4228f73 Reviewed-on: https://gerrit.libreoffice.org/5674 Reviewed-by: Kohei Yoshida kohei.yosh...@suse.de Tested-by: Kohei Yoshida kohei.yosh...@suse.de diff --git a/sc/source/filter/xml/XMLExportIterator.cxx b/sc/source/filter/xml/XMLExportIterator.cxx index df6c2f0..976f387 100644 --- a/sc/source/filter/xml/XMLExportIterator.cxx +++ b/sc/source/filter/xml/XMLExportIterator.cxx @@ -597,7 +597,6 @@ void ScMyDetectiveOpContainer::Sort() ScMyCell::ScMyCell() : aShapeList(), aDetectiveObjVec(), -fValue(0.0), nValidationIndex(-1), bIsAutoStyle( false ), bHasShape( false ), @@ -607,10 +606,6 @@ ScMyCell::ScMyCell() : bHasEmptyDatabase( false ), bHasDetectiveObj( false ), bHasDetectiveOp( false ), -bIsEditCell( false ), -bHasStringValue( false ), -bHasDoubleValue( false ), -bHasXText( false ), bIsMatrixBase( false ), bIsMatrixCovered( false ), bHasAnnotation( false ) @@ -683,10 +678,7 @@ void ScMyNotEmptyCellsIterator::SetCellData( ScMyCell rMyCell, table::CellAddre { rMyCell.maBaseCell.clear(); rMyCell.aCellAddress = rAddress; -rMyCell.bHasStringValue = false; -rMyCell.bHasDoubleValue = false; -rMyCell.bHasXText = false; -rMyCell.bIsEditCell = false; + if( (nCellCol == rAddress.Column) (nCellRow == rAddress.Row) ) { mpCell = mpCellItr-GetNext(nCellCol, nCellRow); @@ -738,8 +730,7 @@ void ScMyNotEmptyCellsIterator::HasAnnotation(ScMyCell aCell) uno::Referencetext::XSimpleText xSimpleText(aCell.xAnnotation, uno::UNO_QUERY); if (aCell.xAnnotation.is() xSimpleText.is()) { -aCell.sAnnotationText = xSimpleText-getString(); -if (!aCell.sAnnotationText.isEmpty()) +if (!xSimpleText-getString().isEmpty()) aCell.bHasAnnotation = true; } aAnnotations.erase(aItr); diff --git a/sc/source/filter/xml/XMLExportIterator.hxx b/sc/source/filter/xml/XMLExportIterator.hxx index 6433510..9fa520d 100644 --- a/sc/source/filter/xml/XMLExportIterator.hxx +++ b/sc/source/filter/xml/XMLExportIterator.hxx @@ -300,15 +300,11 @@ struct ScMyCell com::sun::star::table::CellRangeAddress aMergeRange; com::sun::star::table::CellRangeAddress aMatrixRange; -OUString sStringValue; -OUString sAnnotationText; - ScMyAreaLinkaAreaLink; ScMyShapeList aShapeList; ScMyDetectiveObjVec aDetectiveObjVec; ScMyDetectiveOpVec aDetectiveOpVec; -double fValue; sal_Int32 nValidationIndex; sal_Int32 nStyleIndex; sal_Int32 nNumberFormat; @@ -326,11 +322,6 @@ struct ScMyCell boolbHasDetectiveObj; boolbHasDetectiveOp; -boolbIsEditCell; -boolbHasStringValue; -boolbHasDoubleValue; -boolbHasXText; - boolbIsMatrixBase; boolbIsMatrixCovered; boolbHasAnnotation; diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 873da75..8873238 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -2864,15 +2864,6 @@ bool ScXMLExport::IsMatrix (const ScAddress aCell, return false; } -void ScXMLExport::GetCellText (ScMyCell rMyCell, const ScAddress aPos) const -{ -if (!rMyCell.bHasStringValue) -{ -rMyCell.sStringValue = ScCellObj::GetOutputString_Impl(pDoc, aPos); -rMyCell.bHasStringValue = true; -} -} - void ScXMLExport::WriteTable(sal_Int32 nTable, const Referencesheet::XSpreadsheet xTable) { if (!xTable.is()) @@ -3223,37 +3214,30 @@ void ScXMLExport::WriteCell(ScMyCell aCell, sal_Int32 nEqualCellCount) break; case table::CellContentType_VALUE : { -if (!aCell.bHasDoubleValue) -{ -aCell.fValue = pDoc-GetValue( aCellPos ); -aCell.bHasDoubleValue = true; -} GetNumberFormatAttributesExportHelper()-SetNumberFormatAttributes( -aCell.nNumberFormat, aCell.fValue); +aCell.nNumberFormat
[Libreoffice-commits] core.git: sc/source
sc/source/core/data/table2.cxx | 14 ++ 1 file changed, 14 insertions(+) New commits: commit 68dd91f9e9d9201287acb5825748954a5446f323 Author: Laurent Godard lgodard.li...@laposte.net Date: Wed Aug 21 17:09:52 2013 +0200 fdo#68381 take care of cell notes on Transpose Change-Id: I4272b45a1c8ad34b540ee39d9ef9dd717d4f6325 Reviewed-on: https://gerrit.libreoffice.org/5572 Reviewed-by: Kohei Yoshida kohei.yosh...@suse.de Tested-by: Kohei Yoshida kohei.yosh...@suse.de diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index f60ed3f..349f9ac 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1085,6 +1085,20 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } } } + +// fdo#68381 paste cell notes on Transpose +bool bCloneCaption = true; +for (ScNotes::const_iterator itr = maNotes.begin(); itr != maNotes.end(); ++itr) +{ +SCCOL nCol = itr-first.first; +SCROW nRow = itr-first.second; +if (nCol = nCol1 nCol = nCol2 nRow = nRow1 nRow = nRow2) +{ +ScAddress aDestPos( static_castSCCOL(nRow-nRow1), static_castSCROW(nCol-nCol1), pTransClip-nTab ); +pTransClip-maNotes.erase(aDestPos); +pTransClip-maNotes.insert(aDestPos, itr-second-Clone( ScAddress(nCol, nRow, nTab), *pTransClip-pDocument, aDestPos, bCloneCaption )); +} +} } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sc/source
sc/source/core/data/table2.cxx | 14 ++ 1 file changed, 14 insertions(+) New commits: commit 9c253eb2aa0d9860916d626738b746594775f321 Author: Laurent Godard lgodard.li...@laposte.net Date: Wed Aug 21 17:09:52 2013 +0200 fdo#68381 take care of cell notes on Transpose Change-Id: I4272b45a1c8ad34b540ee39d9ef9dd717d4f6325 Reviewed-on: https://gerrit.libreoffice.org/5572 Reviewed-by: Kohei Yoshida kohei.yosh...@suse.de Tested-by: Kohei Yoshida kohei.yosh...@suse.de (cherry picked from commit 68dd91f9e9d9201287acb5825748954a5446f323) Reviewed-on: https://gerrit.libreoffice.org/5575 diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 4786d30..d9a5baf 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -984,6 +984,20 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } } } + +// fdo#68381 paste cell notes on Transpose +bool bCloneCaption = true; +for (ScNotes::const_iterator itr = maNotes.begin(); itr != maNotes.end(); ++itr) +{ +SCCOL nCol = itr-first.first; +SCROW nRow = itr-first.second; +if (nCol = nCol1 nCol = nCol2 nRow = nRow1 nRow = nRow2) +{ +ScAddress aDestPos( static_castSCCOL(nRow-nRow1), static_castSCROW(nCol-nCol1), pTransClip-nTab ); +pTransClip-maNotes.erase(aDestPos); +pTransClip-maNotes.insert(aDestPos, itr-second-Clone( ScAddress(nCol, nRow, nTab), *pTransClip-pDocument, aDestPos, bCloneCaption )); +} +} } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/editutil.hxx |2 ++ sc/source/core/data/autonamecache.cxx |6 +- sc/source/core/tool/editutil.cxx | 25 - 3 files changed, 27 insertions(+), 6 deletions(-) New commits: commit f807403faa3a20a6b4e95c9e8441cd637e3e548d Author: Laurent Godard lgodard.li...@laposte.net Date: Thu Aug 8 17:18:29 2013 +0200 import performance : do not use EditEngine anymore Change-Id: I5849add3444cff15a201a276c8917fabc4b33262 Reviewed-on: https://gerrit.libreoffice.org/5317 Reviewed-by: Kohei Yoshida kohei.yosh...@suse.de Tested-by: Kohei Yoshida kohei.yosh...@suse.de diff --git a/sc/inc/editutil.hxx b/sc/inc/editutil.hxx index 88a42e8..34ffd34 100644 --- a/sc/inc/editutil.hxx +++ b/sc/inc/editutil.hxx @@ -55,9 +55,11 @@ public: /// Retrieves string with paragraphs delimited by spaces static OUString GetSpaceDelimitedString( const EditEngine rEngine ); +static OUString GetSpaceDelimitedString( const EditTextObject rEdit ); /// Retrieves string with paragraphs delimited by new lines ('\n'). static OUString GetMultilineString( const EditEngine rEngine ); +static OUString GetMultilineString( const EditTextObject rEdit ); /** Retrieves string with paragraphs delimited by new lines ('\n'). diff --git a/sc/source/core/data/autonamecache.cxx b/sc/source/core/data/autonamecache.cxx index 5d2257b..02d74cd 100644 --- a/sc/source/core/data/autonamecache.cxx +++ b/sc/source/core/data/autonamecache.cxx @@ -72,11 +72,7 @@ const ScAutoNameAddresses ScAutoNameCache::GetNameOccurrences( const String rN { const EditTextObject* p = aIter.getEditText(); if (p) -{ -ScFieldEditEngine rEngine = pDoc-GetEditEngine(); -rEngine.SetText(*p); -aStr = ScEditUtil::GetMultilineString(rEngine); // string with line separators between paragraphs -} +aStr = ScEditUtil::GetMultilineString(*p); // string with line separators between paragraphs } break; case CELLTYPE_NONE: diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index ea87597..8935fad 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -29,7 +29,7 @@ #include editeng/flditem.hxx #include editeng/numitem.hxx #include editeng/justifyitem.hxx -#include editeng/editobj.hxx +#include editeng/editobj.hxx #include vcl/svapp.hxx #include vcl/outdev.hxx #include svl/inethist.hxx @@ -81,16 +81,39 @@ static OUString lcl_GetDelimitedString( const EditEngine rEngine, const sal_Cha return aRet.makeStringAndClear(); } +static OUString lcl_GetDelimitedString( const EditTextObject rEdit, const sal_Char c ) +{ +sal_Int32 nParCount = rEdit.GetParagraphCount(); +OUStringBuffer aRet( nParCount * 80 ); +for (sal_Int32 nPar=0; nParnParCount; nPar++) +{ +if (nPar 0) +aRet.append(c); +aRet.append( rEdit.GetText( nPar )); +} +return aRet.makeStringAndClear(); +} + OUString ScEditUtil::GetSpaceDelimitedString( const EditEngine rEngine ) { return lcl_GetDelimitedString(rEngine, ' '); } +OUString ScEditUtil::GetSpaceDelimitedString( const EditTextObject rEdit ) +{ +return lcl_GetDelimitedString(rEdit, ' '); +} + OUString ScEditUtil::GetMultilineString( const EditEngine rEngine ) { return lcl_GetDelimitedString(rEngine, '\n'); } +OUString ScEditUtil::GetMultilineString( const EditTextObject rEdit ) +{ +return lcl_GetDelimitedString(rEdit, '\n'); +} + OUString ScEditUtil::GetString( const EditTextObject rEditText, const ScDocument* pDoc ) { // ScFieldEditEngine is needed to resolve field contents. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sc/source
sc/source/filter/xml/xmltabi.cxx | 12 +--- sc/source/ui/unoobj/cellsuno.cxx |7 +-- 2 files changed, 10 insertions(+), 9 deletions(-) New commits: commit 944929e656fdb66dca162dfd39253757de7cbd16 Author: Laurent Godard lgodard.li...@laposte.net Date: Mon Jul 1 15:43:46 2013 +0200 simplify AddPrintRanges calls at import time - at import time, use directly core functions - honor IsUndoEnabled in uno calls Change-Id: If1e762df0ca9cfa22fa2c0e75518fe892be602b6 Reviewed-on: https://gerrit.libreoffice.org/4656 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-on: https://gerrit.libreoffice.org/4696 diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index a7f014c..a1bc801 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -359,14 +359,12 @@ void ScXMLTableContext::EndElement() SCTAB nCurTab = rTables.GetCurrentSheet(); if (!sPrintRanges.isEmpty()) { -Reference sheet::XPrintAreas xPrintAreas( -rTables.GetCurrentXSheet(), UNO_QUERY); - -if( xPrintAreas.is() ) + ScRangeList aRangeList; +ScRangeStringConverter::GetRangeListFromString( aRangeList, sPrintRanges, pDoc, ::formula::FormulaGrammar::CONV_OOO ); +size_t nCount = aRangeList.size(); +for (size_t i=0; i nCount; i++ ) { -Sequence table::CellRangeAddress aRangeList; -ScRangeStringConverter::GetRangeListFromString( aRangeList, sPrintRanges, pDoc, ::formula::FormulaGrammar::CONV_OOO ); -xPrintAreas-setPrintAreas( aRangeList ); +pDoc-AddPrintRange( nCurTab, *aRangeList[i] ); } } else if (!bPrintEntireSheet) diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 763bf67..1d0a8e8 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -7503,13 +7503,15 @@ void SAL_CALL ScTableSheetObj::setPrintAreas( throw(uno::RuntimeException) { SolarMutexGuard aGuard; +ScPrintRangeSaver* pOldRanges; ScDocShell* pDocSh = GetDocShell(); if ( pDocSh ) { ScDocument* pDoc = pDocSh-GetDocument(); SCTAB nTab = GetTab_Impl(); -ScPrintRangeSaver* pOldRanges = pDoc-CreatePrintRangeSaver(); +if ( pDoc-IsUndoEnabled() ) +pOldRanges = pDoc-CreatePrintRangeSaver(); sal_uInt16 nCount = (sal_uInt16) aPrintAreas.getLength(); pDoc-ClearPrintRanges( nTab ); @@ -7524,7 +7526,8 @@ void SAL_CALL ScTableSheetObj::setPrintAreas( } } -PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc. +if ( pDoc-IsUndoEnabled() ) +PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc. } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sc/source
sc/source/filter/xml/xmlexprt.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 42e32bb7a0a015a2726b148425410fa275c808c9 Author: Laurent Godard lgodard.li...@laposte.net Date: Mon Jul 1 11:32:47 2013 +0200 the calculation of the progressbar leads to very slow saving Change-Id: Ibba31126161b77b499561c5a74c057a56c07a4a8 Reviewed-on: https://gerrit.libreoffice.org/4647 Reviewed-by: Bosdonnat Cedric cedric.bosdon...@free.fr Tested-by: Bosdonnat Cedric cedric.bosdon...@free.fr Reviewed-on: https://gerrit.libreoffice.org/4698 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 9089f27..2a543cd 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -2443,10 +2443,10 @@ void ScXMLExport::_ExportAutoStyles() if (xCellRangesQuery.is()) { Referencesheet::XSheetCellRanges xSheetCellRanges(xCellRangesQuery-queryContentCells(sheet::CellFlags::FORMATTED)); -Referencesheet::XSheetOperation xSheetOperation(xSheetCellRanges, uno::UNO_QUERY); -if (xSheetCellRanges.is() xSheetOperation.is()) +if (xSheetCellRanges.is()) { -sal_uInt32 nCount(sal_uInt32(xSheetOperation-computeFunction(sheet::GeneralFunction_COUNT))); +uno::Sequence table::CellRangeAddress aCellRangeAddresses (xSheetCellRanges-getRangeAddresses()); +sal_uInt32 nCount(aCellRangeAddresses.getLength()); Referencecontainer::XEnumerationAccess xCellsAccess(xSheetCellRanges-getCells()); if (xCellsAccess.is()) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/filter/xml/xmlexprt.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 8be462fde98a8f22f182b5b3e63657f7007ed165 Author: Laurent Godard lgodard.li...@laposte.net Date: Mon Jul 1 11:32:47 2013 +0200 the calculation of the progressbar leads to very slow saving Change-Id: Ibba31126161b77b499561c5a74c057a56c07a4a8 Reviewed-on: https://gerrit.libreoffice.org/4647 Reviewed-by: Bosdonnat Cedric cedric.bosdon...@free.fr Tested-by: Bosdonnat Cedric cedric.bosdon...@free.fr diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 0062479..1943238 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -2432,10 +2432,10 @@ void ScXMLExport::_ExportAutoStyles() if (xCellRangesQuery.is()) { Referencesheet::XSheetCellRanges xSheetCellRanges(xCellRangesQuery-queryContentCells(sheet::CellFlags::FORMATTED)); -Referencesheet::XSheetOperation xSheetOperation(xSheetCellRanges, uno::UNO_QUERY); -if (xSheetCellRanges.is() xSheetOperation.is()) +if (xSheetCellRanges.is()) { -sal_uInt32 nCount(sal_uInt32(xSheetOperation-computeFunction(sheet::GeneralFunction_COUNT))); +uno::Sequence table::CellRangeAddress aCellRangeAddresses (xSheetCellRanges-getRangeAddresses()); +sal_uInt32 nCount(aCellRangeAddresses.getLength()); Referencecontainer::XEnumerationAccess xCellsAccess(xSheetCellRanges-getCells()); if (xCellsAccess.is()) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/filter/xml/xmltabi.cxx | 12 +--- sc/source/ui/unoobj/cellsuno.cxx |7 +-- 2 files changed, 10 insertions(+), 9 deletions(-) New commits: commit 92c7eca78e6ac84ef2b1be5dca102ecfaee9766b Author: Laurent Godard lgodard.li...@laposte.net Date: Mon Jul 1 15:43:46 2013 +0200 simplify AddPrintRanges calls at import time - at import time, use directly core functions - honor IsUndoEnabled in uno calls Change-Id: If1e762df0ca9cfa22fa2c0e75518fe892be602b6 Reviewed-on: https://gerrit.libreoffice.org/4656 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index 1069f47..1701529 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -359,14 +359,12 @@ void ScXMLTableContext::EndElement() SCTAB nCurTab = rTables.GetCurrentSheet(); if (!sPrintRanges.isEmpty()) { -Reference sheet::XPrintAreas xPrintAreas( -rTables.GetCurrentXSheet(), UNO_QUERY); - -if( xPrintAreas.is() ) + ScRangeList aRangeList; +ScRangeStringConverter::GetRangeListFromString( aRangeList, sPrintRanges, pDoc, ::formula::FormulaGrammar::CONV_OOO ); +size_t nCount = aRangeList.size(); +for (size_t i=0; i nCount; i++ ) { -Sequence table::CellRangeAddress aRangeList; -ScRangeStringConverter::GetRangeListFromString( aRangeList, sPrintRanges, pDoc, ::formula::FormulaGrammar::CONV_OOO ); -xPrintAreas-setPrintAreas( aRangeList ); +pDoc-AddPrintRange( nCurTab, *aRangeList[i] ); } } else if (!bPrintEntireSheet) diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 763bf67..1d0a8e8 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -7503,13 +7503,15 @@ void SAL_CALL ScTableSheetObj::setPrintAreas( throw(uno::RuntimeException) { SolarMutexGuard aGuard; +ScPrintRangeSaver* pOldRanges; ScDocShell* pDocSh = GetDocShell(); if ( pDocSh ) { ScDocument* pDoc = pDocSh-GetDocument(); SCTAB nTab = GetTab_Impl(); -ScPrintRangeSaver* pOldRanges = pDoc-CreatePrintRangeSaver(); +if ( pDoc-IsUndoEnabled() ) +pOldRanges = pDoc-CreatePrintRangeSaver(); sal_uInt16 nCount = (sal_uInt16) aPrintAreas.getLength(); pDoc-ClearPrintRanges( nTab ); @@ -7524,7 +7526,8 @@ void SAL_CALL ScTableSheetObj::setPrintAreas( } } -PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc. +if ( pDoc-IsUndoEnabled() ) +PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc. } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Re: need code pointer on basic IDE code
Hi I experience some nasty latencies in basic IDE switching from a module to another [update] i opened an issue with a demo extension https://bugs.freedesktop.org/show_bug.cgi?id=66148 Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
need code pointer on basic IDE code
Hi all I experience some nasty latencies in basic IDE switching from a module to another i identified that this is der to the call to Object catalog real-time refresh the call stack is http://opengrok.libreoffice.org/xref/core/basctl/source/basicide/basides1.cxx#1035 -- commenting this line, all becomes reactive http://opengrok.libreoffice.org/xref/core/basctl/source/basicide/objdlg.cxx#135 http://opengrok.libreoffice.org/xref/core/basctl/source/basicide/bastype2.cxx#829 On quick hack would be to filter if object catalog is displayed or not i need some code pointer to check if the object catalog is shown or hidden in order to filter this call http://opengrok.libreoffice.org/xref/core/basctl/source/basicide/basides1.cxx#1035 one deeper (at least for me) work would be to analyze why selecting the current entry in the Tree is so long any help appreciated thanks in advance Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Relicensing of some classes from JODConverter
Hi Cedric As far as I'm concerned, no problem for me on relicensing the parts I contributed to com/artofsolving/jodconverter/openoffice/connection/AbstractOpenOfficeConnection com/artofsolving/jodconverter/openoffice/connection/OpenOfficeConfiguration com/artofsolving/jodconverter/openoffice/connection/OpenOfficeConnection com/artofsolving/jodconverter/openoffice/connection/OpenOfficeException com/artofsolving/jodconverter/openoffice/connection/PipeOpenOfficeConnection com/artofsolving/jodconverter/openoffice/connection/SocketOpenOfficeConnection thanks a lot Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
api.libreoffice.org CSS lost
Hi all http://api.libreoffice.org/docs/common/ref/com/sun/star/module-ix.html shows wrong colors is it known ? Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/globstr.hrc|5 ++ sc/source/ui/docshell/docfunc.cxx |8 +++- sc/source/ui/inc/undotab.hxx |7 ++- sc/source/ui/inc/viewfunc.hxx |4 +- sc/source/ui/src/globstr.src |8 sc/source/ui/undo/undotab.cxx | 29 +++ sc/source/ui/view/tabvwshf.cxx| 54 +--- sc/source/ui/view/viewfun2.cxx| 71 -- 8 files changed, 109 insertions(+), 77 deletions(-) New commits: commit f1ec7dc619c84beecb05f9cd94a5c317904a7be5 Author: Laurent Godard lgodard.li...@laposte.net Date: Thu Mar 7 09:53:44 2013 +0100 group undo action when hiding/showing sheets - the test if there are enough tabs before hiding is now in HideTabs - a vector is passed to Undo - modification of the displayed text - minor optimization on looping over sheets (exit when condition is fullfilled) Change-Id: I86196c6bb0f5fd6ba5b44c69efadc16b119a7f11 Reviewed-on: https://gerrit.libreoffice.org/2579 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index 9d1d51e..619d8ed 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -654,7 +654,10 @@ #define STR_CHG_CHILD_ORGCONTENT524 #define STR_CHG_EMPTY 525 -#define STR_COUNT 526 +#define STR_UNDO_HIDETABS 526 +#define STR_UNDO_SHOWTABS 527 + +#define STR_COUNT 528 #endif diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 7173a89..28c7af4 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -3079,7 +3079,7 @@ sal_Bool ScDocFunc::SetTableVisible( SCTAB nTab, bool bVisible, sal_Bool bApi ) sal_uInt16 nVisCount = 0; SCTAB nCount = pDoc-GetTableCount(); -for (SCTAB i=0; inCount; i++) +for (SCTAB i=0; inCount nVisCount2; i++) if (pDoc-IsVisible(i)) ++nVisCount; @@ -3093,7 +3093,11 @@ sal_Bool ScDocFunc::SetTableVisible( SCTAB nTab, bool bVisible, sal_Bool bApi ) pDoc-SetVisible( nTab, bVisible ); if (bUndo) -rDocShell.GetUndoManager()-AddUndoAction( new ScUndoShowHideTab( rDocShell, nTab, bVisible ) ); +{ +std::vectorSCTAB undoTabs; +undoTabs.push_back(nTab); +rDocShell.GetUndoManager()-AddUndoAction( new ScUndoShowHideTab( rDocShell, undoTabs, bVisible ) ); +} // Views updaten: if (!bVisible) diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx index 5b7d8e6..25e6888 100644 --- a/sc/source/ui/inc/undotab.hxx +++ b/sc/source/ui/inc/undotab.hxx @@ -333,7 +333,8 @@ public: TYPEINFO(); ScUndoShowHideTab( ScDocShell* pShell, -SCTAB nNewTab, sal_Bool bNewShow ); +const std::vectorSCTAB newUndoTabs, +sal_Bool bNewShow ); virtual ~ScUndoShowHideTab(); virtual voidUndo(); @@ -344,8 +345,8 @@ public: virtual rtl::OUString GetComment() const; private: -SCTAB nTab; -sal_BoolbShow; +std::vectorSCTAB undoTabs; +sal_BoolbShow; void DoChange( sal_Bool bShow ) const; }; diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 748a386..76c6734 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -273,8 +273,8 @@ public: const String rFilter, const String rOptions, const String rSource, sal_uLong nRefresh ); -voidShowTable( const String rName ); -voidHideTable( SCTAB nTabNr ); +voidShowTable( const std::vectorString rNames ); +voidHideTable( const ScMarkData rMark ); voidMakeScenario( const String rName, const String rComment, const Color rColor, sal_uInt16 nFlags ); diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index 042c9a5..9d8613e 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -1141,10 +1141,18 @@ Resource RID_GLOBSTR { Text [ en-US ] = Show Sheet ; }; +String STR_UNDO_SHOWTABS +{ +Text [ en-US ] = Show Sheets ; +}; String STR_UNDO_HIDETAB { Text [ en-US ] = Hide sheet ; }; +String STR_UNDO_HIDETABS +{ +Text [ en-US ] = Hide sheets ; +}; String STR_UNDO_TAB_RTL { Text [ en-US ] = Flip sheet ; diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index 9732e21..a45b648 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx
[PATCH] group undo action when hiding sheets
(); ++it) +{ +nTab = *it; +if (pDoc-IsVisible( nTab )) +{ +pDoc-SetVisible( nTab, false ); +// Update views +pDocSh-Broadcast( ScTablesHint( SC_TAB_HIDDEN, nTab ) ); +SetTabNo( nTab, true ); +// Store for undo +if (bUndo) +undoTabs.push_back(nTab); +} +} if (bUndo) { -pDocSh-GetUndoManager()-AddUndoAction( new ScUndoShowHideTab( pDocSh, nTab, false ) ); +pDocSh-GetUndoManager()-AddUndoAction( new ScUndoShowHideTab( pDocSh, undoTabs, false ) ); } // Update views -pDocSh-Broadcast( ScTablesHint( SC_TAB_HIDDEN, nTab ) ); - -SetTabNo( nTab, sal_True ); SFX_APP()-Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) ); pDocSh-PostPaint(0,0,0,MAXCOL,MAXROW,MAXTAB, PAINT_EXTRAS); pDocSh-SetDocumentModified(); -- To view, visit https://gerrit.libreoffice.org/2579 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I86196c6bb0f5fd6ba5b44c69efadc16b119a7f11 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Laurent Godard lgodard.li...@laposte.net ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/tabvwshf.cxx | 37 +++-- 1 file changed, 15 insertions(+), 22 deletions(-) New commits: commit 30862ca42c6b548a2dce99c0f2a0c2886f059dfa Author: Laurent Godard lgodard.li...@laposte.net Date: Fri Feb 8 18:49:05 2013 +0100 calc : multiple tabs can be hidden at once - enables the Format Sheet Hide menu when mutiple tabs are selected provided there remain one tab at least at the end - loops over selected tabs to hide them - does nothing if the command leads to no visible tabs. Change-Id: I445eccc188f1817006cb425dc9a0e92a25350ec8 Reviewed-on: https://gerrit.libreoffice.org/2053 Reviewed-by: Kohei Yoshida kohei.yosh...@gmail.com Tested-by: Kohei Yoshida kohei.yosh...@gmail.com diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 89585dd..c8320ba 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -109,33 +109,26 @@ void ScTabViewShell::ExecuteTable( SfxRequest rReq ) ScMarkData rMark = pViewData-GetMarkData(); SCTAB nTabSelCount = rMark.GetSelectCount(); sal_uInt16 nVis = 0; -for ( SCTAB i=0; i nTabCount nVis2; i++ ) + +// check to make sure we won't hide all sheets. we need at least one visible at all times. +for ( SCTAB i=0; i nTabCount nVisnTabSelCount + 1; i++ ) if (pDoc-IsVisible(i)) ++nVis; -if ( nVis2 || !pDoc-IsDocEditable() || nTabSelCount 1 ) +if ( nVis=nTabSelCount || !pDoc-IsDocEditable() ) break; - rtl::OUString aName; -if( pReqArgs != NULL ) -{ -const SfxPoolItem* pItem; -if( pReqArgs-HasItem( FID_TABLE_HIDE, pItem ) ) -aName = ((const SfxStringItem*)pItem)-GetValue(); -} +SCTAB nHideTab; +ScMarkData::MarkedTabsType::const_iterator it; + +ScMarkData::MarkedTabsType selectedTabs = rMark.GetSelectedTabs(); -if (aName.isEmpty()) +for (it=selectedTabs.begin(); it!=selectedTabs.end(); ++it) { -pDoc-GetName( nCurrentTab, aName );// aktuelle Tabelle -rReq.AppendItem( SfxStringItem( FID_TABLE_HIDE, aName ) ); +nHideTab = *it; +if (pDoc-IsVisible( nHideTab )) +HideTable( nHideTab ); } - -SCTAB nHideTab; -if (pDoc-GetTable( aName, nHideTab )) -HideTable( nHideTab ); - -if( ! rReq.IsAPI() ) -rReq.Done(); } break; @@ -841,11 +834,11 @@ void ScTabViewShell::ExecuteTable( SfxRequest rReq ) case FID_TABLE_HIDE: { sal_uInt16 nVis = 0; -for ( SCTAB i=0; i nTabCount nVis2; i++ ) +// enable menu : check to make sure we won't hide all sheets. we need at least one visible at all times. +for ( SCTAB i=0; i nTabCount nVisnTabSelCount + 1; i++ ) if (pDoc-IsVisible(i)) ++nVis; - -if ( nVis2 || !pDoc-IsDocEditable() || nTabSelCount 1 ) +if ( nVis=nTabSelCount || !pDoc-IsDocEditable() ) rSet.DisableItem( nWhich ); } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[PATCH] calc : multiple tabs can be hidden at once
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/2053 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/53/2053/1 calc : multiple tabs can be hidden at once Change-Id: I445eccc188f1817006cb425dc9a0e92a25350ec8 --- M sc/source/ui/view/tabvwshf.cxx 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 89585dd..3a66768 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -109,33 +109,33 @@ ScMarkData rMark = pViewData-GetMarkData(); SCTAB nTabSelCount = rMark.GetSelectCount(); sal_uInt16 nVis = 0; -for ( SCTAB i=0; i nTabCount nVis2; i++ ) +for ( SCTAB i=0; i nTabCount nVisnTabSelCount + 1; i++ ) if (pDoc-IsVisible(i)) ++nVis; -if ( nVis2 || !pDoc-IsDocEditable() || nTabSelCount 1 ) +if ( nVis=nTabSelCount || !pDoc-IsDocEditable() ) break; - rtl::OUString aName; -if( pReqArgs != NULL ) -{ -const SfxPoolItem* pItem; -if( pReqArgs-HasItem( FID_TABLE_HIDE, pItem ) ) -aName = ((const SfxStringItem*)pItem)-GetValue(); -} - -if (aName.isEmpty()) -{ -pDoc-GetName( nCurrentTab, aName );// aktuelle Tabelle -rReq.AppendItem( SfxStringItem( FID_TABLE_HIDE, aName ) ); -} - SCTAB nHideTab; -if (pDoc-GetTable( aName, nHideTab )) -HideTable( nHideTab ); +ScMarkData::MarkedTabsType selectedTabs = rMark.GetSelectedTabs(); -if( ! rReq.IsAPI() ) -rReq.Done(); +ScMarkData::MarkedTabsType::const_iterator it; +it = selectedTabs.begin(); +while (it != selectedTabs.end()) +{ +nHideTab = *it; + +pDoc-GetName( nHideTab, aName ); +rReq.AppendItem( SfxStringItem( FID_TABLE_HIDE, aName ) ); + +if (pDoc-GetTable( aName, nHideTab )) +HideTable( nHideTab ); + +if( ! rReq.IsAPI() ) +rReq.Done(); + +it++; +} } break; @@ -841,11 +841,10 @@ case FID_TABLE_HIDE: { sal_uInt16 nVis = 0; -for ( SCTAB i=0; i nTabCount nVis2; i++ ) +for ( SCTAB i=0; i nTabCount nVisnTabSelCount + 1; i++ ) if (pDoc-IsVisible(i)) ++nVis; - -if ( nVis2 || !pDoc-IsDocEditable() || nTabSelCount 1 ) +if ( nVis=nTabSelCount || !pDoc-IsDocEditable() ) rSet.DisableItem( nWhich ); } break; -- To view, visit https://gerrit.libreoffice.org/2053 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I445eccc188f1817006cb425dc9a0e92a25350ec8 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Laurent Godard lgodard.li...@laposte.net ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] sc test XSheetOutline
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/1794 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/94/1794/1 sc test XSheetOutline Change-Id: Iea0576e61963dbdb72c88fe332c7cfe3e8ab7ff0 --- A sc/CppunitTest_sc_outlineobj.mk M sc/Module_sc.mk A sc/qa/extras/scoutlineobj.cxx A sc/qa/extras/testdocuments/ScOutlineObj.ods M test/Library_subsequenttest.mk M test/Package_inc.mk A test/inc/test/sheet/xsheetoutline.hxx A test/source/sheet/xsheetoutline.cxx 8 files changed, 593 insertions(+), 0 deletions(-) diff --git a/sc/CppunitTest_sc_outlineobj.mk b/sc/CppunitTest_sc_outlineobj.mk new file mode 100644 index 000..7817035 --- /dev/null +++ b/sc/CppunitTest_sc_outlineobj.mk @@ -0,0 +1,129 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#* +# 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. +# +# The Initial Developer of the Original Code is +# Copyright (C) 2013 Laurent Godard lgodard.li...@laposte.net (initial developer) +# Portions created by the Initial Developer are Copyright (C) 2013 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# 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. +#* + +$(eval $(call gb_CppunitTest_CppunitTest,sc_outlineobj)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sc_outlineobj, \ +sc/qa/extras/scoutlineobj \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sc_outlineobj, \ +avmedia \ +basegfx \ +comphelper \ +cppu \ +cppuhelper \ +drawinglayer \ +editeng \ +fileacc \ +for \ +forui \ +i18nisolang1 \ +msfilter \ +oox \ +sal \ +salhelper \ +sax \ +sb \ +sc \ +sfx \ +sot \ +svl \ +svt \ +svx \ +svxcore \ + test \ +tl \ +tk \ +subsequenttest \ +ucbhelper \ + unotest \ +utl \ +vbahelper \ +vcl \ +xo \ + $(gb_UWINAPI) \ +)) + +$(eval $(call gb_CppunitTest_set_include,sc_outlineobj,\ +-I$(SRCDIR)/sc/source/ui/inc \ +-I$(SRCDIR)/sc/inc \ +$$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_api,sc_outlineobj,\ +offapi \ +udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,sc_outlineobj)) + +$(eval $(call gb_CppunitTest_use_components,sc_outlineobj,\ +basic/util/sb \ +comphelper/util/comphelp \ +configmgr/source/configmgr \ +dbaccess/util/dba \ +fileaccess/source/fileacc \ +filter/source/config/cache/filterconfig1 \ +forms/util/frm \ +framework/util/fwk \ +i18npool/util/i18npool \ + linguistic/source/lng \ +oox/util/oox \ +package/source/xstor/xstor \ +package/util/package2 \ +sax/source/expatwrap/expwrap \ +sax/source/fastparser/fastsax \ +sc/util/sc \ +sc/util/scd \ +sc/util/scfilt \ +$(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ +scripting/source/basprov/basprov \ +scripting/util/scriptframe \ +sfx2/util/sfx \ +sot/util/sot \ +svl/source/fsstor/fsstorage \ +toolkit/util/tk \ +ucb/source/core/ucb1 \ +ucb/source/ucp/file/ucpfile1 \ +ucb/source/ucp/tdoc/ucptdoc1 \ +unotools/util/utl \ +unoxml/source/rdf/unordf \ +unoxml/source/service/unoxml \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sc_outlineobj)) + +$(eval $(call gb_CppunitTest_use_filter_configuration,sc_outlineobj)) + +$(eval $(call gb_CppunitTest_use_unittest_configuration,sc_outlineobj)) + +# vim: set noet sw=4 ts=4: diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index 3039518..4a4fc41 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -61,6 +61,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\ JunitTest_sc_complex \ JunitTest_sc_unoapi \ +CppunitTest_sc_outlineobj \ CppunitTest_sc_annotationobj \ CppunitTest_sc_annotationsobj \ CppunitTest_sc_cellrangeobj \ diff --git a/sc/qa/extras/scoutlineobj.cxx b/sc/qa/extras/scoutlineobj.cxx new file
[PATCH] sc test for XSheetAnnotation
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/1736 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/36/1736/1 sc test for XSheetAnnotation Change-Id: I1fa77c874c6307ff71ea0aeee653acf1305f2646 --- A sc/CppunitTest_sc_annotationobj.mk M sc/Module_sc.mk A sc/qa/extras/scannotationobj.cxx A sc/qa/extras/testdocuments/ScAnnotationObj.ods M test/Library_subsequenttest.mk M test/Package_inc.mk A test/inc/test/sheet/xsheetannotation.hxx A test/source/sheet/xsheetannotation.cxx 8 files changed, 414 insertions(+), 0 deletions(-) diff --git a/sc/CppunitTest_sc_annotationobj.mk b/sc/CppunitTest_sc_annotationobj.mk new file mode 100644 index 000..16b2d48 --- /dev/null +++ b/sc/CppunitTest_sc_annotationobj.mk @@ -0,0 +1,129 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#* +# 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. +# +# The Initial Developer of the Original Code is +# Copyright (C) 2013 Laurent Godard lgodard.li...@laposte.net (initial developer) +# Portions created by the Initial Developer are Copyright (C) 2011 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# 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. +#* + +$(eval $(call gb_CppunitTest_CppunitTest,sc_annotationobj)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sc_annotationobj, \ +sc/qa/extras/scannotationobj \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sc_annotationobj, \ +avmedia \ +basegfx \ +comphelper \ +cppu \ +cppuhelper \ +drawinglayer \ +editeng \ +fileacc \ +for \ +forui \ +i18nisolang1 \ +msfilter \ +oox \ +sal \ +salhelper \ +sax \ +sb \ +sc \ +sfx \ +sot \ +svl \ +svt \ +svx \ +svxcore \ + test \ +tl \ +tk \ +subsequenttest \ +ucbhelper \ + unotest \ +utl \ +vbahelper \ +vcl \ +xo \ + $(gb_UWINAPI) \ +)) + +$(eval $(call gb_CppunitTest_set_include,sc_annotationobj,\ +-I$(SRCDIR)/sc/source/ui/inc \ +-I$(SRCDIR)/sc/inc \ +$$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_api,sc_annotationobj,\ +offapi \ +udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,sc_annotationobj)) + +$(eval $(call gb_CppunitTest_use_components,sc_annotationobj,\ +basic/util/sb \ +comphelper/util/comphelp \ +configmgr/source/configmgr \ +dbaccess/util/dba \ +fileaccess/source/fileacc \ +filter/source/config/cache/filterconfig1 \ +forms/util/frm \ +framework/util/fwk \ +i18npool/util/i18npool \ + linguistic/source/lng \ +oox/util/oox \ +package/source/xstor/xstor \ +package/util/package2 \ +sax/source/expatwrap/expwrap \ +sax/source/fastparser/fastsax \ +sc/util/sc \ +sc/util/scd \ +sc/util/scfilt \ +$(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ +scripting/source/basprov/basprov \ +scripting/util/scriptframe \ +sfx2/util/sfx \ +sot/util/sot \ +svl/source/fsstor/fsstorage \ +toolkit/util/tk \ +ucb/source/core/ucb1 \ +ucb/source/ucp/file/ucpfile1 \ +ucb/source/ucp/tdoc/ucptdoc1 \ +unotools/util/utl \ +unoxml/source/rdf/unordf \ +unoxml/source/service/unoxml \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sc_annotationobj)) + +$(eval $(call gb_CppunitTest_use_filter_configuration,sc_annotationobj)) + +$(eval $(call gb_CppunitTest_use_unittest_configuration,sc_annotationobj)) + +# vim: set noet sw=4 ts=4: diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index f6c1c62..2b2aa6f 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -61,6 +61,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\ JunitTest_sc_complex \ JunitTest_sc_unoapi \ +CppunitTest_sc_annotationobj \ CppunitTest_sc_cellrangeobj \ $(if $(filter-out $(OS),IOS), \ CppunitTest_sc_databaserangeobj) \ diff
[PATCH] sc test for XSheetAnnotations
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/1738 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/38/1738/1 sc test for XSheetAnnotations Change-Id: Ie5ceb7f8d828eb9c1f4c92996ebb02c8a83f4cac --- A sc/CppunitTest_sc_annotationsobj.mk M sc/Module_sc.mk A sc/qa/extras/scannotationsobj.cxx M test/Library_subsequenttest.mk M test/Package_inc.mk A test/inc/test/sheet/xsheetannotations.hxx A test/source/sheet/xsheetannotations.cxx 7 files changed, 437 insertions(+), 0 deletions(-) diff --git a/sc/CppunitTest_sc_annotationsobj.mk b/sc/CppunitTest_sc_annotationsobj.mk new file mode 100644 index 000..bfd82bc --- /dev/null +++ b/sc/CppunitTest_sc_annotationsobj.mk @@ -0,0 +1,129 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#* +# 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. +# +# The Initial Developer of the Original Code is +# Copyright (C) 2013 Laurent Godard lgodard.li...@laposte.net (initial developer) +# Portions created by the Initial Developer are Copyright (C) 2011 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# 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. +#* + +$(eval $(call gb_CppunitTest_CppunitTest,sc_annotationsobj)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sc_annotationsobj, \ +sc/qa/extras/scannotationsobj \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sc_annotationsobj, \ +avmedia \ +basegfx \ +comphelper \ +cppu \ +cppuhelper \ +drawinglayer \ +editeng \ +fileacc \ +for \ +forui \ +i18nisolang1 \ +msfilter \ +oox \ +sal \ +salhelper \ +sax \ +sb \ +sc \ +sfx \ +sot \ +svl \ +svt \ +svx \ +svxcore \ + test \ +tl \ +tk \ +subsequenttest \ +ucbhelper \ + unotest \ +utl \ +vbahelper \ +vcl \ +xo \ + $(gb_UWINAPI) \ +)) + +$(eval $(call gb_CppunitTest_set_include,sc_annotationsobj,\ +-I$(SRCDIR)/sc/source/ui/inc \ +-I$(SRCDIR)/sc/inc \ +$$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_api,sc_annotationsobj,\ +offapi \ +udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,sc_annotationsobj)) + +$(eval $(call gb_CppunitTest_use_components,sc_annotationsobj,\ +basic/util/sb \ +comphelper/util/comphelp \ +configmgr/source/configmgr \ +dbaccess/util/dba \ +fileaccess/source/fileacc \ +filter/source/config/cache/filterconfig1 \ +forms/util/frm \ +framework/util/fwk \ +i18npool/util/i18npool \ + linguistic/source/lng \ +oox/util/oox \ +package/source/xstor/xstor \ +package/util/package2 \ +sax/source/expatwrap/expwrap \ +sax/source/fastparser/fastsax \ +sc/util/sc \ +sc/util/scd \ +sc/util/scfilt \ +$(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ +scripting/source/basprov/basprov \ +scripting/util/scriptframe \ +sfx2/util/sfx \ +sot/util/sot \ +svl/source/fsstor/fsstorage \ +toolkit/util/tk \ +ucb/source/core/ucb1 \ +ucb/source/ucp/file/ucpfile1 \ +ucb/source/ucp/tdoc/ucptdoc1 \ +unotools/util/utl \ +unoxml/source/rdf/unordf \ +unoxml/source/service/unoxml \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sc_annotationsobj)) + +$(eval $(call gb_CppunitTest_use_filter_configuration,sc_annotationsobj)) + +$(eval $(call gb_CppunitTest_use_unittest_configuration,sc_annotationsobj)) + +# vim: set noet sw=4 ts=4: diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index 2b2aa6f..3039518 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -62,6 +62,7 @@ JunitTest_sc_complex \ JunitTest_sc_unoapi \ CppunitTest_sc_annotationobj \ +CppunitTest_sc_annotationsobj \ CppunitTest_sc_cellrangeobj \ $(if $(filter-out $(OS),IOS), \ CppunitTest_sc_databaserangeobj) \ diff --git a/sc/qa/extras/scannotationsobj.cxx b/sc/qa
[PATCH] fdo#49704 Split Cells in calc popup menu
Hi all referenced as heasyhack please find a patch that adds a Split Cells menu entry in the calc popup menu please note that i left the ~ accelarator undefined HTH Laurent From c25ded4ef8f9ea3d6598d4bda5b4927f5da66e40 Mon Sep 17 00:00:00 2001 From: Laurent Godard lgodard.li...@laposte.net Date: Wed, 28 Nov 2012 17:18:27 +0100 Subject: [PATCH] fdo#49704 add split cells menu entry in calc popup Change-Id: Ia4f80cba29f30d4c684de6f78d8831513afa445c --- sc/inc/sccommands.h|1 + sc/source/ui/src/popup.src |6 ++ 2 files changed, 7 insertions(+) diff --git a/sc/inc/sccommands.h b/sc/inc/sccommands.h index 1350c0c..be8f411 100644 --- a/sc/inc/sccommands.h +++ b/sc/inc/sccommands.h @@ -61,6 +61,7 @@ #define CMD_FID_INS_ROWBRK .uno:InsertRowBreak #define CMD_FID_INS_ROW .uno:InsertRows #define CMD_FID_MERGE_ON.uno:MergeCells +#define CMD_FID_MERGE_OFF .uno:SplitCell #define CMD_SID_OBJECT_MIRROR .uno:Mirror #define CMD_FID_TAB_MOVE.uno:Move #define CMD_SID_PREVIEW_NEXT.uno:NextPage diff --git a/sc/source/ui/src/popup.src b/sc/source/ui/src/popup.src index f0f85f1..2b17e8e 100644 --- a/sc/source/ui/src/popup.src +++ b/sc/source/ui/src/popup.src @@ -82,6 +82,12 @@ Menu RID_POPUP_CELLS HelpId = CMD_FID_MERGE_ON ; Text [ en-US ] = ~Merge Cells... ; }; +MenuItem +{ +Identifier = FID_MERGE_OFF ; +HelpId = CMD_FID_MERGE_OFF ; +Text [ en-US ] = Split Cells... ; +}; //-- MenuItem { Separator = TRUE ; }; //-- -- 1.7.10.4 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [PATCH][PUSHED] fdo#49704 Split Cells in calc popup menu
Great. Pushed the patch to master. thanks Markus !! Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: error python uno HTTPSConnection
Hi Caolan thanks for your response Does import ssl work or fail, just to make sure at least that's working or not ? i won't be able to access the concerned laptop before tuesday but i'll let you know thanks again Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
error python uno HTTPSConnection
Hi all i'm facing a really strange problem in a pyUNo module, i want to use c = httplib.HTTPSConnection(host) no problem, it works but on a single win7 machine (at the moment), it fails telling AttributeError: 'module' object has no attribute 'HTTPSConnection' and effectivelly in my pyUNo script, a dir(httplib) does not show any HTTPS stuff i know this is usually due to SSL support of python but 1- it is a standard libro3.5.4 installation that works on other win7 2- more strange, if i launch the libro python manually an try the c=.. line above then no problem; it works like a charm so i'm lost here anyone could tell me what could happen ? a win7 parameter ? (firewall, other ...) thanks in advance Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: uno, python scripting, macro management window user experience
Hi Marc Range(Foo).select If ActiveCell.MergeCells Then MergedInfo = ActiveCell.MergeArea MergedValue = MergedInfo(1, 1) End If for Libreoffice basic assuming a calc sheet, with some content in A1 and B1 Sub Main doc = thisComponent ' the current document curSheet = doc.CurrentController.activeSheet cellRange = curSheet.getCellRangeByName(A1:B1) cellRange.merge(true) if cellRange.isMerged then cellContent = cellrange.dataArray endif anArray = cellContent(0) print join(anArray, ) End Sub did you have a look there http://wiki.openoffice.org/wiki/Documentation/BASIC_Guide http://wiki.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide i assumle you already identified this ressource (IDL reference) http://api.libreoffice.org/docs/common/ref/com/sun/star/module-ix.html HTH laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [PATCH][PUSHED] fdo 51944, modify exit menu wording
Hi Caolan thanks a lot for pushing and, yes i understand the translation impact for 3.5.x branch thanks again Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH]fdo 51944, modify exit menu wording
Hi all here is a small patch that adds LibreOffice to the Exit label in the menu some user, especially comming from other known office suite, do not understand why their calc documents are closed when they exit from a writer one The proposed menu is more explicit would be great if it could be also part of 3.5.x branch HTH Thanks a lot Laurent From 3d03215628ba3cc07259dc6bd8420d2603cdccaa Mon Sep 17 00:00:00 2001 From: Laurent Godard lgodard.li...@laposte.net Date: Wed, 11 Jul 2012 17:07:23 +0200 Subject: [PATCH] change Exit menu entry to Exit %PRODUCTNAME fdo#51944 Some user do not understand that Exit is for exiting all libreoffice modules and not exiting the current window Change-Id: If3a88a1e7f79c5c19f3011ba65dde3cda11462a4 --- sfx2/source/appl/app.src |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src index aa634f5..4beca7e 100644 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -271,7 +271,7 @@ ToolBox RID_FULLSCREENTOOLBOX String STR_QUITAPP { -Text [ en-US ] = E~xit ; +Text [ en-US ] = E~xit %PRODUCTNAME ; }; String RID_STR_HELP -- 1.7.10.4 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-ux-advise] [PATCH]fdo 51944, modify exit menu wording
Hi all here is a small patch that adds LibreOffice to the Exit label in the menu some user, especially comming from other known office suite, do not understand why their calc documents are closed when they exit from a writer one The proposed menu is more explicit would be great if it could be also part of 3.5.x branch HTH Thanks a lot Laurent From 3d03215628ba3cc07259dc6bd8420d2603cdccaa Mon Sep 17 00:00:00 2001 From: Laurent Godard lgodard.li...@laposte.net Date: Wed, 11 Jul 2012 17:07:23 +0200 Subject: [PATCH] change Exit menu entry to Exit %PRODUCTNAME fdo#51944 Some user do not understand that Exit is for exiting all libreoffice modules and not exiting the current window Change-Id: If3a88a1e7f79c5c19f3011ba65dde3cda11462a4 --- sfx2/source/appl/app.src |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src index aa634f5..4beca7e 100644 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -271,7 +271,7 @@ ToolBox RID_FULLSCREENTOOLBOX String STR_QUITAPP { -Text [ en-US ] = E~xit ; +Text [ en-US ] = E~xit %PRODUCTNAME ; }; String RID_STR_HELP -- 1.7.10.4 ___ Libreoffice-ux-advise mailing list Libreoffice-ux-advise@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-ux-advise
[PATCH]calc and row height for numerical cells with text wrap
Hi all Here is a small patch that tend to address the following problem a row set to optimal height a cell containing a value formated with # ###,00 vertically centered and text wrapping allowed actually the row height is not adjusted The patch removes the test on numerical cell. Then, now the row height of the formatted cell is correct when the text is wrapped over lines (may be some confusion with line break versus text wrapping regarding ATTR_LINEBREAK) Laurent From 8d9379e665c3ec76c3fe53daddd73a0c00858686 Mon Sep 17 00:00:00 2001 From: Laurent Godard lgodard.li...@laposte.net Date: Mon, 14 May 2012 16:53:38 +0200 Subject: [PATCH] automatic row height is not set if a cell with value and text wrapping allowed formatting + vertcially centered + text wrapping allowed, the row height should adapt seems there is a confusion with line break versus text wrapping regarding ATTR_LINEBREAK Change-Id: I I82b7a71fbc4be6f0ddcd5a0489486b5f80a178a8 --- sc/source/core/data/column2.cxx |4 1 file changed, 4 deletions(-) diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index c28249a..5c71a45 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -154,10 +154,6 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, else bBreak = ((const SfxBoolItem)pPattern-GetItem(ATTR_LINEBREAK)).GetValue(); -if (pCell-HasValueData()) -// Cell has a value. Disable line break. -bBreak = false; - // get other attributes from pattern and conditional formatting SvxCellOrientation eOrient = pPattern-GetCellOrientation( pCondSet ); -- 1.7.10 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Need a mentor on framework toolpanel
Hi Kendy If nobody else volunteers, I am happy to make my hands dirty with this code - please ping me / let the student ping me on the IRC should there be something necessary, I am sure we'll find a way together :-) great thanks a lot for your proposal so, i'll continue the process and let you know !!! Thanks a lot again Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: a new mac mini available for libreoffice dev but ...
Hi Tor I *think* you should be able to just run the LO autogen.sh without any options, and it *should* find your thusly installed Xcode 3.2.6. Do you also have /usr/bin/gcc and g++, or just /Developer/usr/bin/gcc and g++? i unfortunatelly have only /Developer/usr/bin/gcc and CCache configure fails Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: a new mac mini available for libreoffice dev but ...
Hi all sorry, i'm a bit lost right now ... as usual, it is when crying at email that things evolve honnestly, i tried a lot of things, and even if it always ended whith the same error, this link let some things to be installed http://catacombae.blogspot.fr/2011/07/installing-xcode-326-in-mac-os-x-lion.html iknow have in Developper a directory SDK with 10.4.u, 10.5 10.6 ( yes, i tried a lot of things) using finder or command line, i do not know how to access this directory to verify. before going on on other steps, is there a basic test i could perform to verify that it is ok regarding Xcode ? Thanks Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Re: librO python ssl support
Hi Caolan thanks a lot for your response We should probably be tweaking the python build to find the headers and (static) library of our internal openssl, e.g. see libxslt/makefile.mk (and others) and SOLARINCDIR/SOLARLIBDIR, there we point the build to our internal libs. i had a look and here is the patch i deduced. may be wrong as makefile things are a bit cryptic to me ;) i have a remaining question though (may be dummy) : why in python_LDFLAGS do we use /usr/lib and not /usr$/lib as on other lines. is it important ? does it make any difference ? ldd basis-link/program/python-core-2.6.1/lib/lib-dynload/_ssl.so no longer lists libssl.so.4 and libcrypto.so.4 as i told, in previous build i myself made, i had no problem. the problem on import ssl only occured with the official downloaded .deb (amd64) so even if it builds i can't verify if the patch solves (or destroy) anything :( thanks a lot again, and if something is pushed please consider also to provide it for 3.5.3 if possible as i'll need it Laurent From 5cf9ae5dd45e5c4cd6a2fbbfd0f160beb43b3b3d Mon Sep 17 00:00:00 2001 From: Laurent Godard lgodard.li...@laposte.net Date: Fri, 6 Apr 2012 12:45:34 +0200 Subject: [PATCH] tweaking the python build to find the headers and (static) library of our internal openssl --- python/makefile.mk |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/makefile.mk b/python/makefile.mk index 3f35d4c..4c201ee 100644 --- a/python/makefile.mk +++ b/python/makefile.mk @@ -67,8 +67,8 @@ MYCWD=$(shell @pwd)/$(INPATH)/misc/build # CLFLAGS get overwritten in Makefile.pre.in .IF $(SYSBASE)!= -CC+:=-I$(SYSBASE)$/usr$/include -python_LDFLAGS+=-L$(SYSBASE)/usr/lib +CC+:=-I$(SOLARINCDIR)$/external -I$(SYSBASE)$/usr$/include +python_LDFLAGS+=-L$(SOLARLIBDIR) -L$(SYSBASE)/usr/lib .IF $(COMNAME)==sunpro5 CC+:=$(C_RESTRICTIONFLAGS) .ENDIF # $(COMNAME)==sunpro5 -- 1.7.9.1 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: master build error in sysui
Hi all after a full clean, it seems to build sorry for the noise Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH]document idl queryContentCells limitation
Hi all a small patch that documents queryContentCells limitation in IDL reference thanks to Kohei for explaining me the reason of it ;) HTH Laurent From 851baad2b8ea7c598a6e377eba28367d97b1a6c7 Mon Sep 17 00:00:00 2001 From: Laurent Godard lgodard.li...@laposte.net Date: Wed, 28 Mar 2012 17:00:53 +0200 Subject: [PATCH] document queryContentCells limitation add also a missing /p in previous paragraph --- offapi/com/sun/star/sheet/XCellRangesQuery.idl |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/offapi/com/sun/star/sheet/XCellRangesQuery.idl b/offapi/com/sun/star/sheet/XCellRangesQuery.idl index f35eec7..a44cc70 100644 --- a/offapi/com/sun/star/sheet/XCellRangesQuery.idl +++ b/offapi/com/sun/star/sheet/XCellRangesQuery.idl @@ -76,7 +76,12 @@ published interface XCellRangesQuery: com::sun::star::uno::XInterface pAttention: Despite the typeCellFlags/type flags are atomlong/atom values, this method expects a atomshort/atom -parameter. +parameter./p + +pAttention: Empty cells in the range are not analyzed.Some +typeCellFlags/type may not be fully honored. For instance, +when querying for STYLES, the returned ranges may not include empty +cells with styles applied./p @returns all cells of the current cell range(s) with the specified -- 1.7.9.1 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] problems with encryption if thunderbird is installed
Hi Markus Thanks a lot of taking care ! I also identified the source code you pointed, but my skills stucked me I think a solution would be really necessary since this loop needs around 40% of one core on my fast development computer and Laurent mentioned around 40% of his whole cpu time( so I suspect 80% of one core for him ) i experience the same as you : 40% of one core thanks again Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] CPU eating after opening a password protected macro library
Hi all I submited https://bugs.freedesktop.org/show_bug.cgi?id=44900 The problem is that when openoing a basic library that is password protected, the CPU is then eaten at 43% until i close libreOffice I have this behaviour on master, 3.5.0beta3 but NOT 3.4.3 So it seems a regression to me. Do we have any solution for this ? Feel free to ask for more details Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] CPU eating after opening a password protected macro library
Hi Michael Great, I've asked for more information in the bug. i'm in train this morning. will work on it though to give more accurate informations (btw, libreO still responsive) In general - unless you're discussing the technical details of a patch, or asking for code pointers to solve a bug - just posting it to the developers list is not the right approach :-) there is no shortage of bugs. as stated by kohei (thanks to him), i'm aware of it and spent some time on this trying hard to understand (and limited by my poor skills). I'm more than willing to help on this but need some code pointers and advices. Sorry i've not been that clear Best laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] LoadComponentFromUrl misuse lead to crash
Hi Caolan Checked this locally (finally), and I get no crash. I get a unsupported url dialog from starbasic. i checked under windows, ok unsupported url seems that the only persons that reproduces the crash are under ubuntu (10.00 for me, 11.10 for jbfaure) you and cedric (i assume you run some linux ;) ) had the expected message (at least no crash) This still a problem for you? if so can you run it under gdb and get a backtrace. the bt was in my original message (rather old). seems an infinite loop regarding titles i paste it there imho, the problem is before the crash, the url being not detected as invalid feel free to ask if you need more details thanks a lot Laurent '-- gdb bt #0 0xb7b52af4 in typelib_static_type_getByTypeClass () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/../ure-link/lib/libuno_cppu.so.3 #1 0xb7afe90b in cppu::OWeakObject::queryInterface(com::sun::star::uno::Type const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3 #2 0xb7af7975 in cppu::WeakImplHelper_query(com::sun::star::uno::Type const, cppu::class_data*, void*, cppu::OWeakObject*) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3 #3 0xb79a3bd2 in ?? () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libsfxlo.so #4 0xb7995d8d in SfxBaseModel::queryInterface(com::sun::star::uno::Type const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libsfxlo.so #5 0xae0b5c43 in ScModelObj::queryInterface(com::sun::star::uno::Type const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/../program/libsclo.so #6 0xb68f1794 in ?? () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #7 0xb69080fb in ?? () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #8 0xb6906eef in framework::TitleHelper::impl_updateTitleForModel(com::sun::star::uno::Referencecom::sun::star::frame::XModel const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #9 0xb69076d8 in framework::TitleHelper::impl_updateTitle() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #10 0xb69079be in framework::TitleHelper::getTitle() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #11 0xb799ff10 in SfxBaseModel::getTitle() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libsfxlo.so #12 0xb69073cb in framework::TitleHelper::impl_updateTitleForController(com::sun::star::uno::Referencecom::sun::star::frame::XController const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #13 0xb69076ec in framework::TitleHelper::impl_updateTitle() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #14 0xb690791a in framework::TitleHelper::titleChanged(com::sun::star::frame::TitleChangedEvent const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #15 0xb690598a in framework::TitleHelper::impl_sendTitleChangedEvent() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #16 0xb690714c in framework::TitleHelper::impl_updateTitleForModel(com::sun::star::uno::Referencecom::sun::star::frame::XModel const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #17 0xb69076d8 in framework::TitleHelper::impl_updateTitle() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #18 0xb69079be in framework::TitleHelper::getTitle() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #19 0xb799ff10 in SfxBaseModel::getTitle() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libsfxlo.so #20 0xb69073cb in framework::TitleHelper::impl_updateTitleForController(com::sun::star::uno::Referencecom::sun::star::frame::XController const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #21 0xb69076ec in
Re: [Libreoffice] LoadComponentFromUrl misuse lead to crash
Hi Caolan This still a problem for you? if so can you run it under gdb and get a backtrace. cedric noel submited a patch yesterday i did not have the time to check, but will do Thanks a lot, i let you know Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] Tell me Easy Hack 42782 remove a dog ! is a joke !
Hi all I don't know if it's a French ideal, it's just the fact that an image of dog should'nt possibly offend anyone. as a newbye, with ideals too, and most important I'm french, i would highly prefer that we speak about cats ! a highly cultural matter concerning Lovecraft lovers please guys, stop this ... Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH]cosmetic around SDK and python
Hi all Here is a cosmetic patch around python and sdk also added a readme on ToolPanel example Laurent From 051740c220b4d97897aa8da7ba6f5da325d409ee Mon Sep 17 00:00:00 2001 From: Laurent Godard lgodard.li...@laposte.net Date: Thu, 8 Dec 2011 17:24:33 +0100 Subject: [PATCH] minor around python and SDK - add Python as available language desc. in SDK homepage - add a readme file to toolpanel example --- odk/examples/examples.html |4 ++-- odk/examples/python/toolpanel/readme | 13 + odk/index.html |6 +++--- 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 odk/examples/python/toolpanel/readme diff --git a/odk/examples/examples.html b/odk/examples/examples.html index 0c9c6b1..9ced1e1 100644 --- a/odk/examples/examples.html +++ b/odk/examples/examples.html @@ -38,7 +38,7 @@ tr td colspan=3 pThe SDK provides a rich set of examples in different programming - languages (Java, C++, OpenOffice.org %PRODUCT_RELEASE% Basic, OLE) to illustrate the use + languages (Java, Python, C++, OpenOffice.org %PRODUCT_RELEASE% Basic, OLE) to illustrate the use of the API and demonstrate how to benefit from the included word processor, spreadsheet, presentation software, graphics program and database of OpenOffice.org %PRODUCT_RELEASE%.br @@ -399,7 +399,7 @@ /tr tr td class=cell20a href=python/toolpanel/title=link to the source directory of the ToolPanel python axampleToolPanelPoc/a/td - td class=cell80This extension illustrates how to create a ToolPanel in Calc./td + td class=cell80This proof of concept extension illustrates how to create a ToolPanel in Calc./td /tr tbody /table diff --git a/odk/examples/python/toolpanel/readme b/odk/examples/python/toolpanel/readme new file mode 100644 index 000..1139438 --- /dev/null +++ b/odk/examples/python/toolpanel/readme @@ -0,0 +1,13 @@ + +This extension is a Proof of concept on implementing Toolpanel in Python + +- make will create the oxt +- provided sdk environnement is set +- alternatively zip the files and name it toolpanel.oxt +- install it +- activate Task Panes in menu (check View Task Pane menu) +- enjoy ! + +The events of the controls (Click me button) in the task pane are handled by basic macro code to illustrate that Toolpanel definition and events codes are indepedant. One could use any language to react on events + +Then focus only on .py and xml files for the toolpanel activation analysis diff --git a/odk/index.html b/odk/index.html index 2a9c57e..f1baa8a 100644 --- a/odk/index.html +++ b/odk/index.html @@ -47,9 +47,9 @@ with new functions./p pThe SDK provides the basic building blocks for external developers to develop components in any language for which a binding exists. - Currently, there are language bindings for LibreOffice %PRODUCT_RELEASE% Basic, Java, + Currently, there are language bindings for LibreOffice %PRODUCT_RELEASE% Basic, Java, Python, and different C++ compilers on different platforms, for LibreOffice %PRODUCT_RELEASE%, - thus covering the two most commonly used programming languages. There + thus covering the most commonly used programming languages. There will be no limit for office automation in heterogeneous environments. Currently supported platforms of the SDK are Linux, Solaris (sparc, x86), and Windows./p @@ -125,7 +125,7 @@ td class=content4img src=docs/images/arrow-1.gif/td td colspan=2a href=examples/examples.html title=link to the examples overview pageExamples/a/td td class=content70A collection of examples in different -programming languages (Java, C++, Basic, OLE, CLI)./td +programming languages (Java, Python, C++, Basic, OLE, CLI)./td /tr tr valign=middle tdimg class=nothing10 src=docs/images/nada.gif/td -- 1.7.1 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] update [PATCH]cosmetic around SDK and python
Hi again sorry for the multiple submission I just realized that the index.html examples age still referenced OOo here is the updated patch laurent From fe27f33008eaf9789a6e113c7685abd6842b38ad Mon Sep 17 00:00:00 2001 From: Laurent Godard lgodard.li...@laposte.net Date: Thu, 8 Dec 2011 17:24:33 +0100 Subject: [PATCH] minor around python and SDK - add Python as available language desc. in SDK homepage - replace OpenOffice.org with LibreOffice in examples index file - add a readme file to toolpanel example --- odk/examples/examples.html | 42 +- odk/examples/python/toolpanel/readme | 13 ++ odk/index.html |6 ++-- 3 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 odk/examples/python/toolpanel/readme diff --git a/odk/examples/examples.html b/odk/examples/examples.html index 0c9c6b1..6e9d21f 100644 --- a/odk/examples/examples.html +++ b/odk/examples/examples.html @@ -38,10 +38,10 @@ tr td colspan=3 pThe SDK provides a rich set of examples in different programming - languages (Java, C++, OpenOffice.org %PRODUCT_RELEASE% Basic, OLE) to illustrate the use + languages (Java, Python, C++, LibreOffice %PRODUCT_RELEASE% Basic, OLE) to illustrate the use of the API and demonstrate how to benefit from the included word processor, spreadsheet, presentation software, graphics program and - database of OpenOffice.org %PRODUCT_RELEASE%.br + database of LibreOffice %PRODUCT_RELEASE%.br Some fo the examples need a running office instance listening on a port. If this is necessary you will get further information in the makefiles./p @@ -88,9 +88,9 @@ /tr tr valign=top td class=content3img src=../docs/images/arrow-1.gif/td - tda href=#Basic_examples title=link to the OpenOffice.org %PRODUCT_RELEASE% Basic examples sectionOpenOffice.org %PRODUCT_RELEASE% Basic examples/a/td + tda href=#Basic_examples title=link to the LibreOffice %PRODUCT_RELEASE% Basic examples sectionLibreOffice %PRODUCT_RELEASE% Basic examples/a/td td class=content75Small set of examples which shows the use of - the API from OpenOffice.org %PRODUCT_RELEASE% Basic./td + the API from LibeOffice %PRODUCT_RELEASE% Basic./td /tr tr valign=top td class=content3img src=../docs/images/arrow-1.gif/td @@ -195,7 +195,7 @@ tr td class=cell20a href=java/Text/ title=link to the source directory of the Java Text examplesWriterSelector/a/td td class=cell80This class gives you information on the selected - objects (text range, text frame, or graphics) at an OpenOffice.org + objects (text range, text frame, or graphics) at a LibreOffice Server./td /tr tbody @@ -219,7 +219,7 @@ /tr tr td class=cell20a href=java/Spreadsheet/ title=link to the source directory of the Java Spreadsheet examplesChartTypeChange/a/td - td class=cell80This class loads an OpenOffice.org %PRODUCT_RELEASE% Calc document and + td class=cell80This class loads a LibreOffice %PRODUCT_RELEASE% Calc document and changes the type of the embedded chart./td /tr tr @@ -303,7 +303,7 @@ td class=cell20a href=http://wiki.services.openoffice.org/wiki/Object_Inspector; title=link to the Object Inspector project page in the wikiObject Inspector/a/td td class=cell80The Object Inspector is primarily an auxiliary tool for the developer, which can present information about an object of the - OpenOffice.org %PRODUCT_RELEASE% API at run-time. Depending on the object to be inspected, + LibreOffice %PRODUCT_RELEASE% API at run-time. Depending on the object to be inspected, appropriate methods, interfaces, services, and attributes can be displayed to the developer. The methods, interfaces, services and attributes are represented in a predictable tree. If the attributes contained in an @@ -399,7 +399,7 @@ /tr tr td class=cell20a href=python/toolpanel/title=link to the source directory of the ToolPanel python axampleToolPanelPoc/a/td - td class=cell80This extension illustrates how to create a ToolPanel in Calc./td + td class=cell80This proof of concept extension illustrates how to create a ToolPanel in Calc./td /tr tbody /table @@ -519,7 +519,7 @@ td table class=table3 tr - td colspan=2 class=head1a name=Basic_examplesOpenOffice.org %PRODUCT_RELEASE% Basic examples/td + td colspan=2 class=head1a name=Basic_examplesLibreOffice %PRODUCT_RELEASE% Basic examples/td td align=right a href=#examples title=link to the examples overviewimg class=navigate src=../docs/images/nav_up.png/a a href=../index.html title=link to the SDK start pageimg class=navigate src=../docs/images/nav_home.png/a @@ -527,8 +527,8
Re: [Libreoffice] [PATCH] [PUSHED] SDK example : add python section and ToolPanel example
Hi stefan Pushed now (I also pushed a follow up containing a Makefile for the toolpanel component, simply packing all the files into a toolpanel.oxt). great !! Thanks a lot I'll probably propose some minor modifications in the coming days Thanks again for your review laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] candidate for a new python section in SDK examples page
Hi all the SDK examples page does not have python section (see sdk/examples/examples.html) on the other hand, i have a proof of concept extension that illustrates how to use XToolPanel i wrote in python Here is the code and the extension. If your review is ok, i'll add this python section in the SDK and propose a patch feel free to send me any remark Laurent # 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. # # The Initial Developer of the Original Code is # Laurent Godard lgodard.li...@laposte.net # Portions created by the Initial Developer are Copyright (C) 2011 the # Initial Developer. All Rights Reserved. # # Major Contributor(s): # # For minor contributions see the git repository. # # inspired from core/testautomation/extensions/optional/input/extension_sources/TaskPaneComponent # # 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. import uno import unohelper from com.sun.star.ui import XUIElementFactory from com.sun.star.ui import XUIElement from com.sun.star.ui.UIElementType import TOOLPANEL as unoTOOLPANEL from com.sun.star.ui import XToolPanel implementation_name = org.lgodard.toolpanel.pocFactory # as defined in Factory.xcu implementation_services = (org.lgodard.toolpanel.pocFactory,) xdlPath = toolpanels/poc.xdl # the path inside the oxt extensionID = org.lgodard.toolpanel # as defined in description.xml class pocToolPanel( unohelper.Base, XToolPanel ): def __init__ ( self, xPanelWindow, ctx ): self.ctx = ctx self.PanelWindow = xPanelWindow self.Window = xPanelWindow def createAccessible( self, i_parentAccessible ): return self.PanelWindow class pyPanel( unohelper.Base, XUIElement ): def __init__ ( self, ctx, xFrame, xParentWindow, url ): self.ctx = ctx self.xParentWindow = xParentWindow self.toolpanel = None self.m_panelRootWindow = None self.Frame = xFrame self.ResourceURL = url self.Type = unoTOOLPANEL def getRealInterface( self ): if not self.toolpanel: rootWindow = self.getOrCreatePanelRootWindow() self.toolpanel = pocToolPanel(rootWindow, self.ctx) return self.toolpanel def getOrCreatePanelRootWindow( self ): pip = self.ctx.getValueByName(/singletons/com.sun.star.deployment.PackageInformationProvider ) s = pip.getPackageLocation(extensionID) dialogUrl = s + / + xdlPath provider = self.ctx.ServiceManager.createInstanceWithContext(com.sun.star.awt.ContainerWindowProvider,self.ctx) self.m_panelRootWindow = provider.createContainerWindow(dialogUrl,,self.xParentWindow, None) return self.m_panelRootWindow def postDisposing( self ): super.postDisposing() if self.m_panelRootWindow: self.m_panelRootWindow.dispose() self.m_panelRootWindow = None self.toolpanel = None return ### ### class pocFactory( unohelper.Base, XUIElementFactory ): def __init__ ( self, ctx ): self.ctx = ctx def createUIElement( self, url, properties ): xParentWindow = None xFrame = None xUIElement = None for arg in properties: if arg.Name == Frame: xFrame = arg.Value elif arg.Name == ParentWindow: xParentWindow = arg.Value if xFrame and xParentWindow: try: xUIElement = pyPanel(self.ctx, xFrame, xParentWindow, url
[Libreoffice] [PATCH]SDK example : add python section and ToolPanel example
Hi all Here is the patch the - add a python section to sdk examples - correct minor css - add the source files of the ToolPanelPoC extension as proof of concept @Stephan, i modified the registration Any remark welcome !!! Laurent From d0b8f1df88384e47a9ee05c79008fe280c0556b6 Mon Sep 17 00:00:00 2001 From: Laurent Godard lgodard.li...@laposte.net Date: Wed, 7 Dec 2011 17:24:12 +0100 Subject: [PATCH] SDK examples : add Python section and ToolPanel python example correct minor css rendering too --- odk/docs/sdk_styles.css| 16 ++- odk/examples/examples.html | 63 - odk/examples/python/toolpanel/CalcWindowState.xcu | 21 +++ odk/examples/python/toolpanel/Factory.xcu | 26 .../python/toolpanel/META-INF/manifest.xml | 15 ++ odk/examples/python/toolpanel/description.xml |5 + .../python/toolpanel/toolPanelPocBasic/Module1.xba | 29 .../python/toolpanel/toolPanelPocBasic/dialog.xlb |3 + .../python/toolpanel/toolPanelPocBasic/script.xlb |5 + odk/examples/python/toolpanel/toolpanel.component | 35 + odk/examples/python/toolpanel/toolpanel.py | 148 odk/examples/python/toolpanel/toolpanels/poc.xdl | 11 ++ 12 files changed, 369 insertions(+), 8 deletions(-) create mode 100644 odk/examples/python/toolpanel/CalcWindowState.xcu create mode 100644 odk/examples/python/toolpanel/Factory.xcu create mode 100644 odk/examples/python/toolpanel/META-INF/manifest.xml create mode 100755 odk/examples/python/toolpanel/description.xml create mode 100644 odk/examples/python/toolpanel/toolPanelPocBasic/Module1.xba create mode 100644 odk/examples/python/toolpanel/toolPanelPocBasic/dialog.xlb create mode 100644 odk/examples/python/toolpanel/toolPanelPocBasic/script.xlb create mode 100644 odk/examples/python/toolpanel/toolpanel.component create mode 100644 odk/examples/python/toolpanel/toolpanel.py create mode 100755 odk/examples/python/toolpanel/toolpanels/poc.xdl diff --git a/odk/docs/sdk_styles.css b/odk/docs/sdk_styles.css index d1cd940..5be9eb7 100644 --- a/odk/docs/sdk_styles.css +++ b/odk/docs/sdk_styles.css @@ -876,7 +876,8 @@ hr { border-color: #CC; border-spacing: 0; border-collapse: collapse; - padding: 4; } + padding: 4; + color: #00; } .cell20 { width: 20%; border-width: 2px; @@ -884,7 +885,8 @@ hr { border-color: #CC; border-spacing: 0; border-collapse: collapse; - padding: 4; } + padding: 4; + color: #00; } .cell80 { width: 80%; border-width: 2px; @@ -892,7 +894,8 @@ hr { border-color: #CC; border-spacing: 0; border-collapse: collapse; - padding: 4; } + padding: 4; + color: #00; } .cell85 { width: 85%; border-width: 2px; @@ -900,7 +903,8 @@ hr { border-color: #CC; border-spacing: 0; border-collapse: collapse; - padding: 4; } + padding: 4; + color: #00;} .nothing1 { width: 20; height: 1; } @@ -941,8 +945,8 @@ hr { font-weight: bold; } .thead { font-weight: bold; - background-image:url(../docs/images/bg_table.png); - backgorund-position: middle; } + background-color:#18a303; + background-position: middle; } .navigate { border: 0; } diff --git a/odk/examples/examples.html b/odk/examples/examples.html index ed66695..0c9c6b1 100644 --- a/odk/examples/examples.html +++ b/odk/examples/examples.html @@ -1,6 +1,6 @@ html head - titleOpenOffice.org %PRODUCT_RELEASE% SDK - Examples/title + titleLibreOffice %PRODUCT_RELEASE% SDK - Examples/title link rel=stylesheet type=text/css href=../docs/sdk_styles.css meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 meta name=author content=Juuml;rgen Schmidt @@ -10,7 +10,7 @@ body class=sdkbodya name=examples/ table class=table1 cellpadding=0 tr style=background-image:url(../docs/images/sdk_head-2.png); backgorund-position: bottom; -td class=background colspan=3 align=leftimg src=../docs/images/sdk_head-1.png width=800 height=120 usemap=#Map border=0/td +td class=background colspan=3 align=leftimg src=../docs/images/sdk_head-1.png height=120 usemap=#Map border=0/td /tr tr td colspan=3img class=nothing10 src=../docs/images/nada.gif/td @@ -77,6 +77,11 @@ /tr tr valign=top td class=content3img src=../docs/images/arrow-1.gif/td + tda href=#python_examples title=link to the Python examples sectionPython examples/a/td + td class=content75Small set of examples which shows the use of the API from Python./td +/tr +tr valign=top + td class=content3img src=../docs/images/arrow-1.gif/td tda href=#Cpp_examples title=link to the C++ examples sectionC++ examples/a/td td class=content75Small set of examples which shows the use of the API from C++./td
Re: [Libreoffice] concept for c++ based subsequenttests
Hi all So, who would be willing to invest time if it were written in python? With C++ at least Markus is already showing interest. I must admit that i would be more comfortable writing tests in python than c++ and could then help for some Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] LoadComponentFromUrl misuse lead to crash
Hi here is a summary of the bug i encounter, present in all LibO versions (master, 344, 322), but safe in OOo321 inside a macro, i launch a stardesktop.loadComponentFromUrl(firstArg, ...). if firstArg is an URL, starting with file://, no problem if firstArg is a path, /the/path/to/my/file, LibO crashes yes, firstArg has to be an URL, it is specified. But LibO should throw an IllegalArgumentException as OOo does. Never good that LibO crashes when i say it crashes, it starts loading. but then enters a loop when progress bar ends; using gdb, i have a lot of the same cycle calls (given at the of the mail) Examining the code, i see no URL check (but may have missed something, high probability) http://opengrok.libreoffice.org/xref/core/framework/source/services/desktop.cxx#657 http://opengrok.libreoffice.org/xref/core/framework/source/loadenv/loadenv.cxx#164 http://opengrok.libreoffice.org/xref/core/framework/source/loadenv/loadenv.cxx#180 http://opengrok.libreoffice.org/xref/core/framework/source/loadenv/loadenv.cxx#239 http://opengrok.libreoffice.org/xref/core/framework/source/loadenv/loadenv.cxx#281 I propose to add a check of validity of sURl somewhere and throw illegalArgument The most easy i see would be in http://opengrok.libreoffice.org/xref/core/framework/source/services/desktop.cxx#657 any other better place in your opinion ? may be in http://opengrok.libreoffice.org/xref/core/framework/source/loadenv/loadenv.cxx#classifyContent ??? do we have any tool that can check if an URL is valid ? (taking various protocols into account like in http://opengrok.libreoffice.org/xref/core/framework/source/loadenv/loadenv.cxx#631 any guidelines welcome so that i can propose a patch Laurent ' gdb bt #0 0xb7b52af4 in typelib_static_type_getByTypeClass () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/../ure-link/lib/libuno_cppu.so.3 #1 0xb7afe90b in cppu::OWeakObject::queryInterface(com::sun::star::uno::Type const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3 #2 0xb7af7975 in cppu::WeakImplHelper_query(com::sun::star::uno::Type const, cppu::class_data*, void*, cppu::OWeakObject*) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3 #3 0xb79a3bd2 in ?? () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libsfxlo.so #4 0xb7995d8d in SfxBaseModel::queryInterface(com::sun::star::uno::Type const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libsfxlo.so #5 0xae0b5c43 in ScModelObj::queryInterface(com::sun::star::uno::Type const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/../program/libsclo.so #6 0xb68f1794 in ?? () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #7 0xb69080fb in ?? () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #8 0xb6906eef in framework::TitleHelper::impl_updateTitleForModel(com::sun::star::uno::Referencecom::sun::star::frame::XModel const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #9 0xb69076d8 in framework::TitleHelper::impl_updateTitle() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #10 0xb69079be in framework::TitleHelper::getTitle() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #11 0xb799ff10 in SfxBaseModel::getTitle() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libsfxlo.so #12 0xb69073cb in framework::TitleHelper::impl_updateTitleForController(com::sun::star::uno::Referencecom::sun::star::frame::XController const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #13 0xb69076ec in framework::TitleHelper::impl_updateTitle() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #14 0xb690791a in framework::TitleHelper::titleChanged(com::sun::star::frame::TitleChangedEvent const) () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #15 0xb690598a in framework::TitleHelper::impl_sendTitleChangedEvent() () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libfwelo.so #16 0xb690714c in
Re: [Libreoffice] uno discoverability
Hi all Thanks to Thorsten pointing the old (2004) pyUno I revived it recently and made it workable again, removing some unnecessary things but it is in my plans to make it cleaner as a lot of things is outdated (eg. old OOo links to idl reference - need to be updated). I hope to find time in a near future btw, here is the version i'm actally using the basic use to instrospect an object at runtime is rather simple inside a pyUNo script : from pyXray import XrayBox XrayBox(self.ctx, theUnoObject) self.ctx, is the context Feel free to include it in LibreOffice sources if you find it usefull, provided the licence is ok (otherwise, i may ask my old employer, but there should be no problem, just let me know) I really hope that it will be usefull for someone (as an introspection tool or sample of pyUno script). Let me know and feel free to ask if any question HTH Laurent # (C) Copyright 2004 Indesko SARL http://indesko.com # Author: Laurent Godard lgod...@indesko.com (old email) # Laurent Godard lgodard.li...@laposte.net # based on Xray Basic macro from Bernard Marcelly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as published # by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # import uno, unohelper # UNO GUI toolkit from com.sun.star.awt.WindowClass import TOP, SIMPLE from com.sun.star.awt.PushButtonType import STANDARD as standard from com.sun.star.awt.PushButtonType import OK as ok from com.sun.star.awt.PushButtonType import CANCEL as cancel from com.sun.star.awt.PushButtonType import HELP as help from com.sun.star.awt.TextAlign import CENTER as center from com.sun.star.awt.TextAlign import LEFT as left from com.sun.star.awt.TextAlign import RIGHT as right # used UNO listeners from com.sun.star.awt import XActionListener from com.sun.star.awt import XItemListener from com.sun.star.awt import XMouseListener # UNO typeClass handling for instrospection from com.sun.star.uno.TypeClass import VOID as unoVoid from com.sun.star.uno.TypeClass import CHAR as unoChar from com.sun.star.uno.TypeClass import BOOLEAN as unoBoolean from com.sun.star.uno.TypeClass import BYTE as unoByte from com.sun.star.uno.TypeClass import SHORT as unoShort from com.sun.star.uno.TypeClass import UNSIGNED_SHORT as unoUnsignedShort from com.sun.star.uno.TypeClass import LONG as unoLong from com.sun.star.uno.TypeClass import UNSIGNED_LONG as unoUnsignedLong from com.sun.star.uno.TypeClass import HYPER as unoHyper from com.sun.star.uno.TypeClass import UNSIGNED_HYPER as unoUnsignedHyper from com.sun.star.uno.TypeClass import FLOAT as unoFloat from com.sun.star.uno.TypeClass import DOUBLE as unoDouble from com.sun.star.uno.TypeClass import STRING as unoString from com.sun.star.uno.TypeClass import TYPE as unoType from com.sun.star.uno.TypeClass import ANY as unoAny from com.sun.star.uno.TypeClass import ENUM as unoEnum from com.sun.star.uno.TypeClass import TYPEDEF as unoTypeDef from com.sun.star.uno.TypeClass import STRUCT as unoStruct from com.sun.star.uno.TypeClass import UNION as unoUnion from com.sun.star.uno.TypeClass import EXCEPTION as unoException from com.sun.star.uno.TypeClass import SEQUENCE as unoSequence from com.sun.star.uno.TypeClass import ARRAY as unoArray from com.sun.star.uno.TypeClass import INTERFACE as unoInterface from com.sun.star.uno.TypeClass import SERVICE as unoService from com.sun.star.uno.TypeClass import MODULE as unoModule from com.sun.star.uno.TypeClass import INTERFACE_METHOD as unoInterfaceMethod from com.sun.star.uno.TypeClass import INTERFACE_ATTRIBUTE as unoInterfaceAttribute from com.sun.star.uno.TypeClass import UNKNOWN as unoUnknown from com.sun.star.uno.TypeClass import PROPERTY as unoProperty from com.sun.star.uno.TypeClass import CONSTANT as unoConstant from com.sun.star.uno.TypeClass import CONSTANTS as unoConstants from com.sun.star.uno.TypeClass import SINGLETON as unoSingleton # file utilities from os import sep from os import mkdir # path logo from os import path from sys import modules logo_path = path.dirname (path.abspath (modules[pyXray].__file__)) #logo_path = logo_path + sep + 'logo.jpg' logo_path= #Browser for SDK Querying from os import environ as OS_ENVIRON #if sep == '/': # problem on invoking konqueror # http://aspn.activestate.com/ASPN/Mail/Message/python-Tutor/2184915 #if OS_ENVIRON['BROWSER']=='kfmclient openProfile webbrowsing': #OS_ENVIRON['BROWSER']='konqueror' import webbrowser my_browser = webbrowser.get
[Libreoffice] licensing and email change
HI all Please note my email change from oooc...@free.fr to lgodard.li...@laposte.net the most important I license all my contributions past+future under MPL/LGPLv3+ Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] config register toolbar controller in adddon
Hi why? is it impossible to configure a custom toolbar in addon using controller.xcu ? and how to get it work in my addon? does OOO provides an API to give advanced custom toolbar configuration in a addon. can someone help on this please? you may have a look at the sdk, there are some example of custom toolbar /sdk/examples/cpp/complextoolbarcontrols/ IIRC, Noel did some presentation about it at Paris HTH Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] config register toolbar controller in adddon
HI , I looked to this one but these are not flexible enough. i need more complex controls (like XFixedText and progressbar). i also want to dynamically show/hide toolbar controls at runtime. do you know how we can do this? i'm currently exploring this http://wiki.services.openoffice.org/wiki/Framework/Article/Tool_Panels quite promosing mixing technlogies (java/python + Basic dialogs) it globally works with some tricks i'm actually on writing the factory as python instead of java (the part dealing with layoutmanager is missing, though) i'll probably will write things about it when ok Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] need mentoring on framework module (enabling toolpanels)
Hi Michael Thanks for your response I have 3 degrees of responses So - you can get a tool panel presented and working for you ? [ do you get to the green screenshot state ? ]. 1- well i went a bit more deeper than the green panel ;) using the java code at core/testautomation/extensions/optional/input/extension_sources/TaskPaneComponent i've been able to load a dialog.xdl file and bind macros (then any scipt code) to the events of the controls (on click for exampke). It is perfect for my use ! one trick though, retrieving the dialog object itself, i manage only using the on-focus event (and store it in a global variable). not beautifull but hey, it works. That what was i was looking for dealing with the LayoutManager, retreiving the panel object to manipulate its components. no more urgent need now (but the lack in core_code remains) 2- The next step i almost finished (but currently not fully working) is rewriting the TaskPaneComponent java code to Python The problem i face here is that all the code is executed, but nothings shows up. probably a stupid mistake somewhere Once all is ok, i'll probbaly take some time to write things on the wiki and provide a sample source code for step 1 and 2 I haven't done pyUNo for years, so it was a bit difficult (but really funny !!) I reactivated a pyUNo tool i wrote in 2004 and with a small polish it worked like a charm. It is a very usefull tool (at least for me) for doing introspection at runtime on pyUNo objects. http://markmail.org/message/kt2va3mc3ggwk4e2 the download link is dead but i'll publish pyXray and offer it to Libreoffice if it can help. At least could be a learning tool ofr pyUno beginers 3- LibreOffice source code once a toolpanel is created, we can not at the moment control it as we control statusbar, toolbars, menubars (especially regarding visibility) this is done using the XLayoutManager interface and as stated in the announce, it is not implemented yet. so i thought that if it was an easy hack, i could perharps do it (but my priority remains calc very large files performances for Libo 3.5 - I'll start working on this in november) regarding my patch, it will be waste of time. it was more or less random modifications, only copying few lines and changing names. i'll try to first finish the point 2. and then see if this XLayoutManager problem is really needed for scripter point of view. i'll come back to you. (but not last week, as i'll be in hollidays with the whole family, so hacking on computers not welcommed ;) ) also what do you want to put in your panel ? [ I for one would love to have some share-pointy stuff in there, workflows and so on for relevant documents ]. my goal is to put any XControl that one can use un Basic dialogs (buttons, labels, treeviews, pictures, combox box aso ...) i'm pretty confident it will work (at least it works with a java factory of the toolpanel) This toolpanel stuff is quite exciting as it offers a lot of possibilities for cool extensions GUI (and what is really cool, is that you can write your events code in the language you want ;) ) I promise officially here to publish a working sample extension and write some guidelines Thanks a lot Michael for your response !! Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] need mentoring on framework module (enabling toolpanels)
Hi all before diving in calc large file in november, i have to deal at the moment with XToolPanel the purpose is to be able to have things in task pane and manipulate them using scripting (macro or python at the moment) i add some succes with core/testautomation/extensions/optional/input/extension_sources/TaskPaneComponent and it seems promising BUT (there is always a BUT to have more fun !) reading http://www.mail-archive.com/dev@api.openoffice.org/msg10273.html They're not yet fully integrated into the UI framework implementation, that is, you cannot yet use the Layout Manager to control them (this is up to a next step, where the existing implementation is to be merged with some layout manager refactoring). So, I do not have the skills to do the whole refactoring of the framework module but i would like to try to add the support of toolpanels I already looked at some source code and did some rough modification taking example on other UIElements, but no success for the moment. essentially in framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx as using it in scprit, a lot of UIElements are shown but no toolpanels before going further and wasting a lot of time (well, i could see it at learning), I definitvely need someone that could mentor me and put me in the right directions (what is really misisng, what should i write, which UiElement could I take as example) Thanks a lot in advance !!! Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] IDL @since build error if not OOo
Hi all tring to a add a new property to calc document, i had to append it to an idl file (offapi/com/sun/star/sheet/SpreadsheetDocumentSettings.idl) one can read for example /** specifies whether the automatic adjustment of the row height is enabled. @since OOo 3.0 */ [optional, property] boolean IsAdjustHeightEnabled; i modified the @since, putting LO 3.5 and end with a build error, complaining that Version information in @since tag has incorrect format.\n Correct version format: \OOo major.minor[.micro if micro is not 0]\. this is in http://opengrok.libreoffice.org/xref/core/autodoc/source/parser_i/idoc/docu_pe2.cxx so my question is do we care about that ? (ie. specifying LO in the @since) i think we should to make things clear to api users the second question is about solving that : this comes from the test http://opengrok.libreoffice.org/xref/core/autodoc/source/parser_i/idoc/docu_pe2.cxx#517 performed at http://opengrok.libreoffice.org/xref/core/autodoc/source/parser_i/idoc/docu_pe2.cxx#616 so, what should i do to be the cleanest and keep consystency over time ? - drop the test ? - modify the String to also take care about LO and LibreOffice ? I can propose a patch as soon as there is an agreement on the modification to do Thanks Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH][REVIEW] IDL @since build error if not OOo
Hi all here is a patch (master branch) that add LibreOffice and LO string support to @since tag in idl files this solves a build breakage in odk if an IDL @since tag in offapi contains LibreOffice or LO Laurent From f98d6dbbcf8fbc98d4a64709c6575ce507024cc0 Mon Sep 17 00:00:00 2001 From: Laurent Godard oooc...@free.fr Date: Wed, 31 Aug 2011 15:26:52 +0200 Subject: [PATCH] allow LibreOffice reference in IDL @since tag --- autodoc/source/parser_i/idoc/docu_pe2.cxx |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/autodoc/source/parser_i/idoc/docu_pe2.cxx b/autodoc/source/parser_i/idoc/docu_pe2.cxx index 2f1af7f..d675103 100644 --- a/autodoc/source/parser_i/idoc/docu_pe2.cxx +++ b/autodoc/source/parser_i/idoc/docu_pe2.cxx @@ -616,7 +616,9 @@ bool SapiDocu_PE::CheckVersionSyntax_OOo(const String i_versionPart1) { return i_versionPart1 == OOo -OR i_versionPart1 == OpenOffice.org; +OR i_versionPart1 == OpenOffice.org +OR i_versionPart1 == LO +OR i_versionPart1 == LibreOffice; } bool -- 1.7.1 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH][REVIEW] [PUSHED] IDL @since build error if not OOo
HI Nah, why bother with abbreviations at all, surely it is not too much to expect people to write LibreOffice in full in *documentation* ? (online chat is another thing) Committed the patch (and then committed a follow-up that dropped the LO) and pushed. (If anybody feels strongly in favour of the abbreviations, feel free to revert etc.) Thanks! i'm fine with that thanks tor (and kohei too, i'm far from core developper ;) ) laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [REVIEW]patch improving calc file loading time
Hi all could you please have a look at this patch it avoids multiple calls to maTables.back() that waste time on loading a calc file. the idea is to store the last table needed and use this instead of retreiving it each time from maTables on a pathological calc file this drastically improve the loading time (near 35% in certains cases) this patch is based on 3.4 branch and targets the 3.4.4 at least thanks again to markus for his great mentoring Laurent From b144f825cd7f12b516348473391dc8a67f4539d9 Mon Sep 17 00:00:00 2001 From: Laurent Godard oooc...@free.fr Date: Wed, 24 Aug 2011 19:09:19 +0200 Subject: [PATCH] avoid maTables.back() calls by store and reuse when needed better performance on loadin calc files (esp. big ones) --- sc/source/filter/xml/xmlsubti.cxx | 99 - sc/source/filter/xml/xmlsubti.hxx |3 +- 2 files changed, 55 insertions(+), 47 deletions(-) diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index 4b1316e..e769fa5 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -68,7 +68,7 @@ using ::std::auto_ptr; using namespace com::sun::star; ScMyTableData::ScMyTableData(sal_Int32 nSheet, sal_Int32 nCol, sal_Int32 nRow) -: nColsPerCol(nDefaultColCount, 1), +: nColsPerCol(nDefaultColCount, 1), nRealCols(nDefaultColCount + 1, 0), nRowsPerRow(nDefaultRowCount, 1), nRealRows(nDefaultRowCount + 1, 0), @@ -163,7 +163,8 @@ ScMyTables::ScMyTables(ScXMLImport rTempImport) nCurrentColStylePos(0), nCurrentDrawPage( -1 ), nCurrentXShapes( -1 ), -nCurrentSheet( -1 ) +nCurrentSheet( -1 ), +pLastTable(NULL) { } @@ -179,6 +180,7 @@ void ScMyTables::NewSheet(const rtl::OUString sTableName, const rtl::OUString nCurrentColStylePos = 0; sCurrentSheetName = sTableName; maTables.clear(); +pLastTable = NULL; ++nCurrentSheet; maProtectionData = rProtectData; @@ -336,12 +338,11 @@ void ScMyTables::DoMerge(sal_Int32 nCount) uno::Reference table::XCellRange xMergeCellRange; if (nCount == -1) { -const ScMyTableData r = maTables.back(); xMergeCellRange.set( xCurrentCellRange-getCellRangeByPosition( aCellAddress.StartColumn, aCellAddress.StartRow, -aCellAddress.EndColumn + r.GetColsPerCol(r.GetColumn()) - 1, -aCellAddress.EndRow + r.GetRowsPerRow(r.GetRow()) - 1)); +aCellAddress.EndColumn + pLastTable-GetColsPerCol(pLastTable-GetColumn()) - 1, +aCellAddress.EndRow + pLastTable-GetRowsPerRow(pLastTable-GetRow()) - 1)); } else xMergeCellRange.set( @@ -362,8 +363,8 @@ void ScMyTables::InsertRow() { table::CellRangeAddress aCellAddress; sal_Int32 nRow(GetRealCellPos().Row); -const ScMyTableData rTab = maTables.back(); -for (sal_Int32 j = 0; j GetRealCellPos().Column - rTab.GetColumn() - 1; ++j) + +for (sal_Int32 j = 0; j GetRealCellPos().Column - pLastTable-GetColumn() - 1; ++j) { if (IsMerged(xCurrentCellRange, j, nRow - 1, aCellAddress)) { @@ -391,7 +392,7 @@ void ScMyTables::NewRow() if (n = 1) return; -if (maTables[n-1].GetRealRows(maTables[n-1].GetRow()) +if (pLastTable-GetRealRows(pLastTable-GetRow()) maTables[n-2].GetRowsPerRow(maTables[n-2].GetRow()) - 1) { if (GetRealCellPos().Column 0) @@ -413,15 +414,14 @@ void ScMyTables::NewRow() void ScMyTables::AddRow() { -ScMyTableData rTab = maTables.back(); -rTab.AddRow(); -rTab.SetFirstColumn(); -sal_Int32 nRow = rTab.GetRow(); +pLastTable-AddRow(); +pLastTable-SetFirstColumn(); +sal_Int32 nRow = pLastTable-GetRow(); if (nRow 0) NewRow(); -rTab.SetRealRows( -nRow + 1, rTab.GetRealRows(nRow) + rTab.GetRowsPerRow(nRow)); +pLastTable-SetRealRows( +nRow + 1, pLastTable-GetRealRows(nRow) + pLastTable-GetRowsPerRow(nRow)); } void ScMyTables::SetRowStyle(const rtl::OUString rCellStyleName) @@ -435,7 +435,8 @@ void ScMyTables::InsertColumn() { table::CellRangeAddress aCellAddress; sal_Int32 nCol(GetRealCellPos().Column); -sal_Int32 n = GetRealCellPos().Row - maTables.back().GetRow() - 1; +sal_Int32 n = GetRealCellPos().Row - pLastTable-GetRow() - 1; + for (sal_Int32 j = 0; j = n; ++j) { table::CellRangeAddress aTempCellAddress; @@ -459,7 +460,7 @@ void ScMyTables::InsertColumn() //insert Cell sheet::CellInsertMode aCellInsertMode(sheet::CellInsertMode_RIGHT); -uno::Reference sheet::XCellRangeMovement xCellRangeMovement (xCurrentSheet, uno::UNO_QUERY); +uno::Reference sheet::XCellRangeMovement xCellRangeMovement
Re: [Libreoffice] [PATCH][REVIEW] SetNamedRanges speedup fdo#35357
Hi all first sorry for my silence. Holidays with bad connectivity (and wife and children veto for using computers ;) ) I just want to thank all of you for finalizing this (and sorry kohei for missing the content thing) hacking libO is not that difficult but requires time. i'll try to propose other patches in the future (but not in the comming days unfortunatelly) have a nice day Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH][REVIEW] SetNamedRanges speedup fdo#35357
Hi all Here is my first patch and want at first thanks a lot everybody who helped me starting my build and especially Kohei for his patience and deep knowledge in calc. Kohei is a great mentor :-) The purpose of this patch is to speed up things when sheet.link is used. It is based on the 3.4 branch The result with the test case in the fdo#35357 is a drop for the 1211 namedRanges from 5.781 seconds to 0.931 seconds. The test case only focused on sheet.link call but that patch should improve the file loading in general, especially with documents with a large number of range names. it would also be great for me if it could be part of the 3.4.x branch as this would affect a large number of my users instead of being stuck to OOo 3.2.1 thanks in advance for your review and thank a lot again to Kohei Laurent From bab77494deaddcc442807fc57ffa9639ec8f573e Mon Sep 17 00:00:00 2001 From: Laurent Godard oooc...@free.fr Date: Fri, 15 Jul 2011 17:55:55 +0200 Subject: [PATCH] fix for fdo#35357 SetNamedRanges speedup use of SheetRangeNameInserter SheetRangeNameInserter now handles rangeType changing SetSheetNamedRanges accordingly rename SheetRangeNameInserter to RangeNameInserter --- sc/source/filter/xml/xmlimprt.cxx | 139 - 1 files changed, 30 insertions(+), 109 deletions(-) diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 83f599f..28d870c 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2770,124 +2770,31 @@ private: } -void ScXMLImport::SetNamedRanges() -{ -ScMyNamedExpressions* pNamedExpressions = GetNamedExpressions(); -if (!pNamedExpressions) -return; - -Reference beans::XPropertySet xPropertySet (GetModel(), UNO_QUERY); -if (!xPropertySet.is()) -return; - -Reference sheet::XNamedRanges xNamedRanges( -xPropertySet-getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_NAMEDRANGES))), UNO_QUERY); - -if (!xNamedRanges.is()) -return; - -Referencebeans::XPropertySet xPropSet(xNamedRanges, UNO_QUERY); -if (!xPropSet.is()) -return; - -// Turn off broadcasting while adding imported range names. -NamedRangesSwitch aSwitch(xPropSet); - -ScMyNamedExpressions::iterator aItr(pNamedExpressions-begin()); -ScMyNamedExpressions::const_iterator aEndItr(pNamedExpressions-end()); -table::CellAddress aCellAddress; -OUString sTempContent(RTL_CONSTASCII_USTRINGPARAM(0)); - -for (; aItr != aEndItr; ++aItr) -{ -sal_Int32 nOffset = 0; -bool bSuccess = ScRangeStringConverter::GetAddressFromString( -aCellAddress, aItr-sBaseCellAddress, GetDocument(), FormulaGrammar::CONV_OOO, nOffset); - -if (!bSuccess) -// Conversion of base cell address failed. Skip this. -continue; - -try -{ -xNamedRanges-addNewByName( -aItr-sName, sTempContent, aCellAddress, GetRangeType(aItr-sRangeType)); -} -catch( uno::RuntimeException ) -{ -OSL_FAIL(here are some Named Ranges with the same name); -uno::Reference container::XIndexAccess xIndex(xNamedRanges, uno::UNO_QUERY); -if (xIndex.is()) -{ -sal_Int32 nMax = xIndex-getCount(); -bool bInserted = false; -sal_Int32 nCount = 1; -OUStringBuffer sName(aItr-sName); -sName.append(sal_Unicode('_')); -while (!bInserted nCount = nMax) -{ -OUStringBuffer sTemp(sName); -sTemp.append(OUString::valueOf(nCount)); -try -{ -xNamedRanges-addNewByName( -sTemp.makeStringAndClear(), sTempContent, aCellAddress, -GetRangeType(aItr-sRangeType)); -bInserted = true; -} -catch( uno::RuntimeException ) -{ -++nCount; -} -} -UnlockSolarMutex(); -} -} -} - -aItr = pNamedExpressions-begin(); -while (aItr != aEndItr) -{ -sal_Int32 nOffset(0); -if (ScRangeStringConverter::GetAddressFromString( -aCellAddress, aItr-sBaseCellAddress, GetDocument(), FormulaGrammar::CONV_OOO, nOffset )) -{ -uno::Reference sheet::XNamedRange xNamedRange(xNamedRanges-getByName(aItr-sName), uno::UNO_QUERY); -if (xNamedRange.is()) -{ -ScXMLImport::MutexGuard aGuard(*this); -ScNamedRangeObj* pNamedRangeObj = ScNamedRangeObj::getImplementation( xNamedRange); -if (pNamedRangeObj) -{ -sTempContent = aItr-sContent; -// Get rid
Re: [Libreoffice] [GSOC] Report #5. Wizards
Hi michael In that case, the templates are the ones that should be changed, right ? Weelll - so you're both right; but really we need to grub about inside the templates themselves to add some improved translation scheme I think; now we have fast native XSLTs - I guess we could use the native XSLT filters to allow the templates to be self-standing, and yet adapt to the locale nicely. IIRC, templates can be deployed with extension mechanism so why not use this and package language based extension when building the installer ? so, you may find more easily maintainers of these files i think your proposal is intellectually the good one, but seems overkill to me regarding the efforts needed when the files will have to be updated thanks anyway for your leading :-) Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [REVIEW] Enable online update service
Hi all I second Ollivier's questions moreover, going one step forward about updates would it be possible to dissociate LibrO update service and Extensions one ? in OOo, there was only one option, but i think this would be better to let the admin choose. the best would be to make this per Extension. would it be something hard to do ? Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] LibreOffice / OpenOffice.org sniffing in extension
Hi Christophe perharps not perfect (and in fact surely ;) ) here is how i quickly solved this using macros can be implemented in java btw, perharps not the right mailing list HTH laurent '- function isLibreOffice dim aSettings, nom aSettings = getConfigSetting(/org.openoffice.Setup/Product, false) nom = aSettings.ooName isLibreOffice = (nom = LibreOffice) end function function getConfigSetting(target as string, forUpdate as boolean) dim service as String ' nom du service d'acces à la configuration dim aSettings, aConfigProvider dim aParams(0) As new com.sun.star.beans.PropertyValue dim varEmpty if forUpdate then service = com.sun.star.configuration.ConfigurationUpdateAccess else service = com.sun.star.configuration.ConfigurationAccess endif aConfigProvider = createUnoService( com.sun.star.configuration.ConfigurationProvider ) aParams(0).Name = nodepath aParams(0).Value = target aSettings = aConfigProvider.createInstanceWithArguments(service, aParams() ) getConfigSetting = aSettings end function ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] Regarding LibreOffice Application Support
Hi same api as OOo have a look at http://api.openoffice.org/ http://wiki.services.openoffice.org/wiki/Extensions for you problem, you may have a look at jodconverter http://www.artofsolving.com/opensource/jodconverter HTH laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] An image editing extension for writer
Hi If it's an optioonal add-in you're prepared to support, then fine, but don't expect it to be accepted into the base LO. IMHO, an external extension is the way to go for such a feature ! do not fear extensions contributors as they may help adding new features to librO ;) please also note the importance of preserving as much as possible API compatibility between OOo and LibO along the time laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] UX New layout Move/Copy sheet in calc
Hi Joost thanks for these nice ideas regarding Step 3 http://wiki.services.openoffice.org/wiki/User_Experience/Projects/NonModalMessageSystem#Step_3_-_Contextual_Message is there no problem with orthographic correction red waves and grammatical blue ones if you underline with a blue line for the message ? thanks again laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] Problem using bin/ooinstall -l target directory
HI experiencing the same error ... LibreOffice/***/gid_Starregistry_Services_Rdb_servicesrdb ... here is some detail http://libreoffice.pastebin.com/zRVRZEx8 There seems to be a problem with the installer on e.g. Ubuntu for python I confirm i'm under ubuntu Lucid components. As a hackaround adding --with-system-python to the ./autogen.sh line might work. I'm not seeing the problem on e.g. Fedora, but I've heard the complaint a few time so far. i tried this morning it built ok but i have the same problem with a make dev-install Laurent ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice