[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/source
sc/source/ui/view/gridwin.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit dc057620aa4652baa73301cf668511b1fd33190f Author: Czeber László Ádám AuthorDate: Fri Aug 11 10:31:24 2023 +0200 Commit: László Németh CommitDate: Wed Aug 30 11:58:19 2023 +0200 tdf#155495 sc: fix cursor positioning editing centered/right-aligned cells It was not always possible to place the cursor in edited text by mouse clicking in case of centered and right-aligned cell content, i.e. when the edited content has been shown before the original (not edited) cell position. Now it's possible to place the cursor by mouse clicking before the left border of the not edited cell (instead of selecting other cells covered by the edited content). Change-Id: I23c59ca3ef67d223181a7e3dfd71b84f43fca32b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155579 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit f8561c0098012b0f76ccf9b5c368a06dcecaf62e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156217 Tested-by: Jenkins diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index e68300c0b369..78a8db5e3d25 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1930,8 +1930,9 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta mrViewData.GetEditView( eWhich, pEditView, nEditCol, nEditRow ); SCCOL nEndCol = mrViewData.GetEditEndCol(); SCROW nEndRow = mrViewData.GetEditEndRow(); +SCCOL nStartCol = mrViewData.GetEditStartCol(); -if ( nPosX >= nEditCol && nPosX <= nEndCol && +if ( nPosX >= nStartCol && nPosX <= nEndCol && nPosY >= nEditRow && nPosY <= nEndRow ) { // when clicking in the table EditView, always reset the focus
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/gridwin.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 62e201d2cf82f4ccaa6564bd2420ac6582594b8f Author: Czeber László Ádám AuthorDate: Fri Aug 11 10:31:24 2023 +0200 Commit: László Németh CommitDate: Tue Aug 29 16:49:20 2023 +0200 tdf#155495 sc: fix cursor positioning editing centered/right-aligned cells It was not always possible to place the cursor in edited text by mouse clicking in case of centered and right-aligned cell content, i.e. when the edited content has been shown before the original (not edited) cell position. Now it's possible to place the cursor by mouse clicking before the left border of the not edited cell (instead of selecting other cells covered by the edited content). Change-Id: I23c59ca3ef67d223181a7e3dfd71b84f43fca32b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155579 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 275c9dbcec25..d5a6bf9db155 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1943,8 +1943,9 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta mrViewData.GetEditView( eWhich, pEditView, nEditCol, nEditRow ); SCCOL nEndCol = mrViewData.GetEditEndCol(); SCROW nEndRow = mrViewData.GetEditEndRow(); +SCCOL nStartCol = mrViewData.GetEditStartCol(); -if ( nPosX >= nEditCol && nPosX <= nEndCol && +if ( nPosX >= nStartCol && nPosX <= nEndCol && nPosY >= nEditRow && nPosY <= nEndRow ) { // when clicking in the table EditView, always reset the focus
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/ucalc_copypaste.cxx | 17 + sc/source/core/data/documen3.cxx |9 - 2 files changed, 25 insertions(+), 1 deletion(-) New commits: commit cb141564733eef078347b89ea657e46e193bd140 Author: Czeber László Ádám AuthorDate: Mon Jul 17 11:41:17 2023 +0200 Commit: László Németh CommitDate: Tue Aug 22 11:56:13 2023 +0200 tdf#103480 sc: fix lost hyperlink at merging an empty cell with its cell Merging a cell containing a hyperlink with an empty cell resulted the loss of the hyperlink, i.e. only the text content was kept. Change-Id: I5148ce55157e3ad7926f5b5a82a682b837a784ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154520 Reviewed-by: László Németh Tested-by: László Németh diff --git a/sc/qa/unit/ucalc_copypaste.cxx b/sc/qa/unit/ucalc_copypaste.cxx index bad57d8646a7..575cfb90f9f7 100644 --- a/sc/qa/unit/ucalc_copypaste.cxx +++ b/sc/qa/unit/ucalc_copypaste.cxx @@ -10752,6 +10752,23 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testUndoBackgroundColor) m_pDoc->DeleteTab(0); } +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMergedHyperlink) +{ +m_pDoc->InsertTab(0, "Table1"); +m_pDoc->InitDrawLayer(m_xDocShell.get()); + +ScFieldEditEngine& pEE = m_pDoc->GetEditEngine(); +pEE.SetTextCurrentDefaults("https://libreoffice.org/;); +m_pDoc->SetEditText(ScAddress(1, 0, 0), pEE.CreateTextObject()); // B1 + +m_pDoc->DoMergeContents(0, 0, 1, 0, 0); // A1:B1 + +CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, m_pDoc->GetCellType(ScAddress(0, 0, 0))); // A1 +const EditTextObject* pEditObj = m_pDoc->GetEditText(ScAddress(0, 0, 0)); // A1 +CPPUNIT_ASSERT(pEditObj); +CPPUNIT_ASSERT_EQUAL(OUString("https://libreoffice.org/;), pEditObj->GetText(0)); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 73cf516c4d49..b52deed7d85b 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -2030,6 +2030,7 @@ void ScDocument::DoMergeContents( SCCOL nStartCol, SCROW nStartRow, OUString aCellStr; SCCOL nCol; SCROW nRow; +ScCellValue aCell; for (nRow=nStartRow; nRow<=nEndRow; nRow++) for (nCol=nStartCol; nCol<=nEndCol; nCol++) { @@ -2039,12 +2040,18 @@ void ScDocument::DoMergeContents( SCCOL nStartCol, SCROW nStartRow, if (!aTotal.isEmpty()) aTotal.append(' '); aTotal.append(aCellStr); +ScAddress aPos(nCol, nRow, nTab); +if ((GetCellType(aPos) == CELLTYPE_EDIT) && aCell.isEmpty()) +aCell = ScRefCellValue(*this, aPos); } if (nCol != nStartCol || nRow != nStartRow) SetString(nCol,nRow,nTab,""); } -SetString(nStartCol,nStartRow,nTab,aTotal.makeStringAndClear()); +if (aCell.isEmpty() || !GetString(nStartCol, nStartRow, nTab).isEmpty()) +SetString(nStartCol, nStartRow, nTab, aTotal.makeStringAndClear()); +else +aCell.release(*this, ScAddress(nStartCol, nStartRow, nTab)); } void ScDocument::DoEmptyBlock( SCCOL nStartCol, SCROW nStartRow,
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/qa sc/source
sc/qa/unit/data/xlsx/tdf142905.xlsx |binary sc/qa/unit/subsequent_filters_test4.cxx | 12 sc/source/filter/oox/excelhandlers.cxx |4 +++- 3 files changed, 15 insertions(+), 1 deletion(-) New commits: commit 15e8278144a7326e9587a665e9e1068562309295 Author: Czeber László Ádám AuthorDate: Thu Jul 20 13:14:21 2023 +0200 Commit: László Németh CommitDate: Wed Jul 26 11:02:57 2023 +0200 tdf#142905 XLSX import: don't trim leading spaces in formula cell When importing an XLSX file, there was a discrepancy between the read and recalculated cell values if it contains leading/ending spaces. With this fix, trimming in worksheet files is only applied to elements that contain a parameter and do not have a space="preserved" parameter. Change-Id: I91e09eaa3cb79537ddbed36e1124e4afd124d8f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154674 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 864e5cdb0cc91b9bf2ea0428590094a8901b33ed) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154914 Tested-by: Jenkins diff --git a/sc/qa/unit/data/xlsx/tdf142905.xlsx b/sc/qa/unit/data/xlsx/tdf142905.xlsx new file mode 100644 index ..b6e8296581c3 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf142905.xlsx differ diff --git a/sc/qa/unit/subsequent_filters_test4.cxx b/sc/qa/unit/subsequent_filters_test4.cxx index 646b1e66f5b7..27d9d6f29150 100644 --- a/sc/qa/unit/subsequent_filters_test4.cxx +++ b/sc/qa/unit/subsequent_filters_test4.cxx @@ -1918,6 +1918,18 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf155402) CPPUNIT_ASSERT_EQUAL(OUString("/[tdf155402.xlsx]Sheet1"), aFilename); } +CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf142905) +{ +createScDoc("xlsx/tdf142905.xlsx"); +ScDocument* pDoc = getScDoc(); + +// Without the fix, trims the spaces in cell C1 after reading the XLSX file. +// After recalculation it is fixed. +// - Expected: " 3M " +// - Actual : "3M" +CPPUNIT_ASSERT_EQUAL(OUString(" 3M "), pDoc->GetString(2, 0, 0)); +} + ScFiltersTest4::ScFiltersTest4() : ScModelTestBase("sc/qa/unit/data") { diff --git a/sc/source/filter/oox/excelhandlers.cxx b/sc/source/filter/oox/excelhandlers.cxx index ab39116b695b..77b5dda2ade7 100644 --- a/sc/source/filter/oox/excelhandlers.cxx +++ b/sc/source/filter/oox/excelhandlers.cxx @@ -30,9 +30,11 @@ WorkbookFragmentBase::WorkbookFragmentBase( { } +// tdf142905: Change mbEnableTrimSpace default value is false, +// because it will not trim members that do not have an attribute. WorksheetFragmentBase::WorksheetFragmentBase( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) : -FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath ), +FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath, false ), WorksheetHelper( rHelper ) { }
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/data/xlsx/tdf142905.xlsx |binary sc/qa/unit/subsequent_filters_test4.cxx | 12 sc/source/filter/oox/excelhandlers.cxx |4 +++- 3 files changed, 15 insertions(+), 1 deletion(-) New commits: commit 7ec4c6df68233b73b1e257e013583ca49fc2ec9b Author: Czeber László Ádám AuthorDate: Thu Jul 20 13:14:21 2023 +0200 Commit: László Németh CommitDate: Tue Jul 25 15:50:15 2023 +0200 tdf#142905 XLSX import: don't trim leading spaces in formula cell When importing an XLSX file, there was a discrepancy between the read and recalculated cell values if it contains leading/ending spaces. With this fix, trimming in worksheet files is only applied to elements that contain a parameter and do not have a space="preserved" parameter. Change-Id: I91e09eaa3cb79537ddbed36e1124e4afd124d8f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154674 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sc/qa/unit/data/xlsx/tdf142905.xlsx b/sc/qa/unit/data/xlsx/tdf142905.xlsx new file mode 100644 index ..b6e8296581c3 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf142905.xlsx differ diff --git a/sc/qa/unit/subsequent_filters_test4.cxx b/sc/qa/unit/subsequent_filters_test4.cxx index 646b1e66f5b7..27d9d6f29150 100644 --- a/sc/qa/unit/subsequent_filters_test4.cxx +++ b/sc/qa/unit/subsequent_filters_test4.cxx @@ -1918,6 +1918,18 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf155402) CPPUNIT_ASSERT_EQUAL(OUString("/[tdf155402.xlsx]Sheet1"), aFilename); } +CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf142905) +{ +createScDoc("xlsx/tdf142905.xlsx"); +ScDocument* pDoc = getScDoc(); + +// Without the fix, trims the spaces in cell C1 after reading the XLSX file. +// After recalculation it is fixed. +// - Expected: " 3M " +// - Actual : "3M" +CPPUNIT_ASSERT_EQUAL(OUString(" 3M "), pDoc->GetString(2, 0, 0)); +} + ScFiltersTest4::ScFiltersTest4() : ScModelTestBase("sc/qa/unit/data") { diff --git a/sc/source/filter/oox/excelhandlers.cxx b/sc/source/filter/oox/excelhandlers.cxx index ab39116b695b..77b5dda2ade7 100644 --- a/sc/source/filter/oox/excelhandlers.cxx +++ b/sc/source/filter/oox/excelhandlers.cxx @@ -30,9 +30,11 @@ WorkbookFragmentBase::WorkbookFragmentBase( { } +// tdf142905: Change mbEnableTrimSpace default value is false, +// because it will not trim members that do not have an attribute. WorksheetFragmentBase::WorksheetFragmentBase( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) : -FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath ), +FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath, false ), WorksheetHelper( rHelper ) { }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/source
sc/source/core/data/postit.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit eec038b982b4672ac8feb030cb6bae546fa8c901 Author: Czeber László Ádám AuthorDate: Fri Jun 30 12:24:53 2023 +0200 Commit: László Németh CommitDate: Tue Jul 25 10:29:29 2023 +0200 tdf#117307 sc: Comments are duplicated after Row delete and Undo The comment was cloned if you deleted and restored its filtered cell. During Undo, the comment was cloned even if it was for the same cell, resulting duplicated comments there. Regression from commit eefe13c77d01be37c911e75af191717a944fedb3 "shrinking the DB area just causes problems, tdf#89546". Change-Id: I86d0813c56ba63370aae6b5f7807a19747e2378c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153803 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 712ec904b68afd965e9108986c29fe9c527c6991) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154707 Tested-by: Jenkins diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index 106a249e5666..cbb2eff1ff14 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -483,6 +483,9 @@ ScPostIt::~ScPostIt() std::unique_ptr ScPostIt::Clone( const ScAddress& rOwnPos, ScDocument& rDestDoc, const ScAddress& rDestPos, bool bCloneCaption ) const { +// tdf#117307: Don't clone comment, if it is in the same position +if ( (rOwnPos == rDestPos) && !mrDoc.IsClipboard() ) +bCloneCaption = false; CreateCaptionFromInitData( rOwnPos ); sal_uInt32 nPostItId = comphelper::LibreOfficeKit::isActive() ? 0 : mnPostItId; return bCloneCaption ? std::make_unique( rDestDoc, rDestPos, *this, nPostItId ) : std::make_unique( rDestDoc, rDestPos, maNoteData, false, mnPostItId );
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/attarray.hxx |2 - sc/inc/column.hxx|6 ++-- sc/source/core/data/attarray.cxx | 56 +++ sc/source/core/data/table1.cxx | 12 ++-- 4 files changed, 47 insertions(+), 29 deletions(-) New commits: commit 87ca7d2f146be2c309fc6fd36f9154f3ea4e4bd8 Author: Czeber László Ádám AuthorDate: Mon Jun 19 11:02:23 2023 +0200 Commit: Eike Rathke CommitDate: Tue Jul 25 00:32:30 2023 +0200 tdf#93315 sc: Only 84 empty row show in the Print Preview Change in Calc behaviour, dropping the 84 line limit. This way, if all rows or columns are bordered, only up to the last cell containing data is displayed in the Print Preview. In other cases, all bordered cells are visible. Change-Id: I7d874a093d76d5ed92b1b63b645b97582d52629e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153256 Tested-by: Jenkins Reviewed-by: Eike Rathke diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index 868118796560..cbc8f7cfe2f9 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -203,7 +203,7 @@ public: boolIsEmpty() const; boolGetFirstVisibleAttr( SCROW& rFirstRow ) const; -boolGetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const; +boolGetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData, bool bSkipEmpty ) const; boolHasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const; boolIsVisibleEqual( const ScAttrArray& rOther, SCROW nStartRow, SCROW nEndRow ) const; diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 4b64537e1705..fe3b84842af2 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -313,7 +313,7 @@ public: boolHasSelectionMatrixFragment(const ScMarkData& rMark, const ScRangeList& rRangeList) const; boolGetFirstVisibleAttr( SCROW& rFirstRow ) const; -boolGetLastVisibleAttr( SCROW& rLastRow ) const; +boolGetLastVisibleAttr( SCROW& rLastRow, bool bSkipEmpty ) const; boolHasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const; boolIsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const; @@ -890,11 +890,11 @@ inline bool ScColumn::GetFirstVisibleAttr( SCROW& rFirstRow ) const return pAttrArray->GetFirstVisibleAttr( rFirstRow ); } -inline bool ScColumn::GetLastVisibleAttr( SCROW& rLastRow ) const +inline bool ScColumn::GetLastVisibleAttr( SCROW& rLastRow, bool bSkipEmpty ) const { // row of last cell is needed SCROW nLastData = GetLastDataPos();// always including notes, 0 if none -return pAttrArray->GetLastVisibleAttr( rLastRow, nLastData ); +return pAttrArray->GetLastVisibleAttr( rLastRow, nLastData, bSkipEmpty ); } inline bool ScColumn::HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 87fa2c11ccf1..02b6b9d793ed 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1942,7 +1942,7 @@ bool ScAttrArray::GetFirstVisibleAttr( SCROW& rFirstRow ) const const SCROW SC_VISATTR_STOP = 84; -bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const +bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData, bool bSkipEmpty ) const { if ( mvData.empty() ) { @@ -1971,31 +1971,43 @@ bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const rLastRow = nLastData; return false; } - -// Find a run below last data row. +// tdf#93315: If "Suppress output of empty pages" in Calc Options is not checked, show empty +// (containing only empty data cells) page in the document bool bFound = false; -Search( nLastData, nPos ); -while ( nPos < mvData.size() ) +if (bSkipEmpty) +{ +Search( nLastData, nPos ); +while ( nPos < mvData.size() ) +{ +// find range of visually equal formats +SCSIZE nEndPos = nPos; +while ( nEndPos < mvData.size()-1 && + mvData[nEndPos].pPattern->IsVisibleEqual(*mvData[nEndPos+1].pPattern)) +++nEndPos; +SCROW nAttrStartRow = ( nPos > 0 ) ? ( mvData[nPos-1].nEndRow + 1) : 0; +if ( nAttrStartRow <= nLastData ) +nAttrStartRow = nLastData + 1; +SCROW nAttrSize = mvData[nEndPos].nEndRow + 1 - nAttrStartRow; +if ( nAttrSize >= SC_VISATTR_STOP ) +break; // while, ignore this range and below +else if ( mvData[nEndPos].pPattern->IsVisible() ) +{ +rLastRow = mvData[nEndPos].nEndRow; +bFound = true; +} +nPos = nEndPos + 1; +} +} +else { -// find range of visually equal formats -SCSIZE nEndPos = nPos; -while ( nEndPos <
[Libreoffice-commits] core.git: sc/source
sc/source/core/data/postit.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit ade2565cc2b2e5e8cf35fe828bf85649f7ff593a Author: Czeber László Ádám AuthorDate: Fri Jun 30 12:24:53 2023 +0200 Commit: László Németh CommitDate: Sat Jul 22 01:08:19 2023 +0200 tdf#117307 sc: Comments are duplicated after Row delete and Undo The comment was cloned if you deleted and restored its filtered cell. During Undo, the comment was cloned even if it was for the same cell, resulting duplicated comments there. Regression from commit eefe13c77d01be37c911e75af191717a944fedb3 "shrinking the DB area just causes problems, tdf#89546". Change-Id: I86d0813c56ba63370aae6b5f7807a19747e2378c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153803 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index 106a249e5666..cbb2eff1ff14 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -483,6 +483,9 @@ ScPostIt::~ScPostIt() std::unique_ptr ScPostIt::Clone( const ScAddress& rOwnPos, ScDocument& rDestDoc, const ScAddress& rDestPos, bool bCloneCaption ) const { +// tdf#117307: Don't clone comment, if it is in the same position +if ( (rOwnPos == rDestPos) && !mrDoc.IsClipboard() ) +bCloneCaption = false; CreateCaptionFromInitData( rOwnPos ); sal_uInt32 nPostItId = comphelper::LibreOfficeKit::isActive() ? 0 : mnPostItId; return bCloneCaption ? std::make_unique( rDestDoc, rDestPos, *this, nPostItId ) : std::make_unique( rDestDoc, rDestPos, maNoteData, false, mnPostItId );
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 10 commits - download.lst external/pdfium include/xmloff sc/inc sc/qa sc/source sd/qa sd/source svx/source sw/qa sw/source xmloff/q
download.lst|8 external/pdfium/Library_pdfium.mk |1 external/pdfium/UnpackedTarball_pdfium.mk |8 external/pdfium/abseil-trivial.patch| 31 --- external/pdfium/build.patch.1 | 170 ++-- external/pdfium/inc/pch/precompiled_pdfium.hxx |2 external/pdfium/include.patch | 11 - include/xmloff/xmlimp.hxx |1 sc/inc/column.hxx |6 sc/qa/unit/ucalc_copypaste.cxx | 45 + sc/source/core/data/table1.cxx |5 sc/source/core/data/table2.cxx |3 sc/source/ui/view/output2.cxx |5 sd/qa/uitest/data/tdf155863.odp |binary sd/qa/uitest/impress_tests/tdf155863.py | 34 sd/source/filter/xml/sdxmlwrp.cxx |2 svx/source/svdraw/svdograf.cxx | 24 +- sw/qa/extras/layout/data/tox-update-wrong-pages.odt |binary sw/qa/extras/layout/layout.cxx | 34 sw/source/core/inc/frmtool.hxx |1 sw/source/core/layout/flowfrm.cxx | 20 ++ sw/source/core/layout/sectfrm.cxx |3 xmloff/qa/unit/uxmloff.cxx | 65 --- xmloff/source/core/xmlimp.cxx | 80 ++--- xmloff/source/meta/xmlmetai.cxx |4 25 files changed, 347 insertions(+), 216 deletions(-) New commits: commit 07f3199b06ef767c1d1378a6e4f270ef0f05f479 Author: Czeber László Ádám AuthorDate: Mon Jun 12 16:12:05 2023 +0200 Commit: Andras Timar CommitDate: Fri Jun 30 00:52:49 2023 +0200 tdf#122676 sc: fix format with * (filling) and NBSP thousand separator Numbers containing no-break space (NBSP) thousand separator enabled the EditEngine layout, losing filling e.g. for stretching spaces. Enable EditEngine for NBSP characters only if there is no filling in the number format code, fixing MSO interoperability, too. In number format codes, asterisk (*) followed by a character is used to fill the available space in the column with that character, e.g. format code [>0]" "* # ##0" € ";[<0]-* # ##0" € ";" "* -#" € ";" "@" " put the minus sign at the left side of the column, while the number at the right side of the column. Because of the NBSP thousand separator, bigger numbers got different layout previously, i.e. minus signs right next to the numbers. Note: there is a better solution for the layout problem: using narrow no-break space (U-202F), which is the proposed thousand separator in typography, and it's back-compatible, because it doesn't enable the different layout. Change-Id: Ia35f01733687ee6005f06ff3ab999b7a4b712ad4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152901 Reviewed-by: László Németh Tested-by: László Németh (cherry picked from commit 72e70088dc45fbe15f809abf5263247b13d937ac) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153337 Tested-by: Jenkins diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 649ccdd7349e..fe8d06684517 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -815,6 +815,11 @@ bool ScDrawStringsVars::HasEditCharacters() const switch(aString[nIdx]) { case CHAR_NBSP: +// tdf#122676: Ignore CHAR_NBSP (this is thousand separator in any number) +// if repeat character is set +if (nRepeatPos < 0) +return true; +break; case CHAR_SHY: case CHAR_ZWSP: case CHAR_LRM: commit 738d7c7198a7697c9311343ebd10c7e56ac9f5d5 Author: Michael Stahl AuthorDate: Tue Jun 27 14:50:02 2023 +0200 Commit: Andras Timar CommitDate: Fri Jun 30 00:52:48 2023 +0200 xmloff: ODF import: adapt generator parsing to 2-digit major versions DocumentInfo currently assumes that a LO version encoded in "BuildId" property has only 1 digit major version, which is now wrong and would start to give incorrect results when major version "30" will be detected as LO_3x. Add the dots as separators into the BuildId because it's not going to work without. Change-Id: I8918afe3642cbefa8488c57658f1505c9a20eddd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153649 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit b1ce8bb078904db1df542f7a1c2ed527dde1a2d3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153689 Reviewed-by: Christian Lohmaier diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 26873175268d..3684a7e087b5 100644
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sc/source
sc/source/ui/view/output2.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 56c965372e2de4ea53b1ab09056906c85fbff06b Author: Czeber László Ádám AuthorDate: Mon Jun 12 16:12:05 2023 +0200 Commit: László Németh CommitDate: Thu Jun 29 10:54:19 2023 +0200 tdf#122676 sc: fix format with * (filling) and NBSP thousand separator Numbers containing no-break space (NBSP) thousand separator enabled the EditEngine layout, losing filling e.g. for stretching spaces. Enable EditEngine for NBSP characters only if there is no filling in the number format code, fixing MSO interoperability, too. In number format codes, asterisk (*) followed by a character is used to fill the available space in the column with that character, e.g. format code [>0]" "* # ##0" € ";[<0]-* # ##0" € ";" "* -#" € ";" "@" " put the minus sign at the left side of the column, while the number at the right side of the column. Because of the NBSP thousand separator, bigger numbers got different layout previously, i.e. minus signs right next to the numbers. Note: there is a better solution for the layout problem: using narrow no-break space (U-202F), which is the proposed thousand separator in typography, and it's back-compatible, because it doesn't enable the different layout. Change-Id: Ia35f01733687ee6005f06ff3ab999b7a4b712ad4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152901 Reviewed-by: László Németh Tested-by: László Németh (cherry picked from commit 72e70088dc45fbe15f809abf5263247b13d937ac) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153337 Tested-by: Jenkins diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 649ccdd7349e..fe8d06684517 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -815,6 +815,11 @@ bool ScDrawStringsVars::HasEditCharacters() const switch(aString[nIdx]) { case CHAR_NBSP: +// tdf#122676: Ignore CHAR_NBSP (this is thousand separator in any number) +// if repeat character is set +if (nRepeatPos < 0) +return true; +break; case CHAR_SHY: case CHAR_ZWSP: case CHAR_LRM:
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sc/inc sc/source
sc/inc/column.hxx |6 ++ sc/source/core/data/table1.cxx | 12 +--- sc/source/core/data/table2.cxx |3 +++ 3 files changed, 14 insertions(+), 7 deletions(-) New commits: commit 93c6fdc58d577d059968a71ae08b80096f73ef1a Author: Czeber László Ádám AuthorDate: Thu Jun 8 14:55:34 2023 +0200 Commit: Xisco Fauli CommitDate: Tue Jun 27 22:36:53 2023 +0200 tdf#153437 sc: fix broken formatting without performance regression Follow-up to commit 7be7e1ff95af485a9cb00748800d3d084f96387c "tdf#153437 sc: fix broken formatting at Undo of row/column insertion" by replacing that with a better version without performance regression. This keeps the original performance fix of commit 2e86718626a07e1656661df3ad69a64848bf4614 "don't allocate unnecessary columns when inserting a row" related to the support of 16k columns. The previous fix used extra memory to fix the broken formatting of the cells. I have now solved the error in tdf#153437 without taking extra memory. It doesn't change the reserved cells, it just deletes a row from the default attribute of the cells when deleting rows, so they don't slip. When deleting a column, the last column in the still reserved area loses its formatting. I copied the default value back here, as the other columns have this value. Change-Id: I35da1cb79ff4e3493e91d29766cc2b81412080eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152742 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit c61f5a5d55c07721f044befc1f6efa0231cd92f6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152814 Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153494 Tested-by: Jenkins diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 949ca30dd137..87d3dc730a9f 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -171,6 +171,7 @@ public: boolTestInsertRow( SCSIZE nSize ) const; voidInsertRow( SCROW nStartRow, SCSIZE nSize ); +voidDeleteRow( SCROW nStartRow, SCSIZE nSize ); }; // Use protected inheritance to prevent publishing some internal ScColumnData @@ -1054,4 +1055,9 @@ inline void ScColumnData::InsertRow( SCROW nStartRow, SCSIZE nSize ) pAttrArray->InsertRow( nStartRow, nSize ); } +inline void ScColumnData::DeleteRow(SCROW nStartRow, SCSIZE nSize) +{ +pAttrArray->DeleteRow( nStartRow, nSize ); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 6cb5384c05f9..308025656319 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1851,13 +1851,11 @@ void ScTable::UpdateReference( } else { -// When deleting row(s) or column(s), allocate the last column -// before updating the references -if (nDx < 0 || nDy < 0) -CreateColumnIfNotExists(rDocument.MaxCol()); - -for (SCCOL col : GetColumnsRange(0, rDocument.MaxCol())) -bUpdated |= CreateColumnIfNotExists(col).UpdateReference(rCxt, pUndoDoc); +for (SCCOL col : GetAllocatedColumnsRange(0, rDocument.MaxCol())) +bUpdated |= aCol[col].UpdateReference(rCxt, pUndoDoc); +// When deleting row(s), delete same row from the default attribute +if (nDy < 0) +aDefaultColData.DeleteRow(nRow1+nDy, -nDy); } if ( bIncludeDraw ) diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 4eb5671f0dc7..91f90dbb1ae4 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -400,6 +400,9 @@ void ScTable::DeleteCol( { for (SCCOL nCol = nStartCol + nSize; nCol < aCol.size(); ++nCol) aCol[nCol].SwapCol(aCol[nCol - nSize]); +// When delete column(s), inicialize the last columns from the default attributes +for (SCCOL nCol = aCol.size() - nSize; nCol < aCol.size(); ++nCol) +aCol[nCol].Init(nCol, aCol[nCol].GetTab(), rDocument, false); } else {
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sc/qa sc/source
sc/qa/unit/ucalc_copypaste.cxx | 45 + sc/source/core/data/table1.cxx |9 ++-- 2 files changed, 52 insertions(+), 2 deletions(-) New commits: commit 0692344caa7b79b7bef980326ede85ce5867631c Author: Czeber László Ádám AuthorDate: Wed May 24 09:05:16 2023 +0200 Commit: László Németh CommitDate: Tue Jun 27 12:34:59 2023 +0200 tdf#153437 sc: fix broken formatting at Undo of row/column insertion Performance fix for the 16k rows resulted broken formatting during Undo of row insertion, e.g. rows with background color fell apart, highlighting partially also the row under the deleted row removed by Undo, or Undo of inserted/copied columns removed the background coloring at the place of the removed columns. Formatting was always deleted after the last column containing data, because the row was only allocated until then. When deleting row(s) or column(s), allocate the last column before updating the references. Regression from commit 2e86718626a07e1656661df3ad69a64848bf4614 "don't allocate unnecessary columns when inserting a row". Change-Id: I8d74d59ff0051fdfe183e14a16d987edc71d55e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152185 Tested-by: László Németh Reviewed-by: László Németh Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153493 Reviewed-by: Stéphane Guillou Tested-by: Jenkins diff --git a/sc/qa/unit/ucalc_copypaste.cxx b/sc/qa/unit/ucalc_copypaste.cxx index b6062cb04c72..e63353c860ec 100644 --- a/sc/qa/unit/ucalc_copypaste.cxx +++ b/sc/qa/unit/ucalc_copypaste.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -135,6 +136,7 @@ public: // tdf#80137 void testCopyPasteMatrixFormula(); +void testUndoBackgroundColor(); CPPUNIT_TEST_SUITE(TestCopyPaste); @@ -239,6 +241,7 @@ public: CPPUNIT_TEST(testMixDataWithFormulaTdf116413); CPPUNIT_TEST(testCopyPasteMatrixFormula); +CPPUNIT_TEST(testUndoBackgroundColor); CPPUNIT_TEST_SUITE_END(); @@ -10905,6 +10908,48 @@ void TestCopyPaste::testCopyPasteMatrixFormula() m_pDoc->DeleteTab(0); } +void TestCopyPaste::testUndoBackgroundColor() +{ +m_pDoc->InsertTab(0, "Table1"); + +ScDocument aClipDoc(SCDOCMODE_CLIP); +ScMarkData aMark(m_pDoc->GetSheetLimits()); + +// Set Values to B1, C2, D5 +m_pDoc->SetValue(ScAddress(1, 0, 0), 1.0); // B1 +m_pDoc->SetValue(ScAddress(2, 1, 0), 2.0); // C2 +m_pDoc->SetValue(ScAddress(3, 4, 0), 3.0); // D5 + +// Add patterns +ScPatternAttr aCellBlueColor(m_pDoc->GetPool()); +aCellBlueColor.GetItemSet().Put(SvxBrushItem(COL_BLUE, ATTR_BACKGROUND)); +m_pDoc->ApplyPatternAreaTab(0, 3, m_pDoc->MaxCol(), 3, 0, aCellBlueColor); + +// Insert a new row at row 3 +ScRange aRowOne(0, 2, 0, m_pDoc->MaxCol(), 2, 0); +aMark.SetMarkArea(aRowOne); +ScDocFunc& rFunc = m_xDocShell->GetDocFunc(); +rFunc.InsertCells(aRowOne, , INS_INSROWS_BEFORE, true, true); + +// Check patterns +const SfxPoolItem* pItem = nullptr; +m_pDoc->GetPattern(ScAddress(1000, 4, 0))->GetItemSet().HasItem(ATTR_BACKGROUND, ); +CPPUNIT_ASSERT(pItem); +CPPUNIT_ASSERT_EQUAL(COL_BLUE, static_cast(pItem)->GetColor()); + +// Undo the new row +m_pDoc->GetUndoManager()->Undo(); + +// Check patterns +// Failed if row 3 is not blue all the way through +pItem = nullptr; +m_pDoc->GetPattern(ScAddress(1000, 3, 0))->GetItemSet().HasItem(ATTR_BACKGROUND, ); +CPPUNIT_ASSERT(pItem); +CPPUNIT_ASSERT_EQUAL(COL_BLUE, static_cast(pItem)->GetColor()); + +m_pDoc->DeleteTab(0); +} + CPPUNIT_TEST_SUITE_REGISTRATION(TestCopyPaste); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 78c49912bcc9..6cb5384c05f9 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1851,8 +1851,13 @@ void ScTable::UpdateReference( } else { -for( SCCOL col : GetAllocatedColumnsRange( 0, rDocument.MaxCol())) -bUpdated |= aCol[col].UpdateReference(rCxt, pUndoDoc); +// When deleting row(s) or column(s), allocate the last column +// before updating the references +if (nDx < 0 || nDy < 0) +CreateColumnIfNotExists(rDocument.MaxCol()); + +for (SCCOL col : GetColumnsRange(0, rDocument.MaxCol())) +bUpdated |= CreateColumnIfNotExists(col).UpdateReference(rCxt, pUndoDoc); } if ( bIncludeDraw )
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/source
sc/source/ui/view/output2.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 68bbbfd3b93c546c8004e916ea58a4c16f95c648 Author: Czeber László Ádám AuthorDate: Mon Jun 12 16:12:05 2023 +0200 Commit: László Németh CommitDate: Fri Jun 23 10:23:59 2023 +0200 tdf#122676 sc: fix format with * (filling) and NBSP thousand separator Numbers containing no-break space (NBSP) thousand separator enabled the EditEngine layout, losing filling e.g. for stretching spaces. Enable EditEngine for NBSP characters only if there is no filling in the number format code, fixing MSO interoperability, too. In number format codes, asterisk (*) followed by a character is used to fill the available space in the column with that character, e.g. format code [>0]" "* # ##0" € ";[<0]-* # ##0" € ";" "* -#" € ";" "@" " put the minus sign at the left side of the column, while the number at the right side of the column. Because of the NBSP thousand separator, bigger numbers got different layout previously, i.e. minus signs right next to the numbers. Note: there is a better solution for the layout problem: using narrow no-break space (U-202F), which is the proposed thousand separator in typography, and it's back-compatible, because it doesn't enable the different layout. Change-Id: Ia35f01733687ee6005f06ff3ab999b7a4b712ad4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152901 Reviewed-by: László Németh Tested-by: László Németh (cherry picked from commit c60700711caff1fc61e5219abdb17c535ea4459d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153336 Tested-by: Jenkins diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 46d26860976e..d8dfb064e605 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -815,6 +815,11 @@ bool ScDrawStringsVars::HasEditCharacters() const switch(aString[nIdx]) { case CHAR_NBSP: +// tdf#122676: Ignore CHAR_NBSP (this is thousand separator in any number) +// if repeat character is set +if (nRepeatPos < 0) +return true; +break; case CHAR_SHY: case CHAR_ZWSP: case CHAR_LRM:
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/output2.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 72e70088dc45fbe15f809abf5263247b13d937ac Author: Czeber László Ádám AuthorDate: Mon Jun 12 16:12:05 2023 +0200 Commit: László Németh CommitDate: Tue Jun 20 14:45:03 2023 +0200 tdf#122676 sc: fix format with * (filling) and NBSP thousand separator Numbers containing no-break space (NBSP) thousand separator enabled the EditEngine layout, losing filling e.g. for stretching spaces. Enable EditEngine for NBSP characters only if there is no filling in the number format code, fixing MSO interoperability, too. In number format codes, asterisk (*) followed by a character is used to fill the available space in the column with that character, e.g. format code [>0]" "* # ##0" € ";[<0]-* # ##0" € ";" "* -#" € ";" "@" " put the minus sign at the left side of the column, while the number at the right side of the column. Because of the NBSP thousand separator, bigger numbers got different layout previously, i.e. minus signs right next to the numbers. Note: there is a better solution for the layout problem: using narrow no-break space (U-202F), which is the proposed thousand separator in typography, and it's back-compatible, because it doesn't enable the different layout. Change-Id: Ia35f01733687ee6005f06ff3ab999b7a4b712ad4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152901 Reviewed-by: László Németh Tested-by: László Németh diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 649ccdd7349e..fe8d06684517 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -815,6 +815,11 @@ bool ScDrawStringsVars::HasEditCharacters() const switch(aString[nIdx]) { case CHAR_NBSP: +// tdf#122676: Ignore CHAR_NBSP (this is thousand separator in any number) +// if repeat character is set +if (nRepeatPos < 0) +return true; +break; case CHAR_SHY: case CHAR_ZWSP: case CHAR_LRM:
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/inc sc/source
sc/inc/column.hxx |6 ++ sc/source/core/data/table1.cxx | 12 +--- sc/source/core/data/table2.cxx |3 +++ 3 files changed, 14 insertions(+), 7 deletions(-) New commits: commit c37e74949cf3cd11b701e4aea943aba4e8c1d4f8 Author: Czeber László Ádám AuthorDate: Thu Jun 8 14:55:34 2023 +0200 Commit: László Németh CommitDate: Mon Jun 12 12:21:30 2023 +0200 tdf#153437 sc: fix broken formatting without performance regression Follow-up to commit 7be7e1ff95af485a9cb00748800d3d084f96387c "tdf#153437 sc: fix broken formatting at Undo of row/column insertion" by replacing that with a better version without performance regression. This keeps the original performance fix of commit 2e86718626a07e1656661df3ad69a64848bf4614 "don't allocate unnecessary columns when inserting a row" related to the support of 16k columns. The previous fix used extra memory to fix the broken formatting of the cells. I have now solved the error in tdf#153437 without taking extra memory. It doesn't change the reserved cells, it just deletes a row from the default attribute of the cells when deleting rows, so they don't slip. When deleting a column, the last column in the still reserved area loses its formatting. I copied the default value back here, as the other columns have this value. Change-Id: I35da1cb79ff4e3493e91d29766cc2b81412080eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152742 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit c61f5a5d55c07721f044befc1f6efa0231cd92f6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152814 diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 5c42f02794ab..4b64537e1705 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -172,6 +172,7 @@ public: boolTestInsertRow( SCSIZE nSize ) const; voidInsertRow( SCROW nStartRow, SCSIZE nSize ); +voidDeleteRow( SCROW nStartRow, SCSIZE nSize ); }; // Use protected inheritance to prevent publishing some internal ScColumnData @@ -1057,4 +1058,9 @@ inline void ScColumnData::InsertRow( SCROW nStartRow, SCSIZE nSize ) pAttrArray->InsertRow( nStartRow, nSize ); } +inline void ScColumnData::DeleteRow(SCROW nStartRow, SCSIZE nSize) +{ +pAttrArray->DeleteRow( nStartRow, nSize ); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 99e0c5f39b0d..c5d4de055f8d 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1849,13 +1849,11 @@ void ScTable::UpdateReference( } else { -// When deleting row(s) or column(s), allocate the last column -// before updating the references -if (nDx < 0 || nDy < 0) -CreateColumnIfNotExists(rDocument.MaxCol()); - -for (SCCOL col : GetColumnsRange(0, rDocument.MaxCol())) -bUpdated |= CreateColumnIfNotExists(col).UpdateReference(rCxt, pUndoDoc); +for (SCCOL col : GetAllocatedColumnsRange(0, rDocument.MaxCol())) +bUpdated |= aCol[col].UpdateReference(rCxt, pUndoDoc); +// When deleting row(s), delete same row from the default attribute +if (nDy < 0) +aDefaultColData.DeleteRow(nRow1+nDy, -nDy); } if ( bIncludeDraw ) diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index b3a5b9aee9b9..b35caa7459bb 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -400,6 +400,9 @@ void ScTable::DeleteCol( { for (SCCOL nCol = nStartCol + nSize; nCol < aCol.size(); ++nCol) aCol[nCol].SwapCol(aCol[nCol - nSize]); +// When delete column(s), inicialize the last columns from the default attributes +for (SCCOL nCol = aCol.size() - nSize; nCol < aCol.size(); ++nCol) +aCol[nCol].Init(nCol, aCol[nCol].GetTab(), rDocument, false); } else {
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/column.hxx |6 ++ sc/source/core/data/table1.cxx | 12 +--- sc/source/core/data/table2.cxx |3 +++ 3 files changed, 14 insertions(+), 7 deletions(-) New commits: commit dd8e061406fac581d399da088c7f0187278035dc Author: Czeber László Ádám AuthorDate: Thu Jun 8 14:55:34 2023 +0200 Commit: László Németh CommitDate: Fri Jun 9 15:41:38 2023 +0200 tdf#153437 sc: fix broken formatting without performance regression Follow-up to commit 7be7e1ff95af485a9cb00748800d3d084f96387c "tdf#153437 sc: fix broken formatting at Undo of row/column insertion" by replacing that with a better version without performance regression. This keeps the original performance fix of commit 2e86718626a07e1656661df3ad69a64848bf4614 "don't allocate unnecessary columns when inserting a row" related to the support of 16k columns. The previous fix used extra memory to fix the broken formatting of the cells. I have now solved the error in tdf#153437 without taking extra memory. It doesn't change the reserved cells, it just deletes a row from the default attribute of the cells when deleting rows, so they don't slip. When deleting a column, the last column in the still reserved area loses its formatting. I copied the default value back here, as the other columns have this value. Change-Id: I35da1cb79ff4e3493e91d29766cc2b81412080eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152742 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 5c42f02794ab..4b64537e1705 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -172,6 +172,7 @@ public: boolTestInsertRow( SCSIZE nSize ) const; voidInsertRow( SCROW nStartRow, SCSIZE nSize ); +voidDeleteRow( SCROW nStartRow, SCSIZE nSize ); }; // Use protected inheritance to prevent publishing some internal ScColumnData @@ -1057,4 +1058,9 @@ inline void ScColumnData::InsertRow( SCROW nStartRow, SCSIZE nSize ) pAttrArray->InsertRow( nStartRow, nSize ); } +inline void ScColumnData::DeleteRow(SCROW nStartRow, SCSIZE nSize) +{ +pAttrArray->DeleteRow( nStartRow, nSize ); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 99e0c5f39b0d..c5d4de055f8d 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1849,13 +1849,11 @@ void ScTable::UpdateReference( } else { -// When deleting row(s) or column(s), allocate the last column -// before updating the references -if (nDx < 0 || nDy < 0) -CreateColumnIfNotExists(rDocument.MaxCol()); - -for (SCCOL col : GetColumnsRange(0, rDocument.MaxCol())) -bUpdated |= CreateColumnIfNotExists(col).UpdateReference(rCxt, pUndoDoc); +for (SCCOL col : GetAllocatedColumnsRange(0, rDocument.MaxCol())) +bUpdated |= aCol[col].UpdateReference(rCxt, pUndoDoc); +// When deleting row(s), delete same row from the default attribute +if (nDy < 0) +aDefaultColData.DeleteRow(nRow1+nDy, -nDy); } if ( bIncludeDraw ) diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index b3a5b9aee9b9..b35caa7459bb 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -400,6 +400,9 @@ void ScTable::DeleteCol( { for (SCCOL nCol = nStartCol + nSize; nCol < aCol.size(); ++nCol) aCol[nCol].SwapCol(aCol[nCol - nSize]); +// When delete column(s), inicialize the last columns from the default attributes +for (SCCOL nCol = aCol.size() - nSize; nCol < aCol.size(); ++nCol) +aCol[nCol].Init(nCol, aCol[nCol].GetTab(), rDocument, false); } else {
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sc/qa sc/source
sc/qa/uitest/calc_tests9/tdf154174.py | 35 ++ sc/source/ui/view/viewfunc.cxx|2 + 2 files changed, 37 insertions(+) New commits: commit 1a0b4190cbdc8c5c5656465422fbcfd59fcff7b5 Author: Czeber László Ádám AuthorDate: Wed May 31 13:06:50 2023 +0200 Commit: Xisco Fauli CommitDate: Thu Jun 1 15:50:34 2023 +0200 tdf#154174 sc: fix input line to update to the repeated content Repeating the last text edit by Repeat, e.g. by pressing Ctrl-Shift-Y, the input line still contained the old content of the cell, and only updated to the new content after moving the cursor to another cell and back. Now the input line is updated automatically, and the actual content of the cell can be modified immediately by pressing F2 or clicking in the input line. Change-Id: Ia38b833ff77c75d37700715638aa71c7f1863e91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152423 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit a5c1b749a89b662f9a136d774b3dfd5fbd639c50) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152437 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/qa/uitest/calc_tests9/tdf154174.py b/sc/qa/uitest/calc_tests9/tdf154174.py new file mode 100644 index ..3cb0da9ea2a3 --- /dev/null +++ b/sc/qa/uitest/calc_tests9/tdf154174.py @@ -0,0 +1,35 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from libreoffice.calc.document import get_cell_by_position +from uitest.uihelper.calc import enter_text_to_cell + +#Bug 154174 - empty edit cell after fill (Ctrl+Shft+Y) + +class tdf154174(UITestCase): +def test_tdf154174_repeat_empty(self): +with self.ui_test.create_doc_in_start_center("calc") as document: +xCalcDoc = self.xUITest.getTopFocusWindow() +gridwin = xCalcDoc.getChild("grid_window") +# enter data +enter_text_to_cell(gridwin, "A1", "") +# focus on A2 +gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) +# repeat (Ctrl+Shft+Y) +gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+CTRL+Y"})) +# edit A2 data +gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F2"})) +# if is empty, then erased, else unchanged +gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DELETE"})) +gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) +# test A2 +self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "") + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index b5953bbf26f0..b6fcd69eb3d9 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -832,6 +832,8 @@ void ScViewFunc::EnterDataAtCursor( const OUString& rString ) SCTAB nTab = GetViewData().GetTabNo(); EnterData( nPosX, nPosY, nTab, rString ); +// tdf#154174: update repeated data in the cell +GetViewData().GetViewShell()->UpdateInputHandler(); } void ScViewFunc::EnterMatrix( const OUString& rString, ::formula::FormulaGrammar::Grammar eGram )
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/uitest/calc_tests9/tdf154174.py | 35 ++ sc/source/ui/view/viewfunc.cxx|2 + 2 files changed, 37 insertions(+) New commits: commit a5c1b749a89b662f9a136d774b3dfd5fbd639c50 Author: Czeber László Ádám AuthorDate: Wed May 31 13:06:50 2023 +0200 Commit: László Németh CommitDate: Thu Jun 1 09:55:40 2023 +0200 tdf#154174 sc: fix input line to update to the repeated content Repeating the last text edit by Repeat, e.g. by pressing Ctrl-Shift-Y, the input line still contained the old content of the cell, and only updated to the new content after moving the cursor to another cell and back. Now the input line is updated automatically, and the actual content of the cell can be modified immediately by pressing F2 or clicking in the input line. Change-Id: Ia38b833ff77c75d37700715638aa71c7f1863e91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152423 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sc/qa/uitest/calc_tests9/tdf154174.py b/sc/qa/uitest/calc_tests9/tdf154174.py new file mode 100644 index ..3cb0da9ea2a3 --- /dev/null +++ b/sc/qa/uitest/calc_tests9/tdf154174.py @@ -0,0 +1,35 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from libreoffice.calc.document import get_cell_by_position +from uitest.uihelper.calc import enter_text_to_cell + +#Bug 154174 - empty edit cell after fill (Ctrl+Shft+Y) + +class tdf154174(UITestCase): +def test_tdf154174_repeat_empty(self): +with self.ui_test.create_doc_in_start_center("calc") as document: +xCalcDoc = self.xUITest.getTopFocusWindow() +gridwin = xCalcDoc.getChild("grid_window") +# enter data +enter_text_to_cell(gridwin, "A1", "") +# focus on A2 +gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) +# repeat (Ctrl+Shft+Y) +gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+CTRL+Y"})) +# edit A2 data +gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F2"})) +# if is empty, then erased, else unchanged +gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DELETE"})) +gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) +# test A2 +self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "") + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 204d5d31bae7..78080364e928 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -832,6 +832,8 @@ void ScViewFunc::EnterDataAtCursor( const OUString& rString ) SCTAB nTab = GetViewData().GetTabNo(); EnterData( nPosX, nPosY, nTab, rString ); +// tdf#154174: update repeated data in the cell +GetViewData().GetViewShell()->UpdateInputHandler(); } void ScViewFunc::EnterMatrix( const OUString& rString, ::formula::FormulaGrammar::Grammar eGram )
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/ucalc_copypaste.cxx | 43 + sc/source/core/data/table1.cxx |9 ++-- 2 files changed, 50 insertions(+), 2 deletions(-) New commits: commit 7be7e1ff95af485a9cb00748800d3d084f96387c Author: Czeber László Ádám AuthorDate: Wed May 24 09:05:16 2023 +0200 Commit: László Németh CommitDate: Wed May 31 11:49:58 2023 +0200 tdf#153437 sc: fix broken formatting at Undo of row/column insertion Performance fix for the 16k rows resulted broken formatting during Undo of row insertion, e.g. rows with background color fell apart, highlighting partially also the row under the deleted row removed by Undo, or Undo of inserted/copied columns removed the background coloring at the place of the removed columns. Formatting was always deleted after the last column containing data, because the row was only allocated until then. When deleting row(s) or column(s), allocate the last column before updating the references. Regression from commit 2e86718626a07e1656661df3ad69a64848bf4614 "don't allocate unnecessary columns when inserting a row". Change-Id: I8d74d59ff0051fdfe183e14a16d987edc71d55e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152185 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sc/qa/unit/ucalc_copypaste.cxx b/sc/qa/unit/ucalc_copypaste.cxx index 695b5b8f6214..bad57d8646a7 100644 --- a/sc/qa/unit/ucalc_copypaste.cxx +++ b/sc/qa/unit/ucalc_copypaste.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -10709,6 +10710,48 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteMatrixFormula) m_pDoc->DeleteTab(0); } +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testUndoBackgroundColor) +{ +m_pDoc->InsertTab(0, "Table1"); + +ScDocument aClipDoc(SCDOCMODE_CLIP); +ScMarkData aMark(m_pDoc->GetSheetLimits()); + +// Set Values to B1, C2, D5 +m_pDoc->SetValue(ScAddress(1, 0, 0), 1.0); // B1 +m_pDoc->SetValue(ScAddress(2, 1, 0), 2.0); // C2 +m_pDoc->SetValue(ScAddress(3, 4, 0), 3.0); // D5 + +// Add patterns +ScPatternAttr aCellBlueColor(m_pDoc->GetPool()); +aCellBlueColor.GetItemSet().Put(SvxBrushItem(COL_BLUE, ATTR_BACKGROUND)); +m_pDoc->ApplyPatternAreaTab(0, 3, m_pDoc->MaxCol(), 3, 0, aCellBlueColor); + +// Insert a new row at row 3 +ScRange aRowOne(0, 2, 0, m_pDoc->MaxCol(), 2, 0); +aMark.SetMarkArea(aRowOne); +ScDocFunc& rFunc = m_xDocShell->GetDocFunc(); +rFunc.InsertCells(aRowOne, , INS_INSROWS_BEFORE, true, true); + +// Check patterns +const SfxPoolItem* pItem = nullptr; +m_pDoc->GetPattern(ScAddress(1000, 4, 0))->GetItemSet().HasItem(ATTR_BACKGROUND, ); +CPPUNIT_ASSERT(pItem); +CPPUNIT_ASSERT_EQUAL(COL_BLUE, static_cast(pItem)->GetColor()); + +// Undo the new row +m_pDoc->GetUndoManager()->Undo(); + +// Check patterns +// Failed if row 3 is not blue all the way through +pItem = nullptr; +m_pDoc->GetPattern(ScAddress(1000, 3, 0))->GetItemSet().HasItem(ATTR_BACKGROUND, ); +CPPUNIT_ASSERT(pItem); +CPPUNIT_ASSERT_EQUAL(COL_BLUE, static_cast(pItem)->GetColor()); + +m_pDoc->DeleteTab(0); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 78c49912bcc9..6cb5384c05f9 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1851,8 +1851,13 @@ void ScTable::UpdateReference( } else { -for( SCCOL col : GetAllocatedColumnsRange( 0, rDocument.MaxCol())) -bUpdated |= aCol[col].UpdateReference(rCxt, pUndoDoc); +// When deleting row(s) or column(s), allocate the last column +// before updating the references +if (nDx < 0 || nDy < 0) +CreateColumnIfNotExists(rDocument.MaxCol()); + +for (SCCOL col : GetColumnsRange(0, rDocument.MaxCol())) +bUpdated |= CreateColumnIfNotExists(col).UpdateReference(rCxt, pUndoDoc); } if ( bIncludeDraw )
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - 2 commits - sc/source vcl/quartz
sc/source/core/data/conditio.cxx |2 ++ vcl/quartz/salgdi.cxx|6 -- 2 files changed, 2 insertions(+), 6 deletions(-) New commits: commit a47221ba0debb637f16e7b70c1d59e5cf6b3cfd6 Author: Czeber László Ádám AuthorDate: Fri May 26 10:14:11 2023 +0200 Commit: Xisco Fauli CommitDate: Wed May 31 08:56:36 2023 +0200 tdf#152037 XLSX import: fix false alarm data validation error Fix validation error on valid input by adding missing SimplifyCompiledFormula() to the implementation of setFormula1() and setFormula2() of XSheetCondition UNO API, which used by the XLSX input filter. Change-Id: I8389227eb5a609c29e8d466cf62420bae36f7927 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152295 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit b14118feb4da3b68caea3e9e60b4eb0f2f83593b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152328 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 8da18a4a0471..54f89dd3a7b3 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -474,6 +474,7 @@ void ScConditionEntry::SetFormula1( const ScTokenArray& rArray ) if( rArray.GetLen() > 0 ) { pFormula1.reset( new ScTokenArray( rArray ) ); +SimplifyCompiledFormula(pFormula1, nVal1, bIsStr1, aStrVal1); bRelRef1 = lcl_HasRelRef( mpDoc, pFormula1.get() ); } @@ -486,6 +487,7 @@ void ScConditionEntry::SetFormula2( const ScTokenArray& rArray ) if( rArray.GetLen() > 0 ) { pFormula2.reset( new ScTokenArray( rArray ) ); +SimplifyCompiledFormula(pFormula2, nVal2, bIsStr2, aStrVal2); bRelRef2 = lcl_HasRelRef( mpDoc, pFormula2.get() ); } commit b203a86f9249c217bf3a218da96d606573419a85 Author: Khaled Hosny AuthorDate: Mon May 29 11:01:56 2023 +0300 Commit: Xisco Fauli CommitDate: Wed May 31 08:56:26 2023 +0200 tdf#149297: Fix Y position of vertical glyphs on macOS Remove the Y position offset that became redundant and now double shifts the glyphs after: commit dd0d0b44fd1c6c0292d7b2eb3f5cf2baa21e4481 Author: Mark Hung Date: Sun May 2 15:12:46 2021 +0800 vcl: adjust LayoutText() for vertical writing. Change-Id: Iac7abfa69acfe75860d05800f446c25ed622bb95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152366 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit ab1985d0b39e8bcc976543b9700e04610f434423) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152324 Reviewed-by: Xisco Fauli diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index 0793c15dd4ab..522ccb2b3add 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -346,16 +346,10 @@ void AquaGraphicsBackend::drawTextLayout(const GenericSalLayout& rLayout, bool b if (rFont.mfFontRotation) { if (pGlyph->IsVertical()) -{ bUprightGlyph = true; -// Adjust the position of upright (vertical) glyphs. -aGCPos.y -= CTFontGetAscent(pCTFont) - CTFontGetDescent(pCTFont); -} else -{ // Transform the position of rotated glyphs. aGCPos = CGPointApplyAffineTransform(aGCPos, aRotMatrix); -} } aGlyphIds.push_back(pGlyph->glyphId());
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/data/xlsx/tdf100034.xlsx|binary sc/qa/unit/subsequent_export_test4.cxx | 16 sc/source/filter/excel/xename.cxx |5 + 3 files changed, 21 insertions(+) New commits: commit 639519dc2bad058197b6ff73c9e3df622f979f97 Author: Czeber László Ádám AuthorDate: Mon May 22 09:58:29 2023 +0200 Commit: László Németh CommitDate: Tue May 23 12:15:56 2023 +0200 tdf#100034: Fix to persistently remove print-range Don't save print range if the builtin index is unknow and sheet index is vaild (this is a deleted range). Change-Id: I10dfa98ad4f24d0f5958053974bd75cb19c85147 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152081 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sc/qa/unit/data/xlsx/tdf100034.xlsx b/sc/qa/unit/data/xlsx/tdf100034.xlsx new file mode 100644 index ..b053a34bca43 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf100034.xlsx differ diff --git a/sc/qa/unit/subsequent_export_test4.cxx b/sc/qa/unit/subsequent_export_test4.cxx index 46ea2547eadc..9d7dddc99c78 100644 --- a/sc/qa/unit/subsequent_export_test4.cxx +++ b/sc/qa/unit/subsequent_export_test4.cxx @@ -1697,6 +1697,22 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf152980) CPPUNIT_ASSERT_EQUAL(OUString("a\n\nb"), pDoc->GetString(0, 7, 0)); } +CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf100034) +{ +createScDoc("xlsx/tdf100034.xlsx"); +ScDocument* pDoc = getScDoc(); + +// Clear print ranges +pDoc->ClearPrintRanges(0); + +// Save and load back +saveAndReload("Calc Office Open XML"); + +// Check if the same print ranges are present +pDoc = getScDoc(); +CPPUNIT_ASSERT_EQUAL(static_cast(0), pDoc->GetPrintRangeCount(0)); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index 4e837a97fadf..5ce4a2ff18c4 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -324,6 +324,11 @@ OUString XclExpName::GetWithDefaultRangeSeparator( const OUString& rSymbol ) con void XclExpName::SaveXml( XclExpXmlStream& rStrm ) { +// tdf#100034: Don't save print range if the built-in index is unknown +// and sheet index is valid (this is a deleted range) +if (mcBuiltIn == EXC_BUILTIN_UNKNOWN && mnScTab != SCTAB_GLOBAL) +return; + sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream(); rWorkbook->startElement( XML_definedName, // OOXTODO: XML_comment, "",
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - 2 commits - oox/source sc/qa sc/source
oox/source/helper/attributelist.cxx|3 sc/qa/unit/data/csv/tdf152980.csv |9 ++ sc/qa/unit/subsequent_export_test2.cxx | 29 sc/source/filter/oox/richstring.cxx| 112 - 4 files changed, 42 insertions(+), 111 deletions(-) New commits: commit 47b30728db3ad47f1b4d0d8b027ba0a55607ac1e Author: Czeber László Ádám AuthorDate: Mon May 8 09:33:07 2023 +0200 Commit: Xisco Fauli CommitDate: Tue May 9 12:28:34 2023 +0200 tdf#152980 CSV import: Fix control character length in XLSX save Converting from CSV to XLSX corrupts text that looks like a control character. Only 4 numeric length escape character allowed, in _x000D_ format, not _x0D_ for exampled. Change lcl_unEscapeUnicodeChars function to decodeXString. Delete not used functions and add multiple occurence for unit test. Change-Id: Id1d4bfcf7d27cf5005e7bea8e289303c5d9aca73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151494 Reviewed-by: Eike Rathke Tested-by: Eike Rathke Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151562 Reviewed-by: Michael Stahl Tested-by: Jenkins diff --git a/sc/qa/unit/data/csv/tdf152980.csv b/sc/qa/unit/data/csv/tdf152980.csv new file mode 100644 index ..c5050b86d968 --- /dev/null +++ b/sc/qa/unit/data/csv/tdf152980.csv @@ -0,0 +1,9 @@ +"a_x1_b" +"a_x01_b" +"a_x001_b" +"a_x0001_b" +"a_xfoo b" +"a b" +"a +b" +"a b" diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 56d7ac158151..d1920de3c3cb 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -193,6 +193,7 @@ public: void testTotalsRowFunction(); void testAutofilterHiddenButton(); void testTdf119565(); +void testTdf152980(); CPPUNIT_TEST_SUITE(ScExportTest2); @@ -325,6 +326,7 @@ public: CPPUNIT_TEST(testTotalsRowFunction); CPPUNIT_TEST(testAutofilterHiddenButton); CPPUNIT_TEST(testTdf119565); +CPPUNIT_TEST(testTdf152980); CPPUNIT_TEST_SUITE_END(); }; @@ -2969,6 +2971,33 @@ void ScExportTest2::testTdf119565() xShapeProps->getPropertyValue("LineJoint").get()); } +void ScExportTest2::testTdf152980() +{ +createScDoc("csv/tdf152980.csv"); +ScDocShell* pDocSh = getScDocShell(); +pDocSh->DoHardRecalc(); +saveAndReload("Calc Office Open XML"); +pDocSh = getScDocShell(); +pDocSh->DoHardRecalc(); + +ScDocument* pDoc = getScDoc(); + +// - Expected: The part between a and b does not change +// - Actual : Only the characters a and b remain +CPPUNIT_ASSERT_EQUAL(OUString("a_x1_b"), pDoc->GetString(0, 0, 0)); +CPPUNIT_ASSERT_EQUAL(OUString("a_x01_b"), pDoc->GetString(0, 1, 0)); +CPPUNIT_ASSERT_EQUAL(OUString("a_x001_b"), pDoc->GetString(0, 2, 0)); + +// The character code does not change in both cases +CPPUNIT_ASSERT_EQUAL(OUString("a_x0001_b"), pDoc->GetString(0, 3, 0)); + +// The escape characters are handled correctly in both cases +CPPUNIT_ASSERT_EQUAL(OUString("a_xfoo\nb"), pDoc->GetString(0, 4, 0)); +CPPUNIT_ASSERT_EQUAL(OUString("a\tb"), pDoc->GetString(0, 5, 0)); +CPPUNIT_ASSERT_EQUAL(OUString("a\nb"), pDoc->GetString(0, 6, 0)); +CPPUNIT_ASSERT_EQUAL(OUString("a\n\nb"), pDoc->GetString(0, 7, 0)); +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sc/source/filter/oox/richstring.cxx b/sc/source/filter/oox/richstring.cxx index a9b272d62a9a..8d2f964362d0 100644 --- a/sc/source/filter/oox/richstring.cxx +++ b/sc/source/filter/oox/richstring.cxx @@ -48,116 +48,6 @@ bool lclNeedsRichTextFormat( const oox::xls::Font* pFont ) return pFont && pFont->needsRichTextFormat(); } -sal_Int32 lcl_getHexLetterValue(sal_Unicode nCode) -{ -if (nCode >= '0' && nCode <= '9') -return nCode - '0'; - -if (nCode >= 'A' && nCode <= 'F') -return nCode - 'A' + 10; - -if (nCode >= 'a' && nCode <= 'f') -return nCode - 'a' + 10; - -return -1; -} - -bool lcl_validEscape(sal_Unicode nCode) -{ -// Valid XML chars that can be escaped (ignoring the restrictions) as in the OOX open spec -// 2.1.1742 Part 1 Section 22.9.2.19, ST_Xstring (Escaped String) -if (nCode == 0x000D || nCode == 0x000A || nCode == 0x0009 || nCode == 0x005F) -return true; - -// Other valid XML chars in basic multilingual plane that cannot be escaped. -if ((nCode >= 0x0020 && nCode <= 0xD7FF) || (nCode >= 0xE000 && nCode <= 0xFFFD)) -return false; - -return true; -} - -OUString lcl_unEscapeUnicodeChars(const OUString& rSrc) -{ -// Example: Escaped representation of unicode char 0x000D is _x000D_ - -sal_Int32 nLen = rSrc.getLength(); -if (!nLen) -return rSrc; - -sal_Int32 nStart = 0; -bool bFound = false; -const OUString aPrefix =
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/data/csv/tdf152980.csv |9 ++ sc/qa/unit/subsequent_export_test4.cxx | 27 +++ sc/source/filter/oox/richstring.cxx| 112 - 3 files changed, 37 insertions(+), 111 deletions(-) New commits: commit 96965871f4cd2e4afbdf3bcae9dc0c43d1543e1d Author: Czeber László Ádám AuthorDate: Mon May 8 09:33:07 2023 +0200 Commit: Eike Rathke CommitDate: Tue May 9 00:05:57 2023 +0200 tdf#152980 CSV import: Fix control character length in XLSX save Converting from CSV to XLSX corrupts text that looks like a control character. Only 4 numeric length escape character allowed, in _x000D_ format, not _x0D_ for exampled. Change lcl_unEscapeUnicodeChars function to decodeXString. Delete not used functions and add multiple occurence for unit test. Change-Id: Id1d4bfcf7d27cf5005e7bea8e289303c5d9aca73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151494 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/sc/qa/unit/data/csv/tdf152980.csv b/sc/qa/unit/data/csv/tdf152980.csv new file mode 100644 index ..c5050b86d968 --- /dev/null +++ b/sc/qa/unit/data/csv/tdf152980.csv @@ -0,0 +1,9 @@ +"a_x1_b" +"a_x01_b" +"a_x001_b" +"a_x0001_b" +"a_xfoo b" +"a b" +"a +b" +"a b" diff --git a/sc/qa/unit/subsequent_export_test4.cxx b/sc/qa/unit/subsequent_export_test4.cxx index 79b5441c8f17..233195b2ebde 100644 --- a/sc/qa/unit/subsequent_export_test4.cxx +++ b/sc/qa/unit/subsequent_export_test4.cxx @@ -1638,6 +1638,33 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf119565) xShapeProps->getPropertyValue("LineJoint").get()); } +CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf152980) +{ +createScDoc("csv/tdf152980.csv"); +ScDocShell* pDocSh = getScDocShell(); +pDocSh->DoHardRecalc(); +saveAndReload("Calc Office Open XML"); +pDocSh = getScDocShell(); +pDocSh->DoHardRecalc(); + +ScDocument* pDoc = getScDoc(); + +// - Expected: The part between a and b does not change +// - Actual : Only the characters a and b remain +CPPUNIT_ASSERT_EQUAL(OUString("a_x1_b"), pDoc->GetString(0, 0, 0)); +CPPUNIT_ASSERT_EQUAL(OUString("a_x01_b"), pDoc->GetString(0, 1, 0)); +CPPUNIT_ASSERT_EQUAL(OUString("a_x001_b"), pDoc->GetString(0, 2, 0)); + +// The character code does not change in both cases +CPPUNIT_ASSERT_EQUAL(OUString("a_x0001_b"), pDoc->GetString(0, 3, 0)); + +// The escape characters are handled correctly in both cases +CPPUNIT_ASSERT_EQUAL(OUString("a_xfoo\nb"), pDoc->GetString(0, 4, 0)); +CPPUNIT_ASSERT_EQUAL(OUString("a\tb"), pDoc->GetString(0, 5, 0)); +CPPUNIT_ASSERT_EQUAL(OUString("a\nb"), pDoc->GetString(0, 6, 0)); +CPPUNIT_ASSERT_EQUAL(OUString("a\n\nb"), pDoc->GetString(0, 7, 0)); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/oox/richstring.cxx b/sc/source/filter/oox/richstring.cxx index a9b272d62a9a..8d2f964362d0 100644 --- a/sc/source/filter/oox/richstring.cxx +++ b/sc/source/filter/oox/richstring.cxx @@ -48,116 +48,6 @@ bool lclNeedsRichTextFormat( const oox::xls::Font* pFont ) return pFont && pFont->needsRichTextFormat(); } -sal_Int32 lcl_getHexLetterValue(sal_Unicode nCode) -{ -if (nCode >= '0' && nCode <= '9') -return nCode - '0'; - -if (nCode >= 'A' && nCode <= 'F') -return nCode - 'A' + 10; - -if (nCode >= 'a' && nCode <= 'f') -return nCode - 'a' + 10; - -return -1; -} - -bool lcl_validEscape(sal_Unicode nCode) -{ -// Valid XML chars that can be escaped (ignoring the restrictions) as in the OOX open spec -// 2.1.1742 Part 1 Section 22.9.2.19, ST_Xstring (Escaped String) -if (nCode == 0x000D || nCode == 0x000A || nCode == 0x0009 || nCode == 0x005F) -return true; - -// Other valid XML chars in basic multilingual plane that cannot be escaped. -if ((nCode >= 0x0020 && nCode <= 0xD7FF) || (nCode >= 0xE000 && nCode <= 0xFFFD)) -return false; - -return true; -} - -OUString lcl_unEscapeUnicodeChars(const OUString& rSrc) -{ -// Example: Escaped representation of unicode char 0x000D is _x000D_ - -sal_Int32 nLen = rSrc.getLength(); -if (!nLen) -return rSrc; - -sal_Int32 nStart = 0; -bool bFound = false; -const OUString aPrefix = "_x"; -sal_Int32 nPrefixStart = rSrc.indexOf(aPrefix, nStart); - -if (nPrefixStart == -1) -return rSrc; - -OUStringBuffer aBuf(rSrc); -sal_Int32 nOffset = 0; // index offset in aBuf w.r.t rSrc. - -do -{ -sal_Int32 nEnd = -1; -sal_Unicode nCode = 0; -bool bFoundThis = false; -for (sal_Int32 nIdx = 0; nIdx < 5; ++nIdx) -{ -sal_Int32 nThisIdx = nPrefixStart + nIdx + 2; -if (nThisIdx >= nLen) -break; - -sal_Unicode nThisCode = rSrc[nThisIdx]; -sal_Int32
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf131722.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 56 +++ writerfilter/source/dmapper/SdtHelper.cxx|5 +- 3 files changed, 59 insertions(+), 2 deletions(-) New commits: commit 855a14d4ca43b517884046eec7e7c75f44a9e975 Author: Czeber László Ádám AuthorDate: Thu Apr 27 09:48:50 2023 +0200 Commit: Xisco Fauli CommitDate: Fri Apr 28 17:48:49 2023 +0200 tdf#131722 DOCX import: fix lost first character in date selector Fix another date selector control bug, date picker first character goes out of the control. The first character of the date separator in the first row of the table is out of control. The fix takes into account the placement of the dummy paragraph in the first row of the table, which caused the date separator to be corrupted. Thanks to Gabor Kelemen for pointing out this error to me. Follow-up to commit e898f95bfab16ddd9b04e516293cb6eb7e0a3847 "tdf#138093 DOCX import: fix broken date selector control in table". Change-Id: I91d272b786a3d3dc047334c2a4a039f987c94ce0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151087 Tested-by: László Németh Reviewed-by: László Németh Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151164 Tested-by: Jenkins diff --git a/sw/qa/extras/ooxmlexport/data/tdf131722.docx b/sw/qa/extras/ooxmlexport/data/tdf131722.docx new file mode 100644 index ..8b72ad4b86a7 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf131722.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 2f412a7d85f1..9bde0369e108 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -1202,6 +1202,62 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148273_sectionBulletFormatLeak, "tdf148273_secti CPPUNIT_ASSERT_EQUAL(false, aValue.hasValue()); } +DECLARE_OOXMLEXPORT_TEST(testTdf131722, "tdf131722.docx") +{ +if (isExported()) +{ +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); +assertXPath(pXmlDoc, "//w:sdt", 4); +uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTables(xTablesSupplier->getTextTables(), +uno::UNO_QUERY); +uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); +uno::Reference xCell = xTable->getCellByName("A1"); +uno::Reference xParagraphsAccess(xCell, uno::UNO_QUERY); +uno::Reference xParagraphs += xParagraphsAccess->createEnumeration(); +uno::Reference xParagraph(xParagraphs->nextElement(), + uno::UNO_QUERY); +uno::Reference xPortions = xParagraph->createEnumeration(); +uno::Reference xTextPortion(xPortions->nextElement(), uno::UNO_QUERY); + +OUString aPortionType; +xTextPortion->getPropertyValue("TextPortionType") >>= aPortionType; +CPPUNIT_ASSERT_EQUAL(OUString("ContentControl"), aPortionType); + +uno::Reference xContentControl; +xTextPortion->getPropertyValue("ContentControl") >>= xContentControl; +uno::Reference xContentControlProps(xContentControl, uno::UNO_QUERY); +bool bDate{}; +xContentControlProps->getPropertyValue("Date") >>= bDate; +CPPUNIT_ASSERT(bDate); +uno::Reference xContentControlEnumAccess(xContentControl, + uno::UNO_QUERY); +uno::Reference xContentControlEnum += xContentControlEnumAccess->createEnumeration(); +uno::Reference xTextPortionRange(xContentControlEnum->nextElement(), + uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("Enter a date here!"), xTextPortionRange->getString()); +} +else +{ +SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); +CPPUNIT_ASSERT(pTextDoc); +SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); +IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); + +for (auto aIter = pMarkAccess->getFieldmarksBegin(); + aIter != pMarkAccess->getFieldmarksEnd(); ++aIter) +{ +::sw::mark::IDateFieldmark* pFieldmark += dynamic_cast<::sw::mark::IDateFieldmark*>(*aIter); +CPPUNIT_ASSERT(pFieldmark); +CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMDATE), pFieldmark->GetFieldname()); +CPPUNIT_ASSERT_EQUAL(OUString("Enter a date here!"), pFieldmark->GetContent()); +} +} +} + DECLARE_OOXMLEXPORT_TEST(testTdf149089, "tdf149089.docx") { uno::Reference xPageStyles = getStyles("PageStyles"); diff --git
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - 3 commits - oox/source sc/inc sc/qa sc/source sw/qa writerfilter/source
oox/source/export/drawingml.cxx |7 ++- sc/inc/colorscale.hxx|2 sc/qa/unit/data/xlsx/tdf119565.xlsx |binary sc/qa/unit/subsequent_export_test2.cxx | 28 + sc/qa/unit/ucalc_condformat.cxx | 52 + sc/source/core/data/colorscale.cxx | 18 sw/qa/extras/ooxmlexport/data/tdf138093.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 56 +++ writerfilter/source/dmapper/SdtHelper.cxx|4 + 9 files changed, 164 insertions(+), 3 deletions(-) New commits: commit 63e1a98e07b12edd967cea48f23e307cf47efea8 Author: Czeber László Ádám AuthorDate: Tue Apr 18 15:01:14 2023 +0200 Commit: Xisco Fauli CommitDate: Fri Apr 28 10:53:50 2023 +0200 tdf#138093 DOCX import: fix broken date selector control in table In tables, first character of the text value of the date selector control left outside of the control during the import, resulting broken date selector, e.g. 2[023] instead of [2023]. (Clicking on the broken control, according to the year *023*, the selector listed the lowest possible value, year 1900, and selecting that, the result became 2[1900].) Note: the fix works well with nested tables, too, so likely the condition with tables is obsolete. Perhaps regression from commit b36ef83ea59eeaca239e58b95aa0b1acdcb99efc "tdf126701: MSForms: Fix import of date field at the end of the paragraph." and commit 68e1be4ccbb90ee9a788962219a88312c4ffbea2 "MSForms: Rework text-based date form field's representation". Change-Id: Ib217a3a06522bfe7b3b0fbc884f98504f628fc59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150575 Tested-by: László Németh Reviewed-by: László Németh Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151053 Tested-by: Jenkins diff --git a/sw/qa/extras/ooxmlexport/data/tdf138093.docx b/sw/qa/extras/ooxmlexport/data/tdf138093.docx new file mode 100644 index ..097fbb1351cc Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf138093.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index ebb5ae15a87e..2f412a7d85f1 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,7 @@ #include #include #include +#include class Test : public SwModelTestBase { @@ -88,6 +90,60 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148380_createField, "tdf148380_createField.docx" CPPUNIT_ASSERT_EQUAL(OUString("yesterday at noon"), xField->getPresentation(false)); } +DECLARE_OOXMLEXPORT_TEST(testTdf138093, "tdf138093.docx") +{ +if (isExported()) +{ +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); +assertXPath(pXmlDoc, "//w:sdt", 3); +uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTables(xTablesSupplier->getTextTables(), +uno::UNO_QUERY); +uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); +uno::Reference xCell = xTable->getCellByName("B1"); +uno::Reference xParagraphsAccess(xCell, uno::UNO_QUERY); +uno::Reference xParagraphs += xParagraphsAccess->createEnumeration(); +uno::Reference xParagraph(xParagraphs->nextElement(), + uno::UNO_QUERY); +uno::Reference xPortions = xParagraph->createEnumeration(); +uno::Reference xTextPortion(xPortions->nextElement(), uno::UNO_QUERY); + +OUString aPortionType; +xTextPortion->getPropertyValue("TextPortionType") >>= aPortionType; +CPPUNIT_ASSERT_EQUAL(OUString("ContentControl"), aPortionType); + +uno::Reference xContentControl; +xTextPortion->getPropertyValue("ContentControl") >>= xContentControl; +uno::Reference xContentControlProps(xContentControl, uno::UNO_QUERY); +bool bDate{}; +xContentControlProps->getPropertyValue("Date") >>= bDate; +CPPUNIT_ASSERT(bDate); +uno::Reference xContentControlEnumAccess(xContentControl, + uno::UNO_QUERY); +uno::Reference xContentControlEnum += xContentControlEnumAccess->createEnumeration(); +uno::Reference xTextPortionRange(xContentControlEnum->nextElement(), + uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("2017"), xTextPortionRange->getString()); +} +else +{ +SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); +
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf131722.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport19.cxx | 57 +++ writerfilter/source/dmapper/SdtHelper.cxx|5 +- 3 files changed, 60 insertions(+), 2 deletions(-) New commits: commit fd79c5ed9b13516bdb0f2a29806296698ddda7b2 Author: Czeber László Ádám AuthorDate: Thu Apr 27 09:48:50 2023 +0200 Commit: László Németh CommitDate: Thu Apr 27 18:47:48 2023 +0200 tdf#131722 DOCX import: fix lost first character in date selector Fix another date selector control bug, date picker first character goes out of the control. The first character of the date separator in the first row of the table is out of control. The fix takes into account the placement of the dummy paragraph in the first row of the table, which caused the date separator to be corrupted. Thanks to Gabor Kelemen for pointing out this error to me. Follow-up to commit e898f95bfab16ddd9b04e516293cb6eb7e0a3847 "tdf#138093 DOCX import: fix broken date selector control in table". Change-Id: I91d272b786a3d3dc047334c2a4a039f987c94ce0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151087 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/extras/ooxmlexport/data/tdf131722.docx b/sw/qa/extras/ooxmlexport/data/tdf131722.docx new file mode 100644 index ..8b72ad4b86a7 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf131722.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx index 729fd09724a9..059d652d0a33 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx @@ -949,6 +949,63 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138093, "tdf138093.docx") } } +DECLARE_OOXMLEXPORT_TEST(testTdf131722, "tdf131722.docx") +{ +if (isExported()) +{ +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); +assertXPath(pXmlDoc, "//w:sdt", 4); +uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTables(xTablesSupplier->getTextTables(), +uno::UNO_QUERY); +uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); +uno::Reference xCell = xTable->getCellByName("A1"); +uno::Reference xParagraphsAccess(xCell, uno::UNO_QUERY); +uno::Reference xParagraphs += xParagraphsAccess->createEnumeration(); +uno::Reference xParagraph(xParagraphs->nextElement(), + uno::UNO_QUERY); +uno::Reference xPortions = xParagraph->createEnumeration(); +uno::Reference xTextPortion(xPortions->nextElement(), uno::UNO_QUERY); + +OUString aPortionType; +xTextPortion->getPropertyValue("TextPortionType") >>= aPortionType; +CPPUNIT_ASSERT_EQUAL(OUString("ContentControl"), aPortionType); + +uno::Reference xContentControl; +xTextPortion->getPropertyValue("ContentControl") >>= xContentControl; +uno::Reference xContentControlProps(xContentControl, uno::UNO_QUERY); +bool bDate{}; +xContentControlProps->getPropertyValue("Date") >>= bDate; +CPPUNIT_ASSERT(bDate); +uno::Reference xContentControlEnumAccess(xContentControl, + uno::UNO_QUERY); +uno::Reference xContentControlEnum += xContentControlEnumAccess->createEnumeration(); +uno::Reference xTextPortionRange(xContentControlEnum->nextElement(), + uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("Enter a date here!"), xTextPortionRange->getString()); +} +else +{ +SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); +CPPUNIT_ASSERT(pTextDoc); +SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); +IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); +CPPUNIT_ASSERT_EQUAL(sal_Int32(2), pMarkAccess->getFieldmarksCount()); + +for (auto aIter = pMarkAccess->getFieldmarksBegin(); + aIter != pMarkAccess->getFieldmarksEnd(); ++aIter) +{ +::sw::mark::IDateFieldmark* pFieldmark += dynamic_cast<::sw::mark::IDateFieldmark*>(*aIter); +CPPUNIT_ASSERT(pFieldmark); +CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMDATE), pFieldmark->GetFieldname()); +CPPUNIT_ASSERT_EQUAL(OUString("Enter a date here!"), pFieldmark->GetContent()); +} +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index f9cedcbf19eb..4f94c46f2f55 100644 ---
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf138093.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport19.cxx | 55 +++ writerfilter/source/dmapper/SdtHelper.cxx|4 + 3 files changed, 58 insertions(+), 1 deletion(-) New commits: commit e898f95bfab16ddd9b04e516293cb6eb7e0a3847 Author: Czeber László Ádám AuthorDate: Tue Apr 18 15:01:14 2023 +0200 Commit: László Németh CommitDate: Wed Apr 26 10:55:29 2023 +0200 tdf#138093 DOCX import: fix broken date selector control in table In tables, first character of the text value of the date selector control left outside of the control during the import, resulting broken date selector, e.g. 2[023] instead of [2023]. (Clicking on the broken control, according to the year *023*, the selector listed the lowest possible value, year 1900, and selecting that, the result became 2[1900].) Note: the fix works well with nested tables, too, so likely the condition with tables is obsolete. Perhaps regression from commit b36ef83ea59eeaca239e58b95aa0b1acdcb99efc "tdf126701: MSForms: Fix import of date field at the end of the paragraph." and commit 68e1be4ccbb90ee9a788962219a88312c4ffbea2 "MSForms: Rework text-based date form field's representation". Change-Id: Ib217a3a06522bfe7b3b0fbc884f98504f628fc59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150575 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/extras/ooxmlexport/data/tdf138093.docx b/sw/qa/extras/ooxmlexport/data/tdf138093.docx new file mode 100644 index ..097fbb1351cc Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf138093.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx index 9e01ca72ca17..729fd09724a9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx @@ -33,6 +33,8 @@ #include #include #include +#include +#include class Test : public SwModelTestBase { @@ -894,6 +896,59 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133363) "0"); } +DECLARE_OOXMLEXPORT_TEST(testTdf138093, "tdf138093.docx") +{ +if (isExported()) +{ +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); +assertXPath(pXmlDoc, "//w:sdt", 3); +uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTables(xTablesSupplier->getTextTables(), +uno::UNO_QUERY); +uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); +uno::Reference xCell = xTable->getCellByName("B1"); +uno::Reference xParagraphsAccess(xCell, uno::UNO_QUERY); +uno::Reference xParagraphs += xParagraphsAccess->createEnumeration(); +uno::Reference xParagraph(xParagraphs->nextElement(), + uno::UNO_QUERY); +uno::Reference xPortions = xParagraph->createEnumeration(); +uno::Reference xTextPortion(xPortions->nextElement(), uno::UNO_QUERY); + +OUString aPortionType; +xTextPortion->getPropertyValue("TextPortionType") >>= aPortionType; +CPPUNIT_ASSERT_EQUAL(OUString("ContentControl"), aPortionType); + +uno::Reference xContentControl; +xTextPortion->getPropertyValue("ContentControl") >>= xContentControl; +uno::Reference xContentControlProps(xContentControl, uno::UNO_QUERY); +bool bDate{}; +xContentControlProps->getPropertyValue("Date") >>= bDate; +CPPUNIT_ASSERT(bDate); +uno::Reference xContentControlEnumAccess(xContentControl, + uno::UNO_QUERY); +uno::Reference xContentControlEnum += xContentControlEnumAccess->createEnumeration(); +uno::Reference xTextPortionRange(xContentControlEnum->nextElement(), + uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("2017"), xTextPortionRange->getString()); +} +else +{ +SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); +CPPUNIT_ASSERT(pTextDoc); +SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); +IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); +CPPUNIT_ASSERT_EQUAL(sal_Int32(2), pMarkAccess->getAllMarksCount()); + +::sw::mark::IDateFieldmark* pFieldmark += dynamic_cast<::sw::mark::IDateFieldmark*>(*pMarkAccess->getAllMarksBegin()); +CPPUNIT_ASSERT(pFieldmark); +CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMDATE), pFieldmark->GetFieldname()); +CPPUNIT_ASSERT_EQUAL(OUString("2017"), pFieldmark->GetContent()); +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf133363.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport19.cxx| 11 +++ writerfilter/source/dmapper/DomainMapper_Impl.cxx |5 - 3 files changed, 15 insertions(+), 1 deletion(-) New commits: commit e6a08aa351815b7be3bd094320c589026582454b Author: Czeber László Ádám AuthorDate: Thu Apr 13 08:48:05 2023 +0200 Commit: László Németh CommitDate: Fri Apr 21 10:53:04 2023 +0200 tdf#133363 sw DOCX import: remove extra auto space in mixed list Remove extra auto space even for mixed list styles. For mixed style lists, it has not removed all the extra space needed. See also commit 9cca15204af9cc44a8a9528ccf2f36616fb70e69 "tdf#133052: DOCX import: fix top auto margin of subitems". Change-Id: I15e58616d5810ea57ac9339bdd8e4b5859f09c81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150313 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/extras/ooxmlexport/data/tdf133363.docx b/sw/qa/extras/ooxmlexport/data/tdf133363.docx new file mode 100644 index ..937554facde6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf133363.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx index 94a2c57c00ea..9e01ca72ca17 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx @@ -883,6 +883,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf105875_VmlShapeRotationWithFlip, } } +CPPUNIT_TEST_FIXTURE(Test, testTdf133363) +{ +loadAndSave("tdf133363.docx"); +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); +// tdf#133363: remove extra auto space between first and second list elements +assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[2]/w:pPr/w:spacing", "before", +"0"); +assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[3]/w:pPr/w:spacing", "after", +"0"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 3bca3186ca82..6cb0c1d90d28 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2498,7 +2498,10 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con m_xPreviousParagraph->getPropertyValue("NumberingStyleName") >>= aPreviousNumberingName; } -if (!aPreviousNumberingName.isEmpty() && aCurrentNumberingName == aPreviousNumberingName) +// tdf#133363: remove extra auto space even for mixed list styles +if (!aPreviousNumberingName.isEmpty() +&& (aCurrentNumberingName == aPreviousNumberingName +|| !isNumberingViaRule)) { uno::Sequence aPrevPropertiesSeq; m_xPreviousParagraph->getPropertyValue("ParaInteropGrabBag") >>= aPrevPropertiesSeq;
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfexport/data/tdf153195.rtf | 319 sw/qa/extras/rtfexport/rtfexport7.cxx | 13 writerfilter/source/rtftok/rtfdispatchvalue.cxx | 31 +- 3 files changed, 357 insertions(+), 6 deletions(-) New commits: commit 5c98966b8318d526bdfbefc77831c051e946231f Author: Czeber László Ádám AuthorDate: Tue Apr 4 15:07:47 2023 +0200 Commit: László Németh CommitDate: Fri Apr 21 09:52:02 2023 +0200 tdf#153195 sw RTF import: fix negative indent of table in footer Fix missing processing of TBLIND keyword, which puts the table in the footer in the correct orientation, applying also the following conversion between RTF and OpenDocument/Writer to avoid regression: Left spacing of the table has different meaning in MSO and Writer. In MSO, left spacing means the indent of the text content of the cells, i.e. if table spacing is 0, the text content of the cells is vertically adjusted to the text content of the table, not to the table border. In Writer, if left table spacing is 0, the table border is vertically adjusted to the page text content. So for the correct conversion, left spacing of the table decreased with the left padding of the table text content during the RTF import. (See table padding on the Borders pane of Table Properties.) Reported and created unit test document by Gábor Kelemen. Change-Id: Ia3a781044a11d012f204a8ac3b160ad4c5dc896a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150022 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/extras/rtfexport/data/tdf153195.rtf b/sw/qa/extras/rtfexport/data/tdf153195.rtf new file mode 100644 index ..995bd6dbc7e4 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf153195.rtf @@ -0,0 +1,319 @@ +{\rtf1\adeflang1025\ansi\ansicpg1250\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1038\deflangfe1038\themelang1038\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};} +{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} +{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};} +{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};} +{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};} +{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};} +{\f364\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\f365\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};} +{\f367\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\f368\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};} +{\f369\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\f370\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};} +{\f371\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\f372\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};} +{\f364\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\f365\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};} +{\f367\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\f368\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};} +{\f369\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\f370\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};} +{\f371\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\f372\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\f754\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} +{\f755\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f757\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f758\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f759\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);} +{\f760\fbidi
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf124472.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport18.cxx| 12 ++ sw/qa/extras/ww8export/ww8export4.cxx |1 writerfilter/source/dmapper/DomainMapper.cxx | 11 ++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 11 +- writerfilter/source/dmapper/DomainMapper_Impl.hxx | 13 ++- writerfilter/source/ooxml/model.xml | 39 -- 7 files changed, 79 insertions(+), 8 deletions(-) New commits: commit 8bf897186de81b39064340c44a54db344d6878f6 Author: Czeber László Ádám AuthorDate: Thu Mar 9 10:35:10 2023 +0100 Commit: László Németh CommitDate: Wed Mar 29 14:58:04 2023 + tdf#124472 DOCX import: fix broken field command by skipping delInstrText Process only inserted and not tracked parts of the (partially) tracked field commands to avoid of broken fields, e.g. hyperlinks with bad URLs. For example, instead of the previous bad URL 'https://www.libreoffice.org/"HYPERLINK https://bugs.libreoffice.org/', now the hypertext field of the test document imported with the correct URL 'https://www.libreoffice.org/'. Field commands have change tracking in OOXML, but not in ODF/Writer. OOXML delInstrText, i.e. deleted part of the field commands was imported as part of the actual command, resulting broken fields, e.g. hyperlinks. FieldCommand was splitted into two parts, deleted and non-deleted elements. This way the commands do not get mixed up if the order is changed and no fragmentation of deleted items occurs (otherwise it could fail on the test of tdf#150086). Change-Id: I97d22e5ee1fe647715206f86c4160ebcc4b9cca0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148528 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/extras/ooxmlexport/data/tdf124472.docx b/sw/qa/extras/ooxmlexport/data/tdf124472.docx new file mode 100644 index ..7d7f275be7b9 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf124472.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index 90e9cf2e6543..b871961406c3 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -658,6 +658,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153664) assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableofFigures']/w:name", "val", "Table of Figures"); } +DECLARE_OOXMLEXPORT_TEST(testTdf124472_hyperlink, "tdf124472.docx") +{ +CPPUNIT_ASSERT_EQUAL(OUString("https://www.libreoffice.org/;), + getProperty(getRun(getParagraph(1), 1), "HyperLinkURL")); +CPPUNIT_ASSERT_EQUAL(OUString("mailto:i...@libreoffice.org;), + getProperty(getRun(getParagraph(2), 1), "HyperLinkURL")); +CPPUNIT_ASSERT_EQUAL(OUString(""), + getProperty(getRun(getParagraph(3), 1), "HyperLinkURL")); +} + DECLARE_OOXMLEXPORT_TEST(testTdf135786, "tdf135786.docx") { // Empty first line remain, if the section's initial dummy paragraph is not deleted: @@ -666,6 +676,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135786, "tdf135786.docx") CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); } -CPPUNIT_PLUGIN_IMPLEMENT(); +CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx index 2fbe6911a2df..b620a0672958 100644 --- a/sw/qa/extras/ww8export/ww8export4.cxx +++ b/sw/qa/extras/ww8export/ww8export4.cxx @@ -75,7 +75,6 @@ DECLARE_WW8EXPORT_TEST(testTdf141649_conditionalText, "tdf141649_conditionalText getParagraph(1, "trueResult"); } - CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 1438ba4fee2e..b0030e781ab7 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3428,6 +3428,17 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) pProperties->resolve(*this); } break; +case NS_ooxml::LN_EG_RunInnerContent_instrText: +{ +m_pImpl->SetIsTextDeleted(false); +} +break; +case NS_ooxml::LN_EG_RunInnerContent_delText: +case NS_ooxml::LN_EG_RunInnerContent_delInstrText: +{ +m_pImpl->SetIsTextDeleted(true); +} +break; default: { #ifdef DBG_UTIL diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 3f402c50b3ee..45128e43565c 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -349,6 +349,7 @@ DomainMapper_Impl::DomainMapper_Impl(
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf135786.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport18.cxx| 10 +- writerfilter/source/dmapper/DomainMapper.cxx |5 +++-- writerfilter/source/dmapper/DomainMapper_Impl.hxx |1 + 4 files changed, 13 insertions(+), 3 deletions(-) New commits: commit 5f138e23f61b58857b0e90dc09642ee832af29d4 Author: Czeber László Ádám AuthorDate: Mon Mar 27 09:59:28 2023 +0200 Commit: László Németh CommitDate: Mon Mar 27 13:50:44 2023 + tdf#135786: DOCX import: remove dummy paragraph before tables with comment Section-starting tables were imported with a section-starting dummy paragraph, when the tables contain comments. Remove dummy paragraph by postponing the call of RemoveDummyParaForTableInSection() after the annotations are processed. Regression from commit 2e8aad6d45c53d554ccaf26de998ede708cfc289 "fdo#39056 fdo#75431 Section Properties if section starts with table". Change-Id: I4c566d0adbe16e4f57018301a98db93b37bcd45f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149623 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/extras/ooxmlexport/data/tdf135786.docx b/sw/qa/extras/ooxmlexport/data/tdf135786.docx new file mode 100644 index ..b766b1905aaf Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf135786.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index 9d7a81304588..90e9cf2e6543 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -658,6 +658,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153664) assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableofFigures']/w:name", "val", "Table of Figures"); } -CPPUNIT_PLUGIN_IMPLEMENT(); +DECLARE_OOXMLEXPORT_TEST(testTdf135786, "tdf135786.docx") +{ +// Empty first line remain, if the section's initial dummy paragraph is not deleted: +// - Expected: 2 +// - Actual : 3 +CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 9db58e721a1b..1438ba4fee2e 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3531,8 +3531,9 @@ void DomainMapper::lcl_endSectionGroup() pSectionContext->CloseSectionGroup( *m_pImpl ); // Remove the dummy paragraph if added for // handling the section properties if section starts with a table -if (m_pImpl->GetIsDummyParaAddedForTableInSection()) -m_pImpl->RemoveDummyParaForTableInSection(); +// tdf#135786: Added annotation condition +if (m_pImpl->GetIsDummyParaAddedForTableInSection() && (m_pImpl->GetAnnotationId() < 0)) + m_pImpl->RemoveDummyParaForTableInSection(); } m_pImpl->SetIsTextFrameInserted( false ); m_pImpl->PopProperties(CONTEXT_SECTION); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 050a510353a8..3150a890f88d 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -906,6 +906,7 @@ public: void PushAnnotation(); void PopAnnotation(); +sal_Int32 GetAnnotationId() { return m_nAnnotationId; } /// A field context starts with a cFieldStart. void PushFieldContext();
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - 2 commits - include/oox include/svx oox/source sd/qa sd/source svx/source sw/qa sw/source
include/oox/drawingml/shape.hxx |3 include/svx/svdmodel.hxx |4 oox/source/drawingml/shape.cxx |4 oox/source/ppt/slidepersist.cxx | 232 +-- sd/qa/unit/data/pptx/standardConnectors.pptx |binary sd/qa/unit/import-tests.cxx | 34 +++ sd/source/ui/docshell/docshel4.cxx |8 svx/source/svdraw/svdmodel.cxx | 21 ++ svx/source/svdraw/svdoedge.cxx | 10 - sw/qa/extras/rtfexport/data/tdf153681.odt|binary sw/qa/extras/rtfexport/rtfexport5.cxx| 16 + sw/source/filter/ww8/rtfattributeoutput.cxx |4 12 files changed, 281 insertions(+), 55 deletions(-) New commits: commit 2860a771f93e43b95250beee78351a58bffba1ff Author: Czeber László Ádám AuthorDate: Mon Feb 27 13:31:33 2023 +0100 Commit: Xisco Fauli CommitDate: Wed Mar 8 19:17:22 2023 + tdf#153681 RTF export: fix extra cell regression at nested tables Table rows exported with an extra empty cell, if there was a nested table in them (and not in the last cell). Partial revert of commit 1f77a5e8d5bf8a7f1b7bd7206996d2b2efc59462 "n#203704 fix RTF export table output for subtables". Note: the partially reverted code was for the old table format (used before OOo 2.3). This old format is partially converted to the new table format since commit e366c928819c44b5c253c45dca6dae40b71c9808 "sw: ODF import: convert the simplest sub-tables to rowspan tables". Change-Id: I63ebefbb99e1a95cd60ce8d8dc34c307573d4b58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147887 Reviewed-by: László Németh Tested-by: László Németh (cherry picked from commit 6ddffa9841a20b7fddd3f742c88dba7d51cf9114) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147984 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/rtfexport/data/tdf153681.odt b/sw/qa/extras/rtfexport/data/tdf153681.odt new file mode 100644 index ..2e2e71740de0 Binary files /dev/null and b/sw/qa/extras/rtfexport/data/tdf153681.odt differ diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index 1104b9e4683b..1b925713cc96 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -1395,6 +1395,22 @@ DECLARE_RTFEXPORT_TEST(testTdf104390, "tdf104390.rtf") CPPUNIT_ASSERT_MESSAGE("Extra elements in paragraph", !xRunEnum->hasMoreElements()); } +DECLARE_RTFEXPORT_TEST(testTdf153681, "tdf153681.odt") +{ +uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY_THROW); +uno::Reference xTables(xTablesSupplier->getTextTables(), +uno::UNO_QUERY_THROW); + +// This is outside table +uno::Reference xTable(xTables->getByIndex(1), uno::UNO_QUERY_THROW); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 2 +// - Actual : 3 +// Generates extra cell +CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getRows()->getCount()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getColumns()->getCount()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index c1221069936b..f2362a53d5b2 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1077,10 +1077,6 @@ void RtfAttributeOutput::EndTableRow() { SAL_INFO("sw.rtf", __func__ << ", (depth is " << m_nTableDepth << ")"); -// Trying to end the row without writing the required number of cells? Fill with empty ones. -for (sal_uInt32 i = 0; i < m_aCells[m_nTableDepth]; i++) -m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_CELL); - if (m_nTableDepth > 1) { m_aAfterRuns.append( commit 5308d68a7cc0a4b38216438150adba2ac62e2bbe Author: Tibor Nagy AuthorDate: Thu Jan 26 09:17:56 2023 +0100 Commit: Xisco Fauli CommitDate: Wed Mar 8 19:17:11 2023 + tdf#149756 tdf#152545 PPTX import: position of standard connector - part2 and add new compatibility option "ConnectorUseSnapRect". Standard connectors (bentConnector3, bentConnector4, bentConnector5) are improved. MSO calculates the edge track differently, so have to add "ConnectorUseSnapRect" compatibility option: - For PPTX file format, it is set to true and use the snap rectangle - For ODP format, it is set to false by default and use the bounding rectangle. Follow-up to commit eec48130271188cab63665acedbabf1ff5e850a2 "tdf#148926 tdf#151678 PPTX import: position of standard connector - part1" (bentConnector2) Change-Id: Icca84708d6e10d44ebf7262415d055ce9cfc157d Reviewed-on:
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/rtfexport/data/tdf153681.odt |binary sw/qa/extras/rtfexport/rtfexport5.cxx | 16 sw/source/filter/ww8/rtfattributeoutput.cxx |4 3 files changed, 16 insertions(+), 4 deletions(-) New commits: commit 6ddffa9841a20b7fddd3f742c88dba7d51cf9114 Author: Czeber László Ádám AuthorDate: Mon Feb 27 13:31:33 2023 +0100 Commit: László Németh CommitDate: Tue Feb 28 17:44:30 2023 + tdf#153681 RTF export: fix extra cell regression at nested tables Table rows exported with an extra empty cell, if there was a nested table in them (and not in the last cell). Partial revert of commit 1f77a5e8d5bf8a7f1b7bd7206996d2b2efc59462 "n#203704 fix RTF export table output for subtables". Note: the partially reverted code was for the old table format (used before OOo 2.3). This old format is partially converted to the new table format since commit e366c928819c44b5c253c45dca6dae40b71c9808 "sw: ODF import: convert the simplest sub-tables to rowspan tables". Change-Id: I63ebefbb99e1a95cd60ce8d8dc34c307573d4b58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147887 Reviewed-by: László Németh Tested-by: László Németh diff --git a/sw/qa/extras/rtfexport/data/tdf153681.odt b/sw/qa/extras/rtfexport/data/tdf153681.odt new file mode 100644 index ..2e2e71740de0 Binary files /dev/null and b/sw/qa/extras/rtfexport/data/tdf153681.odt differ diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index 21952ba2f647..5cb27bf74894 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -1461,6 +1461,22 @@ DECLARE_RTFEXPORT_TEST(testTdf104390, "tdf104390.rtf") CPPUNIT_ASSERT_MESSAGE("Extra elements in paragraph", !xRunEnum->hasMoreElements()); } +DECLARE_RTFEXPORT_TEST(testTdf153681, "tdf153681.odt") +{ +uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY_THROW); +uno::Reference xTables(xTablesSupplier->getTextTables(), +uno::UNO_QUERY_THROW); + +// This is outside table +uno::Reference xTable(xTables->getByIndex(1), uno::UNO_QUERY_THROW); +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 2 +// - Actual : 3 +// Generates extra cell +CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getRows()->getCount()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getColumns()->getCount()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 1b03e94d0a7c..0175fd5d15b5 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1076,10 +1076,6 @@ void RtfAttributeOutput::EndTableRow() { SAL_INFO("sw.rtf", __func__ << ", (depth is " << m_nTableDepth << ")"); -// Trying to end the row without writing the required number of cells? Fill with empty ones. -for (sal_uInt32 i = 0; i < m_aCells[m_nTableDepth]; i++) -m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_CELL); - if (m_nTableDepth > 1) { m_aAfterRuns.append(