core.git: Branch 'distro/cib/libreoffice-6-4' - sc/source
sc/source/core/data/documen2.cxx | 17 + 1 file changed, 17 insertions(+) New commits: commit 820d0c06ba5de5ee42757c61048b4a56fa299268 Author: Andreas Heinisch AuthorDate: Mon Oct 23 23:13:51 2023 +0200 Commit: Thorsten Behrens CommitDate: Sun Jul 21 00:21:02 2024 +0200 tdf#157897 - Clear print ranges before adding additional ones Otherwise, additional print ranges will be added for linked files after the external link will be updated. cherry-picked from commit: e61f8a36220d6e8800dd0decf2a680db97c371c9 (tdf#157897 - Clear print ranges before adding additional ones) Change-Id: I0556fda6609d3e18f1ca992dc6a0399be01bc841 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158365 Tested-by: Jenkins Reviewed-by: Andreas Heinisch Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170592 Reviewed-by: Thorsten Behrens Tested-by: allotropia jenkins diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index dd76b6cc2dc3..85333d24b74c 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -962,6 +962,23 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, maTabs[nDestPos]->SetTabNo(nDestPos); maTabs[nDestPos]->SetTabBgColor(pSrcDoc->maTabs[nSrcPos]->GetTabBgColor()); +if (pSrcDoc->IsPrintEntireSheet(nSrcPos)) +maTabs[nDestPos]->SetPrintEntireSheet(); +else +{ +// tdf#157897 - clear print ranges before adding additional ones +maTabs[nDestPos]->ClearPrintRanges(); +const auto nPrintRangeCount = pSrcDoc->maTabs[nSrcPos]->GetPrintRangeCount(); +for (auto nPos = 0; nPos < nPrintRangeCount; nPos++) +{ +// Adjust the tab for the print range at the new position +ScRange aSrcPrintRange(*pSrcDoc->maTabs[nSrcPos]->GetPrintRange(nPos)); +aSrcPrintRange.aStart.SetTab(nDestPos); +aSrcPrintRange.aEnd.SetTab(nDestPos); +maTabs[nDestPos]->AddPrintRange(aSrcPrintRange); +} +} + if ( !bResultsOnly ) { sc::RefUpdateContext aRefCxt(*this);
core.git: basic/source include/tools
basic/source/inc/date.hxx| 10 ++-- basic/source/runtime/methods.cxx | 93 +++ include/tools/time.hxx |7 ++ 3 files changed, 59 insertions(+), 51 deletions(-) New commits: commit 8730575016b15da4892c5adc0d26620688d174bc Author: Andreas Heinisch AuthorDate: Wed Jun 12 14:22:07 2024 +0200 Commit: Andreas Heinisch CommitDate: Thu Jun 20 14:36:50 2024 +0200 tdf#161469 - Basic: align implementation now with the now function in calc Align the implementation of the now function in basic with the now function in calc to include the also nanoseconds. The precision is limited to milliseconds to avoid comparision inaccuracies. Change-Id: Ia85b653898f5849f67a171749725faab976b2a8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168706 Reviewed-by: Andreas Heinisch Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/basic/source/inc/date.hxx b/basic/source/inc/date.hxx index 4b6cb115fbbf..5db9df621b9e 100644 --- a/basic/source/inc/date.hxx +++ b/basic/source/inc/date.hxx @@ -33,10 +33,11 @@ enum class SbDateCorrection }; bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bUseTwoDigitYear, SbDateCorrection eCorr, double& rdRet ); -double implTimeSerial( sal_Int16 nHour, sal_Int16 nMinute, sal_Int16 nSecond); -bool implDateTimeSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, - sal_Int16 nHour, sal_Int16 nMinute, sal_Int16 nSecond, - double& rdRet ); +double implTimeSerial(sal_Int16 nHour, sal_Int16 nMinute, sal_Int16 nSecond, + sal_Int32 nMilliSecond); +bool implDateTimeSerial(sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, sal_Int16 nHour, +sal_Int16 nMinute, sal_Int16 nSecond, sal_Int32 nMilliSecond, +double& rdRet); sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam = false, sal_Int16 nFirstDay = 0 ); @@ -47,6 +48,7 @@ sal_Int16 implGetDateDay( double aDate ); sal_Int16 implGetHour( double dDate ); sal_Int16 implGetMinute( double dDate ); sal_Int16 implGetSecond( double dDate ); +sal_Int32 implGetNanoSecond(double dDate); css::util::Date SbxDateToUNODate( const SbxValue* ); void SbxDateFromUNODate( SbxValue*, const css::util::Date& ); diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 0235db0fc06a..da57ccc98736 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -111,6 +111,12 @@ using namespace com::sun::star::uno; static sal_Int32 GetDayDiff(const Date& rDate) { return rDate - Date(1899'12'30); } +static sal_Int32 nanoSecToMilliSec(sal_Int64 nNanoSeconds) +{ +// Rounding nanoseconds to milliseconds precision to avoid comparision inaccuracies +return o3tl::convert(nNanoSeconds, 1, tools::Time::nanoPerMilli); +} + #if HAVE_FEATURE_SCRIPTING static void FilterWhiteSpace( OUString& rStr ) @@ -1667,14 +1673,15 @@ css::util::Time SbxDateToUNOTime( const SbxValue* const pVal ) aUnoTime.Hours = implGetHour ( aDate ); aUnoTime.Minutes = implGetMinute( aDate ); aUnoTime.Seconds = implGetSecond( aDate ); -aUnoTime.NanoSeconds = 0; +aUnoTime.NanoSeconds = implGetNanoSecond( aDate ); return aUnoTime; } void SbxDateFromUNOTime( SbxValue *pVal, const css::util::Time& aUnoTime) { -pVal->PutDate( implTimeSerial(aUnoTime.Hours, aUnoTime.Minutes, aUnoTime.Seconds) ); +pVal->PutDate(implTimeSerial(aUnoTime.Hours, aUnoTime.Minutes, aUnoTime.Seconds, + nanoSecToMilliSec(aUnoTime.NanoSeconds))); } // Function to convert date to UNO time (com.sun.star.util.Time) @@ -1715,7 +1722,7 @@ css::util::DateTime SbxDateToUNODateTime( const SbxValue* const pVal ) aUnoDT.Hours = implGetHour ( aDate ); aUnoDT.Minutes = implGetMinute( aDate ); aUnoDT.Seconds = implGetSecond( aDate ); -aUnoDT.NanoSeconds = 0; +aUnoDT.NanoSeconds = implGetNanoSecond( aDate ); return aUnoDT; } @@ -1723,9 +1730,8 @@ css::util::DateTime SbxDateToUNODateTime( const SbxValue* const pVal ) void SbxDateFromUNODateTime( SbxValue *pVal, const css::util::DateTime& aUnoDT) { double dDate(0.0); -if( implDateTimeSerial( aUnoDT.Year, aUnoDT.Month, aUnoDT.Day, -aUnoDT.Hours, aUnoDT.Minutes, aUnoDT.Seconds, -dDate ) ) +if (implDateTimeSerial(aUnoDT.Year, aUnoDT.Month, aUnoDT.Day, aUnoDT.Hours, aUnoDT.Minutes, + aUnoDT.Seconds, nanoSecToMilliSec(aUnoDT.NanoSeconds), dDate)) { pVal->PutDate( dDate ); } @@ -1905,7 +1911,7 @@ void SbRtl_TimeSerial(StarBASIC *, SbxArray & rPar, bool) return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } -rPar.Get(0)->PutDate(implTimeSerial(nHour, nMinute,
core.git: Branch 'libreoffice-24-8' - sw/source
sw/source/uibase/inc/textsh.hxx|4 ++-- sw/source/uibase/shells/textsh.cxx | 11 +-- 2 files changed, 11 insertions(+), 4 deletions(-) New commits: commit e1dc5f1e8fe1ecdaa94ff9adcbeb681816636664 Author: Andreas Heinisch AuthorDate: Wed Jun 12 12:16:22 2024 +0200 Commit: Xisco Fauli CommitDate: Thu Jun 13 10:37:43 2024 +0200 tdf#161352 - Set ChangeCase* requests as done for macro recorder Change-Id: Ie66cb5e2f4095d40e081b9441b46dff7bd0a0d26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168698 Tested-by: Jenkins Reviewed-by: Andreas Heinisch (cherry picked from commit b0aff34ccb12e1af815a059957d7c4f6a14eeaea) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168715 Reviewed-by: Xisco Fauli diff --git a/sw/source/uibase/inc/textsh.hxx b/sw/source/uibase/inc/textsh.hxx index f965370e08c6..e0d962bf8293 100644 --- a/sw/source/uibase/inc/textsh.hxx +++ b/sw/source/uibase/inc/textsh.hxx @@ -75,8 +75,8 @@ public: voidExecParaAttr(SfxRequest &); voidExecParaAttrArgs(SfxRequest &); voidExecDB(SfxRequest const &); -voidExecTransliteration(SfxRequest const &); -voidExecRotateTransliteration(SfxRequest const &); +voidExecTransliteration(SfxRequest &); +voidExecRotateTransliteration(SfxRequest &); voidGetAttrState(SfxItemSet &); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index d6d9f5acfd28..97652924dfe8 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -831,7 +831,7 @@ void SwTextShell::ExecDelete(SfxRequest ) rReq.Done(); } -void SwTextShell::ExecTransliteration( SfxRequest const & rReq ) +void SwTextShell::ExecTransliteration( SfxRequest& rReq ) { using namespace ::com::sun::star::i18n; TransliterationFlags nMode = TransliterationFlags::NONE; @@ -873,10 +873,13 @@ void SwTextShell::ExecTransliteration( SfxRequest const & rReq ) } if( nMode != TransliterationFlags::NONE ) +{ GetShell().TransliterateText( nMode ); +rReq.Done(); +} } -void SwTextShell::ExecRotateTransliteration( SfxRequest const & rReq ) +void SwTextShell::ExecRotateTransliteration( SfxRequest& rReq ) { if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE ) { @@ -892,13 +895,17 @@ void SwTextShell::ExecRotateTransliteration( SfxRequest const & rReq ) transFlags = m_aRotateCase.getNextMode(); } rSh.TransliterateText(transFlags); +rReq.Done(); } else { if (bSentenceCase) transFlags = m_aRotateCase.getNextMode(); if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) && rSh.SelWrd(nullptr, i18n::WordType::WORD_COUNT)) +{ rSh.TransliterateText(transFlags); +rReq.Done(); +} } } }
core.git: sw/source
sw/source/uibase/inc/textsh.hxx|4 ++-- sw/source/uibase/shells/textsh.cxx | 11 +-- 2 files changed, 11 insertions(+), 4 deletions(-) New commits: commit b0aff34ccb12e1af815a059957d7c4f6a14eeaea Author: Andreas Heinisch AuthorDate: Wed Jun 12 12:16:22 2024 +0200 Commit: Andreas Heinisch CommitDate: Wed Jun 12 13:49:41 2024 +0200 tdf#161352 - Set ChangeCase* requests as done for macro recorder Change-Id: Ie66cb5e2f4095d40e081b9441b46dff7bd0a0d26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168698 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sw/source/uibase/inc/textsh.hxx b/sw/source/uibase/inc/textsh.hxx index f965370e08c6..e0d962bf8293 100644 --- a/sw/source/uibase/inc/textsh.hxx +++ b/sw/source/uibase/inc/textsh.hxx @@ -75,8 +75,8 @@ public: voidExecParaAttr(SfxRequest &); voidExecParaAttrArgs(SfxRequest &); voidExecDB(SfxRequest const &); -voidExecTransliteration(SfxRequest const &); -voidExecRotateTransliteration(SfxRequest const &); +voidExecTransliteration(SfxRequest &); +voidExecRotateTransliteration(SfxRequest &); voidGetAttrState(SfxItemSet &); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index d6d9f5acfd28..97652924dfe8 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -831,7 +831,7 @@ void SwTextShell::ExecDelete(SfxRequest ) rReq.Done(); } -void SwTextShell::ExecTransliteration( SfxRequest const & rReq ) +void SwTextShell::ExecTransliteration( SfxRequest& rReq ) { using namespace ::com::sun::star::i18n; TransliterationFlags nMode = TransliterationFlags::NONE; @@ -873,10 +873,13 @@ void SwTextShell::ExecTransliteration( SfxRequest const & rReq ) } if( nMode != TransliterationFlags::NONE ) +{ GetShell().TransliterateText( nMode ); +rReq.Done(); +} } -void SwTextShell::ExecRotateTransliteration( SfxRequest const & rReq ) +void SwTextShell::ExecRotateTransliteration( SfxRequest& rReq ) { if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE ) { @@ -892,13 +895,17 @@ void SwTextShell::ExecRotateTransliteration( SfxRequest const & rReq ) transFlags = m_aRotateCase.getNextMode(); } rSh.TransliterateText(transFlags); +rReq.Done(); } else { if (bSentenceCase) transFlags = m_aRotateCase.getNextMode(); if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) && rSh.SelWrd(nullptr, i18n::WordType::WORD_COUNT)) +{ rSh.TransliterateText(transFlags); +rReq.Done(); +} } } }
core.git: 2 commits - basic/qa sd/qa
basic/qa/cppunit/test_vba.cxx |1 + sd/qa/unit/data/odp/tdf161430.odp |binary sd/qa/unit/import-tests2.cxx | 23 +++ 3 files changed, 24 insertions(+) New commits: commit 2b6caa40d682e04e47a03d426e1359cdd74efbdc Author: Andreas Heinisch AuthorDate: Mon Jun 10 15:08:28 2024 +0200 Commit: Andreas Heinisch CommitDate: Mon Jun 10 17:50:33 2024 +0200 tdf#160321 - Added missing VB test Change-Id: I4019599aa9d7803a63e4270b06841915ea428392 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168637 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx index d9c26acb87e5..e3ed10138da4 100644 --- a/basic/qa/cppunit/test_vba.cxx +++ b/basic/qa/cppunit/test_vba.cxx @@ -87,6 +87,7 @@ void VBATest::testMiscVBAFunctions() "Err.Raise.vb", "exp.vb", "fix.vb", +"gosub_goto.vb", "hex.vb", "hour.vb", "formatnumber.vb", commit ed5bac73c8e09c606b271f385431c5a57b84bbb5 Author: Caolán McNamara AuthorDate: Mon Jun 10 12:41:14 2024 +0100 Commit: Caolán McNamara CommitDate: Mon Jun 10 17:50:22 2024 +0200 Related: tdf#161430 add test case to guard against its return Change-Id: Ia2b12ab696632a4f08fd4c20472646dcfd9058c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168634 Reviewed-by: Caolán McNamara Tested-by: Jenkins diff --git a/sd/qa/unit/data/odp/tdf161430.odp b/sd/qa/unit/data/odp/tdf161430.odp new file mode 100644 index ..1ac9acac85b6 Binary files /dev/null and b/sd/qa/unit/data/odp/tdf161430.odp differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 182c66ce1e82..ab66d016b665 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -59,6 +59,9 @@ #include #include #include +#include +#include +#include using namespace ::com::sun::star; @@ -2062,6 +2065,26 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf161023) } } +CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf161430) +{ +// Without the bug fix this opens with the classic solid 'blue' background used in "Outline 1" +// as seen in slide 3 +createSdImpressDoc("odp/tdf161430.odp"); +SdXImpressDocument* pXImpressDocument = dynamic_cast(mxComponent.get()); +CPPUNIT_ASSERT(pXImpressDocument); +SdDrawDocument* pDoc = pXImpressDocument->GetDoc(); + +SdStyleSheetPool* const pPool(pDoc->GetSdStyleSheetPool()); + +OUString aStyleName(SdResId(STR_PSEUDOSHEET_OUTLINE) + " 1"); +SfxStyleSheetBase* pStyleSheet = pPool->Find(aStyleName, SfxStyleFamily::Pseudo); +CPPUNIT_ASSERT(pStyleSheet); + +const XFillStyleItem& rFillStyle = pStyleSheet->GetItemSet().Get(XATTR_FILLSTYLE); +drawing::FillStyle eXFS = rFillStyle.GetValue(); +CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, eXFS); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
core.git: basic/qa basic/source
basic/qa/basic_coverage/test_tdf160321_gosub_goto.bas | 43 + basic/qa/vba_tests/gosub_goto.vb | 44 ++ basic/source/runtime/runtime.cxx | 15 +++--- 3 files changed, 96 insertions(+), 6 deletions(-) New commits: commit 84e8758d429d5cfaa049cd0bfa437f539029 Author: Andreas Heinisch AuthorDate: Wed Apr 10 21:40:47 2024 +0200 Commit: Andreas Heinisch CommitDate: Mon Jun 10 13:52:00 2024 +0200 tdf#160321 - Don't execute jump statement if the expression is out of range Don't execute On expression GoSub Statement; On expression GoTo Statement if the expression lies out of range. Change-Id: I5c1de25918b5e812d7ec82034f8d56351374d56a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165960 Reviewed-by: Andreas Heinisch Tested-by: Jenkins diff --git a/basic/qa/basic_coverage/test_tdf160321_gosub_goto.bas b/basic/qa/basic_coverage/test_tdf160321_gosub_goto.bas new file mode 100644 index ..79f886fa179d --- /dev/null +++ b/basic/qa/basic_coverage/test_tdf160321_gosub_goto.bas @@ -0,0 +1,43 @@ +' +' 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/. +' + +Option Explicit + +Function doUnitTest() As String +TestUtil.TestInit +verify_GoSub_GoTo +doUnitTest = TestUtil.GetResult() +End Function + +Sub verify_GoSub_GoTo +On Error GoTo errorHandler + +Dim iVar As Integer + +' tdf#160321 - don't execute the GoSub statement if the expression is 0 +On 0 GoSub Sub1, Sub2 +iVar = iVar + 1 +TestUtil.AssertEqual(iVar, 1, "iVar incremented incorrectly") + +' tdf#160321 - check the correct functionality of the GoTo statement +On 1 GoTo Sub1, Sub2 +iVar = iVar + 1 + +Exit Sub +Sub1: +TestUtil.AssertEqual(iVar, 1, "iVar incremented incorrectly") +On 2 GoTo Sub1, Sub2 +iVar = iVar + 1 +Exit Sub +Sub2: +TestUtil.AssertEqual(iVar, 1, "iVar incremented incorrectly") +Exit Sub +errorHandler: +TestUtil.ReportErrorHandler("verify_GoSub_GoTo", Err, Error$, Erl) +Exit Sub +End Sub diff --git a/basic/qa/vba_tests/gosub_goto.vb b/basic/qa/vba_tests/gosub_goto.vb new file mode 100644 index ..523f15ac94c9 --- /dev/null +++ b/basic/qa/vba_tests/gosub_goto.vb @@ -0,0 +1,44 @@ +' +' 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/. +' + +Option VBASupport 1 +Option Explicit + +Function doUnitTest() As String +TestUtil.TestInit +verify_GoSub_GoTo +doUnitTest = TestUtil.GetResult() +End Function + +Sub verify_GoSub_GoTo +On Error GoTo errorHandler + +Dim iVar As Integer + +' tdf#160321 - don't execute the GoSub statement if the expression is 0 +On 0 GoSub Sub1, Sub2 +iVar = iVar + 1 +TestUtil.AssertEqual(iVar, 1, "iVar incremented incorrectly") + +' tdf#160321 - check the correct functionality of the GoTo statement +On 1 GoTo Sub1, Sub2 +iVar = iVar + 1 + +Exit Sub +Sub1: +TestUtil.AssertEqual(iVar, 1, "iVar incremented incorrectly") +On 2 GoTo Sub1, Sub2 +iVar = iVar + 1 +Exit Sub +Sub2: +TestUtil.AssertEqual(iVar, 1, "iVar incremented incorrectly") +Exit Sub +errorHandler: +TestUtil.ReportErrorHandler("verify_GoSub_GoTo", Err, Error$, Erl) +Exit Sub +End Sub diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index e2f82d5ad97d..90b40cb8adc8 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -3043,13 +3043,16 @@ void SbiRuntime::StepONJUMP( sal_uInt32 nOp1 ) { SbxVariableRef p = PopVar(); sal_Int16 n = p->GetInteger(); -if( nOp1 & 0x8000 ) -{ + +if (nOp1 & 0x8000) nOp1 &= 0x7FFF; -PushGosub( pCode + 5 * nOp1 ); -} -if( n < 1 || o3tl::make_unsigned(n) > nOp1 ) -n = static_cast( nOp1 + 1 ); + +// tdf#160321 - do not execute the jump statement if the expression is out of range +if (n < 1 || o3tl::make_unsigned(n) > nOp1) +n = static_cast(nOp1 + 1); +else if (nOp1 & 0x8000) +PushGosub(pCode + 5 * nOp1); + nOp1 = static_cast(pCode - pImg->GetCode()) + 5 * --n; StepJUMP( nOp1 ); }
core.git: sc/qa sc/source
sc/qa/uitest/pasteSpecial/tdf139858.py |7 sc/qa/uitest/pasteSpecial/tdf158110.py | 48 + sc/qa/uitest/pasteSpecial/tdf160765.py |9 +- sc/source/ui/miscdlgs/inscodlg.cxx |7 ++-- sc/source/ui/view/viewfun3.cxx | 21 -- 5 files changed, 78 insertions(+), 14 deletions(-) New commits: commit 76941af9837406b1526b2f2d13c89df7a2023072 Author: Andreas Heinisch AuthorDate: Mon May 6 14:53:19 2024 +0200 Commit: Andreas Heinisch CommitDate: Wed May 22 07:27:32 2024 +0200 tdf#158110 - Paste special: Remove special ADDNOTES flag handling Remove special ADDNOTES flag handling and just add it to existing NOTE flag to ensure no content will be deleted. However, the check for empty cells needs to be improved. Change-Id: I44ae75aa3997a0b1041447106bc3c07146043351 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167202 Reviewed-by: Andreas Heinisch Tested-by: Jenkins diff --git a/sc/qa/uitest/pasteSpecial/tdf139858.py b/sc/qa/uitest/pasteSpecial/tdf139858.py old mode 100755 new mode 100644 index ca81c7715cb6..b5689ec3fdca --- a/sc/qa/uitest/pasteSpecial/tdf139858.py +++ b/sc/qa/uitest/pasteSpecial/tdf139858.py @@ -12,6 +12,7 @@ from uitest.framework import UITestCase from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.calc import enter_text_to_cell +from uitest.uihelper.common import get_state_as_dict from libreoffice.calc.paste_special import reset_default_values class tdf139858(UITestCase): @@ -51,6 +52,12 @@ class tdf139858(UITestCase): xCommentsChkBox = xPasteSpecialDlg.getChild("comments") xCommentsChkBox.executeAction("CLICK", tuple()) +# After tdf#158110 when an existing comment is overwritten, a confirmation dialog is shown +xCheckWarningDlg = self.xUITest.getTopFocusWindow() +if get_state_as_dict(xCheckWarningDlg)["ID"] == "CheckWarningDialog": +xYesBtn = xCheckWarningDlg.getChild("yes") +xYesBtn.executeAction("CLICK", tuple()) + # Without the fix in place, this test would have failed with # AssertionError: 'A1 sample text' != '' # i.e., the cell content was overwritten diff --git a/sc/qa/uitest/pasteSpecial/tdf158110.py b/sc/qa/uitest/pasteSpecial/tdf158110.py new file mode 100644 index ..9b0dba6ed8cd --- /dev/null +++ b/sc/qa/uitest/pasteSpecial/tdf158110.py @@ -0,0 +1,48 @@ +# -*- 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.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +from libreoffice.calc.paste_special import reset_default_values + +class tdf158110(UITestCase): +def test_tdf158110_paste_special_multiple_cells(self): +with self.ui_test.create_doc_in_start_center("calc") as document: +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + +# Insert a comment in cell A1 +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL":"A1"})) +xArgs = mkPropertyValues({"Text": "Comment 1"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Copy cell range A1:A2 to clipboard +xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"})) +self.xUITest.executeCommand(".uno:Copy") + +# Paste data using special options (check only comments) +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"})) +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +reset_default_values(self, xPasteSpecialDlg) +xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime") +xDateTimeChkBox.executeAction("CLICK", tuple()) +xTextChkBox = xPasteSpecialDlg.getChild("text") +xTextChkBox.executeAction("CLICK", tuple()) +xNumbersChkBox = xPasteSpecialDlg.getChild("numbers") +xNumbersChkBox.executeAction("CLICK", tuple()) +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +xCommentsChkBox.executeAction("CLICK", tuple()) + +# Without the fix in place, this test would have failed with +# AssertionError: 'Comment 1' != '' +# i.e., the comment was not copied +self.assertEqual("Comment 1",
core.git: Branch 'libreoffice-7-6-7' - sc/qa sc/source
sc/qa/uitest/pasteSpecial/tdf160765.py | 34 + sc/source/ui/miscdlgs/inscodlg.cxx |4 ++- 2 files changed, 37 insertions(+), 1 deletion(-) New commits: commit d4cfeb2a69e40148ab080eae179e6278837fc754 Author: Andreas Heinisch AuthorDate: Fri Apr 26 20:29:53 2024 +0200 Commit: Christian Lohmaier CommitDate: Tue May 7 18:27:42 2024 +0200 tdf#160765 - Paste Special Dialog: Remember comments checkbox After the change of tdf#139858 the comments checkbox was not remembered anymore after closing the dialog. In order to fix this issue, additionally check not only the NOTE flag but also for the ADDNOTES one. Change-Id: I8b24d231313b57a05b7e527c0865686762e5a2b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166762 Reviewed-by: Andreas Heinisch Tested-by: Jenkins (cherry picked from commit 7e30434655754277bfa7ce7d8ec37b07181d2c92) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166838 Reviewed-by: Xisco Fauli (cherry picked from commit 30524d5998d38b7e216b721859c72fbfc56a5b5a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166890 Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167231 Reviewed-by: Christian Lohmaier Tested-by: Christian Lohmaier diff --git a/sc/qa/uitest/pasteSpecial/tdf160765.py b/sc/qa/uitest/pasteSpecial/tdf160765.py index 0b56be4c2dfa..c0c264432ef4 100644 --- a/sc/qa/uitest/pasteSpecial/tdf160765.py +++ b/sc/qa/uitest/pasteSpecial/tdf160765.py @@ -13,8 +13,42 @@ from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.paste_special import reset_default_values +from uitest.uihelper.common import get_state_as_dict class tdf160765(UITestCase): +def test_tdf160765_paste_special_comments_checked(self): +with self.ui_test.create_doc_in_start_center("calc"): +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + +# Insert a comment in cell A1 +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL":"A1"})) +xArgs = mkPropertyValues({"Text": "Comment 1"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Copy cell A1 to clipboard +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) +self.xUITest.executeCommand(".uno:Copy") + +# Paste data using special options (check only comments) +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +reset_default_values(self, xPasteSpecialDlg) +xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime") +xDateTimeChkBox.executeAction("CLICK", tuple()) +xTextChkBox = xPasteSpecialDlg.getChild("text") +xTextChkBox.executeAction("CLICK", tuple()) +xNumbersChkBox = xPasteSpecialDlg.getChild("numbers") +xNumbersChkBox.executeAction("CLICK", tuple()) +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +xCommentsChkBox.executeAction("CLICK", tuple()) + +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +# Without the fix in place, this test would have failed with +# AssertionError: 'true' != 'false' +# i.e., the comments checkbox was not remembered + self.assertEqual(get_state_as_dict(xCommentsChkBox)["Selected"], "true") + def test_tdf160765_undo_paste_comment(self): with self.ui_test.create_doc_in_start_center("calc") as document: xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx index 84292dcd91c4..378b10f37fd0 100644 --- a/sc/source/ui/miscdlgs/inscodlg.cxx +++ b/sc/source/ui/miscdlgs/inscodlg.cxx @@ -231,7 +231,9 @@ void ScInsertContentsDlg::SetInsContentsCmdBits(const InsertDeleteFlags eFlags) mxBtnInsNumbers->set_active((InsertDeleteFlags::VALUE & eFlags) == InsertDeleteFlags::VALUE); mxBtnInsDateTime->set_active((InsertDeleteFlags::DATETIME & eFlags) == InsertDeleteFlags::DATETIME); mxBtnInsStrings->set_active((InsertDeleteFlags::STRING & eFlags) == InsertDeleteFlags::STRING); -mxBtnInsNotes->set_active((InsertDeleteFlags::NOTE & eFlags) == InsertDeleteFlags::NOTE); +// tdf#160765 - additionally check either NOTE or ADDNOTES +mxBtnInsNotes->set_active(((InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES) & eFlags) +
core.git: Branch 'libreoffice-7-6-7' - sc/qa sc/source
sc/qa/uitest/pasteSpecial/tdf160765.py | 75 + sc/source/ui/view/viewfun3.cxx |3 - 2 files changed, 77 insertions(+), 1 deletion(-) New commits: commit e600195ae980f297b414ef69161de7b629f59346 Author: Andreas Heinisch AuthorDate: Mon Apr 22 20:06:50 2024 +0200 Commit: Christian Lohmaier CommitDate: Tue May 7 18:27:06 2024 +0200 tdf#160765 - Save content for undo when pasting notes even if no content was changed after pasting special. Otherwise, the undo functionality crashes due to undoing a cell with no content where the annotation indicator will remain (unod/redo of note captions are handled via drawing undo). Change-Id: I7007fce510d6e9896cbda11a1e14a61b5ccb34a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166469 Tested-by: Jenkins Reviewed-by: Stéphane Guillou Reviewed-by: Andreas Heinisch (cherry picked from commit a1694b194c2b3e89250c5b79a69e7dd184b69976) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166524 Reviewed-by: Xisco Fauli (cherry picked from commit 4d744d94cc4ee114a7e5d5373b2b599baed31ee5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166846 Tested-by: Christian Lohmaier Reviewed-by: Christian Lohmaier diff --git a/sc/qa/uitest/pasteSpecial/tdf160765.py b/sc/qa/uitest/pasteSpecial/tdf160765.py new file mode 100644 index ..0b56be4c2dfa --- /dev/null +++ b/sc/qa/uitest/pasteSpecial/tdf160765.py @@ -0,0 +1,75 @@ +# -*- 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.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.paste_special import reset_default_values + +class tdf160765(UITestCase): +def test_tdf160765_undo_paste_comment(self): +with self.ui_test.create_doc_in_start_center("calc") as document: +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + +# Write text to cell A1 and B1 +enter_text_to_cell(xGridWin, "A1", "A1 sample text") +enter_text_to_cell(xGridWin, "B1", "B1 sample text") + +# Insert a comment in cell B1 +xArgs = mkPropertyValues({"Text": "Comment 1"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Insert a comment in cell A2 +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL":"A2"})) +xArgs = mkPropertyValues({"Text": "Comment 2"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Copy cell A2 to clipboard +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) +self.xUITest.executeCommand(".uno:Copy") + +# Set cursor to cells and paste data using special options (check only comments) +targetCells = ["A1", "B1"] +for index, targetCell in enumerate(targetCells): +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": targetCell})) +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +reset_default_values(self, xPasteSpecialDlg) +xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime") +xDateTimeChkBox.executeAction("CLICK", tuple()) +xTextChkBox = xPasteSpecialDlg.getChild("text") +xTextChkBox.executeAction("CLICK", tuple()) +xNumbersChkBox = xPasteSpecialDlg.getChild("numbers") +xNumbersChkBox.executeAction("CLICK", tuple()) +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +xCommentsChkBox.executeAction("CLICK", tuple()) + +# Undo both inserted comments +self.xUITest.executeCommand(".uno:Undo") +# Without the fix in place, this test would have failed with +# AssertionError: 'Comment 1' != '' +# i.e., the cell does not contain any comment +self.assertEqual("Comment 1", get_cell_by_position(document, 0, 1, 0).Annotation.String) +self.xUITest.executeCommand(".uno:Undo") +self.assertEqual("", get_cell_by_position(document, 0, 0, 0).Annotation.String) + +# Redo both inserted comments +self.xUITest.executeCommand(".uno:Redo") +# Without the fix in place, this test would have failed with +# AssertionError: 'Comment 2' != '' +# i.e.,
core.git: Branch 'libreoffice-7-6' - sc/qa sc/source
sc/qa/uitest/pasteSpecial/tdf160765.py | 34 + sc/source/ui/miscdlgs/inscodlg.cxx |4 ++- 2 files changed, 37 insertions(+), 1 deletion(-) New commits: commit a4f679ed901923046e4fee3e11a9fc236c4ff506 Author: Andreas Heinisch AuthorDate: Fri Apr 26 20:29:53 2024 +0200 Commit: Xisco Fauli CommitDate: Mon May 6 15:47:18 2024 +0200 tdf#160765 - Paste Special Dialog: Remember comments checkbox After the change of tdf#139858 the comments checkbox was not remembered anymore after closing the dialog. In order to fix this issue, additionally check not only the NOTE flag but also for the ADDNOTES one. Change-Id: I8b24d231313b57a05b7e527c0865686762e5a2b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166762 Reviewed-by: Andreas Heinisch Tested-by: Jenkins (cherry picked from commit 7e30434655754277bfa7ce7d8ec37b07181d2c92) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166838 Reviewed-by: Xisco Fauli (cherry picked from commit 30524d5998d38b7e216b721859c72fbfc56a5b5a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166890 diff --git a/sc/qa/uitest/pasteSpecial/tdf160765.py b/sc/qa/uitest/pasteSpecial/tdf160765.py index 0b56be4c2dfa..c0c264432ef4 100755 --- a/sc/qa/uitest/pasteSpecial/tdf160765.py +++ b/sc/qa/uitest/pasteSpecial/tdf160765.py @@ -13,8 +13,42 @@ from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.paste_special import reset_default_values +from uitest.uihelper.common import get_state_as_dict class tdf160765(UITestCase): +def test_tdf160765_paste_special_comments_checked(self): +with self.ui_test.create_doc_in_start_center("calc"): +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + +# Insert a comment in cell A1 +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL":"A1"})) +xArgs = mkPropertyValues({"Text": "Comment 1"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Copy cell A1 to clipboard +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) +self.xUITest.executeCommand(".uno:Copy") + +# Paste data using special options (check only comments) +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +reset_default_values(self, xPasteSpecialDlg) +xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime") +xDateTimeChkBox.executeAction("CLICK", tuple()) +xTextChkBox = xPasteSpecialDlg.getChild("text") +xTextChkBox.executeAction("CLICK", tuple()) +xNumbersChkBox = xPasteSpecialDlg.getChild("numbers") +xNumbersChkBox.executeAction("CLICK", tuple()) +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +xCommentsChkBox.executeAction("CLICK", tuple()) + +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +# Without the fix in place, this test would have failed with +# AssertionError: 'true' != 'false' +# i.e., the comments checkbox was not remembered + self.assertEqual(get_state_as_dict(xCommentsChkBox)["Selected"], "true") + def test_tdf160765_undo_paste_comment(self): with self.ui_test.create_doc_in_start_center("calc") as document: xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx index 84292dcd91c4..378b10f37fd0 100644 --- a/sc/source/ui/miscdlgs/inscodlg.cxx +++ b/sc/source/ui/miscdlgs/inscodlg.cxx @@ -231,7 +231,9 @@ void ScInsertContentsDlg::SetInsContentsCmdBits(const InsertDeleteFlags eFlags) mxBtnInsNumbers->set_active((InsertDeleteFlags::VALUE & eFlags) == InsertDeleteFlags::VALUE); mxBtnInsDateTime->set_active((InsertDeleteFlags::DATETIME & eFlags) == InsertDeleteFlags::DATETIME); mxBtnInsStrings->set_active((InsertDeleteFlags::STRING & eFlags) == InsertDeleteFlags::STRING); -mxBtnInsNotes->set_active((InsertDeleteFlags::NOTE & eFlags) == InsertDeleteFlags::NOTE); +// tdf#160765 - additionally check either NOTE or ADDNOTES +mxBtnInsNotes->set_active(((InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES) & eFlags) + != InsertDeleteFlags::NONE); mxBtnInsFormulas->set_active((InsertDeleteFlags::FORMULA & eFlags) == InsertDeleteFlags::FORMULA);
core.git: Branch 'libreoffice-24-2' - sc/qa sc/source
sc/qa/uitest/pasteSpecial/tdf160765.py | 34 + sc/source/ui/miscdlgs/inscodlg.cxx |4 ++- 2 files changed, 37 insertions(+), 1 deletion(-) New commits: commit 30524d5998d38b7e216b721859c72fbfc56a5b5a Author: Andreas Heinisch AuthorDate: Fri Apr 26 20:29:53 2024 +0200 Commit: Xisco Fauli CommitDate: Mon Apr 29 21:12:47 2024 +0200 tdf#160765 - Paste Special Dialog: Remember comments checkbox After the change of tdf#139858 the comments checkbox was not remembered anymore after closing the dialog. In order to fix this issue, additionally check not only the NOTE flag but also for the ADDNOTES one. Change-Id: I8b24d231313b57a05b7e527c0865686762e5a2b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166762 Reviewed-by: Andreas Heinisch Tested-by: Jenkins (cherry picked from commit 7e30434655754277bfa7ce7d8ec37b07181d2c92) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166838 Reviewed-by: Xisco Fauli diff --git a/sc/qa/uitest/pasteSpecial/tdf160765.py b/sc/qa/uitest/pasteSpecial/tdf160765.py index 0b56be4c2dfa..c0c264432ef4 100755 --- a/sc/qa/uitest/pasteSpecial/tdf160765.py +++ b/sc/qa/uitest/pasteSpecial/tdf160765.py @@ -13,8 +13,42 @@ from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.paste_special import reset_default_values +from uitest.uihelper.common import get_state_as_dict class tdf160765(UITestCase): +def test_tdf160765_paste_special_comments_checked(self): +with self.ui_test.create_doc_in_start_center("calc"): +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + +# Insert a comment in cell A1 +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL":"A1"})) +xArgs = mkPropertyValues({"Text": "Comment 1"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Copy cell A1 to clipboard +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) +self.xUITest.executeCommand(".uno:Copy") + +# Paste data using special options (check only comments) +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +reset_default_values(self, xPasteSpecialDlg) +xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime") +xDateTimeChkBox.executeAction("CLICK", tuple()) +xTextChkBox = xPasteSpecialDlg.getChild("text") +xTextChkBox.executeAction("CLICK", tuple()) +xNumbersChkBox = xPasteSpecialDlg.getChild("numbers") +xNumbersChkBox.executeAction("CLICK", tuple()) +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +xCommentsChkBox.executeAction("CLICK", tuple()) + +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +# Without the fix in place, this test would have failed with +# AssertionError: 'true' != 'false' +# i.e., the comments checkbox was not remembered + self.assertEqual(get_state_as_dict(xCommentsChkBox)["Selected"], "true") + def test_tdf160765_undo_paste_comment(self): with self.ui_test.create_doc_in_start_center("calc") as document: xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx index 84292dcd91c4..378b10f37fd0 100644 --- a/sc/source/ui/miscdlgs/inscodlg.cxx +++ b/sc/source/ui/miscdlgs/inscodlg.cxx @@ -231,7 +231,9 @@ void ScInsertContentsDlg::SetInsContentsCmdBits(const InsertDeleteFlags eFlags) mxBtnInsNumbers->set_active((InsertDeleteFlags::VALUE & eFlags) == InsertDeleteFlags::VALUE); mxBtnInsDateTime->set_active((InsertDeleteFlags::DATETIME & eFlags) == InsertDeleteFlags::DATETIME); mxBtnInsStrings->set_active((InsertDeleteFlags::STRING & eFlags) == InsertDeleteFlags::STRING); -mxBtnInsNotes->set_active((InsertDeleteFlags::NOTE & eFlags) == InsertDeleteFlags::NOTE); +// tdf#160765 - additionally check either NOTE or ADDNOTES +mxBtnInsNotes->set_active(((InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES) & eFlags) + != InsertDeleteFlags::NONE); mxBtnInsFormulas->set_active((InsertDeleteFlags::FORMULA & eFlags) == InsertDeleteFlags::FORMULA); mxBtnInsAttrs->set_active((InsertDeleteFlags::ATTRIB & eFlags) == InsertDeleteFlags::ATTRIB); mxBtnInsObjects->set_active((InsertDeleteFlags::OBJECTS & eFlags) ==
core.git: Branch 'libreoffice-7-6' - sc/qa sc/source
sc/qa/uitest/pasteSpecial/tdf160765.py | 75 + sc/source/ui/view/viewfun3.cxx |3 - 2 files changed, 77 insertions(+), 1 deletion(-) New commits: commit 4d744d94cc4ee114a7e5d5373b2b599baed31ee5 Author: Andreas Heinisch AuthorDate: Mon Apr 22 20:06:50 2024 +0200 Commit: Xisco Fauli CommitDate: Mon Apr 29 21:01:47 2024 +0200 tdf#160765 - Save content for undo when pasting notes even if no content was changed after pasting special. Otherwise, the undo functionality crashes due to undoing a cell with no content where the annotation indicator will remain (unod/redo of note captions are handled via drawing undo). Change-Id: I7007fce510d6e9896cbda11a1e14a61b5ccb34a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166469 Tested-by: Jenkins Reviewed-by: Stéphane Guillou Reviewed-by: Andreas Heinisch (cherry picked from commit a1694b194c2b3e89250c5b79a69e7dd184b69976) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166524 Reviewed-by: Xisco Fauli diff --git a/sc/qa/uitest/pasteSpecial/tdf160765.py b/sc/qa/uitest/pasteSpecial/tdf160765.py new file mode 100755 index ..0b56be4c2dfa --- /dev/null +++ b/sc/qa/uitest/pasteSpecial/tdf160765.py @@ -0,0 +1,75 @@ +# -*- 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.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.paste_special import reset_default_values + +class tdf160765(UITestCase): +def test_tdf160765_undo_paste_comment(self): +with self.ui_test.create_doc_in_start_center("calc") as document: +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + +# Write text to cell A1 and B1 +enter_text_to_cell(xGridWin, "A1", "A1 sample text") +enter_text_to_cell(xGridWin, "B1", "B1 sample text") + +# Insert a comment in cell B1 +xArgs = mkPropertyValues({"Text": "Comment 1"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Insert a comment in cell A2 +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL":"A2"})) +xArgs = mkPropertyValues({"Text": "Comment 2"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Copy cell A2 to clipboard +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) +self.xUITest.executeCommand(".uno:Copy") + +# Set cursor to cells and paste data using special options (check only comments) +targetCells = ["A1", "B1"] +for index, targetCell in enumerate(targetCells): +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": targetCell})) +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +reset_default_values(self, xPasteSpecialDlg) +xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime") +xDateTimeChkBox.executeAction("CLICK", tuple()) +xTextChkBox = xPasteSpecialDlg.getChild("text") +xTextChkBox.executeAction("CLICK", tuple()) +xNumbersChkBox = xPasteSpecialDlg.getChild("numbers") +xNumbersChkBox.executeAction("CLICK", tuple()) +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +xCommentsChkBox.executeAction("CLICK", tuple()) + +# Undo both inserted comments +self.xUITest.executeCommand(".uno:Undo") +# Without the fix in place, this test would have failed with +# AssertionError: 'Comment 1' != '' +# i.e., the cell does not contain any comment +self.assertEqual("Comment 1", get_cell_by_position(document, 0, 1, 0).Annotation.String) +self.xUITest.executeCommand(".uno:Undo") +self.assertEqual("", get_cell_by_position(document, 0, 0, 0).Annotation.String) + +# Redo both inserted comments +self.xUITest.executeCommand(".uno:Redo") +# Without the fix in place, this test would have failed with +# AssertionError: 'Comment 2' != '' +# i.e., the cell does not contain the restored comment +self.assertEqual("Comment 2", get_cell_by_position(document, 0, 0, 0).Annotation.String) +self.xUITest.executeCommand(".uno:Redo") +
core.git: Branch 'libreoffice-24-2-3' - sc/qa sc/source
sc/qa/uitest/pasteSpecial/tdf160765.py | 75 + sc/source/ui/view/viewfun3.cxx |3 - 2 files changed, 77 insertions(+), 1 deletion(-) New commits: commit 985a85437c1352079ff1812b6039874b5226882b Author: Andreas Heinisch AuthorDate: Mon Apr 22 20:06:50 2024 +0200 Commit: Xisco Fauli CommitDate: Mon Apr 29 18:43:38 2024 +0200 tdf#160765 - Save content for undo when pasting notes even if no content was changed after pasting special. Otherwise, the undo functionality crashes due to undoing a cell with no content where the annotation indicator will remain (unod/redo of note captions are handled via drawing undo). Change-Id: I7007fce510d6e9896cbda11a1e14a61b5ccb34a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166469 Tested-by: Jenkins Reviewed-by: Stéphane Guillou Reviewed-by: Andreas Heinisch (cherry picked from commit a1694b194c2b3e89250c5b79a69e7dd184b69976) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166523 Reviewed-by: Xisco Fauli (cherry picked from commit 7e2e1d7fd4531f57bbc30a0a8e1cb8c40519a349) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166527 Tested-by: Xisco Fauli Reviewed-by: Patrick Luby Reviewed-by: Ilmari Lauhakangas diff --git a/sc/qa/uitest/pasteSpecial/tdf160765.py b/sc/qa/uitest/pasteSpecial/tdf160765.py new file mode 100755 index ..0b56be4c2dfa --- /dev/null +++ b/sc/qa/uitest/pasteSpecial/tdf160765.py @@ -0,0 +1,75 @@ +# -*- 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.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.paste_special import reset_default_values + +class tdf160765(UITestCase): +def test_tdf160765_undo_paste_comment(self): +with self.ui_test.create_doc_in_start_center("calc") as document: +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + +# Write text to cell A1 and B1 +enter_text_to_cell(xGridWin, "A1", "A1 sample text") +enter_text_to_cell(xGridWin, "B1", "B1 sample text") + +# Insert a comment in cell B1 +xArgs = mkPropertyValues({"Text": "Comment 1"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Insert a comment in cell A2 +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL":"A2"})) +xArgs = mkPropertyValues({"Text": "Comment 2"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Copy cell A2 to clipboard +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) +self.xUITest.executeCommand(".uno:Copy") + +# Set cursor to cells and paste data using special options (check only comments) +targetCells = ["A1", "B1"] +for index, targetCell in enumerate(targetCells): +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": targetCell})) +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +reset_default_values(self, xPasteSpecialDlg) +xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime") +xDateTimeChkBox.executeAction("CLICK", tuple()) +xTextChkBox = xPasteSpecialDlg.getChild("text") +xTextChkBox.executeAction("CLICK", tuple()) +xNumbersChkBox = xPasteSpecialDlg.getChild("numbers") +xNumbersChkBox.executeAction("CLICK", tuple()) +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +xCommentsChkBox.executeAction("CLICK", tuple()) + +# Undo both inserted comments +self.xUITest.executeCommand(".uno:Undo") +# Without the fix in place, this test would have failed with +# AssertionError: 'Comment 1' != '' +# i.e., the cell does not contain any comment +self.assertEqual("Comment 1", get_cell_by_position(document, 0, 1, 0).Annotation.String) +self.xUITest.executeCommand(".uno:Undo") +self.assertEqual("", get_cell_by_position(document, 0, 0, 0).Annotation.String) + +# Redo both inserted comments +self.xUITest.executeCommand(".uno:Redo") +# Without the fix in place, this test would have failed with +# AssertionError: 'Comment 2' != '' +
core.git: sc/qa sc/source
sc/qa/uitest/pasteSpecial/tdf160765.py | 34 + sc/source/ui/miscdlgs/inscodlg.cxx |4 ++- 2 files changed, 37 insertions(+), 1 deletion(-) New commits: commit 7e30434655754277bfa7ce7d8ec37b07181d2c92 Author: Andreas Heinisch AuthorDate: Fri Apr 26 20:29:53 2024 +0200 Commit: Andreas Heinisch CommitDate: Mon Apr 29 15:57:20 2024 +0200 tdf#160765 - Paste Special Dialog: Remember comments checkbox After the change of tdf#139858 the comments checkbox was not remembered anymore after closing the dialog. In order to fix this issue, additionally check not only the NOTE flag but also for the ADDNOTES one. Change-Id: I8b24d231313b57a05b7e527c0865686762e5a2b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166762 Reviewed-by: Andreas Heinisch Tested-by: Jenkins diff --git a/sc/qa/uitest/pasteSpecial/tdf160765.py b/sc/qa/uitest/pasteSpecial/tdf160765.py index 0b56be4c2dfa..c0c264432ef4 100755 --- a/sc/qa/uitest/pasteSpecial/tdf160765.py +++ b/sc/qa/uitest/pasteSpecial/tdf160765.py @@ -13,8 +13,42 @@ from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.paste_special import reset_default_values +from uitest.uihelper.common import get_state_as_dict class tdf160765(UITestCase): +def test_tdf160765_paste_special_comments_checked(self): +with self.ui_test.create_doc_in_start_center("calc"): +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + +# Insert a comment in cell A1 +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL":"A1"})) +xArgs = mkPropertyValues({"Text": "Comment 1"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Copy cell A1 to clipboard +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) +self.xUITest.executeCommand(".uno:Copy") + +# Paste data using special options (check only comments) +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +reset_default_values(self, xPasteSpecialDlg) +xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime") +xDateTimeChkBox.executeAction("CLICK", tuple()) +xTextChkBox = xPasteSpecialDlg.getChild("text") +xTextChkBox.executeAction("CLICK", tuple()) +xNumbersChkBox = xPasteSpecialDlg.getChild("numbers") +xNumbersChkBox.executeAction("CLICK", tuple()) +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +xCommentsChkBox.executeAction("CLICK", tuple()) + +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +# Without the fix in place, this test would have failed with +# AssertionError: 'true' != 'false' +# i.e., the comments checkbox was not remembered + self.assertEqual(get_state_as_dict(xCommentsChkBox)["Selected"], "true") + def test_tdf160765_undo_paste_comment(self): with self.ui_test.create_doc_in_start_center("calc") as document: xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx index 84292dcd91c4..378b10f37fd0 100644 --- a/sc/source/ui/miscdlgs/inscodlg.cxx +++ b/sc/source/ui/miscdlgs/inscodlg.cxx @@ -231,7 +231,9 @@ void ScInsertContentsDlg::SetInsContentsCmdBits(const InsertDeleteFlags eFlags) mxBtnInsNumbers->set_active((InsertDeleteFlags::VALUE & eFlags) == InsertDeleteFlags::VALUE); mxBtnInsDateTime->set_active((InsertDeleteFlags::DATETIME & eFlags) == InsertDeleteFlags::DATETIME); mxBtnInsStrings->set_active((InsertDeleteFlags::STRING & eFlags) == InsertDeleteFlags::STRING); -mxBtnInsNotes->set_active((InsertDeleteFlags::NOTE & eFlags) == InsertDeleteFlags::NOTE); +// tdf#160765 - additionally check either NOTE or ADDNOTES +mxBtnInsNotes->set_active(((InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES) & eFlags) + != InsertDeleteFlags::NONE); mxBtnInsFormulas->set_active((InsertDeleteFlags::FORMULA & eFlags) == InsertDeleteFlags::FORMULA); mxBtnInsAttrs->set_active((InsertDeleteFlags::ATTRIB & eFlags) == InsertDeleteFlags::ATTRIB); mxBtnInsObjects->set_active((InsertDeleteFlags::OBJECTS & eFlags) == InsertDeleteFlags::OBJECTS);
core.git: Branch 'libreoffice-24-2' - sc/qa sc/source
sc/qa/uitest/pasteSpecial/tdf160765.py | 75 + sc/source/ui/view/viewfun3.cxx |3 - 2 files changed, 77 insertions(+), 1 deletion(-) New commits: commit 7e2e1d7fd4531f57bbc30a0a8e1cb8c40519a349 Author: Andreas Heinisch AuthorDate: Mon Apr 22 20:06:50 2024 +0200 Commit: Xisco Fauli CommitDate: Thu Apr 25 16:22:56 2024 +0200 tdf#160765 - Save content for undo when pasting notes even if no content was changed after pasting special. Otherwise, the undo functionality crashes due to undoing a cell with no content where the annotation indicator will remain (unod/redo of note captions are handled via drawing undo). Change-Id: I7007fce510d6e9896cbda11a1e14a61b5ccb34a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166469 Tested-by: Jenkins Reviewed-by: Stéphane Guillou Reviewed-by: Andreas Heinisch (cherry picked from commit a1694b194c2b3e89250c5b79a69e7dd184b69976) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166523 Reviewed-by: Xisco Fauli diff --git a/sc/qa/uitest/pasteSpecial/tdf160765.py b/sc/qa/uitest/pasteSpecial/tdf160765.py new file mode 100755 index ..0b56be4c2dfa --- /dev/null +++ b/sc/qa/uitest/pasteSpecial/tdf160765.py @@ -0,0 +1,75 @@ +# -*- 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.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.paste_special import reset_default_values + +class tdf160765(UITestCase): +def test_tdf160765_undo_paste_comment(self): +with self.ui_test.create_doc_in_start_center("calc") as document: +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + +# Write text to cell A1 and B1 +enter_text_to_cell(xGridWin, "A1", "A1 sample text") +enter_text_to_cell(xGridWin, "B1", "B1 sample text") + +# Insert a comment in cell B1 +xArgs = mkPropertyValues({"Text": "Comment 1"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Insert a comment in cell A2 +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL":"A2"})) +xArgs = mkPropertyValues({"Text": "Comment 2"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Copy cell A2 to clipboard +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) +self.xUITest.executeCommand(".uno:Copy") + +# Set cursor to cells and paste data using special options (check only comments) +targetCells = ["A1", "B1"] +for index, targetCell in enumerate(targetCells): +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": targetCell})) +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +reset_default_values(self, xPasteSpecialDlg) +xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime") +xDateTimeChkBox.executeAction("CLICK", tuple()) +xTextChkBox = xPasteSpecialDlg.getChild("text") +xTextChkBox.executeAction("CLICK", tuple()) +xNumbersChkBox = xPasteSpecialDlg.getChild("numbers") +xNumbersChkBox.executeAction("CLICK", tuple()) +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +xCommentsChkBox.executeAction("CLICK", tuple()) + +# Undo both inserted comments +self.xUITest.executeCommand(".uno:Undo") +# Without the fix in place, this test would have failed with +# AssertionError: 'Comment 1' != '' +# i.e., the cell does not contain any comment +self.assertEqual("Comment 1", get_cell_by_position(document, 0, 1, 0).Annotation.String) +self.xUITest.executeCommand(".uno:Undo") +self.assertEqual("", get_cell_by_position(document, 0, 0, 0).Annotation.String) + +# Redo both inserted comments +self.xUITest.executeCommand(".uno:Redo") +# Without the fix in place, this test would have failed with +# AssertionError: 'Comment 2' != '' +# i.e., the cell does not contain the restored comment +self.assertEqual("Comment 2", get_cell_by_position(document, 0, 0, 0).Annotation.String) +self.xUITest.executeCommand(".uno:Redo") +
core.git: sc/qa sc/source
sc/qa/uitest/pasteSpecial/tdf160765.py | 75 + sc/source/ui/view/viewfun3.cxx |3 - 2 files changed, 77 insertions(+), 1 deletion(-) New commits: commit a1694b194c2b3e89250c5b79a69e7dd184b69976 Author: Andreas Heinisch AuthorDate: Mon Apr 22 20:06:50 2024 +0200 Commit: Andreas Heinisch CommitDate: Wed Apr 24 10:06:48 2024 +0200 tdf#160765 - Save content for undo when pasting notes even if no content was changed after pasting special. Otherwise, the undo functionality crashes due to undoing a cell with no content where the annotation indicator will remain (unod/redo of note captions are handled via drawing undo). Change-Id: I7007fce510d6e9896cbda11a1e14a61b5ccb34a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166469 Tested-by: Jenkins Reviewed-by: Stéphane Guillou Reviewed-by: Andreas Heinisch diff --git a/sc/qa/uitest/pasteSpecial/tdf160765.py b/sc/qa/uitest/pasteSpecial/tdf160765.py new file mode 100755 index ..0b56be4c2dfa --- /dev/null +++ b/sc/qa/uitest/pasteSpecial/tdf160765.py @@ -0,0 +1,75 @@ +# -*- 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.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.paste_special import reset_default_values + +class tdf160765(UITestCase): +def test_tdf160765_undo_paste_comment(self): +with self.ui_test.create_doc_in_start_center("calc") as document: +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + +# Write text to cell A1 and B1 +enter_text_to_cell(xGridWin, "A1", "A1 sample text") +enter_text_to_cell(xGridWin, "B1", "B1 sample text") + +# Insert a comment in cell B1 +xArgs = mkPropertyValues({"Text": "Comment 1"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Insert a comment in cell A2 +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL":"A2"})) +xArgs = mkPropertyValues({"Text": "Comment 2"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Copy cell A2 to clipboard +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) +self.xUITest.executeCommand(".uno:Copy") + +# Set cursor to cells and paste data using special options (check only comments) +targetCells = ["A1", "B1"] +for index, targetCell in enumerate(targetCells): +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": targetCell})) +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +reset_default_values(self, xPasteSpecialDlg) +xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime") +xDateTimeChkBox.executeAction("CLICK", tuple()) +xTextChkBox = xPasteSpecialDlg.getChild("text") +xTextChkBox.executeAction("CLICK", tuple()) +xNumbersChkBox = xPasteSpecialDlg.getChild("numbers") +xNumbersChkBox.executeAction("CLICK", tuple()) +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +xCommentsChkBox.executeAction("CLICK", tuple()) + +# Undo both inserted comments +self.xUITest.executeCommand(".uno:Undo") +# Without the fix in place, this test would have failed with +# AssertionError: 'Comment 1' != '' +# i.e., the cell does not contain any comment +self.assertEqual("Comment 1", get_cell_by_position(document, 0, 1, 0).Annotation.String) +self.xUITest.executeCommand(".uno:Undo") +self.assertEqual("", get_cell_by_position(document, 0, 0, 0).Annotation.String) + +# Redo both inserted comments +self.xUITest.executeCommand(".uno:Redo") +# Without the fix in place, this test would have failed with +# AssertionError: 'Comment 2' != '' +# i.e., the cell does not contain the restored comment +self.assertEqual("Comment 2", get_cell_by_position(document, 0, 0, 0).Annotation.String) +self.xUITest.executeCommand(".uno:Redo") +# Without the fix in place, this test would have failed with +# AssertionError: 'Comment 2' != '' +# i.e., the cell does not contain the
core.git: sc/qa sc/source
sc/qa/unit/subsequent_export_test4.cxx | 20 sc/source/filter/excel/xename.cxx | 14 +++--- sc/source/filter/excel/xihelper.cxx|8 sc/source/filter/inc/xihelper.hxx |5 + 4 files changed, 44 insertions(+), 3 deletions(-) New commits: commit 2d472fae8f1223dc969172951d08ff6e4b4f98ba Author: Andreas Heinisch AuthorDate: Wed Mar 6 13:48:46 2024 +0100 Commit: Andreas Heinisch CommitDate: Wed Mar 13 09:28:43 2024 +0100 tdf#148170 - Convert print range to an excel cell range During export from Calc to XLS, ensure that the print range is converted to a valid XLS print range. If the print range exceeds XLS format limitations, it will be appropriately cropped to fit within the constraints. Change-Id: I2b233e4d57dfbe30f491448d2ee2972b8b717ea3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164469 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/qa/unit/subsequent_export_test4.cxx b/sc/qa/unit/subsequent_export_test4.cxx index 41d76cc9698d..ff453d2ca7ed 100644 --- a/sc/qa/unit/subsequent_export_test4.cxx +++ b/sc/qa/unit/subsequent_export_test4.cxx @@ -761,6 +761,26 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf51022_lostPrintRange) CPPUNIT_ASSERT_EQUAL(aRange2, *pDoc->GetPrintRange(0, 1)); } +CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf148170_ExceedXlsPrintRange) +{ +createScDoc(); + +// Create print range that exceeds the xls limitations +const auto aScSheeLimits = ScSheetLimits::CreateDefault(); +ScRange aCalcPrintRange(0, 0, 0, aScSheeLimits.MaxCol(), aScSheeLimits.MaxRow(), 0); +ScDocument* pDoc = getScDoc(); +pDoc->AddPrintRange(0, aCalcPrintRange); + +saveAndReload("MS Excel 97"); + +// Check if print range was shrunk to xls limitations +pDoc = getScDoc(); +CPPUNIT_ASSERT_EQUAL(static_cast(1), pDoc->GetPrintRangeCount(0)); +// Check sc/source/filter/inc/xlconst.hxx for xls limitations +ScRange aXlsPrintRange(0, 0, 0, 16383, 65535, 0); +CPPUNIT_ASSERT_EQUAL(aXlsPrintRange, *pDoc->GetPrintRange(0, 0)); +} + CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf138741_externalLinkSkipUnusedsCrash) { createScDoc("xlsx/tdf138741_externalLinkSkipUnusedsCrash.xlsx"); diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index 84073da8ff90..8d97ffaadda9 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -36,6 +36,7 @@ #include #include #include +#include using namespace ::oox; using namespace ::com::sun::star; @@ -713,10 +714,17 @@ void XclExpNameManagerImpl::CreateBuiltInNames() aRange.aStart.SetTab( nScTab ); aRange.aEnd.SetTab( nScTab ); aRange.PutInOrder(); -aRangeList.push_back( aRange ); + +// tdf#148170 - convert print range to an excel cell range +XclRange aXclRange(ScAddress::UNINITIALIZED); +// create no warning if ranges are shrunken +if (GetAddressConverter().ConvertRange(aXclRange, aRange, false)) +{ +XclImpAddressConverter::FillRange(aXclRange, aRange); +aRangeList.push_back(aRange); +} } -// create the NAME record (do not warn if ranges are shrunken) -GetAddressConverter().ValidateRangeList( aRangeList, false ); +// create the NAME record if( !aRangeList.empty() ) GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTAREA, aRangeList ); } diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index e095d22018ac..2f05d6722d7a 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -98,6 +98,14 @@ ScAddress XclImpAddressConverter::CreateValidAddress( // cell range - +void XclImpAddressConverter::FillRange(const XclRange& rXclRange, ScRange& rScRange) +{ +const XclAddress aXclStartAdr = rXclRange.maFirst; +lclFillAddress(rScRange.aStart, aXclStartAdr.mnCol, aXclStartAdr.mnRow, rScRange.aStart.Tab()); +const XclAddress aXclEndAdr = rXclRange.maLast; +lclFillAddress(rScRange.aEnd, aXclEndAdr.mnCol, aXclEndAdr.mnRow, rScRange.aEnd.Tab()); +} + bool XclImpAddressConverter::ConvertRange( ScRange& rScRange, const XclRange& rXclRange, SCTAB nScTab1, SCTAB nScTab2, bool bWarn ) { diff --git a/sc/source/filter/inc/xihelper.hxx b/sc/source/filter/inc/xihelper.hxx index 746259e844e4..fe6ba7ce7a63 100644 --- a/sc/source/filter/inc/xihelper.hxx +++ b/sc/source/filter/inc/xihelper.hxx @@ -71,6 +71,11 @@ public: // cell range - +/**
core.git: Branch 'libreoffice-7-6' - sc/inc sc/qa sc/source
sc/inc/typedstrdata.hxx | 10 + sc/qa/uitest/autofilter/autofilterBugs.py | 24 + sc/source/core/data/documen3.cxx |2 + sc/source/core/tool/typedstrdata.cxx | 54 +++--- 4 files changed, 86 insertions(+), 4 deletions(-) New commits: commit d2d8332dc9dee0baed504470a3b80d431bc255a8 Author: Andreas Heinisch AuthorDate: Tue Nov 28 18:24:52 2023 +0100 Commit: Xisco Fauli CommitDate: Tue Feb 27 10:42:01 2024 +0100 tdf#158326 - Auto Filter: separate sorting and removing of duplicates Change-Id: Ide74895508af280f4b0c129689d852635e62dbff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160052 Tested-by: Jenkins Reviewed-by: Andreas Heinisch (cherry picked from commit 6d0fddb697fd619d11da3469f4dd72782334f3bb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162891 Reviewed-by: Xisco Fauli (cherry picked from commit 0fc3c31387b0995cbe80ad802e66f84702def7c5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163139 diff --git a/sc/inc/typedstrdata.hxx b/sc/inc/typedstrdata.hxx index b4a9bc5d37c6..b6bed2dfc249 100644 --- a/sc/inc/typedstrdata.hxx +++ b/sc/inc/typedstrdata.hxx @@ -54,11 +54,21 @@ public: bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; }; +struct LessSortCaseSensitive +{ +bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; +}; + struct LessCaseInsensitive { bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; }; +struct LessSortCaseInsensitive +{ +bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; +}; + struct EqualCaseSensitive { bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; diff --git a/sc/qa/uitest/autofilter/autofilterBugs.py b/sc/qa/uitest/autofilter/autofilterBugs.py index 6fa029985fcc..849351861d7f 100644 --- a/sc/qa/uitest/autofilter/autofilterBugs.py +++ b/sc/qa/uitest/autofilter/autofilterBugs.py @@ -73,6 +73,30 @@ class autofilter(UITestCase): self.assertEqual(get_state_as_dict(xTreeList.getChild("4"))["Text"], "vröude") self.assertEqual(get_state_as_dict(xTreeList.getChild("5"))["Text"], "vröudᵉ") + def test_tdf158326(self): +with self.ui_test.create_doc_in_start_center("calc"): +calcDoc = self.xUITest.getTopFocusWindow() +xGridWindow = calcDoc.getChild("grid_window") +enter_text_to_cell(xGridWindow, "A1", "vröude") +enter_text_to_cell(xGridWindow, "A2", "vröudᵉ") +enter_text_to_cell(xGridWindow, "A3", "vröude") +enter_text_to_cell(xGridWindow, "A4", "vröudᵉ") +enter_text_to_cell(xGridWindow, "A5", "vröude") +enter_text_to_cell(xGridWindow, "A6", "vröudᵉ") +xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A6"})) + +with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="no"): +pass + +xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"})) +xFloatWindow = self.xUITest.getFloatWindow() +xTreeList = xFloatWindow.getChild("check_list_box") + +# Without the fix in place, there would be 5 items since they will not be removed +self.assertEqual(2, len(xTreeList.getChildren())) + self.assertEqual(get_state_as_dict(xTreeList.getChild("0"))["Text"], "vröude") + self.assertEqual(get_state_as_dict(xTreeList.getChild("1"))["Text"], "vröudᵉ") + def test_tdf94055(self): with self.ui_test.create_doc_in_start_center("calc") as document: calcDoc = self.xUITest.getTopFocusWindow() diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 8d0d2ba9a665..9184ea53c767 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -88,6 +88,7 @@ void sortAndRemoveDuplicates(std::vector& rStrings, bool bCaseSe std::vector::iterator it = std::unique(rStrings.begin(), rStrings.end(), ScTypedStrData::EqualCaseSensitive()); rStrings.erase(it, rStrings.end()); +std::stable_sort(rStrings.begin(), rStrings.end(), ScTypedStrData::LessSortCaseSensitive()); } else { @@ -95,6 +96,7 @@ void sortAndRemoveDuplicates(std::vector& rStrings, bool bCaseSe std::vector::iterator it = std::unique(rStrings.begin(), rStrings.end(), ScTypedStrData::EqualCaseInsensitive()); rStrings.erase(it, rStrings.end()); +std::stable_sort(rStrings.begin(), rStrings.end(), ScTypedStrData::LessSortCaseInsensitive()); } if (std::any_of(rStrings.begin(), rStrings.end(), [](ScTypedStrData& rString) {
core.git: Branch 'libreoffice-24-2' - sc/inc sc/qa sc/source
sc/inc/typedstrdata.hxx | 10 + sc/qa/uitest/autofilter/autofilterBugs.py | 24 + sc/source/core/data/documen3.cxx |2 + sc/source/core/tool/typedstrdata.cxx | 54 +++--- 4 files changed, 86 insertions(+), 4 deletions(-) New commits: commit bacf30464c601663c7c58020e7bf230cd3661768 Author: Andreas Heinisch AuthorDate: Tue Nov 28 18:24:52 2023 +0100 Commit: Xisco Fauli CommitDate: Thu Feb 8 13:32:09 2024 +0100 tdf#158326 - Auto Filter: separate sorting and removing of duplicates Change-Id: Ide74895508af280f4b0c129689d852635e62dbff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160052 Tested-by: Jenkins Reviewed-by: Andreas Heinisch (cherry picked from commit 6d0fddb697fd619d11da3469f4dd72782334f3bb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162891 Reviewed-by: Xisco Fauli diff --git a/sc/inc/typedstrdata.hxx b/sc/inc/typedstrdata.hxx index b4a9bc5d37c6..b6bed2dfc249 100644 --- a/sc/inc/typedstrdata.hxx +++ b/sc/inc/typedstrdata.hxx @@ -54,11 +54,21 @@ public: bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; }; +struct LessSortCaseSensitive +{ +bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; +}; + struct LessCaseInsensitive { bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; }; +struct LessSortCaseInsensitive +{ +bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; +}; + struct EqualCaseSensitive { bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; diff --git a/sc/qa/uitest/autofilter/autofilterBugs.py b/sc/qa/uitest/autofilter/autofilterBugs.py index 6fa029985fcc..849351861d7f 100644 --- a/sc/qa/uitest/autofilter/autofilterBugs.py +++ b/sc/qa/uitest/autofilter/autofilterBugs.py @@ -73,6 +73,30 @@ class autofilter(UITestCase): self.assertEqual(get_state_as_dict(xTreeList.getChild("4"))["Text"], "vröude") self.assertEqual(get_state_as_dict(xTreeList.getChild("5"))["Text"], "vröudᵉ") + def test_tdf158326(self): +with self.ui_test.create_doc_in_start_center("calc"): +calcDoc = self.xUITest.getTopFocusWindow() +xGridWindow = calcDoc.getChild("grid_window") +enter_text_to_cell(xGridWindow, "A1", "vröude") +enter_text_to_cell(xGridWindow, "A2", "vröudᵉ") +enter_text_to_cell(xGridWindow, "A3", "vröude") +enter_text_to_cell(xGridWindow, "A4", "vröudᵉ") +enter_text_to_cell(xGridWindow, "A5", "vröude") +enter_text_to_cell(xGridWindow, "A6", "vröudᵉ") +xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A6"})) + +with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="no"): +pass + +xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"})) +xFloatWindow = self.xUITest.getFloatWindow() +xTreeList = xFloatWindow.getChild("check_list_box") + +# Without the fix in place, there would be 5 items since they will not be removed +self.assertEqual(2, len(xTreeList.getChildren())) + self.assertEqual(get_state_as_dict(xTreeList.getChild("0"))["Text"], "vröude") + self.assertEqual(get_state_as_dict(xTreeList.getChild("1"))["Text"], "vröudᵉ") + def test_tdf94055(self): with self.ui_test.create_doc_in_start_center("calc") as document: calcDoc = self.xUITest.getTopFocusWindow() diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index b42a8d36b582..8ae4ff6c4e87 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -89,6 +89,7 @@ void sortAndRemoveDuplicates(std::vector& rStrings, bool bCaseSe std::vector::iterator it = std::unique(rStrings.begin(), rStrings.end(), ScTypedStrData::EqualCaseSensitive()); rStrings.erase(it, rStrings.end()); +std::stable_sort(rStrings.begin(), rStrings.end(), ScTypedStrData::LessSortCaseSensitive()); } else { @@ -96,6 +97,7 @@ void sortAndRemoveDuplicates(std::vector& rStrings, bool bCaseSe std::vector::iterator it = std::unique(rStrings.begin(), rStrings.end(), ScTypedStrData::EqualCaseInsensitive()); rStrings.erase(it, rStrings.end()); +std::stable_sort(rStrings.begin(), rStrings.end(), ScTypedStrData::LessSortCaseInsensitive()); } if (std::any_of(rStrings.begin(), rStrings.end(), [](ScTypedStrData& rString) { return rString.IsHiddenByFilter(); })) { diff --git a/sc/source/core/tool/typedstrdata.cxx b/sc/source/core/tool/typedstrdata.cxx index
core.git: svtools/source
svtools/source/uno/statusbarcontroller.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 2441344bf1e8586a1ce181e73504fde0f9d2282e Author: Andreas Heinisch AuthorDate: Thu Feb 1 22:54:53 2024 +0100 Commit: Andreas Heinisch CommitDate: Fri Feb 2 10:07:23 2024 +0100 tdf#91914 - Open available options through status bar using single click Enable one-click access to available options in Calc through the status bar, ensuring consistency with Writer and other applications. Change-Id: Ia6c52ed9ae6e316a69f9aad9e80384cfa18feb47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162916 Reviewed-by: Jim Raykowski Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/svtools/source/uno/statusbarcontroller.cxx b/svtools/source/uno/statusbarcontroller.cxx index 5baa311e9a4a..3bf6de2cf103 100644 --- a/svtools/source/uno/statusbarcontroller.cxx +++ b/svtools/source/uno/statusbarcontroller.cxx @@ -312,10 +312,6 @@ void SAL_CALL StatusbarController::paint( } void SAL_CALL StatusbarController::click( const css::awt::Point& ) -{ -} - -void SAL_CALL StatusbarController::doubleClick( const css::awt::Point& ) { SolarMutexGuard aSolarMutexGuard; @@ -326,6 +322,10 @@ void SAL_CALL StatusbarController::doubleClick( const css::awt::Point& ) execute( aArgs ); } +void SAL_CALL StatusbarController::doubleClick( const css::awt::Point& ) +{ +} + void StatusbarController::addStatusListener( const OUString& aCommandURL ) { Reference< XDispatch > xDispatch;
core.git: sc/inc sc/qa sc/source
sc/inc/typedstrdata.hxx | 10 + sc/qa/uitest/autofilter/autofilterBugs.py | 24 + sc/source/core/data/documen3.cxx |2 + sc/source/core/tool/typedstrdata.cxx | 54 +++--- 4 files changed, 86 insertions(+), 4 deletions(-) New commits: commit 6d0fddb697fd619d11da3469f4dd72782334f3bb Author: Andreas Heinisch AuthorDate: Tue Nov 28 18:24:52 2023 +0100 Commit: Andreas Heinisch CommitDate: Thu Feb 1 13:32:21 2024 +0100 tdf#158326 - Auto Filter: separate sorting and removing of duplicates Change-Id: Ide74895508af280f4b0c129689d852635e62dbff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160052 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/inc/typedstrdata.hxx b/sc/inc/typedstrdata.hxx index b4a9bc5d37c6..b6bed2dfc249 100644 --- a/sc/inc/typedstrdata.hxx +++ b/sc/inc/typedstrdata.hxx @@ -54,11 +54,21 @@ public: bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; }; +struct LessSortCaseSensitive +{ +bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; +}; + struct LessCaseInsensitive { bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; }; +struct LessSortCaseInsensitive +{ +bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; +}; + struct EqualCaseSensitive { bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; diff --git a/sc/qa/uitest/autofilter/autofilterBugs.py b/sc/qa/uitest/autofilter/autofilterBugs.py index 6fa029985fcc..849351861d7f 100644 --- a/sc/qa/uitest/autofilter/autofilterBugs.py +++ b/sc/qa/uitest/autofilter/autofilterBugs.py @@ -73,6 +73,30 @@ class autofilter(UITestCase): self.assertEqual(get_state_as_dict(xTreeList.getChild("4"))["Text"], "vröude") self.assertEqual(get_state_as_dict(xTreeList.getChild("5"))["Text"], "vröudᵉ") + def test_tdf158326(self): +with self.ui_test.create_doc_in_start_center("calc"): +calcDoc = self.xUITest.getTopFocusWindow() +xGridWindow = calcDoc.getChild("grid_window") +enter_text_to_cell(xGridWindow, "A1", "vröude") +enter_text_to_cell(xGridWindow, "A2", "vröudᵉ") +enter_text_to_cell(xGridWindow, "A3", "vröude") +enter_text_to_cell(xGridWindow, "A4", "vröudᵉ") +enter_text_to_cell(xGridWindow, "A5", "vröude") +enter_text_to_cell(xGridWindow, "A6", "vröudᵉ") +xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A6"})) + +with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="no"): +pass + +xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"})) +xFloatWindow = self.xUITest.getFloatWindow() +xTreeList = xFloatWindow.getChild("check_list_box") + +# Without the fix in place, there would be 5 items since they will not be removed +self.assertEqual(2, len(xTreeList.getChildren())) + self.assertEqual(get_state_as_dict(xTreeList.getChild("0"))["Text"], "vröude") + self.assertEqual(get_state_as_dict(xTreeList.getChild("1"))["Text"], "vröudᵉ") + def test_tdf94055(self): with self.ui_test.create_doc_in_start_center("calc") as document: calcDoc = self.xUITest.getTopFocusWindow() diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index dd1f0a1c7f1d..b30e79e8dc1f 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -89,6 +89,7 @@ void sortAndRemoveDuplicates(std::vector& rStrings, bool bCaseSe std::vector::iterator it = std::unique(rStrings.begin(), rStrings.end(), ScTypedStrData::EqualCaseSensitive()); rStrings.erase(it, rStrings.end()); +std::stable_sort(rStrings.begin(), rStrings.end(), ScTypedStrData::LessSortCaseSensitive()); } else { @@ -96,6 +97,7 @@ void sortAndRemoveDuplicates(std::vector& rStrings, bool bCaseSe std::vector::iterator it = std::unique(rStrings.begin(), rStrings.end(), ScTypedStrData::EqualCaseInsensitive()); rStrings.erase(it, rStrings.end()); +std::stable_sort(rStrings.begin(), rStrings.end(), ScTypedStrData::LessSortCaseInsensitive()); } if (std::any_of(rStrings.begin(), rStrings.end(), [](ScTypedStrData& rString) { return rString.IsHiddenByFilter(); })) { diff --git a/sc/source/core/tool/typedstrdata.cxx b/sc/source/core/tool/typedstrdata.cxx index e00c1bc18d91..4e3f862ae3a4 100644 --- a/sc/source/core/tool/typedstrdata.cxx +++ b/sc/source/core/tool/typedstrdata.cxx @@ -34,8 +34,31 @@ bool
core.git: include/svx sc/qa sw/qa
include/svx/flagsdef.hxx|5 +-- sc/qa/uitest/csv_dialog/tdf88359.py |2 - sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py | 20 ++-- 3 files changed, 14 insertions(+), 13 deletions(-) New commits: commit 58cfe9ccff7b6aa8ada18234ee73809700c39e02 Author: Andreas Heinisch AuthorDate: Fri Jan 19 13:02:37 2024 +0100 Commit: Andreas Heinisch CommitDate: Mon Jan 22 20:13:59 2024 +0100 tdf#38231 - Change default example date value to 1999-12-01 Change default example date value from 1999-12-31 to 1999-12-01. Otherwise, certain date formats cannot be distiguished in the preview window, e.g., D MM (1 Dec / 01 Dec 99 vs. 31 Dec / 31 Dec). Change-Id: Iebd78de8d5ef8615c4f2bf400357745e7acfb857 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162308 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/include/svx/flagsdef.hxx b/include/svx/flagsdef.hxx index 3fbb70ca6b5e..e5b292ae 100644 --- a/include/svx/flagsdef.hxx +++ b/include/svx/flagsdef.hxx @@ -84,8 +84,9 @@ const o3tl::enumarray fSvxNumValConst = { -1234.56789012345678, // SvxNumValCategory::Standard -0.1295,// SvxNumValCategory::Percent -1234.0,// SvxNumValCategory::Currency -36525.5678935185, // SvxNumValCategory::Date -36525.5678935185, // SvxNumValCategory::Time +// tdf#38231 - change default example date value to 1999-12-01 +36495.5678935185, // SvxNumValCategory::Date +36495.5678935185, // SvxNumValCategory::Time 12345.67889,// SvxNumValCategory::Scientific 123.456,// SvxNumValCategory::Fraction 1.0,// SvxNumValCategory::Boolean diff --git a/sc/qa/uitest/csv_dialog/tdf88359.py b/sc/qa/uitest/csv_dialog/tdf88359.py index 19fa8b91928e..075e891d1e15 100644 --- a/sc/qa/uitest/csv_dialog/tdf88359.py +++ b/sc/qa/uitest/csv_dialog/tdf88359.py @@ -34,7 +34,7 @@ class Tdf88359(UITestCase): # Without the fix in place, this test would have failed with # AssertionError: 'Date' != 'Text' self.assertEqual("Date", get_state_as_dict(xliststore1)["SelectEntryText"]) -self.assertEqual("1999-12-31T13:37:46", get_state_as_dict(xliststore2)["SelectEntryText"]) +self.assertEqual("1999-12-01T13:37:46", get_state_as_dict(xliststore2)["SelectEntryText"]) self.assertEqual("-MM-DD\"T\"HH:MM:SS", get_state_as_dict(xformatted)["Text"]) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py b/sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py index 0c556b6c2b65..0f8e9f1d305e 100644 --- a/sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py +++ b/sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py @@ -24,17 +24,17 @@ class dateFormFieldDialog(UITestCase): # check whether we have the right format selected self.assertEqual(get_state_as_dict(itemsList)["Children"], "20") - self.assertEqual(get_state_as_dict(itemsList)["SelectEntryText"], "12/31/99") + self.assertEqual(get_state_as_dict(itemsList)["SelectEntryText"], "12/01/99") # select a new format itemsList.getChild("11").executeAction("SELECT", tuple()); - self.assertEqual(get_state_as_dict(itemsList)["SelectEntryText"], "12-31") + self.assertEqual(get_state_as_dict(itemsList)["SelectEntryText"], "12-01") # open the dialog again with self.ui_test.execute_dialog_through_command(".uno:ControlProperties") as xDialog: itemsList = xDialog.getChild("date_formats_treeview") - self.assertEqual(get_state_as_dict(itemsList)["SelectEntryText"], "12-31") + self.assertEqual(get_state_as_dict(itemsList)["SelectEntryText"], "12-01") def test_date_field_with_custom_format(self): @@ -55,7 +55,7 @@ class dateFormFieldDialog(UITestCase): # SelectEntryText doesn't match the sample string, so all this # is rather fragile depending on actual locale data. self.assertEqual(get_state_as_dict(itemsList)["Children"], "21") - self.assertEqual(get_state_as_dict(itemsList)["SelectEntryText"], "1999. december 31., péntek[System]") + self.assertEqual(get_state_as_dict(itemsList)["SelectEntryText"], "1999. december 1., szerda[System]") def test_date_reformat(self): @@ -70,11 +70,11 @@ class dateFormFieldDialog(UITestCase): # check whether we have the right format selected self.assertEqual(get_state_as_dict(itemsList)["Children"], "20") - self.assertEqual(get_state_as_dict(itemsList)["SelectEntryText"], "12/31/99")
core.git: sfx2/source
sfx2/source/doc/objstor.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 48bbdf24ebe3cf78199bf213ab5585a293dc40ae Author: Andreas Heinisch AuthorDate: Mon Jan 15 22:50:45 2024 +0100 Commit: Andreas Heinisch CommitDate: Tue Jan 16 10:57:33 2024 +0100 tdf#53614 - Don't try to lock file after cancelling the import process After cancelling the import process don't try to lock the file. Otherwise, the document in use dialog will be shown which has literally no effect. Change-Id: I0a9c786899a7fc648678c785e316d28fc43c7fe7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162150 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index a7253f7a0b83..854389ae31be 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -654,7 +654,9 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed ) EnableSetModified( false ); -pMedium->LockOrigFileOnDemand( true, false ); +// tdf#53614 - don't try to lock file after cancelling the import process +if (GetErrorIgnoreWarning() != ERRCODE_ABORT) +pMedium->LockOrigFileOnDemand( true, false ); if ( GetErrorIgnoreWarning() == ERRCODE_NONE && bOwnStorageFormat && ( !pFilter || !( pFilter->GetFilterFlags() & SfxFilterFlags::STARONEFILTER ) ) ) { uno::Reference< embed::XStorage > xStorage;
core.git: editeng/source sw/source
editeng/source/misc/svxacorr.cxx |2 ++ sw/source/core/swg/SwXMLTextBlocks.cxx |2 ++ 2 files changed, 4 insertions(+) New commits: commit a03a9236b01437b573cb68112959b9403418e11b Author: Andreas Heinisch AuthorDate: Thu Jan 11 13:09:51 2024 +0100 Commit: Andreas Heinisch CommitDate: Thu Jan 11 19:25:50 2024 +0100 tdf#156769 - Escape the question mark in the storage name Otherwise, an auto-text using the question mark for its shortcut cannot be inserted. Change-Id: I369e3d0f2ff82cea2d053896964a5c2c23b8d6f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161921 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index ff2c4518aadd..d278b582e833 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1976,6 +1976,8 @@ static void GeneratePackageName ( std::u16string_view rShort, OUString& rPackage case ':': case '.': case '\': +// tdf#156769 - escape the question mark in the storage name +case '?': aBuf[nPos] = '_'; break; default: diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index efc3e530b0f2..f69311dfdb5f 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -527,6 +527,8 @@ OUString SwXMLTextBlocks::GeneratePackageName ( std::u16string_view rShort ) case ':': case '.': case '\': +// tdf#156769 - escape the question mark in the storage name for auto-texts +case '?': aBuf[nPos] = '_'; break; default:
core.git: svx/Library_svxcore.mk svx/source
svx/Library_svxcore.mk |1 svx/source/tbxctrls/tbxcolorupdate.cxx | 80 +++-- 2 files changed, 59 insertions(+), 22 deletions(-) New commits: commit 8c822b764b35a0116a0865e991a87c8315e005ab Author: Andreas Heinisch AuthorDate: Mon Nov 27 21:46:17 2023 +0100 Commit: Andreas Heinisch CommitDate: Mon Jan 8 19:19:09 2024 +0100 tdf#72991 - Remember last used color depending in cui Change-Id: I4c2cd970aa5b96a8037ecab5e3ae5e5e7cbe4975 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160008 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 28ed214c063f..51dc332b26e0 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -87,6 +87,7 @@ $(eval $(call gb_Library_use_libraries,svxcore,\ $(eval $(call gb_Library_use_externals,svxcore,\ boost_headers \ + frozen \ icuuc \ icu_headers \ libxml2 \ diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx index 0854ad034dc2..064b4636230b 100644 --- a/svx/source/tbxctrls/tbxcolorupdate.cxx +++ b/svx/source/tbxctrls/tbxcolorupdate.cxx @@ -38,6 +38,13 @@ #include #include +#include +#include +#include + +#include +#include +#include namespace svx { @@ -74,30 +81,51 @@ namespace svx } } -switch (nSlotId) +// tdf#72991 - remember last used color depending on slot id +const auto aSlotNamedColorMap = frozen::make_unordered_map( +{ { SID_ATTR_CHAR_COLOR, +NamedColor(COL_DEFAULT_FONT, SvxResId(RID_SVXSTR_COLOR_DEFAULT_FONT)) }, + { SID_ATTR_CHAR_COLOR2, +NamedColor(COL_DEFAULT_FONT, SvxResId(RID_SVXSTR_COLOR_DEFAULT_FONT)) }, + { SID_FRAME_LINECOLOR, +NamedColor(COL_DEFAULT_FRAMELINE, SvxResId(RID_SVXSTR_COLOR_DEFAULT_FRAMELINE)) }, + { SID_ATTR_CHAR_COLOR_BACKGROUND, +NamedColor(COL_DEFAULT_HIGHLIGHT, SvxResId(RID_SVXSTR_COLOR_DEFAULT_HIGHLIGHT)) }, + { SID_ATTR_CHAR_BACK_COLOR, +NamedColor(COL_DEFAULT_HIGHLIGHT, SvxResId(RID_SVXSTR_COLOR_DEFAULT_HIGHLIGHT)) }, + { SID_BACKGROUND_COLOR, +NamedColor(COL_DEFAULT_HIGHLIGHT, SvxResId(RID_SVXSTR_COLOR_DEFAULT_HIGHLIGHT)) }, + { SID_TABLE_CELL_BACKGROUND_COLOR, +NamedColor(COL_DEFAULT_HIGHLIGHT, SvxResId(RID_SVXSTR_COLOR_DEFAULT_HIGHLIGHT)) }, + { SID_ATTR_LINE_COLOR, NamedColor(COL_DEFAULT_SHAPE_STROKE, + SvxResId(RID_SVXSTR_COLOR_DEFAULT_SHAPE_STROKE)) }, + { SID_ATTR_FILL_COLOR, NamedColor(COL_DEFAULT_SHAPE_FILLING, + SvxResId(RID_SVXSTR_COLOR_DEFAULT_SHAPE_FILLING)) } + +}); + +const auto aIterator = aSlotNamedColorMap.find(nSlotId); +if (aIterator != aSlotNamedColorMap.end()) { -case SID_ATTR_CHAR_COLOR: -case SID_ATTR_CHAR_COLOR2: -Update(NamedColor(COL_DEFAULT_FONT, SvxResId(RID_SVXSTR_COLOR_DEFAULT_FONT))); -break; -case SID_FRAME_LINECOLOR: -Update(NamedColor(COL_DEFAULT_FRAMELINE, SvxResId(RID_SVXSTR_COLOR_DEFAULT_FRAMELINE))); -break; -case SID_ATTR_CHAR_COLOR_BACKGROUND: -case SID_ATTR_CHAR_BACK_COLOR: -case SID_BACKGROUND_COLOR: -case SID_TABLE_CELL_BACKGROUND_COLOR: -Update(NamedColor(COL_DEFAULT_HIGHLIGHT, SvxResId(RID_SVXSTR_COLOR_DEFAULT_HIGHLIGHT))); -break; -case SID_ATTR_LINE_COLOR: -Update(NamedColor(COL_DEFAULT_SHAPE_STROKE, SvxResId(RID_SVXSTR_COLOR_DEFAULT_SHAPE_STROKE))); -break; -case SID_ATTR_FILL_COLOR: -Update(NamedColor(COL_DEFAULT_SHAPE_FILLING, SvxResId(RID_SVXSTR_COLOR_DEFAULT_SHAPE_FILLING))); -break; -default: -Update(COL_TRANSPARENT); +NamedColor aNamedColor(aIterator->second); +SvtViewOptions aViewOpt(EViewType::Dialog, "ToolboxButtonColor"); +if (aViewOpt.Exists()) +{ +css::uno::Any aUserItem = aViewOpt.GetUserItem(OUString::number(nSlotId)); +OUString aUserData; +if (aUserItem >>= aUserData) +{ +sal_Int32 nIdx = 0; +aNamedColor.m_aName = o3tl::getToken(aUserData, 0, ';', nIdx); +aNamedColor.m_aColor += Color(ColorTransparencyTag::ColorTransparency, +o3tl::toUInt32(o3tl::getToken(aUserData, 0, ';', nIdx))); +} +} +Update(aNamedColor); } +else +
core.git: Branch 'libreoffice-7-6' - sc/source svtools/source
sc/source/ui/view/tabview.cxx |3 +-- svtools/source/control/tabbar.cxx |4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) New commits: commit c4c079d3a72999c7b9cf740f86db9fddaac71ea3 Author: Andreas Heinisch AuthorDate: Thu Dec 21 20:29:32 2023 +0100 Commit: Xisco Fauli CommitDate: Fri Dec 22 20:30:57 2023 +0100 Revert "tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings" This reverts commit 4f1b3c16f5530a2a190cab07c07c7bf63acf42c7. Reason for revert: To many regressions. Change-Id: I7352bb3c192d5e6c72e95c387ee551764007e97b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161152 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch (cherry picked from commit 19e856aa1ade6686fa495e57386b81cabae47495) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161157 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos (cherry picked from commit a735f64391b5c194b38cacb577f14ef60556bcbc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161162 Reviewed-by: Xisco Fauli diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 56776d2d9b49..b6c7a2bd8e66 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -280,8 +280,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) if (bHasHint) RemoveHintWindow(); -// tdf#100584 - arrange sheets depending on the RTL settings -bool bLayoutRTL = AllSettings::GetLayoutRTL(); +bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); tools::Long nTotalWidth = rSize.Width(); if ( bLayoutRTL ) nTotalWidth += 2*rOffset.X(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 02a23b8aea33..1690269ba234 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -715,7 +715,9 @@ void TabBar::ImplFormat() const size_t nItemListSize = mpImpl->maItemList.size(); for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) { -auto& rItem = mpImpl->maItemList[nItemIndex]; +// tdf#100584 - arrange sheets depending on the RTL settings +auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] + : mpImpl->maItemList[nItemIndex]; // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
core.git: Branch 'libreoffice-24-2' - svtools/source
svtools/source/control/tabbar.cxx | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) New commits: commit b3e86695022f8db57344f4115ee360072d671838 Author: Andreas Heinisch AuthorDate: Thu Dec 21 20:33:20 2023 +0100 Commit: Xisco Fauli CommitDate: Fri Dec 22 12:30:54 2023 +0100 Revert "tdf#100584 - Arrange sheets in the tab bar depending on the RTL settings" This reverts commit be86c8f2432623fdb8ed4f22ca08c35121fd8bec. Reason for revert: To many regressions. Change-Id: Id3fb8dc5d4edb84c0008b7834a80887aaa7d9f83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161154 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch (cherry picked from commit 3430a2c639a9f714259f9d319515464a653d21ab) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161159 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 1690269ba234..f9faa2bbe0dc 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -710,15 +710,10 @@ void TabBar::ImplFormat() if (!mbFormat) return; +sal_uInt16 nItemIndex = 0; tools::Long x = mnOffX; - -const size_t nItemListSize = mpImpl->maItemList.size(); -for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) +for (auto & rItem : mpImpl->maItemList) { -// tdf#100584 - arrange sheets depending on the RTL settings -auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] - : mpImpl->maItemList[nItemIndex]; - // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX)) rItem.maRect.SetEmpty(); @@ -746,6 +741,8 @@ void TabBar::ImplFormat() rItem.maRect.SetLeft(nNewLeft); } } + +nItemIndex++; } mbFormat = false;
core.git: Branch 'libreoffice-24-2' - sc/source svtools/source
sc/source/ui/view/tabview.cxx |3 +-- svtools/source/control/tabbar.cxx |4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) New commits: commit a735f64391b5c194b38cacb577f14ef60556bcbc Author: Andreas Heinisch AuthorDate: Thu Dec 21 20:29:32 2023 +0100 Commit: Adolfo Jayme Barrientos CommitDate: Thu Dec 21 23:32:56 2023 +0100 Revert "tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings" This reverts commit 4f1b3c16f5530a2a190cab07c07c7bf63acf42c7. Reason for revert: To many regressions. Change-Id: I7352bb3c192d5e6c72e95c387ee551764007e97b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161152 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch (cherry picked from commit 19e856aa1ade6686fa495e57386b81cabae47495) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161157 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index f580198f9bfc..44c74c5455a7 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -281,8 +281,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) if (bHasHint) RemoveHintWindow(); -// tdf#100584 - arrange sheets depending on the RTL settings -bool bLayoutRTL = AllSettings::GetLayoutRTL(); +bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); tools::Long nTotalWidth = rSize.Width(); if ( bLayoutRTL ) nTotalWidth += 2*rOffset.X(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 02a23b8aea33..1690269ba234 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -715,7 +715,9 @@ void TabBar::ImplFormat() const size_t nItemListSize = mpImpl->maItemList.size(); for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) { -auto& rItem = mpImpl->maItemList[nItemIndex]; +// tdf#100584 - arrange sheets depending on the RTL settings +auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] + : mpImpl->maItemList[nItemIndex]; // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
core.git: svtools/source
svtools/source/control/tabbar.cxx | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) New commits: commit 3430a2c639a9f714259f9d319515464a653d21ab Author: Andreas Heinisch AuthorDate: Thu Dec 21 20:33:20 2023 +0100 Commit: Andreas Heinisch CommitDate: Thu Dec 21 20:33:47 2023 +0100 Revert "tdf#100584 - Arrange sheets in the tab bar depending on the RTL settings" This reverts commit be86c8f2432623fdb8ed4f22ca08c35121fd8bec. Reason for revert: To many regressions. Change-Id: Id3fb8dc5d4edb84c0008b7834a80887aaa7d9f83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161154 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index dafdf5f7e218..58fa5d76de3a 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -710,15 +710,10 @@ void TabBar::ImplFormat() if (!mbFormat) return; +sal_uInt16 nItemIndex = 0; tools::Long x = mnOffX; - -const size_t nItemListSize = mpImpl->maItemList.size(); -for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) +for (auto & rItem : mpImpl->maItemList) { -// tdf#100584 - arrange sheets depending on the RTL settings -auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] - : mpImpl->maItemList[nItemIndex]; - // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX)) rItem.maRect.SetEmpty(); @@ -746,6 +741,8 @@ void TabBar::ImplFormat() rItem.maRect.SetLeft(nNewLeft); } } + +nItemIndex++; } mbFormat = false;
core.git: sc/source svtools/source
sc/source/ui/view/tabview.cxx |3 +-- svtools/source/control/tabbar.cxx |4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) New commits: commit 19e856aa1ade6686fa495e57386b81cabae47495 Author: Andreas Heinisch AuthorDate: Thu Dec 21 20:29:32 2023 +0100 Commit: Andreas Heinisch CommitDate: Thu Dec 21 20:32:22 2023 +0100 Revert "tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings" This reverts commit 4f1b3c16f5530a2a190cab07c07c7bf63acf42c7. Reason for revert: To many regressions. Change-Id: I7352bb3c192d5e6c72e95c387ee551764007e97b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161152 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index f580198f9bfc..44c74c5455a7 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -281,8 +281,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) if (bHasHint) RemoveHintWindow(); -// tdf#100584 - arrange sheets depending on the RTL settings -bool bLayoutRTL = AllSettings::GetLayoutRTL(); +bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); tools::Long nTotalWidth = rSize.Width(); if ( bLayoutRTL ) nTotalWidth += 2*rOffset.X(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 73ddf396eb25..dafdf5f7e218 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -715,7 +715,9 @@ void TabBar::ImplFormat() const size_t nItemListSize = mpImpl->maItemList.size(); for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) { -auto& rItem = mpImpl->maItemList[nItemIndex]; +// tdf#100584 - arrange sheets depending on the RTL settings +auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] + : mpImpl->maItemList[nItemIndex]; // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
core.git: sw/qa sw/source
sw/qa/uibase/fldui/fldui.cxx | 20 sw/source/core/fields/docufld.cxx |3 --- 2 files changed, 20 insertions(+), 3 deletions(-) New commits: commit 74f25206bc5a1a36b85683555cb27179e5da3275 Author: Andreas Heinisch AuthorDate: Mon Dec 18 10:54:15 2023 +0100 Commit: Andreas Heinisch CommitDate: Wed Dec 20 19:57:36 2023 +0100 tdf#68364 - Don't assume a database if only two dots are present Additionally, a database table name (database.table.column) has to be retrieved from the database to be valid. Change-Id: I8949ae61d96043412425d634763d2ea33ce6a0f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160910 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sw/qa/uibase/fldui/fldui.cxx b/sw/qa/uibase/fldui/fldui.cxx index 78b2fcedd42a..0bf6bfa33fb6 100644 --- a/sw/qa/uibase/fldui/fldui.cxx +++ b/sw/qa/uibase/fldui/fldui.cxx @@ -121,6 +121,26 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertRefmark) CPPUNIT_ASSERT_EQUAL(OUString("aaabbbccc"), pTextNode->GetText()); } +CPPUNIT_TEST_FIXTURE(Test, testTdf68364InsertConditionalFieldWithTwoDots) +{ +// Create an empty document +createSwDoc(); +SwDoc* pDoc = getSwDoc(); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + +// Insert a conditional field containing exactly two dots for its condition +SwFieldMgr aFieldMgr(pWrtShell); +SwInsertField_Data aFieldData(SwFieldTypesEnum::ConditionalText, 0, "true", "19.12.2023", 0); +CPPUNIT_ASSERT(aFieldMgr.InsertField(aFieldData)); +pWrtShell->SttEndDoc(true); + +// Without the accompanying fix in place, this test would have failed with: +// - Expected: 19.12.2023 +// - Actual : +CPPUNIT_ASSERT_EQUAL(OUString("19.12.2023"), + pWrtShell->GetCurField()->ExpandField(true, nullptr)); +} + CPPUNIT_TEST_FIXTURE(Test, testInsertRefmarkSelection) { // Given a document with a single selected word: diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 37249555a0e4..ba5f45beceec 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1389,9 +1389,6 @@ void SwHiddenTextField::Evaluate(SwDoc& rDoc) GetLanguage(), m_aContent, ); m_bValid = true; } -else if( !sDBName.isEmpty() && !sDataSource.isEmpty() && - !sDataTableOrQuery.isEmpty() ) -m_bValid = true; } #endif }
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/uitest/writer_tests5/tdf115871.py | 87 sw/source/ui/chrdlg/numpara.cxx |6 +- 2 files changed, 92 insertions(+), 1 deletion(-) New commits: commit c95f406fcde65e383cff90842ff66e55bfabfc79 Author: Andreas Heinisch AuthorDate: Tue Nov 21 15:45:22 2023 +0100 Commit: Andreas Heinisch CommitDate: Tue Nov 21 16:55:59 2023 +0100 tdf#115871 - Reset outline and list options to parent settings Added the various items of the controls in the outline and list options tab to the range container. Otherwise, the main dialog does not have any knowledge about the options to reset to the parent settings. Change-Id: Icc9f862e741eb0457cfb1c74e64324809c143ab3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159787 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sw/qa/uitest/writer_tests5/tdf115871.py b/sw/qa/uitest/writer_tests5/tdf115871.py new file mode 100755 index ..1f8639b64586 --- /dev/null +++ b/sw/qa/uitest/writer_tests5/tdf115871.py @@ -0,0 +1,87 @@ +# -*- 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 uitest.uihelper.common import type_text +from uitest.uihelper.common import select_pos +from uitest.uihelper.common import get_state_as_dict +from libreoffice.uno.propertyvalue import mkPropertyValues + +class tdf115871(UITestCase): + + def test_tdf115871_reset_outline_list_options_parent(self): + +with self.ui_test.create_doc_in_start_center("writer"): + +# Create new style from selection +with self.ui_test.execute_dialog_through_command(".uno:StyleNewByExample") as xDialog: +xStyleName = xDialog.getChild("stylename") +type_text(xStyleName, "Custom Heading 1") + +# Modify the created style to inherit paragraph attributes from Heading 1 +with self.ui_test.execute_dialog_through_command(".uno:EditStyle") as xDialog: +xTabs = xDialog.getChild("tabcontrol") +select_pos(xTabs, "0") +xLinkedWith = xTabs.getChild("linkedwith") +xLinkedWith.executeAction("SELECT", mkPropertyValues({"TEXT": "Heading 1"})) + self.assertEqual(get_state_as_dict(xLinkedWith)["SelectEntryText"], "Heading 1") + +# Modify outline & list settings of the created style +with self.ui_test.execute_dialog_through_command(".uno:EditStyle") as xDialog: +xTabs = xDialog.getChild("tabcontrol") +select_pos(xTabs, "15") + +# Outline level +xOutlineLevel = xTabs.getChild("comboLB_OUTLINE_LEVEL") +xOutlineLevel.executeAction("SELECT", mkPropertyValues({"TEXT": "Level 5"})) + self.assertEqual(get_state_as_dict(xOutlineLevel)["SelectEntryText"], "Level 5") + +# List style +xListStyle = xTabs.getChild("comboLB_NUMBER_STYLE") +xListStyle.executeAction("SELECT", mkPropertyValues({"TEXT": "Numbering 123"})) + self.assertEqual(get_state_as_dict(xListStyle)["SelectEntryText"], "Numbering 123") + +# Line numbering including start with +xRestartAtParagraph = xTabs.getChild("checkCB_RESTART_PARACOUNT") +xRestartAtParagraph.executeAction("CLICK", tuple()) + self.assertEqual(get_state_as_dict(xRestartAtParagraph)["Selected"], "true") +xStartWith = xTabs.getChild("spinNF_RESTART_PARA") +xStartWith.executeAction("UP", tuple()) +self.assertEqual(get_state_as_dict(xStartWith)["Text"], "2") + +# Open the paragraph style dialog and reset dialog to parent settings +with self.ui_test.execute_dialog_through_command(".uno:EditStyle") as xDialog: +xTabs = xDialog.getChild("tabcontrol") +select_pos(xTabs, "15") + +xStandardButton = xDialog.getChild("standard") +xStandardButton.executeAction("CLICK", tuple()) + +xOutlineLevel = xTabs.getChild("comboLB_OUTLINE_LEVEL") +# Without the fix in place, this test would have failed with +# AssertionError: 'Level 5' != 'Level 1' + self.assertEqual(get_state_as_dict(xOutlineLevel)["SelectEntryText"], "Level 1") + +xListStyle = xTabs.getChild("comboLB_NUMBER_STYLE") +# Without the fix in place, this test would have failed with +# AssertionError: 'Numbering 123' != 'Heading Numbering' +
[Libreoffice-commits] core.git: cui/source sw/qa
cui/source/tabpages/paragrph.cxx|6 sw/qa/uitest/writer_tests5/tdf154543.py | 39 2 files changed, 44 insertions(+), 1 deletion(-) New commits: commit 5af2041c551e97903d2ba7994c5e893836891832 Author: Andreas Heinisch AuthorDate: Fri Nov 17 12:09:18 2023 +0100 Commit: Andreas Heinisch CommitDate: Fri Nov 17 14:13:14 2023 +0100 tdf#154543 - Paragraph dialog: reset snap to grid to parent setting Added the SID_ATTR_PARA_SNAPTOGRID to the alignment ranges in order to reset the snap to grid option to the corresponding parent setting. Without this parameter, the main dialog does not have any knowledge about this option. Change-Id: Ib090fae0919be54dd41674d129f5355c3566a90c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159565 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 7c8f2dc225a7..132b125f0293 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -66,7 +66,11 @@ const WhichRangesContainer SvxStdParagraphTabPage::pStdRanges( >); const WhichRangesContainer SvxParaAlignTabPage::pAlignRanges( -svl::Items); // 10027 +svl::Items< +SID_ATTR_PARA_ADJUST, SID_ATTR_PARA_ADJUST, // 10027 +// tdf#154543 - reset snap to grid to parent +SID_ATTR_PARA_SNAPTOGRID, SID_ATTR_PARA_SNAPTOGRID // 10945 +>); const WhichRangesContainer SvxParaAlignTabPage::pSdrAlignRanges( svl::Items< diff --git a/sw/qa/uitest/writer_tests5/tdf154543.py b/sw/qa/uitest/writer_tests5/tdf154543.py new file mode 100755 index ..ab6ab0a06e19 --- /dev/null +++ b/sw/qa/uitest/writer_tests5/tdf154543.py @@ -0,0 +1,39 @@ +# -*- 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 uitest.uihelper.common import select_pos +from uitest.uihelper.common import get_state_as_dict + +class tdf154543(UITestCase): + + def test_tdf154543_reset_snap_to_grid_parent(self): + +with self.ui_test.create_doc_in_start_center("writer"): + +# Open the paragraph style dialog and unselect the snap to grid checkbox +with self.ui_test.execute_dialog_through_command(".uno:EditStyle") as xDialog: +xTabs = xDialog.getChild("tabcontrol") +select_pos(xTabs, "2") +xSnapCheckbox = xTabs.getChild("checkCB_SNAP") +xSnapCheckbox.executeAction("CLICK", tuple()) +self.assertEqual(get_state_as_dict(xSnapCheckbox)["Selected"], "false") + +# Open the paragraph style dialog and reset dialog to parent settings +with self.ui_test.execute_dialog_through_command(".uno:EditStyle") as xDialog: +xTabs = xDialog.getChild("tabcontrol") +select_pos(xTabs, "2") +xSnapCheckbox = xTabs.getChild("checkCB_SNAP") +xStandardButton = xDialog.getChild("standard") +xStandardButton.executeAction("CLICK", tuple()) +# Without the fix in place, this test would have failed with +# AssertionError: 'false' != 'true' +self.assertEqual(get_state_as_dict(xSnapCheckbox)["Selected"], "true") + +# vim: set shiftwidth=4 softtabstop=4 expandtab:
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/viewopt.hxx |9 + sw/source/ui/index/cnttab.cxx | 16 +++- sw/source/uibase/config/viewopt.cxx |4 3 files changed, 28 insertions(+), 1 deletion(-) New commits: commit 8bf614179f5664d7cdd49db41ef462073cc8608d Author: Andreas Heinisch AuthorDate: Thu Nov 9 16:00:10 2023 +0100 Commit: Andreas Heinisch CommitDate: Mon Nov 13 18:16:38 2023 +0100 tdf#135266 - Remember last used entry level depending on the index type Change-Id: I4fe9342c28fc9135b73286e67464b16a1d910a9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159217 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 3c847acfd6fe..72659849a627 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -274,6 +274,9 @@ class SW_DLLPUBLIC SwViewOption boolm_bShowPlaceHolderFields : 1; // Only used in printing! mutable boolm_bIdle; sal_Int32 m_nDefaultAnchor; // GetDefaultAnchorType() to convert int to RndStdIds +// tdf#135266 - tox dialog: remember last used entry level depending on the index type +sal_uInt8 m_nTocEntryLvl; +sal_uInt8 m_nIdxEntryLvl; // Scale sal_uInt16 m_nZoom; // In percent. @@ -845,6 +848,12 @@ public: RndStdIds GetDefaultAnchorType() const; +// tdf#135266 - tox dialog: remember last used entry level depending on the index type +sal_uInt8 GetTocEntryLvl() const { return m_nTocEntryLvl; } +void SetTocEntryLvl(sal_uInt8 n) { m_nTocEntryLvl = n; } +sal_uInt8 GetIdxEntryLvl() const { return m_nIdxEntryLvl; } +void SetIdxEntryLvl(sal_uInt8 n) { m_nIdxEntryLvl = n; } + // Useful for when getting the current view SwViewOption is not possible otherwise static const SwViewOption& GetCurrentViewOptions(); }; diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 829beb6e9499..a5d3bf92ddef 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -2065,6 +2065,17 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(weld::Container* pPage, weld::DialogControl SwTOXEntryTabPage::~SwTOXEntryTabPage() { m_xTokenWIN.reset(); + +// tdf#135266 - remember last used entry level depending on the index type +if (const auto aSelectedIndex = m_xLevelLB->get_selected_index(); aSelectedIndex != -1) +{ +auto& rSh = static_cast(GetDialogController())->GetWrtShell(); +SwViewOption* pVOpt = const_cast(rSh.GetViewOptions()); +if (m_aLastTOXType == TOX_INDEX) +pVOpt->SetIdxEntryLvl(aSelectedIndex); +else +pVOpt->SetTocEntryLvl(aSelectedIndex); +} } IMPL_LINK_NOARG(SwTOXEntryTabPage, ModifyClickHdl, weld::Toggleable&, void) @@ -2240,7 +2251,10 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/) else m_xLevelFT->set_label(m_sLevelStr); -m_xLevelLB->select(bToxIsIndex ? 1 : 0); +// tdf#135266 - remember last used entry level depending on the index type +m_xLevelLB->select(bToxIsIndex ? pTOXDlg->GetWrtShell().GetViewOptions()->GetIdxEntryLvl() + : pTOXDlg->GetWrtShell().GetViewOptions()->GetTocEntryLvl()); + //show or hide controls ShowHideControls(aCurType.eType); diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx index 1e78b1fdac02..36fdf1fd4484 100644 --- a/sw/source/uibase/config/viewopt.cxx +++ b/sw/source/uibase/config/viewopt.cxx @@ -292,6 +292,10 @@ SwViewOption::SwViewOption() : m_nDefaultAnchor = 1; //FLY_TO_CHAR +// tdf#135266 - tox dialog: remember last used entry level depending on the index type +m_nTocEntryLvl = 0; +m_nIdxEntryLvl = 1; + #ifdef DBG_UTIL // correspond to the statements in ui/config/cfgvw.src m_bTest1 = m_bTest2 = m_bTest3 = m_bTest4 =
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/viewopti.hxx|2 ++ sc/source/core/tool/viewopti.cxx |1 + sc/source/ui/inc/mvtabdlg.hxx |3 --- sc/source/ui/miscdlgs/mvtabdlg.cxx | 16 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) New commits: commit bb79936ec808712f53bc48663a485875571ba643 Author: Andreas Heinisch AuthorDate: Fri Nov 10 12:00:46 2023 +0100 Commit: Andreas Heinisch CommitDate: Fri Nov 10 16:59:29 2023 +0100 tdf#96854 - De-static-ize last used option for copy/move sheet Change-Id: Iafb12b51f166f9485f1658c406a98e5db5b246ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159292 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/inc/viewopti.hxx b/sc/inc/viewopti.hxx index 489a3e8c81da..beb0530e88a5 100644 --- a/sc/inc/viewopti.hxx +++ b/sc/inc/viewopti.hxx @@ -45,6 +45,8 @@ enum ScViewOption VOPT_ANCHOR, VOPT_PAGEBREAKS, VOPT_SUMMARY, +// tdf#96854 - move/copy sheet dialog: last used option for action (true: copy, false: move) +VOPT_COPY_SHEET, VOPT_THEMEDCURSOR, }; diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx index 80d8915effb9..a91f0cef8bf9 100644 --- a/sc/source/core/tool/viewopti.cxx +++ b/sc/source/core/tool/viewopti.cxx @@ -107,6 +107,7 @@ void ScViewOptions::SetDefaults() aOptArr[ VOPT_ANCHOR ] = true; aOptArr[ VOPT_PAGEBREAKS ] = true; aOptArr[ VOPT_SUMMARY ] = true; +aOptArr[ VOPT_COPY_SHEET ] = false; aOptArr[ VOPT_THEMEDCURSOR ] = false; aModeArr[VOBJ_TYPE_OLE ] = VOBJ_MODE_SHOW; diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx index 665d3cd46085..c6e89ab9fed0 100644 --- a/sc/source/ui/inc/mvtabdlg.hxx +++ b/sc/source/ui/inc/mvtabdlg.hxx @@ -61,9 +61,6 @@ private: boolbRenameTable:1; boolmbEverEdited:1; -// tdf#96854 - remember last used option for copy/move sheet -static bool mbRememeberedCopy; - std::unique_ptr m_xBtnMove; std::unique_ptr m_xBtnCopy; std::unique_ptr m_xFtDoc; diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx index 12c4e4d54bcc..afacdc48b46e 100644 --- a/sc/source/ui/miscdlgs/mvtabdlg.cxx +++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx @@ -26,9 +26,7 @@ #include #include #include - -// tdf#96854 - remember last used option for copy/move sheet -bool ScMoveTableDlg::mbRememeberedCopy = false; +#include ScMoveTableDlg::ScMoveTableDlg(weld::Window* pParent, OUString aDefault) : GenericDialogController(pParent, "modules/scalc/ui/movecopysheet.ui", "MoveCopySheetDialog") @@ -193,8 +191,11 @@ void ScMoveTableDlg::Init() m_xEdTabName->connect_changed(LINK(this, ScMoveTableDlg, CheckNameHdl)); // tdf#96854 - remember last used option for copy/move sheet -m_xBtnMove->set_active(!mbRememeberedCopy); -m_xBtnCopy->set_active(mbRememeberedCopy); +const bool bIsCopyActive += ScTabViewShell::GetActiveViewShell()->GetViewData().GetOptions().GetOption( +VOPT_COPY_SHEET); +m_xBtnMove->set_active(!bIsCopyActive); +m_xBtnCopy->set_active(bIsCopyActive); m_xEdTabName->set_sensitive(false); m_xFtWarn->hide(); InitDocListBox(); @@ -250,7 +251,10 @@ void ScMoveTableDlg::SetOkBtnLabel() // tdf#139464 Write "Copy" or "Move" on OK button m_xBtnOk->set_label(bIsCopyActive ? m_xBtnCopy->get_label() : m_xBtnMove->get_label()); // tdf#96854 - remember last used option for copy/move sheet -mbRememeberedCopy = bIsCopyActive; +ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell(); +ScViewOptions aViewOpt(pScViewShell->GetViewData().GetOptions()); +aViewOpt.SetOption(VOPT_COPY_SHEET, bIsCopyActive); +pScViewShell->GetViewData().SetOptions(aViewOpt); } // Handler:
[Libreoffice-commits] core.git: cui/source
cui/source/dialogs/hlmarkwn.cxx | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) New commits: commit bf927cb4513f8ef2a5205e98fbcf1ff02c344b4a Author: Andreas Heinisch AuthorDate: Fri Nov 3 14:07:34 2023 +0100 Commit: Andreas Heinisch CommitDate: Mon Nov 6 22:39:33 2023 +0100 tdf#149935 - Hyperlink Target Dialog: remember last used position and size Change-Id: I87fdf78b6ec4963eb4450d937dd86209e03865a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158879 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx index 7eb2ced02489..cf90450450ad 100644 --- a/cui/source/dialogs/hlmarkwn.cxx +++ b/cui/source/dialogs/hlmarkwn.cxx @@ -79,11 +79,19 @@ SvxHlinkDlgMarkWnd::SvxHlinkDlgMarkWnd(weld::Window* pParentDialog, SvxHyperlink mxBtApply->connect_clicked( LINK ( this, SvxHlinkDlgMarkWnd, ClickApplyHdl_Impl ) ); mxBtClose->connect_clicked( LINK ( this, SvxHlinkDlgMarkWnd, ClickCloseHdl_Impl ) ); mxLbTree->connect_row_activated( LINK ( this, SvxHlinkDlgMarkWnd, DoubleClickApplyHdl_Impl ) ); + +// tdf#149935 - remember last used position and size +SvtViewOptions aDlgOpt(EViewType::Dialog, m_xDialog->get_help_id()); +if (aDlgOpt.Exists()) +m_xDialog->set_window_state(aDlgOpt.GetWindowState()); } SvxHlinkDlgMarkWnd::~SvxHlinkDlgMarkWnd() { ClearTree(); +// tdf#149935 - remember last used position and size +SvtViewOptions aDlgOpt(EViewType::Dialog, m_xDialog->get_help_id()); + aDlgOpt.SetWindowState(m_xDialog->get_window_state(vcl::WindowDataMask::PosSize)); } void SvxHlinkDlgMarkWnd::ErrorChanged() @@ -126,7 +134,12 @@ sal_uInt16 SvxHlinkDlgMarkWnd::SetError( sal_uInt16 nError) // Move window void SvxHlinkDlgMarkWnd::MoveTo(const Point& rNewPos) { -m_xDialog->window_move(rNewPos.X(), rNewPos.Y()); +// tdf#149935 - remember last used position and size +SvtViewOptions aDlgOpt(EViewType::Dialog, m_xDialog->get_help_id()); +if (aDlgOpt.Exists()) +m_xDialog->set_window_state(aDlgOpt.GetWindowState()); +else +m_xDialog->window_move(rNewPos.X(), rNewPos.Y()); } namespace
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/qa sc/source
sc/qa/unit/uicalc/data/tdf157897_linked.ods |binary sc/qa/unit/uicalc/data/tdf157897_main.ods |binary sc/qa/unit/uicalc/uicalc.cxx| 19 +++ sc/source/core/data/documen2.cxx|2 ++ 4 files changed, 21 insertions(+) New commits: commit e61f8a36220d6e8800dd0decf2a680db97c371c9 Author: Andreas Heinisch AuthorDate: Mon Oct 23 23:13:51 2023 +0200 Commit: Xisco Fauli CommitDate: Thu Nov 2 00:51:24 2023 +0100 tdf#157897 - Clear print ranges before adding additional ones Otherwise, additional print ranges will be added for linked files after the external link will be updated. Change-Id: I0556fda6609d3e18f1ca992dc6a0399be01bc841 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158365 Tested-by: Jenkins Reviewed-by: Andreas Heinisch (cherry picked from commit 96b91357fb93028d35d70bdb52b4bac3ecbfbf57) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158534 Reviewed-by: Xisco Fauli diff --git a/sc/qa/unit/uicalc/data/tdf157897_linked.ods b/sc/qa/unit/uicalc/data/tdf157897_linked.ods new file mode 100755 index ..bb75c31d82ae Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf157897_linked.ods differ diff --git a/sc/qa/unit/uicalc/data/tdf157897_main.ods b/sc/qa/unit/uicalc/data/tdf157897_main.ods new file mode 100755 index ..1e1af575145f Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf157897_main.ods differ diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index d96b78b87136..a2b96bfda52c 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -1380,6 +1380,25 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf146994) CPPUNIT_ASSERT_EQUAL(OUString("Sheet1.D3:Sheet1.D4"), aMarkedAreaString); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf157897_duplicated_print_ranges) +{ +createScDoc("tdf157897_main.ods"); +ScDocument* pDoc = getScDoc(); + +const sal_uInt16 nPos = 0; +const SCTAB nFirstTab = 0; +// Ensure that there exists a print range in the first documents tab +CPPUNIT_ASSERT_EQUAL(static_cast(1), pDoc->GetPrintRangeCount(nFirstTab)); + +// Reload all links and check if the print range was not duplicated +const auto initialPrintRange = pDoc->GetPrintRange(nFirstTab, nPos); +ScDocShell* pDocSh = getScDocShell(); +pDocSh->ReloadAllLinks(); + +// Without the fix in place, the print range in the linked tab will be duplicated +CPPUNIT_ASSERT_EQUAL(initialPrintRange, pDoc->GetPrintRange(nFirstTab, nPos)); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf154991) { createScDoc("tdf154991.ods"); diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index e5d5df5a94cb..7766d54aba99 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -1042,6 +1042,8 @@ sal_uLong ScDocument::TransferTab( ScDocument& rSrcDoc, SCTAB nSrcPos, maTabs[nDestPos]->SetPrintEntireSheet(); else { +// tdf#157897 - clear print ranges before adding additional ones +maTabs[nDestPos]->ClearPrintRanges(); const auto nPrintRangeCount = rSrcDoc.maTabs[nSrcPos]->GetPrintRangeCount(); for (auto nPos = 0; nPos < nPrintRangeCount; nPos++) {
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/source svtools/source
sc/source/ui/view/tabview.cxx |3 ++- svtools/source/control/tabbar.cxx |4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) New commits: commit 7a062cdd9b91c577b2296bfe1f81ea78e0b75168 Author: Andreas Heinisch AuthorDate: Tue Oct 31 15:48:44 2023 +0100 Commit: Adolfo Jayme Barrientos CommitDate: Wed Nov 1 05:58:04 2023 +0100 tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings The tab bar's position should be determined globally based on the RTL settings, rather than being individually set for each sheet. Change-Id: I0690b01c842d2da6d49b57d1adad0a8e0844087f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158730 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch (cherry picked from commit 4f1b3c16f5530a2a190cab07c07c7bf63acf42c7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158696 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index b6c7a2bd8e66..56776d2d9b49 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -280,7 +280,8 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) if (bHasHint) RemoveHintWindow(); -bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); +// tdf#100584 - arrange sheets depending on the RTL settings +bool bLayoutRTL = AllSettings::GetLayoutRTL(); tools::Long nTotalWidth = rSize.Width(); if ( bLayoutRTL ) nTotalWidth += 2*rOffset.X(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 1690269ba234..02a23b8aea33 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -715,9 +715,7 @@ void TabBar::ImplFormat() const size_t nItemListSize = mpImpl->maItemList.size(); for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) { -// tdf#100584 - arrange sheets depending on the RTL settings -auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] - : mpImpl->maItemList[nItemIndex]; +auto& rItem = mpImpl->maItemList[nItemIndex]; // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
[Libreoffice-commits] core.git: sc/source svtools/source
sc/source/ui/view/tabview.cxx |3 ++- svtools/source/control/tabbar.cxx |4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) New commits: commit 4f1b3c16f5530a2a190cab07c07c7bf63acf42c7 Author: Andreas Heinisch AuthorDate: Tue Oct 31 15:48:44 2023 +0100 Commit: Andreas Heinisch CommitDate: Tue Oct 31 15:51:59 2023 +0100 tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings The tab bar's position should be determined globally based on the RTL settings, rather than being individually set for each sheet. Change-Id: I0690b01c842d2da6d49b57d1adad0a8e0844087f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158730 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index d158516fdb0a..25d60abc2946 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -280,7 +280,8 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) if (bHasHint) RemoveHintWindow(); -bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); +// tdf#100584 - arrange sheets depending on the RTL settings +bool bLayoutRTL = AllSettings::GetLayoutRTL(); tools::Long nTotalWidth = rSize.Width(); if ( bLayoutRTL ) nTotalWidth += 2*rOffset.X(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 1690269ba234..02a23b8aea33 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -715,9 +715,7 @@ void TabBar::ImplFormat() const size_t nItemListSize = mpImpl->maItemList.size(); for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) { -// tdf#100584 - arrange sheets depending on the RTL settings -auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] - : mpImpl->maItemList[nItemIndex]; +auto& rItem = mpImpl->maItemList[nItemIndex]; // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
[Libreoffice-commits] core.git: sc/source svtools/source
sc/source/ui/view/tabview.cxx |3 +-- svtools/source/control/tabbar.cxx |4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) New commits: commit 3be361d00eb1d61543e2c8c6953e63c149fb1eb0 Author: Andreas Heinisch AuthorDate: Tue Oct 31 15:39:13 2023 +0100 Commit: Andreas Heinisch CommitDate: Tue Oct 31 15:40:01 2023 +0100 Revert "tdf#100584, tdff#157784 - Arrange sheets depending on the RTL settings" This reverts commit a90d89d5b2dae2b4c3fd6a411de2160a3bf20779. Reason for revert: Typo in the commit message Change-Id: I58f184e2733d91aa827396868fb4f7b8e9d47a48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158693 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 25d60abc2946..d158516fdb0a 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -280,8 +280,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) if (bHasHint) RemoveHintWindow(); -// tdf#100584 - arrange sheets depending on the RTL settings -bool bLayoutRTL = AllSettings::GetLayoutRTL(); +bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); tools::Long nTotalWidth = rSize.Width(); if ( bLayoutRTL ) nTotalWidth += 2*rOffset.X(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 02a23b8aea33..1690269ba234 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -715,7 +715,9 @@ void TabBar::ImplFormat() const size_t nItemListSize = mpImpl->maItemList.size(); for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) { -auto& rItem = mpImpl->maItemList[nItemIndex]; +// tdf#100584 - arrange sheets depending on the RTL settings +auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] + : mpImpl->maItemList[nItemIndex]; // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
[Libreoffice-commits] core.git: sc/source svtools/source
sc/source/ui/view/tabview.cxx |3 ++- svtools/source/control/tabbar.cxx |4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) New commits: commit a90d89d5b2dae2b4c3fd6a411de2160a3bf20779 Author: Andreas Heinisch AuthorDate: Mon Oct 30 20:29:05 2023 +0100 Commit: Andreas Heinisch CommitDate: Tue Oct 31 15:37:57 2023 +0100 tdf#100584, tdff#157784 - Arrange sheets depending on the RTL settings The tab bar's position should be determined globally based on the RTL settings, rather than being individually set for each sheet. Change-Id: I0906f85058a5b4250540dda07740eec61f46d299 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158675 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index d158516fdb0a..25d60abc2946 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -280,7 +280,8 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) if (bHasHint) RemoveHintWindow(); -bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); +// tdf#100584 - arrange sheets depending on the RTL settings +bool bLayoutRTL = AllSettings::GetLayoutRTL(); tools::Long nTotalWidth = rSize.Width(); if ( bLayoutRTL ) nTotalWidth += 2*rOffset.X(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 1690269ba234..02a23b8aea33 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -715,9 +715,7 @@ void TabBar::ImplFormat() const size_t nItemListSize = mpImpl->maItemList.size(); for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) { -// tdf#100584 - arrange sheets depending on the RTL settings -auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] - : mpImpl->maItemList[nItemIndex]; +auto& rItem = mpImpl->maItemList[nItemIndex]; // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/uicalc/data/tdf157897_linked.ods |binary sc/qa/unit/uicalc/data/tdf157897_main.ods |binary sc/qa/unit/uicalc/uicalc.cxx| 18 ++ sc/source/core/data/documen2.cxx|2 ++ 4 files changed, 20 insertions(+) New commits: commit 96b91357fb93028d35d70bdb52b4bac3ecbfbf57 Author: Andreas Heinisch AuthorDate: Mon Oct 23 23:13:51 2023 +0200 Commit: Andreas Heinisch CommitDate: Thu Oct 26 18:41:49 2023 +0200 tdf#157897 - Clear print ranges before adding additional ones Otherwise, additional print ranges will be added for linked files after the external link will be updated. Change-Id: I0556fda6609d3e18f1ca992dc6a0399be01bc841 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158365 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/qa/unit/uicalc/data/tdf157897_linked.ods b/sc/qa/unit/uicalc/data/tdf157897_linked.ods new file mode 100755 index ..bb75c31d82ae Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf157897_linked.ods differ diff --git a/sc/qa/unit/uicalc/data/tdf157897_main.ods b/sc/qa/unit/uicalc/data/tdf157897_main.ods new file mode 100755 index ..1e1af575145f Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf157897_main.ods differ diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 4259f56a..15795baceaa1 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -1395,6 +1395,24 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf146994) CPPUNIT_ASSERT_EQUAL(OUString("Sheet1.D3:Sheet1.D4"), aMarkedAreaString); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf157897_duplicated_print_ranges) +{ +createScDoc("tdf157897_main.ods"); +ScDocument* pDoc = getScDoc(); + +const sal_uInt16 nPos = 0; +const SCTAB nFirstTab = 0; +// Ensure that there exists a print range in the first documents tab +CPPUNIT_ASSERT_EQUAL(static_cast(1), pDoc->GetPrintRangeCount(nFirstTab)); + +// Reload all links and check if the print range was not duplicated +const auto initialPrintRange = pDoc->GetPrintRange(nFirstTab, nPos); +pDoc->GetDocumentShell()->ReloadAllLinks(); + +// Without the fix in place, the print range in the linked tab will be duplicated +CPPUNIT_ASSERT_EQUAL(initialPrintRange, pDoc->GetPrintRange(nFirstTab, nPos)); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf154991) { createScDoc("tdf154991.ods"); diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 4b07b0d33ff5..c53dc6b3e305 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -1040,6 +1040,8 @@ sal_uLong ScDocument::TransferTab( ScDocument& rSrcDoc, SCTAB nSrcPos, maTabs[nDestPos]->SetPrintEntireSheet(); else { +// tdf#157897 - clear print ranges before adding additional ones +maTabs[nDestPos]->ClearPrintRanges(); const auto nPrintRangeCount = rSrcDoc.maTabs[nSrcPos]->GetPrintRangeCount(); for (auto nPos = 0; nPos < nPrintRangeCount; nPos++) {
[Libreoffice-commits] core.git: sd/source
sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit ea574f7929d4c226d56273178779ef38ca2ce5c9 Author: Andreas Heinisch AuthorDate: Fri Oct 6 09:27:10 2023 +0200 Commit: Andreas Heinisch CommitDate: Mon Oct 23 18:44:30 2023 +0200 tdf#111737 - Add new (master) page depending on the edit mode Change-Id: I5e0d0f604714cbc395cd6b0c7a9b5665f0d5f93b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157631 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index f8376ec409fd..1af2abcabfc7 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -377,8 +377,11 @@ bool SelectionFunction::KeyInput (const KeyEvent& rEvent) } else if (pViewShell->GetDispatcher() != nullptr) { +// tdf#111737 - add new (master) page depending on the edit mode pViewShell->GetDispatcher()->Execute( -SID_INSERTPAGE, +mrSlideSorter.GetModel().GetEditMode() == EditMode::Page +? SID_INSERTPAGE +: SID_INSERT_MASTER_PAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD); } bResult = true;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/source
sc/source/ui/attrdlg/attrdlg.cxx |9 - 1 file changed, 9 deletions(-) New commits: commit a0faa0bca2bcd6929d178ad40237addec98090c5 Author: Andreas Heinisch AuthorDate: Fri Oct 6 20:52:15 2023 +0200 Commit: Xisco Fauli CommitDate: Mon Oct 9 13:05:18 2023 +0200 Revert "tdf#149598 - Remember window state of the format cell dialog" This reverts commit c1893df42567c260ca5fb069038d1a55616e7b7f. Reason for revert: causes a regression under Linux (Bug 156710) https://bugs.documentfoundation.org/show_bug.cgi?id=156710 Change-Id: I72a570ecba4cf7fe594a0bb50a121ab2e99cc613 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157624 Tested-by: Jenkins Reviewed-by: Andreas Heinisch (cherry picked from commit f1f2a3faeaddf9e9a59f44bf9de38a1f0aa97104) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157712 Reviewed-by: Xisco Fauli diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx index e09a69b5c13f..deb814820bd6 100644 --- a/sc/source/ui/attrdlg/attrdlg.cxx +++ b/sc/source/ui/attrdlg/attrdlg.cxx @@ -31,17 +31,11 @@ #include #include #include -#include ScAttrDlg::ScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs) : SfxTabDialogController(pParent, "modules/scalc/ui/formatcellsdialog.ui", "FormatCellsDialog", pCellAttrs) { -// tdf#149598 - restore window state of the dialog -SvtViewOptions aDlgOpt(EViewType::Dialog, "FormatCellDialog"); -if (aDlgOpt.Exists()) -m_xDialog->set_window_state(aDlgOpt.GetWindowState()); - SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageCreatorFunc fail!"); @@ -73,9 +67,6 @@ ScAttrDlg::ScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs) ScAttrDlg::~ScAttrDlg() { -// tdf#149598 - remember window state of the dialog -SvtViewOptions aDlgOpt(EViewType::Dialog, "FormatCellDialog"); - aDlgOpt.SetWindowState(m_xDialog->get_window_state(vcl::WindowDataMask::PosSize)); } void ScAttrDlg::PageCreated(const OUString& rPageId, SfxTabPage& rTabPage)
[Libreoffice-commits] core.git: sc/source
sc/source/ui/attrdlg/attrdlg.cxx |9 - 1 file changed, 9 deletions(-) New commits: commit f1f2a3faeaddf9e9a59f44bf9de38a1f0aa97104 Author: Andreas Heinisch AuthorDate: Fri Oct 6 20:52:15 2023 +0200 Commit: Andreas Heinisch CommitDate: Sat Oct 7 08:49:32 2023 +0200 Revert "tdf#149598 - Remember window state of the format cell dialog" This reverts commit c1893df42567c260ca5fb069038d1a55616e7b7f. Reason for revert: causes a regression under Linux (Bug 156710) https://bugs.documentfoundation.org/show_bug.cgi?id=156710 Change-Id: I72a570ecba4cf7fe594a0bb50a121ab2e99cc613 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157624 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx index 7bd79468d27d..faa08bf3ca00 100644 --- a/sc/source/ui/attrdlg/attrdlg.cxx +++ b/sc/source/ui/attrdlg/attrdlg.cxx @@ -31,17 +31,11 @@ #include #include #include -#include ScAttrDlg::ScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs) : SfxTabDialogController(pParent, "modules/scalc/ui/formatcellsdialog.ui", "FormatCellsDialog", pCellAttrs) { -// tdf#149598 - restore window state of the dialog -SvtViewOptions aDlgOpt(EViewType::Dialog, "FormatCellDialog"); -if (aDlgOpt.Exists()) -m_xDialog->set_window_state(aDlgOpt.GetWindowState()); - SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageCreatorFunc fail!"); @@ -73,9 +67,6 @@ ScAttrDlg::ScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs) ScAttrDlg::~ScAttrDlg() { -// tdf#149598 - remember window state of the dialog -SvtViewOptions aDlgOpt(EViewType::Dialog, "FormatCellDialog"); - aDlgOpt.SetWindowState(m_xDialog->get_window_state(vcl::WindowDataMask::PosSize)); } void ScAttrDlg::PageCreated(const OUString& rPageId, SfxTabPage& rTabPage)
[Libreoffice-commits] core.git: sd/inc sd/source
sd/inc/strings.hrc|2 ++ sd/source/ui/dlg/titledockwin.cxx |6 ++ sd/source/ui/inc/titledockwin.hxx |2 ++ sd/source/ui/view/drviews1.cxx| 21 + 4 files changed, 31 insertions(+) New commits: commit 25d09bdb9f48313c000cc8ec8df60b1bb8efe2e6 Author: Andreas Heinisch AuthorDate: Sun Oct 1 11:28:31 2023 +0200 Commit: Andreas Heinisch CommitDate: Mon Oct 2 10:21:26 2023 +0200 tdf#87638 - Modify slide pane title in Impress/Draw based on edit mode Change-Id: I0dd668324c32172144f29cf40c52e2b66e7895b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157444 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc index 8438a9262a95..e3f5c45a5fcd 100644 --- a/sd/inc/strings.hrc +++ b/sd/inc/strings.hrc @@ -234,7 +234,9 @@ #define STR_PLACEHOLDER_DESCRIPTION_NOTES NC_("STR_PLACEHOLDER_DESCRIPTION_NOTES", "Notes Area") #define STR_UNDO_HANGULHANJACONVERSION NC_("STR_UNDO_HANGULHANJACONVERSION", "Hangul/Hanja Conversion") #define STR_LEFT_PANE_IMPRESS_TITLE NC_("STR_LEFT_PANE_IMPRESS_TITLE", "Slides") +#define STR_LEFT_PANE_IMPRESS_TITLE_MASTER NC_("STR_LEFT_PANE_IMPRESS_TITLE_MASTER", "Master Slides") #define STR_LEFT_PANE_DRAW_TITLE NC_("STR_LEFT_PANE_DRAW_TITLE", "Pages") +#define STR_LEFT_PANE_DRAW_TITLE_MASTER NC_("STR_LEFT_PANE_DRAW_TITLE_MASTER", "Master Pages") #define STR_TASKPANEL_NOT_AVAILABLE_SUBSTITUTION NC_("STR_TASKPANEL_NOT_AVAILABLE_SUBSTITUTION", "Preview not available") #define STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION NC_("STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION", "Preparing preview") #define STR_TASKPANEL_LAYOUT_MENU_TITLE NC_("STR_TASKPANEL_LAYOUT_MENU_TITLE", "Layouts") diff --git a/sd/source/ui/dlg/titledockwin.cxx b/sd/source/ui/dlg/titledockwin.cxx index 0550f05d2f8b..d545170da688 100644 --- a/sd/source/ui/dlg/titledockwin.cxx +++ b/sd/source/ui/dlg/titledockwin.cxx @@ -68,6 +68,12 @@ namespace sd SfxDockingWindow::dispose(); } +void TitledDockingWindow::SetTitle(const OUString& i_rText) +{ +m_sTitle = i_rText; +Invalidate(); +} + void TitledDockingWindow::SetText( const OUString& i_rText ) { SfxDockingWindow::SetText( i_rText ); diff --git a/sd/source/ui/inc/titledockwin.hxx b/sd/source/ui/inc/titledockwin.hxx index bdbd386ba62a..5a880e268739 100644 --- a/sd/source/ui/inc/titledockwin.hxx +++ b/sd/source/ui/inc/titledockwin.hxx @@ -76,6 +76,8 @@ namespace sd */ Orientation GetOrientation() const; +void SetTitle(const OUString& i_rText); + private: // Window overridables virtual void Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& i_rArea) override; diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index f9378e1ec4fd..309a5d5ed3cc 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -71,6 +71,9 @@ #include #include #include +#include +#include +#include using namespace com::sun::star; @@ -393,6 +396,16 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) ConfigureAppBackgroundColor(); +// tdf#87638 - change slide pane title according to the edit mode +auto setLeftPaneTitleIfPaneExists += [pViewShell = GetViewFrame()](sal_uInt16 nId, TranslateId aId) +{ +if (auto* pChildWindow = pViewShell->GetChildWindow(nId)) +if (auto* pTitledDockingWindow += static_cast(pChildWindow->GetWindow())) +pTitledDockingWindow->SetTitle(SdResId(aId)); +}; + if (meEditMode == EditMode::Page) { /** @@ -401,6 +414,10 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) maTabControl->Clear(); +// tdf#87638 - change slide pane title according to the edit mode +setLeftPaneTitleIfPaneExists(SID_LEFT_PANE_DRAW, STR_LEFT_PANE_DRAW_TITLE); +setLeftPaneTitleIfPaneExists(SID_LEFT_PANE_IMPRESS, STR_LEFT_PANE_IMPRESS_TITLE); + SdPage* pPage; sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind); @@ -431,6 +448,10 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) GetViewFrame()->SetChildWindow( AnimationChildWindow::GetChildWindowId(), false ); +// tdf#87638 - change slide pane title according to the edit mode +setLeftPaneTitleIfPaneExists(SID_LEFT_PANE_DRAW, STR_LEFT_PANE_DRAW_TITLE_MASTER); +setLeftPaneTitleIfPaneExists(SID_LEFT_PANE_IMPRESS, STR_LEFT_PANE_IMPRESS_TITLE_MASTER); + if (comphelper::LibreOfficeKit::isActive())
[Libreoffice-commits] core.git: framework/source include/unotools sfx2/source unotools/source
framework/source/uielement/recentfilesmenucontroller.cxx |2 include/unotools/historyoptions.hxx |5 sfx2/source/control/recentdocsview.cxx |2 sfx2/source/dialog/backingwindow.cxx |2 unotools/source/config/historyoptions.cxx| 88 ++- 5 files changed, 65 insertions(+), 34 deletions(-) New commits: commit 71cae3a219ff1629368b8f324d0de89afc9445e9 Author: Andreas Heinisch AuthorDate: Fri Sep 22 12:06:50 2023 +0200 Commit: Andreas Heinisch CommitDate: Mon Sep 25 14:15:37 2023 +0200 tdf#155698 - Start Center: Retain pinned items when clearing the list Change-Id: Ife54845e020977cdb80a7fcc1fa6afc17b32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157169 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 75d13407ad93..9c8eea5ef694 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -383,7 +383,7 @@ void SAL_CALL RecentFilesMenuController::itemSelected( const css::awt::MenuEvent if ( aCommand == CMD_CLEAR_LIST ) { -SvtHistoryOptions::Clear( EHistoryType::PickList ); +SvtHistoryOptions::Clear( EHistoryType::PickList, false ); dispatchCommand( "vnd.org.libreoffice.recentdocs:ClearRecentFileList", css::uno::Sequence< css::beans::PropertyValue >() ); diff --git a/include/unotools/historyoptions.hxx b/include/unotools/historyoptions.hxx index b2388de2ad4b..3eb8162ee0b5 100644 --- a/include/unotools/historyoptions.hxx +++ b/include/unotools/historyoptions.hxx @@ -44,7 +44,7 @@ namespace SvtHistoryOptions @param eHistory select right history. */ -UNOTOOLS_DLLPUBLIC void Clear(EHistoryType eHistory); +UNOTOOLS_DLLPUBLIC void Clear(EHistoryType eHistory, const bool bClearPinnedItems = true); /** Return the complete specified history list. @@ -81,7 +81,8 @@ namespace SvtHistoryOptions /** Delete item from the specified list. */ -UNOTOOLS_DLLPUBLIC void DeleteItem(EHistoryType eHistory, const OUString& sURL); +UNOTOOLS_DLLPUBLIC void DeleteItem(EHistoryType eHistory, const OUString& sURL, + const bool bClearPinned = true); // tdf#38742 - toggle pinned state of an item UNOTOOLS_DLLPUBLIC void TogglePinItem(EHistoryType eHistory, const OUString& sURL); diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index f2c58cf6e12e..cc2e80de17e9 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -191,7 +191,7 @@ void RecentDocsView::clearUnavailableFiles(){ { const SvtHistoryOptions::HistoryItem& rPickListEntry = aHistoryList[i]; if ( !comphelper::DirectoryHelper::fileExists(rPickListEntry.sURL) ){ - SvtHistoryOptions::DeleteItem(EHistoryType::PickList,rPickListEntry.sURL); + SvtHistoryOptions::DeleteItem(EHistoryType::PickList,rPickListEntry.sURL, false); } } Reload(); diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index fbae5e1af221..553577a846df 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -647,7 +647,7 @@ IMPL_LINK (BackingWindow, MenuSelectHdl, const OUString&, rId, void) { if (rId == "clear_all") { -SvtHistoryOptions::Clear(EHistoryType::PickList); +SvtHistoryOptions::Clear(EHistoryType::PickList, false); mxAllRecentThumbnails->Reload(); return; } diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index 2cda950858d2..8361aa6bc358 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -68,27 +68,49 @@ static sal_uInt32 GetCapacity(const uno::Reference& xCom namespace SvtHistoryOptions { -void Clear( EHistoryType eHistory ) +void Clear(EHistoryType eHistory, const bool bClearPinnedItems) { try { uno::Reference xCfg = GetConfig(); uno::Reference xListAccess(GetListAccess(xCfg, eHistory)); -// clear ItemList -uno::Reference xNode; -xListAccess->getByName(s_sItemList) >>= xNode; -Sequence aStrings(xNode->getElementNames()); +// Retrieve order and item lists using name access to check properties of individual items +uno::Reference xItemList; +uno::Reference xOrderList; +xListAccess->getByName(s_sItemList) >>= xItemList; +xListAccess->getByName(s_sOrderList) >>= xOrderList; -for (const auto& rString : std::as_const(aStrings)) -xNode->removeByName(rString); +
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/uiwriter/data/testTdf106663.odt |binary sw/qa/extras/uiwriter/uiwriter6.cxx | 20 2 files changed, 20 insertions(+) New commits: commit 486ae5db6987411d5e394de94b2b077099d03856 Author: Andreas Heinisch AuthorDate: Tue Sep 19 21:20:40 2023 +0200 Commit: Andreas Heinisch CommitDate: Tue Sep 19 22:44:05 2023 +0200 tdf#106663 - Test GoToNextPlacemarker in header's fly frame Change-Id: I3a2d63c0a1f07460db4aeabd1df289090c5f013b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157070 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sw/qa/extras/uiwriter/data/testTdf106663.odt b/sw/qa/extras/uiwriter/data/testTdf106663.odt new file mode 100755 index ..eee462406bb0 Binary files /dev/null and b/sw/qa/extras/uiwriter/data/testTdf106663.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index 80eecbaa5edd..f1f349779dac 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -2522,6 +2522,26 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf146178) CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pCursor->GetPoint()->GetContentIndex()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf106663HeaderTextFrameGoToNextPlacemarker) +{ +createSwDoc("testTdf106663.odt"); + +SwDoc* pDoc = getSwDoc(); +SwPaM* pCursor = pDoc->GetEditShell()->GetCursor(); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + +// Move the cursor into the fly frame of the document's header +pWrtShell->GotoFly("FrameInHeader", FLYCNTTYPE_FRM, false); + +// Check that GoToNextPlacemarker highlights the first field instead of the second one +dispatchCommand(mxComponent, ".uno:GoToNextPlacemarker", {}); +// Without the fix in place, this test would have failed with +// - Expected: Heading +// - Actual : Some other marker +// i.e. the GoToNextPlacemarker command skipped the first field + CPPUNIT_ASSERT(pCursor->GetPoint()->GetNode().GetTextNode()->GetText().startsWith("Heading")); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf155407) { createSwDoc();
[Libreoffice-commits] core.git: sw/source
sw/source/core/doc/docfld.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 016f3aea1e1a3731f925a3f8e7e5a92fff3ef28d Author: Andreas Heinisch AuthorDate: Wed Sep 13 13:50:08 2023 +0200 Commit: Samuel Mehrbrodt CommitDate: Thu Sep 14 08:21:25 2023 +0200 tdf#106663 - Fields: use the starting position of the frame instead of the length of the text in the frame. Otherwise, the searching position is after the first field, e.g., "Heading x1", where x1 is the field and the postion of the index would be at the end of the paragraph. Change-Id: Ifb48bfea09e29c6263f4f81190643a88b0f57aa1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156894 Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 01bcc1cd8483..f8e3d079a960 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -213,7 +213,8 @@ void SetGetExpField::SetBodyPos( const SwContentFrame& rFrame ) bool const bResult = ::GetBodyTextNode( rDoc, aPos, rFrame ); OSL_ENSURE(bResult, "Where is the field?"); m_nNode = aPos.GetNodeIndex(); -m_nContent = aPos.GetContentIndex(); +// tdf#106663 - use the starting position of the frame +m_nContent = 0; } }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/sfx2 sfx2/source
include/sfx2/thumbnailviewitem.hxx |9 - sfx2/source/control/recentdocsviewitem.cxx | 52 + sfx2/source/control/recentdocsviewitem.hxx |9 - sfx2/source/control/thumbnailview.cxx | 18 ++ sfx2/source/control/thumbnailviewitem.cxx | 39 - 5 files changed, 65 insertions(+), 62 deletions(-) New commits: commit aeaa6c301a055ce915cab31083f26e43a20086f1 Author: Andreas Heinisch AuthorDate: Wed Sep 6 17:03:26 2023 +0200 Commit: Adolfo Jayme Barrientos CommitDate: Tue Sep 12 06:00:56 2023 +0200 tdf#156959 - Remove pinned icons from thumbnail view item Remove pinned icons from thumbnail view item and pushed it down to the recent documents view item. This avoids that the pinned icon will be shown in a simple thumbnail view, e.g., in the thumbnail view of the side pane in base. In addition, fixed an error with the number of elements in the thumbnail view in the start center when items are pinned, i.e., removed a spurious new line. Change-Id: I76026bfa9239f709aa60ff12efabe28cb09f0d76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156625 Tested-by: Jenkins Reviewed-by: Andreas Heinisch Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156641 Reviewed-by: Adolfo Jayme Barrientos diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx index e34985c799d3..5dcdde2b6cd2 100644 --- a/include/sfx2/thumbnailviewitem.hxx +++ b/include/sfx2/thumbnailviewitem.hxx @@ -72,16 +72,11 @@ public: bool mbBorder; bool mbSelected; bool mbHover; -bool mbPinned; BitmapEx maPreview1; OUString maTitle; OUString maHelpText; css::uno::Reference< css::accessibility::XAccessible > mxAcc; -bool mbPinnedDocumentHighlighted; -BitmapEx maPinnedDocumentBitmap; -BitmapEx maPinnedDocumentBitmapHiglighted; - ThumbnailViewItem(ThumbnailView& rView, sal_uInt16 nId); virtual ~ThumbnailViewItem (); @@ -98,10 +93,6 @@ public: void setHighlight (bool state); -bool isPinned () const { return mbPinned; } - -void setPinned (bool state); - /** Updates own highlight status based on the aPoint position. Returns rectangle that needs to be invalidated. diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index 57a670b37c53..2070a4efe46e 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -128,10 +128,13 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView , const OUStri mrParentView(rView), maURL(rURL), m_isReadOnly(isReadOnly), - m_isPinned(isPinned), m_bRemoveIconHighlighted(false), m_aRemoveRecentBitmap(BMP_RECENTDOC_REMOVE), - m_aRemoveRecentBitmapHighlighted(BMP_RECENTDOC_REMOVE_HIGHLIGHTED) + m_aRemoveRecentBitmapHighlighted(BMP_RECENTDOC_REMOVE_HIGHLIGHTED), + m_bPinned(isPinned), + m_bPinnedIconHighlighted(false), + m_aPinnedDocumentBitmap(BMP_PIN_DOC), + m_aPinnedDocumentBitmapHiglighted(BMP_PIN_DOC_HIGHLIGHTED) { OUString aTitle(rTitle); INetURLObject aURLObj(rURL); @@ -231,7 +234,6 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView , const OUStri maTitle = aTitle; maPreview1 = aThumbnail; -mbPinned = m_isPinned; } ::tools::Rectangle RecentDocsViewItem::updateHighlight(bool bVisible, const Point& rPoint) @@ -253,6 +255,21 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView , const OUStri m_bRemoveIconHighlighted = false; } +if (bVisible && getPinnedIconArea().Contains(rPoint)) +{ +if (!m_bPinnedIconHighlighted) +aRect.Union(getPinnedIconArea()); + +m_bPinnedIconHighlighted = true; +} +else +{ +if (m_bPinnedIconHighlighted) +aRect.Union(getPinnedIconArea()); + +m_bPinnedIconHighlighted = false; +} + return aRect; } @@ -266,6 +283,11 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView , const OUStri aSize); } +::tools::Rectangle RecentDocsViewItem::getPinnedIconArea() const +{ +return ::tools::Rectangle(maPinPos, m_aPinnedDocumentBitmap.GetSizePixel()); +} + OUString RecentDocsViewItem::getHelpText() const { return m_sHelpText; @@ -275,10 +297,10 @@ void RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc { ThumbnailViewItem::Paint(pProcessor, pAttrs); -// paint the remove icon when hovered +// paint the remove/pinned icon when hovered if (isHighlighted()) { -drawinglayer::primitive2d::Primitive2DContainer aSeq(1); +drawinglayer::primitive2d::Primitive2DContainer aSeq(2); Point aIconPos(getRemoveIconArea().TopLeft()); @@ -286,6 +308,23 @@ void
[Libreoffice-commits] core.git: include/sfx2 sfx2/source
include/sfx2/thumbnailviewitem.hxx |7 --- sfx2/source/control/recentdocsviewitem.cxx | 51 + sfx2/source/control/recentdocsviewitem.hxx |8 sfx2/source/control/thumbnailview.cxx | 18 ++ sfx2/source/control/thumbnailviewitem.cxx | 34 --- 5 files changed, 65 insertions(+), 53 deletions(-) New commits: commit 9a37652b79001bf5208841b9221dee851b9b6d0f Author: Andreas Heinisch AuthorDate: Wed Sep 6 17:03:26 2023 +0200 Commit: Andreas Heinisch CommitDate: Wed Sep 6 22:06:09 2023 +0200 tdf#156959 - Remove pinned icons from thumbnail view item Remove pinned icons from thumbnail view item and pushed it down to the recent documents view item. This avoids that the pinned icon will be shown in a simple thumbnail view, e.g., in the thumbnail view of the side pane in base. In addition, fixed an error with the number of elements in the thumbnail view in the start center when items are pinned, i.e., removed a spurious new line. Change-Id: I76026bfa9239f709aa60ff12efabe28cb09f0d76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156625 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx index 7c84b344a8a0..9495b08054e3 100644 --- a/include/sfx2/thumbnailviewitem.hxx +++ b/include/sfx2/thumbnailviewitem.hxx @@ -73,16 +73,11 @@ public: bool mbBorder; bool mbSelected; bool mbHover; -bool mbPinned; BitmapEx maPreview1; OUString maTitle; OUString maHelpText; rtl::Reference< ThumbnailViewItemAcc > mxAcc; -bool mbPinnedDocumentHighlighted; -BitmapEx maPinnedDocumentBitmap; -BitmapEx maPinnedDocumentBitmapHiglighted; - ThumbnailViewItem(ThumbnailView& rView, sal_uInt16 nId); virtual ~ThumbnailViewItem (); @@ -102,8 +97,6 @@ public: void setHighlight (bool state); -bool isPinned () const { return mbPinned; } - /** Updates own highlight status based on the aPoint position. Returns rectangle that needs to be invalidated. diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index 240ef0c32d9d..2070a4efe46e 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -130,7 +130,11 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView , const OUStri m_isReadOnly(isReadOnly), m_bRemoveIconHighlighted(false), m_aRemoveRecentBitmap(BMP_RECENTDOC_REMOVE), - m_aRemoveRecentBitmapHighlighted(BMP_RECENTDOC_REMOVE_HIGHLIGHTED) + m_aRemoveRecentBitmapHighlighted(BMP_RECENTDOC_REMOVE_HIGHLIGHTED), + m_bPinned(isPinned), + m_bPinnedIconHighlighted(false), + m_aPinnedDocumentBitmap(BMP_PIN_DOC), + m_aPinnedDocumentBitmapHiglighted(BMP_PIN_DOC_HIGHLIGHTED) { OUString aTitle(rTitle); INetURLObject aURLObj(rURL); @@ -230,7 +234,6 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView , const OUStri maTitle = aTitle; maPreview1 = aThumbnail; -mbPinned = isPinned; } ::tools::Rectangle RecentDocsViewItem::updateHighlight(bool bVisible, const Point& rPoint) @@ -252,6 +255,21 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView , const OUStri m_bRemoveIconHighlighted = false; } +if (bVisible && getPinnedIconArea().Contains(rPoint)) +{ +if (!m_bPinnedIconHighlighted) +aRect.Union(getPinnedIconArea()); + +m_bPinnedIconHighlighted = true; +} +else +{ +if (m_bPinnedIconHighlighted) +aRect.Union(getPinnedIconArea()); + +m_bPinnedIconHighlighted = false; +} + return aRect; } @@ -265,6 +283,11 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView , const OUStri aSize); } +::tools::Rectangle RecentDocsViewItem::getPinnedIconArea() const +{ +return ::tools::Rectangle(maPinPos, m_aPinnedDocumentBitmap.GetSizePixel()); +} + OUString RecentDocsViewItem::getHelpText() const { return m_sHelpText; @@ -274,10 +297,10 @@ void RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc { ThumbnailViewItem::Paint(pProcessor, pAttrs); -// paint the remove icon when hovered +// paint the remove/pinned icon when hovered if (isHighlighted()) { -drawinglayer::primitive2d::Primitive2DContainer aSeq(1); +drawinglayer::primitive2d::Primitive2DContainer aSeq(2); Point aIconPos(getRemoveIconArea().TopLeft()); @@ -285,6 +308,23 @@ void RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc m_bRemoveIconHighlighted ? m_aRemoveRecentBitmapHighlighted : m_aRemoveRecentBitmap, B2DPoint(aIconPos.X(), aIconPos.Y(; +// tdf#38742 - draw pinned icon +
[Libreoffice-commits] core.git: sd/inc sd/qa sd/source
sd/inc/drawdoc.hxx |4 ++-- sd/qa/unit/misc-tests.cxx | 24 sd/source/core/drawdoc3.cxx |4 +++- 3 files changed, 29 insertions(+), 3 deletions(-) New commits: commit 139cffc531277b57bae8e272fef13af00ace5366 Author: Andreas Heinisch AuthorDate: Mon Jul 24 11:34:27 2023 +0200 Commit: Andreas Heinisch CommitDate: Fri Aug 25 14:10:52 2023 +0200 tdf#39519 - Rename slide if its name is not unique For instance, if a slide is copied by ctrl + drag and drop (DND_ACTION_COPY) Change-Id: I1c669c299a38431680ce602922c1e2c7f117a2ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154838 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx index 50a5e2f09ca3..12814f3717b8 100644 --- a/sd/inc/drawdoc.hxx +++ b/sd/inc/drawdoc.hxx @@ -346,8 +346,8 @@ public: page, or preserve the old name */ -SAL_DLLPRIVATE bool InsertBookmarkAsPage(const std::vector , - std::vector *pExchangeList, +bool InsertBookmarkAsPage(const std::vector , + std::vector *pExchangeList, bool bLink, bool bReplace, sal_uInt16 nPgPos, bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh, bool bCopy, bool bMergeMasterPages, diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx index e8e34c20c8c2..3cdc212e69db 100644 --- a/sd/qa/unit/misc-tests.cxx +++ b/sd/qa/unit/misc-tests.cxx @@ -82,6 +82,7 @@ public: void testTdf131033(); void testTdf129898LayerDrawnInSlideshow(); void testTdf136956(); +void testTdf39519(); void testEncodedTableStyles(); CPPUNIT_TEST_SUITE(SdMiscTest); @@ -104,6 +105,7 @@ public: CPPUNIT_TEST(testTdf131033); CPPUNIT_TEST(testTdf129898LayerDrawnInSlideshow); CPPUNIT_TEST(testTdf136956); +CPPUNIT_TEST(testTdf39519); CPPUNIT_TEST(testEncodedTableStyles); CPPUNIT_TEST_SUITE_END(); }; @@ -886,6 +888,28 @@ void SdMiscTest::testTdf136956() CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xTable->getRowCount()); } +void SdMiscTest::testTdf39519() +{ +createSdImpressDoc(); +SdXImpressDocument* pXImpressDocument = dynamic_cast(mxComponent.get()); +CPPUNIT_ASSERT(pXImpressDocument); + +// Change the name of the first page in the newly created document +SdDrawDocument* pDoc = pXImpressDocument->GetDoc(); +SdPage* pPage = static_cast(pDoc->GetPage(1)); +pPage->SetName("Test"); + +// Insert a bookmark as a new page using the same name +std::vector aBookmarkList = { "Test" }; +pDoc->InsertBookmarkAsPage(aBookmarkList, nullptr, false, false, 2, true, pDoc->GetDocSh(), + true, false, false); + +// Check if the copied page has a different name +SdPage* pCopiedPage = static_cast(pDoc->GetPage(2)); +// Without the fix in place, the names of the pages would not be different +CPPUNIT_ASSERT(pCopiedPage->GetName() != pPage->GetName()); +} + void SdMiscTest::testEncodedTableStyles() { // Silence unrelated failure: diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 6fbefd24..357858f46222 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -696,7 +696,9 @@ bool SdDrawDocument::InsertBookmarkAsPage( } } -if( bMustRename ) +// tdf#39519 - rename page if its name is not unique, e.g., if a slide is copied by +// ctrl + drag and drop (DND_ACTION_COPY) +if (bMustRename || !mpDocSh->IsPageNameUnique(aPgName)) { // Page name already in use -> use default name for default and // notes page
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6-0' - sc/source
sc/source/ui/miscdlgs/linkarea.cxx |8 1 file changed, 8 insertions(+) New commits: commit bcbcb3f692f51085ba8a9ad6ea2be410dc79dd7b Author: Andreas Heinisch AuthorDate: Fri Jul 28 09:37:47 2023 +0200 Commit: Eike Rathke CommitDate: Tue Aug 1 14:39:43 2023 +0200 tdf#142600 - External links dialog: list database ranges Regression from commit 462f9d1f589a7afd66d3fc61925467d3b68e5b31 where the database ranges were dropped. Change-Id: Ic0e453fc6fe62849d72b6acf88ed7ebd3c47775b (cherry picked from commit f7c3ded18a757e31b23723ea335febf442acae68) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155035 Reviewed-by: Adolfo Jayme Barrientos Reviewed-by: Patrick Luby Tested-by: Eike Rathke Reviewed-by: Eike Rathke diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx index 09cfe6c3c285..6b1716407561 100644 --- a/sc/source/ui/miscdlgs/linkarea.cxx +++ b/sc/source/ui/miscdlgs/linkarea.cxx @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -259,6 +260,13 @@ void ScLinkedAreaDlg::UpdateSourceRanges() m_xLbRanges->append_text(pRangeData->GetName()); } } +// tdf#142600 - list database ranges +if (const auto pDBs = m_pSourceShell->GetDocument().GetDBCollection()) +{ +const auto& rNamedDBs = pDBs->getNamedDBs(); +for (const auto& rNamedDB : rNamedDBs) +m_xLbRanges->append_text(rNamedDB->GetName()); +} } m_xLbRanges->thaw();
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/source
sc/source/ui/miscdlgs/linkarea.cxx |8 1 file changed, 8 insertions(+) New commits: commit 4386edcf40b54343771fb24287641611b135 Author: Andreas Heinisch AuthorDate: Fri Jul 28 09:37:47 2023 +0200 Commit: Eike Rathke CommitDate: Sat Jul 29 20:42:38 2023 +0200 tdf#142600 - External links dialog: list database ranges Regression from commit 462f9d1f589a7afd66d3fc61925467d3b68e5b31 where the database ranges were dropped. Change-Id: Ic0e453fc6fe62849d72b6acf88ed7ebd3c47775b (cherry picked from commit f7c3ded18a757e31b23723ea335febf442acae68) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155030 Tested-by: Jenkins Reviewed-by: Eike Rathke diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx index 09cfe6c3c285..6b1716407561 100644 --- a/sc/source/ui/miscdlgs/linkarea.cxx +++ b/sc/source/ui/miscdlgs/linkarea.cxx @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -259,6 +260,13 @@ void ScLinkedAreaDlg::UpdateSourceRanges() m_xLbRanges->append_text(pRangeData->GetName()); } } +// tdf#142600 - list database ranges +if (const auto pDBs = m_pSourceShell->GetDocument().GetDBCollection()) +{ +const auto& rNamedDBs = pDBs->getNamedDBs(); +for (const auto& rNamedDB : rNamedDBs) +m_xLbRanges->append_text(rNamedDB->GetName()); +} } m_xLbRanges->thaw();
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sc/source
sc/source/ui/miscdlgs/linkarea.cxx |8 1 file changed, 8 insertions(+) New commits: commit 0290a06c016186588720d73d6786acdc9f3880e6 Author: Andreas Heinisch AuthorDate: Fri Jul 28 09:37:47 2023 +0200 Commit: Eike Rathke CommitDate: Sat Jul 29 20:42:15 2023 +0200 tdf#142600 - External links dialog: list database ranges Regression from commit 462f9d1f589a7afd66d3fc61925467d3b68e5b31 where the database ranges were dropped. Change-Id: Ic0e453fc6fe62849d72b6acf88ed7ebd3c47775b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155009 Reviewed-by: Eike Rathke Tested-by: Jenkins (cherry picked from commit 2f2cd7558e1d01f9670436412d62d03f28bab2c1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155031 diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx index 09cfe6c3c285..6b1716407561 100644 --- a/sc/source/ui/miscdlgs/linkarea.cxx +++ b/sc/source/ui/miscdlgs/linkarea.cxx @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -259,6 +260,13 @@ void ScLinkedAreaDlg::UpdateSourceRanges() m_xLbRanges->append_text(pRangeData->GetName()); } } +// tdf#142600 - list database ranges +if (const auto pDBs = m_pSourceShell->GetDocument().GetDBCollection()) +{ +const auto& rNamedDBs = pDBs->getNamedDBs(); +for (const auto& rNamedDB : rNamedDBs) +m_xLbRanges->append_text(rNamedDB->GetName()); +} } m_xLbRanges->thaw();
[Libreoffice-commits] core.git: sc/source
sc/source/ui/miscdlgs/linkarea.cxx |8 1 file changed, 8 insertions(+) New commits: commit 2f2cd7558e1d01f9670436412d62d03f28bab2c1 Author: Andreas Heinisch AuthorDate: Fri Jul 28 09:37:47 2023 +0200 Commit: Andreas Heinisch CommitDate: Fri Jul 28 18:37:46 2023 +0200 tdf#142600 - External links dialog: list database ranges Regression from commit 462f9d1f589a7afd66d3fc61925467d3b68e5b31 where the database ranges were dropped. Change-Id: Ic0e453fc6fe62849d72b6acf88ed7ebd3c47775b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155009 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx index 09cfe6c3c285..6b1716407561 100644 --- a/sc/source/ui/miscdlgs/linkarea.cxx +++ b/sc/source/ui/miscdlgs/linkarea.cxx @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -259,6 +260,13 @@ void ScLinkedAreaDlg::UpdateSourceRanges() m_xLbRanges->append_text(pRangeData->GetName()); } } +// tdf#142600 - list database ranges +if (const auto pDBs = m_pSourceShell->GetDocument().GetDBCollection()) +{ +const auto& rNamedDBs = pDBs->getNamedDBs(); +for (const auto& rNamedDB : rNamedDBs) +m_xLbRanges->append_text(rNamedDB->GetName()); +} } m_xLbRanges->thaw();
[Libreoffice-commits] core.git: cui/source sw/qa
cui/source/dialogs/hltpbase.cxx | 33 ++ sw/qa/uitest/writer_tests3/hyperlinkdialog.py | 16 2 files changed, 45 insertions(+), 4 deletions(-) New commits: commit 89d3735e05b98223a49a387421386fd736fc3de6 Author: Andreas Heinisch AuthorDate: Wed Jul 26 10:31:56 2023 +0200 Commit: Andreas Heinisch CommitDate: Thu Jul 27 09:01:57 2023 +0200 tdf#146576 - Propose clipboard content when inserting a hyperlink Change-Id: I30067b88b3d1e196f7ecfd150f5215cc93adf095 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154931 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index 01776c80d25e..f2448460ee66 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -450,14 +450,39 @@ void SvxHyperlinkTabPageBase::Reset( const SfxItemSet& rItemSet) if ( pHyperlinkItem ) { +// tdf#146576 - propose clipboard content when inserting a hyperlink +OUString aStrURL(pHyperlinkItem->GetURL()); +// Store initial URL +maStrInitURL = aStrURL; +if (aStrURL.isEmpty()) +{ +if (auto xClipboard = GetSystemClipboard()) +{ +if (auto xTransferable = xClipboard->getContents()) +{ +css::datatransfer::DataFlavor aFlavor; + SotExchange::GetFormatDataFlavor(SotClipboardFormatId::STRING, aFlavor); +if (xTransferable->isDataFlavorSupported(aFlavor)) +{ +OUString aClipBoardConentent; +if (xTransferable->getTransferData(aFlavor) >>= aClipBoardConentent) +{ +INetURLObject aURL; +aURL.SetSmartURL(aClipBoardConentent); +if (!aURL.HasError()) +aStrURL += aURL.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous); +} +} +} +} +} + // set dialog-fields FillStandardDlgFields (pHyperlinkItem); // set all other fields -FillDlgFields ( pHyperlinkItem->GetURL() ); - -// Store initial URL -maStrInitURL = pHyperlinkItem->GetURL(); +FillDlgFields(aStrURL); } } diff --git a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py index 6390310810d5..531b5f42a866 100644 --- a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py +++ b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py @@ -105,6 +105,22 @@ class HyperlinkDialog(UITestCase): # i.e. the last used tab in the hyperlink dialog was not remembered self.assertEqual("1", get_state_as_dict(xTab)["CurrPagePos"]) +def test_tdf146576_propose_clipboard_content(self): +with self.ui_test.create_doc_in_start_center("writer"): +# Insert a sample URL +xWriterDoc = self.xUITest.getTopFocusWindow() +xWriterEdit = xWriterDoc.getChild("writer_edit") +xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "www.libreoffice.org"})) + +# Copy URL and open the hyperlink dialog +self.xUITest.executeCommand(".uno:SelectAll") +self.xUITest.executeCommand(".uno:Copy") +with self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog", close_button="cancel") as xDialog: +xTab = xDialog.getChild("tabcontrol") +select_pos(xTab, "0") +# Check if the content of the clipboard is proposed as URL in the hyperlink dialog +xTarget = xDialog.getChild("target") +self.assertEqual(get_state_as_dict(xTarget)["Text"].lower(), "http://www.libreoffice.org/;) def test_tdf141166(self): # Skip this test for --with-help=html and --with-help=online, as that would fail with a
[Libreoffice-commits] core.git: basic/source include/basic sfx2/source uui/inc uui/source
basic/source/basmgr/basmgr.cxx | 13 + basic/source/classes/image.cxx | 40 +--- basic/source/classes/sbxmod.cxx |4 ++-- basic/source/inc/filefmt.hxx|1 - basic/source/inc/image.hxx |1 + basic/source/uno/scriptcont.cxx |2 +- include/basic/basmgr.hxx|6 +++--- include/basic/sbmod.hxx |2 +- sfx2/source/appl/appbaslib.cxx |4 ++-- sfx2/source/doc/objstor.cxx |2 +- sfx2/source/inc/appbaslib.hxx |2 +- uui/inc/ids.hrc |2 +- uui/source/iahndl.cxx | 16 +++- 13 files changed, 30 insertions(+), 65 deletions(-) New commits: commit 17154ceafe4b96b43fdc9994736e378d6a11f3e4 Author: Andreas Heinisch AuthorDate: Wed Mar 29 12:01:07 2023 +0200 Commit: Andreas Heinisch CommitDate: Mon Jul 24 13:55:28 2023 +0200 tdf#92620 - Adjust error message about exceeding legacy module size Adjusted the error message about exceeding legacy module size and removed the code for saving image version 11. Modules using image version 11 still can be loaded. Saving modules always result in an image version higher than image version 11 depending on the size of the module. In addition, some minor performance issues (construction of the error message and the correct list of modules) were fixed. Change-Id: I3bde9fcc1596b63446193c836fa7b5cb06eb7d97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149687 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 206b917b7edd..f7a4fb2ae192 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -1390,7 +1390,7 @@ void BasicManager::SetGlobalUNOConstant( const OUString& rName, const uno::Any& pStandardLib->Insert( xUnoObj.get() ); } -bool BasicManager::LegacyPsswdBinaryLimitExceeded( std::vector< OUString >& _out_rModuleNames ) +bool BasicManager::ImgVersion12PsswdBinaryLimitExceeded( std::vector< OUString >& _out_rModuleNames ) { try { @@ -1409,19 +1409,16 @@ bool BasicManager::LegacyPsswdBinaryLimitExceeded( std::vector< OUString >& _out uno::Reference< container::XNameAccess > xScriptLibrary( xScripts->getByName( scriptElementName ), uno::UNO_QUERY_THROW ); const uno::Sequence< OUString > aElementNames( xScriptLibrary->getElementNames() ); -sal_Int32 nLen = aElementNames.getLength(); - -std::vector< OUString > aBigModules( nLen ); -sal_Int32 nBigModules = 0; +std::vector aBigModules; for ( auto const & libraryElementName : aElementNames ) { SbModule* pMod = pBasicLib->FindModule( libraryElementName ); -if ( pMod && pMod->ExceedsLegacyModuleSize() ) -aBigModules[ nBigModules++ ] = libraryElementName; +if ( pMod && pMod->ExceedsImgVersion12ModuleSize() ) +aBigModules.push_back(libraryElementName); } -if ( nBigModules ) +if (!aBigModules.empty()) { _out_rModuleNames.swap(aBigModules); return true; diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index eab5fe9e0905..ee490947029e 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -373,31 +373,13 @@ done: bool SbiImage::Save( SvStream& r, sal_uInt32 nVer ) { -bool bLegacy = ( nVer < B_IMG_VERSION_12 ); - -// detect if old code exceeds legacy limits -// if so, then disallow save -if ( bLegacy && ExceedsLegacyLimits() ) -{ -SbiImage aEmptyImg; -aEmptyImg.aName = aName; -aEmptyImg.Save( r, B_IMG_VERSION_11 ); -return true; -} // First of all the header sal_uInt64 nStart = SbiOpenRecord( r, FileOffset::Module, 1 ); sal_uInt64 nPos; eCharSet = GetSOStoreTextEncoding( eCharSet ); -if ( bLegacy ) -{ -r.WriteInt32( B_IMG_VERSION_11 ); -} -else -{ -r.WriteInt32( nVer ); -} -r .WriteInt32( eCharSet ) +r .WriteInt32( nVer ) + .WriteInt32( eCharSet ) .WriteInt32( nDimBase ) .WriteInt16( static_cast(nFlags) ) .WriteInt16( 0 ) @@ -429,17 +411,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer ) if (aCode.size() && r.good()) { nPos = SbiOpenRecord( r, FileOffset::PCode, 1 ); -if ( bLegacy ) -{ -PCodeBuffConvertor aNewToLegacy(aCode.data(), aCode.size()); -aNewToLegacy.convert(); -aLegacyPCode = aNewToLegacy.GetBuffer(); -r.WriteBytes(aLegacyPCode.data(), aLegacyPCode.size()); -} -else -{ -r.WriteBytes(aCode.data(), aCode.size()); -} +r.WriteBytes(aCode.data(),
[Libreoffice-commits] core.git: helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3a23c6c7a38317794cc7e8894e6a82f4418c8c6d Author: Andreas Heinisch AuthorDate: Fri Jul 21 14:02:56 2023 +0200 Commit: Gerrit Code Review CommitDate: Fri Jul 21 14:02:56 2023 +0200 Update git submodules * Update helpcontent2 from branch 'master' to 1c52b29e3858fd600a651635d4d4172a4a5d04d9 - tdf#155148 - Reflect the fact that CDbl/Csng is locale dependent Change-Id: I67374217490e3016c20065bf39118de8106549a5 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/154695 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/helpcontent2 b/helpcontent2 index 0a11014c12d1..1c52b29e3858 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 0a11014c12d12432e66be19775a44761a8282599 +Subproject commit 1c52b29e3858fd600a651635d4d4172a4a5d04d9
[Libreoffice-commits] help.git: source/text
source/text/sbasic/shared/03100900.xhp |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 1c52b29e3858fd600a651635d4d4172a4a5d04d9 Author: Andreas Heinisch AuthorDate: Fri Jul 21 09:33:13 2023 +0200 Commit: Olivier Hallot CommitDate: Fri Jul 21 14:02:55 2023 +0200 tdf#155148 - Reflect the fact that CDbl/Csng is locale dependent Change-Id: I67374217490e3016c20065bf39118de8106549a5 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/154695 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/source/text/sbasic/shared/03100900.xhp b/source/text/sbasic/shared/03100900.xhp index 2a477f5a6e..4870bdf735 100644 --- a/source/text/sbasic/shared/03100900.xhp +++ b/source/text/sbasic/shared/03100900.xhp @@ -46,7 +46,7 @@ - Expression: Any string or numeric expression that you want to convert. To convert a string expression, the number must be entered using a dot "." as the decimal point and a comma "," as the thousands separator (for instance 123,456.78), which may differ from your %PRODUCTNAME language settings. + Expression: Any string or numeric expression that you want to convert. To convert a string expression, the number must be entered as normal text using the default number format of your %PRODUCTNAME language settings. For instance, the number must be entered using a dot "." as the decimal point and a comma "," as the thousands separator (for instance 123,456.78) for the English language setting.
[Libreoffice-commits] core.git: sd/qa
sd/qa/unit/uiimpress.cxx | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) New commits: commit fd361874d5c4da99dec763dfdc9c4dd21dfe34a6 Author: Andreas Heinisch AuthorDate: Mon Jul 17 10:57:56 2023 +0200 Commit: Andreas Heinisch CommitDate: Wed Jul 19 10:12:41 2023 +0200 tdf#130581 - Improve unit test of undo command for hide/show slides The test has the following structure: 1. The first slide will be selected and set to hidden 2. Then, the test checks if the slide is hidden and if there is the undo command for hiding the slide 3. Second, hiding the slide will be undone 4. Again, the test checks if the slide is visible and if there is the redo command for hiding the slide Finally, the same actions will be tested using the show slide command where the tests checks for two undo actions, i.e., show and hide slide. Change-Id: I8e9c4905f4ebbb45d872f5e6ca76179dbfae3a31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154464 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index 3a1c2ad911aa..acc3fabe5494 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -493,7 +493,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf100950) CPPUNIT_ASSERT(rPageSelector.IsPageSelected(2)); } -CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130581) +CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130581_undo_hide_show_slide) { createSdImpressDoc(); @@ -505,9 +505,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130581) auto pXImpressDocument = dynamic_cast(mxComponent.get()); SdDrawDocument* pDocument = pXImpressDocument->GetDoc(); sd::UndoManager* pUndoManager = pDocument->GetUndoManager(); -// Without the fix in place, this test would have failed with -// - Expected: 1 -// - Actual : 0 +// Check if there is the correct undo action, i.e., hide slide CPPUNIT_ASSERT_EQUAL(static_cast(1), pUndoManager->GetUndoActionCount()); CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_HIDE_SLIDE), pUndoManager->GetUndoActionComment()); sd::slidesorter::SlideSorterViewShell* pSSVS = getSlideSorterViewShell(); @@ -518,10 +516,8 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130581) CPPUNIT_ASSERT_EQUAL(true, rPageSelector.IsPageExcluded(0)); // Undo hide slide action and check the number of available redo actions +// including the correct undo action, i.e., hide slide dispatchCommand(mxComponent, ".uno:Undo", {}); -// Without the fix in place, this test would have failed with -// - Expected: 1 -// - Actual : 0 CPPUNIT_ASSERT_EQUAL(static_cast(1), pUndoManager->GetRedoActionCount()); CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_HIDE_SLIDE), pUndoManager->GetRedoActionComment()); CPPUNIT_ASSERT_EQUAL(false, rPageSelector.IsPageExcluded(0)); @@ -530,18 +526,14 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130581) dispatchCommand(mxComponent, ".uno:Redo", {}); CPPUNIT_ASSERT_EQUAL(true, rPageSelector.IsPageExcluded(0)); dispatchCommand(mxComponent, ".uno:ShowSlide", {}); -// Without the fix in place, this test would have failed with -// - Expected: 2 -// - Actual : 0 +// There should be two undo actions, i.e., show and hide slide CPPUNIT_ASSERT_EQUAL(static_cast(2), pUndoManager->GetUndoActionCount()); CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_SHOW_SLIDE), pUndoManager->GetUndoActionComment()); CPPUNIT_ASSERT_EQUAL(false, rPageSelector.IsPageExcluded(0)); -// Undo show slide action and check the number of available undo/redo actions +// Undo show slide and check the number of available undo/redo actions dispatchCommand(mxComponent, ".uno:Undo", {}); -// Without the fix in place, this test would have failed with -// - Expected: 1 -// - Actual : 0 +// There should be one undo action, i.e., hide slide, and one redo action, i.e., show slide CPPUNIT_ASSERT_EQUAL(static_cast(1), pUndoManager->GetUndoActionCount()); CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_HIDE_SLIDE), pUndoManager->GetUndoActionComment()); CPPUNIT_ASSERT_EQUAL(static_cast(1), pUndoManager->GetRedoActionCount());
[Libreoffice-commits] core.git: sw/source
sw/source/core/tox/tox.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit c4bbd05d506c14a29cfb07f118f710c11958d83c Author: Andreas Heinisch AuthorDate: Tue Jul 18 09:04:56 2023 +0200 Commit: Andreas Heinisch CommitDate: Tue Jul 18 10:52:06 2023 +0200 tdf#156325 - Index of tables: support ctrl + click on an item Change-Id: I6de76d946ab0810cc3c2ba9fbec5d3c1db043a1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154574 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index d87e78c002fd..04f43e5d41f8 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -350,7 +350,9 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237# } SwFormTokens aTokens; -if (TOX_CONTENT == m_eType || TOX_ILLUSTRATIONS == m_eType ) +const bool bNeedsLink += TOX_CONTENT == m_eType || TOX_ILLUSTRATIONS == m_eType || TOX_TABLES == m_eType; +if (bNeedsLink) { SwFormToken aLinkStt (TOKEN_LINK_START); aLinkStt.sCharStyleName = SwResId(STR_POOLCHR_TOXJUMP); @@ -378,7 +380,7 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237# aTokens.emplace_back(TOKEN_PAGE_NUMS); } -if (TOX_CONTENT == m_eType || TOX_ILLUSTRATIONS == m_eType) +if (bNeedsLink) aTokens.emplace_back(TOKEN_LINK_END); SetTemplate(0, SwResId(*pPoolId++));
[Libreoffice-commits] core.git: sd/inc sd/qa sd/source
sd/inc/strings.hrc |2 sd/qa/unit/uiimpress.cxx| 58 ++ sd/source/ui/inc/unmodpg.hxx| 28 sd/source/ui/slidesorter/controller/SlsPageSelector.cxx | 18 +++ sd/source/ui/slidesorter/controller/SlsSlotManager.cxx |9 + sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx | 14 ++ sd/source/ui/view/unmodpg.cxx | 69 7 files changed, 198 insertions(+) New commits: commit 2b3a950e937efe77ad39b034819c9f7a707fe29e Author: Andreas Heinisch AuthorDate: Wed Jun 21 10:07:02 2023 +0200 Commit: Andreas Heinisch CommitDate: Mon Jul 17 09:11:29 2023 +0200 tdf#130581 - Add undo command for hide/show slides Change-Id: I7305e222df65fda6523940ca63f5759857c94bea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153375 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc index 0d9303e18bea..afcf1d4e3be3 100644 --- a/sd/inc/strings.hrc +++ b/sd/inc/strings.hrc @@ -130,6 +130,8 @@ #define STR_UNDO_INSERT_FILE NC_("STR_UNDO_INSERT_FILE", "Insert file") #define STR_UNDO_INSERT_SPECCHAR NC_("STR_UNDO_INSERT_SPECCHAR", "Insert special character") #define STR_UNDO_SET_PRESLAYOUT NC_("STR_UNDO_SET_PRESLAYOUT", "Apply presentation layout") +#define STR_UNDO_HIDE_SLIDE NC_("STR_UNDO_HIDE_SLIDE", "Hide slide") +#define STR_UNDO_SHOW_SLIDE NC_("STR_UNDO_SHOW_SLIDE", "Show slide") #define STR_PLAYNC_("STR_PLAY", "~Play") #define STR_STOPNC_("STR_STOP", "Sto~p") #define STR_UNDO_ORIGINALSIZE NC_("STR_UNDO_ORIGINALSIZE", "Original Size") diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index c4cdc0a5e338..3a1c2ad911aa 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -56,6 +56,8 @@ #include #include #include +#include +#include using namespace ::com::sun::star; @@ -491,6 +493,62 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf100950) CPPUNIT_ASSERT(rPageSelector.IsPageSelected(2)); } +CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130581) +{ +createSdImpressDoc(); + +// Hide slide and check the number of available undo actions +dispatchCommand(mxComponent, ".uno:ShowSlide", {}); +dispatchCommand(mxComponent, ".uno:HideSlide", {}); + +// There should be a single undo action, i.e., hide slide +auto pXImpressDocument = dynamic_cast(mxComponent.get()); +SdDrawDocument* pDocument = pXImpressDocument->GetDoc(); +sd::UndoManager* pUndoManager = pDocument->GetUndoManager(); +// Without the fix in place, this test would have failed with +// - Expected: 1 +// - Actual : 0 +CPPUNIT_ASSERT_EQUAL(static_cast(1), pUndoManager->GetUndoActionCount()); +CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_HIDE_SLIDE), pUndoManager->GetUndoActionComment()); +sd::slidesorter::SlideSorterViewShell* pSSVS = getSlideSorterViewShell(); + +// Check if the page is actually hidden +auto& rSSController = pSSVS->GetSlideSorter().GetController(); +auto& rPageSelector = rSSController.GetPageSelector(); +CPPUNIT_ASSERT_EQUAL(true, rPageSelector.IsPageExcluded(0)); + +// Undo hide slide action and check the number of available redo actions +dispatchCommand(mxComponent, ".uno:Undo", {}); +// Without the fix in place, this test would have failed with +// - Expected: 1 +// - Actual : 0 +CPPUNIT_ASSERT_EQUAL(static_cast(1), pUndoManager->GetRedoActionCount()); +CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_HIDE_SLIDE), pUndoManager->GetRedoActionComment()); +CPPUNIT_ASSERT_EQUAL(false, rPageSelector.IsPageExcluded(0)); + +// Show slide and check the number of available undo actions +dispatchCommand(mxComponent, ".uno:Redo", {}); +CPPUNIT_ASSERT_EQUAL(true, rPageSelector.IsPageExcluded(0)); +dispatchCommand(mxComponent, ".uno:ShowSlide", {}); +// Without the fix in place, this test would have failed with +// - Expected: 2 +// - Actual : 0 +CPPUNIT_ASSERT_EQUAL(static_cast(2), pUndoManager->GetUndoActionCount()); +CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_SHOW_SLIDE), pUndoManager->GetUndoActionComment()); +CPPUNIT_ASSERT_EQUAL(false, rPageSelector.IsPageExcluded(0)); + +// Undo show slide action and check the number of available undo/redo actions +dispatchCommand(mxComponent, ".uno:Undo", {}); +// Without the fix in place, this test would have failed with +// - Expected: 1 +// - Actual : 0 +CPPUNIT_ASSERT_EQUAL(static_cast(1), pUndoManager->GetUndoActionCount()); +CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_HIDE_SLIDE),
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - 3 commits - basegfx/source dbaccess/source include/unotools oox/qa oox/source sfx2/source sw/qa sw/source unotools/source
basegfx/source/tools/bgradient.cxx | 14 dbaccess/source/ui/app/AppController.cxx|2 include/unotools/historyoptions.hxx |4 oox/qa/unit/data/tdf155852_MCGR_StepCount4.fodp | 637 oox/qa/unit/mcgr.cxx| 25 oox/source/export/drawingml.cxx | 10 sfx2/source/appl/newhelp.cxx|3 sfx2/source/appl/sfxpicklist.cxx|3 sw/qa/extras/htmlexport/data/tdf155871.fodt | 21 sw/qa/extras/htmlexport/htmlexport.cxx | 12 sw/source/filter/html/htmlnumwriter.cxx |2 unotools/source/config/historyoptions.cxx | 68 +- 12 files changed, 764 insertions(+), 37 deletions(-) New commits: commit 0e54294046c33cd2bbda6318ee61242dbfd8dcf6 Author: Andreas Heinisch AuthorDate: Thu Jun 15 19:48:18 2023 +0200 Commit: Xisco Fauli CommitDate: Tue Jun 20 09:11:25 2023 +0200 tdf#38742 - Start Center: move last opened documents to the top Change-Id: If395b0784d9bdcdc1200c15fca60647da825ea1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153150 Tested-by: Jenkins Reviewed-by: Andreas Heinisch (cherry picked from commit 760c7a806ced3861086d5fdfbb7b4b1461948c27) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153227 Reviewed-by: Xisco Fauli diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 175f56b39724..ad18bff5892c 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -361,7 +361,7 @@ void SAL_CALL OApplicationController::disposing() aURL.GetURLNoPass( INetURLObject::DecodeMechanism::NONE ), aFilter, getStrippedDatabaseName(), -std::nullopt, std::nullopt, std::nullopt); +std::nullopt, std::nullopt); // add to recent document list if ( aURL.GetProtocol() == INetProtocol::File ) diff --git a/include/unotools/historyoptions.hxx b/include/unotools/historyoptions.hxx index 53b9fcdfa805..b2388de2ad4b 100644 --- a/include/unotools/historyoptions.hxx +++ b/include/unotools/historyoptions.hxx @@ -73,13 +73,11 @@ namespace SvtHistoryOptions @param sTitle document title to save in history @param sThumbnail base64 encoded thumbnail of the item @param oIsReadOnly item was opened editable or read-only -@param oIsPinned item is pinned in the user-interface */ UNOTOOLS_DLLPUBLIC void AppendItem(EHistoryType eHistory, const OUString& sURL, const OUString& sFilter, const OUString& sTitle, const std::optional& sThumbnail, - std::optional oIsReadOnly, - std::optional oIsPinned); + std::optional oIsReadOnly); /** Delete item from the specified list. */ diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 5c2d7cf6c0e1..e676bec19d4e 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1175,8 +1175,7 @@ BookmarksTabPage_Impl::~BookmarksTabPage_Impl() for (sal_Int32 i = 0; i < nCount; ++i) { SvtHistoryOptions::AppendItem(EHistoryType::HelpBookmarks, m_xBookmarksBox->get_id(i), "", - m_xBookmarksBox->get_text(i), std::nullopt, std::nullopt, - std::nullopt); + m_xBookmarksBox->get_text(i), std::nullopt, std::nullopt); } m_xBookmarksBox.reset(); diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 2451a8d0cad8..fb676d981d35 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -131,8 +131,7 @@ void SfxPickListImpl::AddDocumentToPickList( const SfxObjectShell* pDocSh ) aFilter, aTitle, aThumbnail, -oIsReadOnly, -std::nullopt); +oIsReadOnly); if ( aURL.GetProtocol() == INetProtocol::File ) Application::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::DecodeMechanism::NONE ), diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index 0b9e4d717b83..2cda950858d2 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -134,7 +134,8 @@ std::vector< HistoryItem > GetList( EHistoryType eHistory ) xSet->getPropertyValue(s_sPassword) >>= aItem.sPassword; xSet->getPropertyValue(s_sThumbnail) >>= aItem.sThumbnail; xSet->getPropertyValue(s_sReadOnly) >>=
[Libreoffice-commits] core.git: dbaccess/source include/unotools sfx2/source unotools/source
dbaccess/source/ui/app/AppController.cxx |2 include/unotools/historyoptions.hxx |4 - sfx2/source/appl/newhelp.cxx |3 - sfx2/source/appl/sfxpicklist.cxx |3 - unotools/source/config/historyoptions.cxx | 68 -- 5 files changed, 51 insertions(+), 29 deletions(-) New commits: commit 760c7a806ced3861086d5fdfbb7b4b1461948c27 Author: Andreas Heinisch AuthorDate: Thu Jun 15 19:48:18 2023 +0200 Commit: Andreas Heinisch CommitDate: Mon Jun 19 07:47:59 2023 +0200 tdf#38742 - Start Center: move last opened documents to the top Change-Id: If395b0784d9bdcdc1200c15fca60647da825ea1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153150 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 175f56b39724..ad18bff5892c 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -361,7 +361,7 @@ void SAL_CALL OApplicationController::disposing() aURL.GetURLNoPass( INetURLObject::DecodeMechanism::NONE ), aFilter, getStrippedDatabaseName(), -std::nullopt, std::nullopt, std::nullopt); +std::nullopt, std::nullopt); // add to recent document list if ( aURL.GetProtocol() == INetProtocol::File ) diff --git a/include/unotools/historyoptions.hxx b/include/unotools/historyoptions.hxx index 53b9fcdfa805..b2388de2ad4b 100644 --- a/include/unotools/historyoptions.hxx +++ b/include/unotools/historyoptions.hxx @@ -73,13 +73,11 @@ namespace SvtHistoryOptions @param sTitle document title to save in history @param sThumbnail base64 encoded thumbnail of the item @param oIsReadOnly item was opened editable or read-only -@param oIsPinned item is pinned in the user-interface */ UNOTOOLS_DLLPUBLIC void AppendItem(EHistoryType eHistory, const OUString& sURL, const OUString& sFilter, const OUString& sTitle, const std::optional& sThumbnail, - std::optional oIsReadOnly, - std::optional oIsPinned); + std::optional oIsReadOnly); /** Delete item from the specified list. */ diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 5c2d7cf6c0e1..e676bec19d4e 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1175,8 +1175,7 @@ BookmarksTabPage_Impl::~BookmarksTabPage_Impl() for (sal_Int32 i = 0; i < nCount; ++i) { SvtHistoryOptions::AppendItem(EHistoryType::HelpBookmarks, m_xBookmarksBox->get_id(i), "", - m_xBookmarksBox->get_text(i), std::nullopt, std::nullopt, - std::nullopt); + m_xBookmarksBox->get_text(i), std::nullopt, std::nullopt); } m_xBookmarksBox.reset(); diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 2451a8d0cad8..fb676d981d35 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -131,8 +131,7 @@ void SfxPickListImpl::AddDocumentToPickList( const SfxObjectShell* pDocSh ) aFilter, aTitle, aThumbnail, -oIsReadOnly, -std::nullopt); +oIsReadOnly); if ( aURL.GetProtocol() == INetProtocol::File ) Application::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::DecodeMechanism::NONE ), diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index 0b9e4d717b83..2cda950858d2 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -134,7 +134,8 @@ std::vector< HistoryItem > GetList( EHistoryType eHistory ) xSet->getPropertyValue(s_sPassword) >>= aItem.sPassword; xSet->getPropertyValue(s_sThumbnail) >>= aItem.sThumbnail; xSet->getPropertyValue(s_sReadOnly) >>= aItem.isReadOnly; -xSet->getPropertyValue(s_sPinned) >>= aItem.isPinned; +if (xSet->getPropertySetInfo()->hasPropertyByName(s_sPinned)) +xSet->getPropertyValue(s_sPinned) >>= aItem.isPinned; aRet.push_back(aItem); } @@ -160,7 +161,7 @@ std::vector< HistoryItem > GetList( EHistoryType eHistory ) void AppendItem(EHistoryType eHistory, const OUString& sURL, const OUString& sFilter, const OUString& sTitle, const std::optional& sThumbnail, -::std::optional const oIsReadOnly,
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - framework/source
framework/source/uielement/recentfilesmenucontroller.cxx | 47 ++- 1 file changed, 34 insertions(+), 13 deletions(-) New commits: commit eb1ee15aeb542fe55b38ba70cc2f9eb962cc245e Author: Andreas Heinisch AuthorDate: Tue Jun 6 23:33:12 2023 +0200 Commit: Xisco Fauli CommitDate: Fri Jun 16 09:27:26 2023 +0200 tdf#155699 - MRU: show pinned documents at the beginning of the list Change-Id: Id08678708ee74a4a278baa1e67930044f25e5d5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152690 Tested-by: Jenkins Reviewed-by: Andreas Heinisch (cherry picked from commit 651d60f79c28c9a8e456817990c21a404c69d700) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153084 Reviewed-by: Xisco Fauli diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 194f66d1476f..e630dda1cba3 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -165,35 +165,50 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > = officecfg::Office::Common::History::ShowCurrentModuleOnly::get(); size_t nItemPosModule = 0; +size_t nItemPosPinned = 0; if (( nPickListMenuItems > 0 ) && !m_bDisabled ) { size_t nItemPos = 0; + +// tdf#155699 - create a lambda to insert a recent document item at a specified position +auto insertHistoryItemAtPos = +[&](const SvtHistoryOptions::HistoryItem& rPickListEntry, const size_t aInsertPosition) +{ +m_aRecentFilesItems.insert(m_aRecentFilesItems.begin() + aInsertPosition, + { rPickListEntry.sURL, rPickListEntry.isReadOnly }); +nItemPos++; +}; + if (m_aModuleName != "com.sun.star.frame.StartModule") { ::comphelper::MimeConfigurationHelper aConfigHelper( comphelper::getProcessComponentContext()); + // Show the first MAX_MENU_ITEMS_PER_MODULE items of the current module // on top of the recent document list. for (int i = 0; i < nPickListMenuItems; i++) { const SvtHistoryOptions::HistoryItem& rPickListEntry = aHistoryList[i]; -const std::pair aPickListEntry(rPickListEntry.sURL, - rPickListEntry.isReadOnly); -if ((nItemPosModule < MAX_MENU_ITEMS_PER_MODULE || bShowCurrentModuleOnly) -&& aConfigHelper.GetDocServiceNameFromFilter(rPickListEntry.sFilter) - == m_aModuleName) + +// tdf#155699 - insert pinned document at the beginning of the list +if (rPickListEntry.isPinned) { -m_aRecentFilesItems.insert(m_aRecentFilesItems.begin() + nItemPosModule, - aPickListEntry); -nItemPos++; +insertHistoryItemAtPos(rPickListEntry, nItemPosPinned); +nItemPosPinned++; nItemPosModule++; } -else if (!bShowCurrentModuleOnly) +// tdf#56696 - insert documents of the current module +else if ((bShowCurrentModuleOnly + || (nItemPosModule - nItemPosPinned) < MAX_MENU_ITEMS_PER_MODULE) + && aConfigHelper.GetDocServiceNameFromFilter(rPickListEntry.sFilter) +== m_aModuleName) { -m_aRecentFilesItems.insert(m_aRecentFilesItems.begin() + nItemPos, - aPickListEntry); -nItemPos++; +insertHistoryItemAtPos(rPickListEntry, nItemPosModule); +nItemPosModule++; } +// Insert all other documents at the end of the list if the expert option is not set +else if (!bShowCurrentModuleOnly) +insertHistoryItemAtPos(rPickListEntry, nItemPos); } } else @@ -201,7 +216,9 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > for (int i = 0; i < nPickListMenuItems; i++) { const SvtHistoryOptions::HistoryItem& rPickListEntry = aHistoryList[i]; -m_aRecentFilesItems.emplace_back(rPickListEntry.sURL, rPickListEntry.isReadOnly); +// tdf#155699 - insert pinned document at the beginning of the list +insertHistoryItemAtPos(rPickListEntry, + rPickListEntry.isPinned ? nItemPosModule++ : nItemPos); } } } @@ -263,6 +280,10 @@ void
[Libreoffice-commits] core.git: framework/source
framework/source/uielement/recentfilesmenucontroller.cxx | 47 ++- 1 file changed, 34 insertions(+), 13 deletions(-) New commits: commit 651d60f79c28c9a8e456817990c21a404c69d700 Author: Andreas Heinisch AuthorDate: Tue Jun 6 23:33:12 2023 +0200 Commit: Andreas Heinisch CommitDate: Thu Jun 15 09:54:55 2023 +0200 tdf#155699 - MRU: show pinned documents at the beginning of the list Change-Id: Id08678708ee74a4a278baa1e67930044f25e5d5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152690 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 194f66d1476f..e630dda1cba3 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -165,35 +165,50 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > = officecfg::Office::Common::History::ShowCurrentModuleOnly::get(); size_t nItemPosModule = 0; +size_t nItemPosPinned = 0; if (( nPickListMenuItems > 0 ) && !m_bDisabled ) { size_t nItemPos = 0; + +// tdf#155699 - create a lambda to insert a recent document item at a specified position +auto insertHistoryItemAtPos = +[&](const SvtHistoryOptions::HistoryItem& rPickListEntry, const size_t aInsertPosition) +{ +m_aRecentFilesItems.insert(m_aRecentFilesItems.begin() + aInsertPosition, + { rPickListEntry.sURL, rPickListEntry.isReadOnly }); +nItemPos++; +}; + if (m_aModuleName != "com.sun.star.frame.StartModule") { ::comphelper::MimeConfigurationHelper aConfigHelper( comphelper::getProcessComponentContext()); + // Show the first MAX_MENU_ITEMS_PER_MODULE items of the current module // on top of the recent document list. for (int i = 0; i < nPickListMenuItems; i++) { const SvtHistoryOptions::HistoryItem& rPickListEntry = aHistoryList[i]; -const std::pair aPickListEntry(rPickListEntry.sURL, - rPickListEntry.isReadOnly); -if ((nItemPosModule < MAX_MENU_ITEMS_PER_MODULE || bShowCurrentModuleOnly) -&& aConfigHelper.GetDocServiceNameFromFilter(rPickListEntry.sFilter) - == m_aModuleName) + +// tdf#155699 - insert pinned document at the beginning of the list +if (rPickListEntry.isPinned) { -m_aRecentFilesItems.insert(m_aRecentFilesItems.begin() + nItemPosModule, - aPickListEntry); -nItemPos++; +insertHistoryItemAtPos(rPickListEntry, nItemPosPinned); +nItemPosPinned++; nItemPosModule++; } -else if (!bShowCurrentModuleOnly) +// tdf#56696 - insert documents of the current module +else if ((bShowCurrentModuleOnly + || (nItemPosModule - nItemPosPinned) < MAX_MENU_ITEMS_PER_MODULE) + && aConfigHelper.GetDocServiceNameFromFilter(rPickListEntry.sFilter) +== m_aModuleName) { -m_aRecentFilesItems.insert(m_aRecentFilesItems.begin() + nItemPos, - aPickListEntry); -nItemPos++; +insertHistoryItemAtPos(rPickListEntry, nItemPosModule); +nItemPosModule++; } +// Insert all other documents at the end of the list if the expert option is not set +else if (!bShowCurrentModuleOnly) +insertHistoryItemAtPos(rPickListEntry, nItemPos); } } else @@ -201,7 +216,9 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > for (int i = 0; i < nPickListMenuItems; i++) { const SvtHistoryOptions::HistoryItem& rPickListEntry = aHistoryList[i]; -m_aRecentFilesItems.emplace_back(rPickListEntry.sURL, rPickListEntry.isReadOnly); +// tdf#155699 - insert pinned document at the beginning of the list +insertHistoryItemAtPos(rPickListEntry, + rPickListEntry.isPinned ? nItemPosModule++ : nItemPos); } } } @@ -263,6 +280,10 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > rPopupMenu->setTipHelpText(sal_uInt16(i + 1), aTipHelpText);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - unotools/source
unotools/source/config/historyoptions.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 2b332cace587fadd645de375c8327e58e7ca10cb Author: Andreas Heinisch AuthorDate: Tue Jun 6 23:22:37 2023 +0200 Commit: Xisco Fauli CommitDate: Mon Jun 12 15:56:49 2023 +0200 tdf#38742 - Start Center: odb files messes up pinned documents Opening an odb file will mess up the pinned documents in the start center. To fix this issue, newly appended items will be moved to their correct position after their creation in the history vector. Change-Id: I991ae3ae1018198e054eba3477bb948d7df85b44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152689 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch (cherry picked from commit 1b368909b09cd62494239faaea09bb500dc9f19d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152880 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index 7578bd190d47..0b9e4d717b83 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -273,7 +273,13 @@ void AppendItem(EHistoryType eHistory, const OUString& sURL, const OUString& sFi if (oIsPinned) { xSet->setPropertyValue(s_sPinned, uno::Any(*oIsPinned)); +if (*oIsPinned) +PrependItem(xCfg, xOrderList, sURL); +else +MoveItemToUnpinned(xCfg, xOrderList, xItemList, sURL); } +else +MoveItemToUnpinned(xCfg, xOrderList, xItemList, sURL); ::comphelper::ConfigurationHelper::flush(xCfg); }
[Libreoffice-commits] core.git: unotools/source
unotools/source/config/historyoptions.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 1b368909b09cd62494239faaea09bb500dc9f19d Author: Andreas Heinisch AuthorDate: Tue Jun 6 23:22:37 2023 +0200 Commit: Andreas Heinisch CommitDate: Thu Jun 8 15:05:33 2023 +0200 tdf#38742 - Start Center: odb files messes up pinned documents Opening an odb file will mess up the pinned documents in the start center. To fix this issue, newly appended items will be moved to their correct position after their creation in the history vector. Change-Id: I991ae3ae1018198e054eba3477bb948d7df85b44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152689 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index 7578bd190d47..0b9e4d717b83 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -273,7 +273,13 @@ void AppendItem(EHistoryType eHistory, const OUString& sURL, const OUString& sFi if (oIsPinned) { xSet->setPropertyValue(s_sPinned, uno::Any(*oIsPinned)); +if (*oIsPinned) +PrependItem(xCfg, xOrderList, sURL); +else +MoveItemToUnpinned(xCfg, xOrderList, xItemList, sURL); } +else +MoveItemToUnpinned(xCfg, xOrderList, xItemList, sURL); ::comphelper::ConfigurationHelper::flush(xCfg); }
[Libreoffice-commits] core.git: dbaccess/source icon-themes/breeze icon-themes/breeze_dark icon-themes/breeze_dark_svg icon-themes/breeze_svg icon-themes/colibre icon-themes/colibre_dark icon-themes/c
dbaccess/source/ui/app/AppController.cxx|2 icon-themes/breeze/res/recentdoc_pin.png|binary icon-themes/breeze/res/recentdoc_pin_highlighted.png|binary icon-themes/breeze_dark/res/recentdoc_pin.png |binary icon-themes/breeze_dark/res/recentdoc_pin_highlighted.png |binary icon-themes/breeze_dark_svg/res/recentdoc_pin.svg |1 icon-themes/breeze_dark_svg/res/recentdoc_pin_highlighted.svg | 14 icon-themes/breeze_svg/res/recentdoc_pin.svg|1 icon-themes/breeze_svg/res/recentdoc_pin_highlighted.svg| 14 icon-themes/colibre/res/recentdoc_pin.png |binary icon-themes/colibre/res/recentdoc_pin_highlighted.png |binary icon-themes/colibre_dark/res/recentdoc_pin.png |binary icon-themes/colibre_dark/res/recentdoc_pin_highlighted.png |binary icon-themes/colibre_dark_svg/res/recentdoc_pin.svg |1 icon-themes/colibre_dark_svg/res/recentdoc_pin_highlighted.svg | 14 icon-themes/colibre_svg/res/recentdoc_pin.svg |1 icon-themes/colibre_svg/res/recentdoc_pin_highlighted.svg | 14 icon-themes/elementary/res/recentdoc_pin.png|binary icon-themes/elementary/res/recentdoc_pin_highlighted.png|binary icon-themes/elementary_svg/res/recentdoc_pin.svg|1 icon-themes/elementary_svg/res/recentdoc_pin_highlighted.svg| 14 icon-themes/sifr/res/recentdoc_pin.png |binary icon-themes/sifr/res/recentdoc_pin_highlighted.png |binary icon-themes/sifr_dark/res/recentdoc_pin.png |binary icon-themes/sifr_dark/res/recentdoc_pin_highlighted.png |binary icon-themes/sifr_dark_svg/res/recentdoc_pin.svg |1 icon-themes/sifr_dark_svg/res/recentdoc_pin_highlighted.svg | 14 icon-themes/sifr_svg/res/recentdoc_pin.svg |1 icon-themes/sifr_svg/res/recentdoc_pin_highlighted.svg | 14 icon-themes/sukapura/res/pin_document.png |binary icon-themes/sukapura/res/recentdoc_pin.png |binary icon-themes/sukapura/res/recentdoc_pin_highlighted.png |binary icon-themes/sukapura/res/unpin_document.png |binary icon-themes/sukapura_dark/res/pin_document.png |binary icon-themes/sukapura_dark/res/recentdoc_pin.png |binary icon-themes/sukapura_dark/res/recentdoc_pin_highlighted.png |binary icon-themes/sukapura_dark/res/unpin_document.png|binary icon-themes/sukapura_dark_svg/res/pin_document.svg |7 icon-themes/sukapura_dark_svg/res/recentdoc_pin.svg |1 icon-themes/sukapura_dark_svg/res/recentdoc_pin_highlighted.svg | 14 icon-themes/sukapura_dark_svg/res/unpin_document.svg| 17 + icon-themes/sukapura_svg/res/recentdoc_pin.svg |1 icon-themes/sukapura_svg/res/recentdoc_pin_highlighted.svg | 14 include/sfx2/thumbnailviewitem.hxx | 10 include/unotools/historyoptions.hxx | 25 + officecfg/registry/schema/org/openoffice/Office/Histories.xcs |5 sfx2/inc/bitmaps.hlst |2 sfx2/inc/recentdocsview.hxx |3 sfx2/source/appl/newhelp.cxx|4 sfx2/source/appl/sfxpicklist.cxx|3 sfx2/source/control/recentdocsview.cxx | 10 sfx2/source/control/recentdocsviewitem.cxx | 14 sfx2/source/control/recentdocsviewitem.hxx |6 sfx2/source/control/thumbnailview.cxx | 14 sfx2/source/control/thumbnailviewitem.cxx | 47 ++ unotools/source/config/historyoptions.cxx | 165 -- 56 files changed, 421 insertions(+), 48 deletions(-) New commits: commit 436f3f8eb5b45620842351a1f29ba49571043515 Author: Andreas Heinisch AuthorDate: Mon May 22 22:46:55 2023 +0200 Commit: Andreas Heinisch CommitDate: Tue Jun 6 07:08:09 2023 +0200 tdf#38742 - Start Center: introduce push pins to favorite documents Change-Id: I879e4d93e1da222d9acabb776552ca1cf819574b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152136 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index ad18bff5892c..175f56b39724 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -361,7 +361,7 @@ void SAL_CALL OApplicationController::disposing() aURL.GetURLNoPass(
[Libreoffice-commits] core.git: sc/source
sc/source/ui/attrdlg/attrdlg.cxx |9 + 1 file changed, 9 insertions(+) New commits: commit c1893df42567c260ca5fb069038d1a55616e7b7f Author: Andreas Heinisch AuthorDate: Thu Jun 1 09:08:05 2023 +0200 Commit: Andreas Heinisch CommitDate: Thu Jun 1 10:55:41 2023 +0200 tdf#149598 - Remember window state of the format cell dialog Change-Id: Ie3b468c674a9a811a5359155cda1d96ed44e50fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152474 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx index ad0a82542c3e..7a80073d9da3 100644 --- a/sc/source/ui/attrdlg/attrdlg.cxx +++ b/sc/source/ui/attrdlg/attrdlg.cxx @@ -31,11 +31,17 @@ #include #include #include +#include ScAttrDlg::ScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs) : SfxTabDialogController(pParent, "modules/scalc/ui/formatcellsdialog.ui", "FormatCellsDialog", pCellAttrs) { +// tdf#149598 - restore window state of the dialog +SvtViewOptions aDlgOpt(EViewType::Dialog, "FormatCellDialog"); +if (aDlgOpt.Exists()) +m_xDialog->set_window_state(aDlgOpt.GetWindowState()); + SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageCreatorFunc fail!"); @@ -67,6 +73,9 @@ ScAttrDlg::ScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs) ScAttrDlg::~ScAttrDlg() { +// tdf#149598 - remember window state of the dialog +SvtViewOptions aDlgOpt(EViewType::Dialog, "FormatCellDialog"); + aDlgOpt.SetWindowState(m_xDialog->get_window_state(vcl::WindowDataMask::PosSize)); } void ScAttrDlg::PageCreated(const OUString& rPageId, SfxTabPage& rTabPage)
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/ucalc_copypaste.cxx | 14 -- sc/qa/unit/uicalc/uicalc.cxx | 35 +++ sc/source/core/data/document.cxx |5 +++-- 3 files changed, 46 insertions(+), 8 deletions(-) New commits: commit 535f8fde0c33c435e4a8e9f768003516ce933666 Author: Andreas Heinisch AuthorDate: Mon May 15 09:01:21 2023 +0200 Commit: Andreas Heinisch CommitDate: Tue May 16 11:05:04 2023 +0200 tdf#141440 - Do not delete notes when pasting contents Contents include cells with values, datetimes, strings, formulas, outlines, and sparklines. Change-Id: I9acf3a33c7723300d6b85f0abe468db28de6ebcb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151759 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/qa/unit/ucalc_copypaste.cxx b/sc/qa/unit/ucalc_copypaste.cxx index 43f9272a13c0..695b5b8f6214 100644 --- a/sc/qa/unit/ucalc_copypaste.cxx +++ b/sc/qa/unit/ucalc_copypaste.cxx @@ -9407,10 +9407,11 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty) // Check the content after the paste. { +// tdf#141440 - do not delete notes when pasting contents static const Check aChecks[] = { -{ "Clip1", COL_YELLOW, false }, { "B", COL_BLUE, true }, -{ "Clip2", COL_YELLOW, false }, { "D", COL_BLUE, true }, -{ "Clip3", COL_YELLOW, false }, +{ "Clip1", COL_YELLOW, true }, { "B", COL_BLUE, true }, +{ "Clip2", COL_YELLOW, true }, { "D", COL_BLUE, true }, +{ "Clip3", COL_YELLOW, true }, }; bool bRes @@ -9434,10 +9435,11 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty) // Redo, and check the content again. aUndo.Redo(); { +// tdf#141440 - do not delete notes when pasting contents static const Check aChecks[] = { -{ "Clip1", COL_YELLOW, false }, { "B", COL_BLUE, true }, -{ "Clip2", COL_YELLOW, false }, { "D", COL_BLUE, true }, -{ "Clip3", COL_YELLOW, false }, +{ "Clip1", COL_YELLOW, true }, { "B", COL_BLUE, true }, +{ "Clip2", COL_YELLOW, true }, { "D", COL_BLUE, true }, +{ "Clip3", COL_YELLOW, true }, }; bool bRes diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index d3ae6e4d02fe..a6854ae76d56 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -1893,6 +1893,41 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf150219) CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 0, 1))); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf141440) +{ +createScDoc(); +ScDocument* pDoc = getScDoc(); + +// Insert a note to cell A1 +goToCell("A1"); +uno::Sequence aArgs += comphelper::InitPropertySequence({ { "Text", uno::Any(OUString("Note in A1")) } }); +dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs); + +// Insert a formula to cell A2 +insertStringToCell("A2", u"=1+1"); +CPPUNIT_ASSERT_EQUAL(OUString("2"), pDoc->GetString(ScAddress(0, 1, 0))); + +// Copy content of A2 to A1 using paste special command as a formula (Flags F) +goToCell("A2"); +dispatchCommand(mxComponent, ".uno:Copy", {}); +goToCell("A1"); +aArgs = comphelper::InitPropertySequence( +{ { "Flags", uno::Any(OUString("F")) }, + { "FormulaCommand", uno::Any(sal_uInt16(ScPasteFunc::ADD)) }, + { "SkipEmptyCells", uno::Any(false) }, + { "Transpose", uno::Any(false) }, + { "AsLink", uno::Any(false) }, + { "MoveMode", uno::Any(sal_uInt16(InsCellCmd::INS_NONE)) } }); +dispatchCommand(mxComponent, ".uno:InsertContents", aArgs); + +// Check if string in cell A2 was copied to cell A1 +CPPUNIT_ASSERT_EQUAL(OUString("2"), pDoc->GetString(ScAddress(0, 0, 0))); +// Without the fix in place, there would be no note in cell A1 after using paste special +CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0))); +CPPUNIT_ASSERT_EQUAL(OUString("Note in A1"), pDoc->GetNote(ScAddress(0, 0, 0))->GetText()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 25d0363c35f4..cab1dc364b31 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2905,8 +2905,9 @@ void ScDocument::CopyFromClip( InsertDeleteFlags nDelFlag = InsertDeleteFlags::NONE; if ( (nInsFlag & (InsertDeleteFlags::CONTENTS | InsertDeleteFlags::ADDNOTES)) == (InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES) ) nDelFlag |= InsertDeleteFlags::NOTE; -else if ( nInsFlag & InsertDeleteFlags::CONTENTS ) -nDelFlag |= InsertDeleteFlags::CONTENTS; +// tdf#141440 - do not delete notes when pasting contents (see InsertDeleteFlags::CONTENTS) +else if
[Libreoffice-commits] core.git: helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 777e188e7284e658a610dc5fa86e4d8f54fd2cb7 Author: Andreas Heinisch AuthorDate: Sun May 14 13:05:19 2023 +0200 Commit: Gerrit Code Review CommitDate: Sun May 14 13:05:19 2023 +0200 Update git submodules * Update helpcontent2 from branch 'master' to f2535c6ff09e2afaa4c5db0a7fb6ee594a417732 - tdf#139858 - Adapt documentation for paste special Change-Id: I35f43fca75427c77f320cb88fd5d164ef8fb67b7 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/151622 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/helpcontent2 b/helpcontent2 index afa422b963d6..f2535c6ff09e 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit afa422b963d6b3677165dd8050286431652a815c +Subproject commit f2535c6ff09e2afaa4c5db0a7fb6ee594a417732
[Libreoffice-commits] help.git: source/text
source/text/shared/01/0207.xhp |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f2535c6ff09e2afaa4c5db0a7fb6ee594a417732 Author: Andreas Heinisch AuthorDate: Sun May 14 12:59:10 2023 +0200 Commit: Andreas Heinisch CommitDate: Sun May 14 13:05:19 2023 +0200 tdf#139858 - Adapt documentation for paste special Change-Id: I35f43fca75427c77f320cb88fd5d164ef8fb67b7 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/151622 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/source/text/shared/01/0207.xhp b/source/text/shared/01/0207.xhp index 891cd55906..c4f775ff82 100644 --- a/source/text/shared/01/0207.xhp +++ b/source/text/shared/01/0207.xhp @@ -97,7 +97,7 @@ Inserts cells containing formulae. Comments - Inserts comments that are attached to cells. If you want to add the comments to the existing cell content, select the "Add" operation. + Inserts comments that are attached to cells. Formats Inserts cell format attributes.
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/uitest/pasteSpecial/tdf139858.py | 60 + sc/source/ui/miscdlgs/inscodlg.cxx |3 + 2 files changed, 62 insertions(+), 1 deletion(-) New commits: commit 28bcb35b12f19858eca3d08559d7914e36ad1d2b Author: Andreas Heinisch AuthorDate: Wed May 10 09:08:47 2023 +0200 Commit: Andreas Heinisch CommitDate: Fri May 12 09:01:56 2023 +0200 tdf#139858 - Do not delete existing cell contents when pasting notes Change-Id: I9befa9e28f70ba767bbd9c4694521964a40c4463 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151603 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/qa/uitest/pasteSpecial/tdf139858.py b/sc/qa/uitest/pasteSpecial/tdf139858.py new file mode 100755 index ..ca81c7715cb6 --- /dev/null +++ b/sc/qa/uitest/pasteSpecial/tdf139858.py @@ -0,0 +1,60 @@ +# -*- 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.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.paste_special import reset_default_values + +class tdf139858(UITestCase): +def test_tdf139858_paste_comment(self): +with self.ui_test.create_doc_in_start_center("calc") as document: +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + +# Write text to cell A1 and B1 +enter_text_to_cell(xGridWin, "A1", "A1 sample text") +enter_text_to_cell(xGridWin, "B1", "B1 sample text") + +# Insert a comment in cell B1 +xArgs = mkPropertyValues({"Text": "Comment 1"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Insert a comment in cell A2 +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL":"A2"})) +xArgs = mkPropertyValues({"Text": "Comment 2"}) +self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + +# Copy cell A2 to clipboard +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) +self.xUITest.executeCommand(".uno:Copy") + +# Set cursor to cells and paste data using special options (check only comments) +targetCells = ["A1", "B1"] +for index, targetCell in enumerate(targetCells): +xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": targetCell})) +with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: +reset_default_values(self, xPasteSpecialDlg) +xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime") +xDateTimeChkBox.executeAction("CLICK", tuple()) +xTextChkBox = xPasteSpecialDlg.getChild("text") +xTextChkBox.executeAction("CLICK", tuple()) +xNumbersChkBox = xPasteSpecialDlg.getChild("numbers") +xNumbersChkBox.executeAction("CLICK", tuple()) +xCommentsChkBox = xPasteSpecialDlg.getChild("comments") +xCommentsChkBox.executeAction("CLICK", tuple()) + +# Without the fix in place, this test would have failed with +# AssertionError: 'A1 sample text' != '' +# i.e., the cell content was overwritten +self.assertEqual(targetCell + " sample text", get_cell_by_position(document, 0, index, 0).getString()) +self.assertEqual("Comment 2", get_cell_by_position(document, 0, index, 0).Annotation.String) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx index ca4fd1cfa8bd..84292dcd91c4 100644 --- a/sc/source/ui/miscdlgs/inscodlg.cxx +++ b/sc/source/ui/miscdlgs/inscodlg.cxx @@ -213,8 +213,9 @@ InsertDeleteFlags ScInsertContentsDlg::GetInsContentsCmdBits() const ScInsertContentsDlg::nPreviousChecks |= InsertDeleteFlags::DATETIME; if ( mxBtnInsFormulas->get_active()) ScInsertContentsDlg::nPreviousChecks |= InsertDeleteFlags::FORMULA; +// tdf#139858 - do not delete existing cell contents when pasting notes if ( mxBtnInsNotes->get_active() ) -ScInsertContentsDlg::nPreviousChecks |= InsertDeleteFlags::NOTE; +ScInsertContentsDlg::nPreviousChecks |= InsertDeleteFlags::ADDNOTES; if ( mxBtnInsAttrs->get_active() ) ScInsertContentsDlg::nPreviousChecks |= InsertDeleteFlags::ATTRIB; if ( mxBtnInsObjects->get_active() )
[Libreoffice-commits] core.git: formula/source sc/qa
formula/source/ui/dlg/formula.cxx |3 ++- formula/source/ui/dlg/funcpage.cxx| 10 +- formula/source/ui/dlg/funcpage.hxx|6 ++ sc/qa/uitest/function_wizard/tdf104487.py | 28 4 files changed, 45 insertions(+), 2 deletions(-) New commits: commit 421d4fc533498d058a91f9686c47b35114e6a6c9 Author: Andreas Heinisch AuthorDate: Tue May 9 11:04:37 2023 +0200 Commit: Andreas Heinisch CommitDate: Tue May 9 17:39:05 2023 +0200 tdf#104487 - Function wizard: remember last used function category Change-Id: I978dd63553e3528e7b9b853dbb438304f1f680cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151565 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index c12534268131..123642c46c1e 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -828,7 +828,8 @@ void FormulaDlg_Impl::FillListboxes() } else if ( pData ) { -m_xFuncPage->SetCategory( 1 ); +// tdf#104487 - remember last used function category +m_xFuncPage->SetCategory(FuncPage::GetRememeberdFunctionCategory()); m_xFuncPage->SetFunction( -1 ); } FuncSelHdl(*m_xFuncPage); diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx index 3013b84c06b6..dbdb49464ae7 100644 --- a/formula/source/ui/dlg/funcpage.cxx +++ b/formula/source/ui/dlg/funcpage.cxx @@ -37,6 +37,9 @@ IMPL_LINK(FuncPage, KeyInputHdl, const KeyEvent&, rKEvt, bool) return false; } +// tdf#104487 - remember last used function category - set default to All category +sal_Int32 FuncPage::m_nRememberedFunctionCategory = 1; + FuncPage::FuncPage(weld::Container* pParent, const IFunctionManager* _pFunctionManager) : m_xBuilder(Application::CreateBuilder(pParent, "formula/ui/functionpage.ui")) , m_xContainer(m_xBuilder->weld_container("FunctionPage")) @@ -58,7 +61,8 @@ FuncPage::FuncPage(weld::Container* pParent, const IFunctionManager* _pFunctionM m_xLbCategory->append(sId, pCategory->getName()); } -m_xLbCategory->set_active(1); +// tdf#104487 - remember last used function category +m_xLbCategory->set_active(m_nRememberedFunctionCategory); OUString searchStr = m_xLbFunctionSearchString->get_text(); UpdateFunctionList(searchStr); // lock to its initial size @@ -96,6 +100,8 @@ void FuncPage::UpdateFunctionList(const OUString& aStr) m_xLbFunction->freeze(); const sal_Int32 nSelPos = m_xLbCategory->get_active(); +// tdf#104487 - remember last used function category +m_nRememberedFunctionCategory = nSelPos; if (aStr.isEmpty() || nSelPos == 0) { @@ -217,6 +223,8 @@ IMPL_LINK_NOARG(FuncPage, ModifyHdl, weld::Entry&, void) void FuncPage::SetCategory(sal_Int32 nCat) { +// tdf#104487 - remember last used function category +m_nRememberedFunctionCategory = nCat; m_xLbCategory->set_active(nCat); UpdateFunctionList(OUString()); } diff --git a/formula/source/ui/dlg/funcpage.hxx b/formula/source/ui/dlg/funcpage.hxx index 1e91b610ec0d..e7ca248d861b 100644 --- a/formula/source/ui/dlg/funcpage.hxx +++ b/formula/source/ui/dlg/funcpage.hxx @@ -48,6 +48,9 @@ private: ::std::vector< TFunctionDesc > aLRUList; OUStringm_aHelpId; +// tdf#104487 - remember last used function category +static sal_Int32 m_nRememberedFunctionCategory; + void impl_addFunctions(const IFunctionCategory* _pCategory); DECL_LINK(SelComboBoxHdl, weld::ComboBox&, void); @@ -71,6 +74,9 @@ public: sal_Int32 GetFunction() const; sal_Int32 GetFunctionEntryCount() const; +// tdf#104487 - remember last used function category +static sal_Int32 GetRememeberdFunctionCategory() { return m_nRememberedFunctionCategory; }; + sal_Int32 GetFuncPos(const IFunctionDescription* _pDesc); const IFunctionDescription* GetFuncDesc( sal_Int32 nPos ) const; OUStringGetSelFunctionName() const; diff --git a/sc/qa/uitest/function_wizard/tdf104487.py b/sc/qa/uitest/function_wizard/tdf104487.py new file mode 100755 index ..8b563bc5b372 --- /dev/null +++ b/sc/qa/uitest/function_wizard/tdf104487.py @@ -0,0 +1,28 @@ +# -*- 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 uitest.uihelper.common import get_state_as_dict, select_pos + +class tdf104487(UITestCase): +def test_tdf104487_remember_function_category(self): +with self.ui_test.create_doc_in_start_center("calc"): +# Open function dialog and select select a
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - basic/qa basic/source
basic/qa/vba_tests/constants.vb |9 + basic/source/comp/parser.cxx|9 + 2 files changed, 18 insertions(+) New commits: commit b15035870c0be5fc855904ba3750b38d68abb1ae Author: Andreas Heinisch AuthorDate: Tue May 9 11:43:45 2023 +0200 Commit: Xisco Fauli CommitDate: Tue May 9 16:15:07 2023 +0200 tdf#153543 - Add vba shell constants Change-Id: Ifa73050f6892ce8ce95d16dedc166e68d1809491 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151567 Tested-by: Jenkins Reviewed-by: Andreas Heinisch (cherry picked from commit fa0a1f6462c050bdd14a4f75589eb324c6575a91) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151522 Reviewed-by: Xisco Fauli diff --git a/basic/qa/vba_tests/constants.vb b/basic/qa/vba_tests/constants.vb index be7add515e83..c31444889fae 100644 --- a/basic/qa/vba_tests/constants.vb +++ b/basic/qa/vba_tests/constants.vb @@ -25,6 +25,15 @@ Sub verify_testConstants() TestUtil.AssertEqual(vbNewLine, vbLf, "vbNewline") End If +' tdf#153543 - check for vba shell constants +' See https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/shell-constants +TestUtil.AssertEqual(vbHide, 0, "vbHide") +TestUtil.AssertEqual(vbNormalFocus, 1, "vbNormalFocus") +TestUtil.AssertEqual(vbMinimizedFocus, 2, "vbMinimizedFocus") +TestUtil.AssertEqual(vbMaximizedFocus, 3, "vbMaximizedFocus") +TestUtil.AssertEqual(vbNormalNoFocus,4, "vbNormalNoFocus") +TestUtil.AssertEqual(vbMinimizedNoFocus, 6, "vbMinimizedNoFocus") + ' tdf#131563 - check for vba color constants ' See https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/color-constants TestUtil.AssertEqual(vbBlack, RGB(0, 0, 0), "vbBlack") diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index 70bc27dcd16b..97bd27675fa8 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -849,6 +849,15 @@ static void addNumericConst(SbiSymPool& rPool, const OUString& pSym, double nVal void SbiParser::AddConstants() { +// tdf#153543 - shell constants +// See https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/shell-constants +addNumericConst(aPublics, "vbHide", 0); +addNumericConst(aPublics, "vbNormalFocus", 1); +addNumericConst(aPublics, "vbMinimizedFocus", 2); +addNumericConst(aPublics, "vbMaximizedFocus", 3); +addNumericConst(aPublics, "vbNormalNoFocus", 4); +addNumericConst(aPublics, "vbMinimizedNoFocus", 6); + // tdf#131563 - add vba color constants // See https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/color-constants addNumericConst(aPublics, "vbBlack", 0x0);
[Libreoffice-commits] core.git: basic/qa basic/source
basic/qa/vba_tests/constants.vb |9 + basic/source/comp/parser.cxx|9 + 2 files changed, 18 insertions(+) New commits: commit fa0a1f6462c050bdd14a4f75589eb324c6575a91 Author: Andreas Heinisch AuthorDate: Tue May 9 11:43:45 2023 +0200 Commit: Andreas Heinisch CommitDate: Tue May 9 14:12:54 2023 +0200 tdf#153543 - Add vba shell constants Change-Id: Ifa73050f6892ce8ce95d16dedc166e68d1809491 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151567 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/basic/qa/vba_tests/constants.vb b/basic/qa/vba_tests/constants.vb index be7add515e83..c31444889fae 100644 --- a/basic/qa/vba_tests/constants.vb +++ b/basic/qa/vba_tests/constants.vb @@ -25,6 +25,15 @@ Sub verify_testConstants() TestUtil.AssertEqual(vbNewLine, vbLf, "vbNewline") End If +' tdf#153543 - check for vba shell constants +' See https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/shell-constants +TestUtil.AssertEqual(vbHide, 0, "vbHide") +TestUtil.AssertEqual(vbNormalFocus, 1, "vbNormalFocus") +TestUtil.AssertEqual(vbMinimizedFocus, 2, "vbMinimizedFocus") +TestUtil.AssertEqual(vbMaximizedFocus, 3, "vbMaximizedFocus") +TestUtil.AssertEqual(vbNormalNoFocus,4, "vbNormalNoFocus") +TestUtil.AssertEqual(vbMinimizedNoFocus, 6, "vbMinimizedNoFocus") + ' tdf#131563 - check for vba color constants ' See https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/color-constants TestUtil.AssertEqual(vbBlack, RGB(0, 0, 0), "vbBlack") diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index 70bc27dcd16b..97bd27675fa8 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -849,6 +849,15 @@ static void addNumericConst(SbiSymPool& rPool, const OUString& pSym, double nVal void SbiParser::AddConstants() { +// tdf#153543 - shell constants +// See https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/shell-constants +addNumericConst(aPublics, "vbHide", 0); +addNumericConst(aPublics, "vbNormalFocus", 1); +addNumericConst(aPublics, "vbMinimizedFocus", 2); +addNumericConst(aPublics, "vbMaximizedFocus", 3); +addNumericConst(aPublics, "vbNormalNoFocus", 4); +addNumericConst(aPublics, "vbMinimizedNoFocus", 6); + // tdf#131563 - add vba color constants // See https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/color-constants addNumericConst(aPublics, "vbBlack", 0x0);
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/uitest/calc_tests6/moveCopySheet.py | 32 ++ sc/source/ui/inc/mvtabdlg.hxx |3 ++ sc/source/ui/miscdlgs/mvtabdlg.cxx| 15 ++ 3 files changed, 42 insertions(+), 8 deletions(-) New commits: commit 6f67eb36d035fa3fe4103e497207452602ff993b Author: Andreas Heinisch AuthorDate: Fri May 5 19:28:58 2023 +0200 Commit: Andreas Heinisch CommitDate: Sun May 7 13:39:12 2023 +0200 tdf#96854 - Remember last used option in copy/move sheet dialog Change-Id: Iebfd224091c108bb5068b716c39da0979a7ab3ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151437 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/qa/uitest/calc_tests6/moveCopySheet.py b/sc/qa/uitest/calc_tests6/moveCopySheet.py index 80bd9f830a27..5b21e6e86cb0 100644 --- a/sc/qa/uitest/calc_tests6/moveCopySheet.py +++ b/sc/qa/uitest/calc_tests6/moveCopySheet.py @@ -23,8 +23,10 @@ class moveCopySheet(UITestCase): newName.executeAction("TYPE", mkPropertyValues({"TEXT":"newName"})) #verify, the file has 2 sheets; first one "newName" is selected self.assertEqual(document.Sheets.getCount(), 2) -# dialog move/copy sheet ; Move is selected; select -move to end position - ; New Name = moveName +# dialog move/copy sheet ; Copy is selected; Select move and -move to end position - ; New Name = moveName with self.ui_test.execute_dialog_through_command(".uno:Move") as xDialog: +xMoveButton = xDialog.getChild("move") +xMoveButton.executeAction("CLICK", tuple()) insertBefore = xDialog.getChild("insertBefore") xTreeEntry = insertBefore.getChild('2') @@ -76,6 +78,29 @@ class moveCopySheet(UITestCase): self.assertEqual(get_state_as_dict(xMoveButton)["Checked"], "false") self.assertEqual(get_state_as_dict(xMoveButton)["Enabled"], "false") +# tdf#96854 - remember last used option for copy/move sheet +def test_tdf96854_remember_copy_move_option(self): +with self.ui_test.create_doc_in_start_center("calc"): +# Add a second sheet to the calc document +with self.ui_test.execute_dialog_through_command(".uno:Move") as xDialog: +pass + +# Check if the copy option was remembered +with self.ui_test.execute_dialog_through_command(".uno:Move") as xDialog: +xCopyButton = xDialog.getChild("copy") +self.assertEqual(get_state_as_dict(xCopyButton)["Checked"], "true") +xMoveButton = xDialog.getChild("move") +self.assertEqual(get_state_as_dict(xMoveButton)["Checked"], "false") +# Move selected sheet and check if option was remembered +xMoveButton.executeAction("CLICK", tuple()) + +# Check if move option was remembered +with self.ui_test.execute_dialog_through_command(".uno:Move") as xDialog: +xCopyButton = xDialog.getChild("copy") +self.assertEqual(get_state_as_dict(xCopyButton)["Checked"], "false") +xMoveButton = xDialog.getChild("move") +self.assertEqual(get_state_as_dict(xMoveButton)["Checked"], "true") + #tdf#139464 Set OK button label to selected action: Move or Copy def test_tdf139464_move_sheet(self): with self.ui_test.create_doc_in_start_center("calc"): @@ -87,11 +112,10 @@ class moveCopySheet(UITestCase): xOkButton = xDialog.getChild("ok") xCopyButton = xDialog.getChild("copy") xMoveButton = xDialog.getChild("move") -self.assertEqual(get_state_as_dict(xMoveButton)['Text'], get_state_as_dict(xOkButton)['Text']) -xCopyButton.executeAction("CLICK", tuple()) self.assertEqual(get_state_as_dict(xCopyButton)['Text'], get_state_as_dict(xOkButton)['Text']) xMoveButton.executeAction("CLICK", tuple()) self.assertEqual(get_state_as_dict(xMoveButton)['Text'], get_state_as_dict(xOkButton)['Text']) - +xCopyButton.executeAction("CLICK", tuple()) +self.assertEqual(get_state_as_dict(xCopyButton)['Text'], get_state_as_dict(xOkButton)['Text']) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx index c6e89ab9fed0..665d3cd46085 100644 --- a/sc/source/ui/inc/mvtabdlg.hxx +++ b/sc/source/ui/inc/mvtabdlg.hxx @@ -61,6 +61,9 @@ private: boolbRenameTable:1; boolmbEverEdited:1; +// tdf#96854 - remember last used option for copy/move sheet +static bool mbRememeberedCopy; + std::unique_ptr m_xBtnMove; std::unique_ptr m_xBtnCopy; std::unique_ptr m_xFtDoc; diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/uitest/table/splitTable.py | 22 +- sw/source/ui/table/splittbl.cxx | 25 + sw/source/uibase/inc/splittbl.hxx |8 3 files changed, 54 insertions(+), 1 deletion(-) New commits: commit a86cbb0da80e0e05c041a8ddbd8e16df47638c73 Author: Andreas Heinisch AuthorDate: Fri Apr 28 11:01:34 2023 +0200 Commit: Andreas Heinisch CommitDate: Fri May 5 15:35:22 2023 +0200 tdf#131759 - Remember last used option in split table dialog Change-Id: Id7aaa300babff988f0244d822860d455d57c86c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151160 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sw/qa/uitest/table/splitTable.py b/sw/qa/uitest/table/splitTable.py index 2bfc4ca476ed..0292c452b187 100644 --- a/sw/qa/uitest/table/splitTable.py +++ b/sw/qa/uitest/table/splitTable.py @@ -7,7 +7,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # from uitest.framework import UITestCase -from uitest.uihelper.common import get_url_for_data_file +from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file #Writer Split Table @@ -64,4 +64,24 @@ class splitTable(UITestCase): self.xUITest.executeCommand(".uno:Undo") self.assertEqual(writer_doc.TextTables.getCount(), 1) +def test_tdf115572_remember_split_table_option(self): +with self.ui_test.load_file(get_url_for_data_file("splitTable.odt")) as writer_doc: +# Go to second row +self.xUITest.executeCommand(".uno:GoDown") +self.xUITest.executeCommand(".uno:GoDown") + +# Split table using a non default option +with self.ui_test.execute_dialog_through_command(".uno:SplitTable") as xDialog: +xRadioNoHeading = xDialog.getChild("noheading") +xRadioNoHeading.executeAction("CLICK", tuple()) + +# Reopen split table dialog and check preselection +self.xUITest.executeCommand(".uno:GoDown") +with self.ui_test.execute_dialog_through_command(".uno:SplitTable") as xDialog: +xRadioNoHeading = xDialog.getChild("noheading") +# Without the fix in place, this test would have failed with +# AssertionError: 'true' != 'false' +# i.e. the last used option in the split table dialog was not remembered +self.assertEqual("true", get_state_as_dict(xRadioNoHeading)["Checked"]) + # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/source/ui/table/splittbl.cxx b/sw/source/ui/table/splittbl.cxx index bc33390861b1..5a7ef0ae080a 100644 --- a/sw/source/ui/table/splittbl.cxx +++ b/sw/source/ui/table/splittbl.cxx @@ -21,6 +21,9 @@ #include #include +SplitTable_HeadlineOption SwSplitTableDlg::m_eRememberedSplitOption += SplitTable_HeadlineOption::ContentCopy; + SwSplitTableDlg::SwSplitTableDlg(weld::Window* pParent, SwWrtShell& rSh) : GenericDialogController(pParent, "modules/swriter/ui/splittable.ui", "SplitTableDialog") , m_xBoxAttrCopyWithParaRB(m_xBuilder->weld_radio_button("customheadingapplystyle")) @@ -29,6 +32,25 @@ SwSplitTableDlg::SwSplitTableDlg(weld::Window* pParent, SwWrtShell& rSh) , m_rShell(rSh) , m_nSplit(SplitTable_HeadlineOption::ContentCopy) { +// tdf#131759 - remember last used option in split table dialog +m_nSplit = m_eRememberedSplitOption; +switch (m_nSplit) +{ +case SplitTable_HeadlineOption::BoxAttrAllCopy: +m_xBoxAttrCopyWithParaRB->set_active(true); +break; +case SplitTable_HeadlineOption::BoxAttrCopy: +m_xBoxAttrCopyNoParaRB->set_active(true); +break; +case SplitTable_HeadlineOption::BorderCopy: +m_xBorderCopyRB->set_active(true); +break; +case SplitTable_HeadlineOption::NONE: +case SplitTable_HeadlineOption::ContentCopy: +default: +// Use the default value in case of an invalid option +m_nSplit = SplitTable_HeadlineOption::ContentCopy; +} } void SwSplitTableDlg::Apply() @@ -41,6 +63,9 @@ void SwSplitTableDlg::Apply() else if (m_xBorderCopyRB->get_active()) m_nSplit = SplitTable_HeadlineOption::BorderCopy; +// tdf#131759 - remember last used option in split table dialog +m_eRememberedSplitOption = m_nSplit; + m_rShell.SplitTable(m_nSplit); } diff --git a/sw/source/uibase/inc/splittbl.hxx b/sw/source/uibase/inc/splittbl.hxx index 9eaef2a02901..c579eea177a9 100644 --- a/sw/source/uibase/inc/splittbl.hxx +++ b/sw/source/uibase/inc/splittbl.hxx @@ -21,6 +21,7 @@ #include #include +#include class SwWrtShell; @@ -34,6 +35,9 @@ private: SwWrtShell& m_rShell; SplitTable_HeadlineOption m_nSplit; +// tdf#131759 - remember last used option in split table dialog +static SplitTable_HeadlineOption m_eRememberedSplitOption; +
[Libreoffice-commits] core.git: svx/source sw/qa
svx/source/inc/findtextfield.hxx |2 svx/source/tbxctrls/tbunosearchcontrollers.cxx | 26 +++--- sw/qa/uitest/findBar/tdf154818.py | 65 + sw/qa/uitest/findReplace/findReplace.py| 22 4 files changed, 98 insertions(+), 17 deletions(-) New commits: commit 4cae4a11642f0d8f0c8005141893e34e1c216fde Author: Andreas Heinisch AuthorDate: Wed May 3 18:02:30 2023 +0200 Commit: Andreas Heinisch CommitDate: Thu May 4 12:08:55 2023 +0200 tdf#154818 - Find bar: remember and reuse last search string Changed remembered search string in the find bar from user configuration to session and added UI test. Change-Id: Idf211f1fadd87ba935fe3948c20c4e511aa8afdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151335 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/svx/source/inc/findtextfield.hxx b/svx/source/inc/findtextfield.hxx index 8cfa98f03242..2c79a529b3f4 100644 --- a/svx/source/inc/findtextfield.hxx +++ b/svx/source/inc/findtextfield.hxx @@ -67,6 +67,8 @@ private: // tdf#154269 - respect FindReplaceRememberedSearches expert option sal_uInt16 m_nRememberSize; +// tdf#154818 - remember last search string +static OUString m_sRememberedSearchString; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 1ae8a0b5c738..e2c76a9800de 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -60,7 +60,6 @@ #include #include #include -#include #include @@ -192,6 +191,9 @@ void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext } +// tdf#154818 - remember last search string +OUString FindTextFieldControl::m_sRememberedSearchString; + FindTextFieldControl::FindTextFieldControl( vcl::Window* pParent, css::uno::Reference< css::frame::XFrame > xFrame, css::uno::Reference< css::uno::XComponentContext > xContext) : @@ -260,20 +262,12 @@ void FindTextFieldControl::SetTextToSelected_Impl() m_xWidget->set_entry_text(aString); m_aChangeHdl.Call(*m_xWidget); } -else +// tdf#154818 - reuse last search string +else if (!m_sRememberedSearchString.isEmpty() || get_count() > 0) { -// tdf#154818 - reuse last search string -SvtViewOptions aDlgOpt(EViewType::Dialog, m_xWidget->get_help_id()); -if (aDlgOpt.Exists()) -{ -css::uno::Any aUserItem = aDlgOpt.GetUserItem("UserItem"); -aUserItem >>= aString; -} -else if (get_count() > 0) -aString = m_xWidget->get_text(0); - // prepopulate with last search word (fdo#84256) -m_xWidget->set_entry_text(aString); +m_xWidget->set_entry_text(m_sRememberedSearchString.isEmpty() ? m_xWidget->get_text(0) + : m_sRememberedSearchString); } } @@ -340,10 +334,8 @@ IMPL_LINK(FindTextFieldControl, KeyInputHdl, const KeyEvent&, rKeyEvent, bool) void FindTextFieldControl::ActivateFind(bool bShift) { // tdf#154818 - remember last search string -const OUString aLastSearchString = m_xWidget->get_active_text(); -SvtViewOptions aDlgOpt(EViewType::Dialog, m_xWidget->get_help_id()); -aDlgOpt.SetUserItem("UserItem", css::uno::Any(aLastSearchString)); -Remember_Impl(aLastSearchString); +m_sRememberedSearchString = m_xWidget->get_active_text(); +Remember_Impl(m_sRememberedSearchString); vcl::Window* pWindow = GetParent(); ToolBox* pToolBox = static_cast(pWindow); diff --git a/sw/qa/uitest/findBar/tdf154818.py b/sw/qa/uitest/findBar/tdf154818.py new file mode 100644 index ..e0470206faf8 --- /dev/null +++ b/sw/qa/uitest/findBar/tdf154818.py @@ -0,0 +1,65 @@ +# -*- 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 uitest.uihelper.common import get_state_as_dict, select_pos +from libreoffice.uno.propertyvalue import mkPropertyValues + +class tdf154818(UITestCase): + +def test_tdf154818_remember_search_item(self): +with self.ui_test.create_doc_in_start_center("writer"): +xWriterDoc = self.xUITest.getTopFocusWindow() +xWriterEdit = xWriterDoc.getChild("writer_edit") + +# Search for an entry and check again if it is preselected (A -> B -> A) +searchTerms = ["A", "B", "A"] +for searchTerm in searchTerms: +xWriterEdit.executeAction("TYPE",
[Libreoffice-commits] core.git: cui/source
cui/source/dialogs/cuihyperdlg.cxx | 13 - cui/source/dialogs/iconcdlg.cxx|4 +--- cui/source/inc/cuihyperdlg.hxx |2 ++ 3 files changed, 7 insertions(+), 12 deletions(-) New commits: commit ebfd2f10b400ad215ccd2263267f48a79b1427ef Author: Andreas Heinisch AuthorDate: Wed May 3 17:01:10 2023 +0200 Commit: Andreas Heinisch CommitDate: Wed May 3 18:50:33 2023 +0200 tdf#90496 - Remember last used view in hyperlink dialog Changed remembered last used view in hyperlink dialog from user configuration to session. Change-Id: Ifd04fc92d8ca8880d85c6cb52a7e364cff54a82e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151331 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx index 782877d438f7..86fd3c1a2c8f 100644 --- a/cui/source/dialogs/cuihyperdlg.cxx +++ b/cui/source/dialogs/cuihyperdlg.cxx @@ -79,6 +79,9 @@ void SvxHlinkCtrl::StateChangedAtToolBoxControl( sal_uInt16 nSID, SfxItemState e } } +// tdf#90496 - remember last used view in hyperlink dialog +OUString SvxHpLinkDlg::msRememberedPageId("internet"); + //# # //# Hyperlink - Dialog # //# # @@ -135,15 +138,7 @@ SvxHpLinkDlg::SvxHpLinkDlg(SfxBindings* pBindings, SfxChildWindow* pChild, weld: } // tdf#90496 - remember last used view in hyperlink dialog -OUString sPageId("internet"); -SvtViewOptions aViewOpt(EViewType::TabDialog, m_xDialog->get_accessible_name()); -if (aViewOpt.Exists()) -{ -const OUString sSavedPageId = aViewOpt.GetPageID(); -if (GetPageData(sSavedPageId)) -sPageId = sSavedPageId; -} -SetCurPageId(sPageId); +SetCurPageId(msRememberedPageId); // Init Dialog Start(); diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx index ede5c0582b5c..4aacf0e2b50e 100644 --- a/cui/source/dialogs/iconcdlg.cxx +++ b/cui/source/dialogs/iconcdlg.cxx @@ -23,7 +23,6 @@ #include #include #include -#include /** | @@ -150,8 +149,7 @@ void SvxHpLinkDlg::ActivatePageImpl() m_xDialog->set_help_id(pData->xPage->GetHelpId()); // tdf#90496 - remember last used view in hyperlink dialog -SvtViewOptions aViewOpt(EViewType::TabDialog, m_xDialog->get_accessible_name()); -aViewOpt.SetPageID(msCurrentPageId); +msRememberedPageId = msCurrentPageId; m_xResetBtn->show(); } diff --git a/cui/source/inc/cuihyperdlg.hxx b/cui/source/inc/cuihyperdlg.hxx index cc85db7cfe3c..8423d8c49759 100644 --- a/cui/source/inc/cuihyperdlg.hxx +++ b/cui/source/inc/cuihyperdlg.hxx @@ -68,6 +68,8 @@ private: std::vector< std::unique_ptr > maPageList; OUString msCurrentPageId; +// tdf#90496 - remember last used view in hyperlink dialog +static OUString msRememberedPageId; const SfxItemSet* pSet; std::unique_ptr pOutSet;
[Libreoffice-commits] core.git: cui/source sw/qa
cui/source/dialogs/cuihyperdlg.cxx| 11 ++- cui/source/dialogs/iconcdlg.cxx |5 + sw/qa/uitest/writer_tests3/hyperlinkdialog.py | 14 ++ 3 files changed, 29 insertions(+), 1 deletion(-) New commits: commit a9cea0ddeb5cd51db0720f96af75af75120908d9 Author: Andreas Heinisch AuthorDate: Wed Apr 26 10:37:40 2023 +0200 Commit: Andreas Heinisch CommitDate: Fri Apr 28 20:34:17 2023 +0200 tdf#90496 - Remember last used view in hyperlink dialog Change-Id: I500e9e58c84486307c50f4ccb878ad0340412246 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151039 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx index 9eb5a1fa367e..782877d438f7 100644 --- a/cui/source/dialogs/cuihyperdlg.cxx +++ b/cui/source/dialogs/cuihyperdlg.cxx @@ -134,7 +134,16 @@ SvxHpLinkDlg::SvxHpLinkDlg(SfxBindings* pBindings, SfxChildWindow* pChild, weld: AddTabPage("newdocument", SvxHyperlinkNewDocTp::Create); } -SetCurPageId("internet"); +// tdf#90496 - remember last used view in hyperlink dialog +OUString sPageId("internet"); +SvtViewOptions aViewOpt(EViewType::TabDialog, m_xDialog->get_accessible_name()); +if (aViewOpt.Exists()) +{ +const OUString sSavedPageId = aViewOpt.GetPageID(); +if (GetPageData(sSavedPageId)) +sPageId = sSavedPageId; +} +SetCurPageId(sPageId); // Init Dialog Start(); diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx index 0c2219f0ee71..ede5c0582b5c 100644 --- a/cui/source/dialogs/iconcdlg.cxx +++ b/cui/source/dialogs/iconcdlg.cxx @@ -23,6 +23,7 @@ #include #include #include +#include /** | @@ -148,6 +149,10 @@ void SvxHpLinkDlg::ActivatePageImpl() pData->xPage->ActivatePage( *pExampleSet ); m_xDialog->set_help_id(pData->xPage->GetHelpId()); +// tdf#90496 - remember last used view in hyperlink dialog +SvtViewOptions aViewOpt(EViewType::TabDialog, m_xDialog->get_accessible_name()); +aViewOpt.SetPageID(msCurrentPageId); + m_xResetBtn->show(); } diff --git a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py index 4494ab45a14c..6390310810d5 100644 --- a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py +++ b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py @@ -91,6 +91,20 @@ class HyperlinkDialog(UITestCase): xedit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "29"})) self.assertEqual(get_state_as_dict(xedit)["SelectedText"], "http://www.libreoffice.org:80;) +def test_tdf90496(self): +with self.ui_test.create_doc_in_start_center("writer"): +with self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog", close_button="cancel") as xDialog: +# Select a random tab to check the preselection in the hyperlink dialog +xTab = xDialog.getChild("tabcontrol") +select_pos(xTab, "1") + +with self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog", close_button="cancel") as xDialog: +xTab = xDialog.getChild("tabcontrol") +# Without the fix in place, this test would have failed with +# AssertionError: '1' != '0' +# i.e. the last used tab in the hyperlink dialog was not remembered +self.assertEqual("1", get_state_as_dict(xTab)["CurrPagePos"]) + def test_tdf141166(self): # Skip this test for --with-help=html and --with-help=online, as that would fail with a
[Libreoffice-commits] core.git: svx/source
svx/source/tbxctrls/tbunosearchcontrollers.cxx |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit 89afe2978500233dc7b58d39cc519ecb9c224e98 Author: Andreas Heinisch AuthorDate: Wed Apr 26 19:40:34 2023 +0200 Commit: Andreas Heinisch CommitDate: Thu Apr 27 11:12:52 2023 +0200 tdf#154818 - Find bar: remember and reuse last search string If there exists no last search string in the view options and there exists a search history, preselect the last search item. Change-Id: Ic6056e02eaf6c0ee7e266e47ba961dff11e9f9da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151072 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index d43222fe4e32..1ae8a0b5c738 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -268,9 +268,12 @@ void FindTextFieldControl::SetTextToSelected_Impl() { css::uno::Any aUserItem = aDlgOpt.GetUserItem("UserItem"); aUserItem >>= aString; -// prepopulate with last search word (fdo#84256) -m_xWidget->set_entry_text(aString); } +else if (get_count() > 0) +aString = m_xWidget->get_text(0); + +// prepopulate with last search word (fdo#84256) +m_xWidget->set_entry_text(aString); } }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5-3' - sc/qa sc/source
sc/qa/extras/macros-test.cxx| 34 ++ sc/source/ui/unoobj/viewuno.cxx | 18 +- 2 files changed, 47 insertions(+), 5 deletions(-) New commits: commit a2cff9bdbcee063c787c64721c840db30a203cbf Author: Andreas Heinisch AuthorDate: Fri Apr 14 14:29:12 2023 +0200 Commit: Xisco Fauli CommitDate: Wed Apr 26 13:20:10 2023 +0200 tdf#154803 - Check if range is entirely merged Regression from commit b9411e587586750f36ba9009b5f1e29fe461d8b5 where I missinterpreted the check to get merged cells. Regression: tdf#147122 - Return cell object when a simple selection is merged Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145378 Change-Id: I2e39599a206cf102b1da8c7fc4bb2d8c0a4b106c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150412 Tested-by: Jenkins Reviewed-by: Andreas Heinisch Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150581 (cherry picked from commit 752f0aa9d25a286d70a5627d466ce9e76c84fba6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150570 Reviewed-by: Stéphane Guillou Reviewed-by: Eike Rathke diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index d1af2ae52846..f22412771033 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -73,6 +73,7 @@ public: void testShapeLayerId(); void testFunctionAccessIndirect(); void testTdf147122(); +void testTdf154803(); CPPUNIT_TEST_SUITE(ScMacrosTest); CPPUNIT_TEST(testStarBasic); @@ -109,6 +110,7 @@ public: CPPUNIT_TEST(testShapeLayerId); CPPUNIT_TEST(testFunctionAccessIndirect); CPPUNIT_TEST(testTdf147122); +CPPUNIT_TEST(testTdf154803); CPPUNIT_TEST_SUITE_END(); }; @@ -960,6 +962,38 @@ void ScMacrosTest::testTdf147122() CPPUNIT_ASSERT_EQUAL(Any(OUString("This is a test")), aRet); } +void ScMacrosTest::testTdf154803() +{ +mxComponent = loadFromDesktop("private:factory/scalc"); + +css::uno::Reference xDocScr(mxComponent, UNO_QUERY_THROW); +auto xLibs = xDocScr->getBasicLibraries(); +auto xLibrary = xLibs->createLibrary("TestLibrary"); +xLibrary->insertByName( +"TestModule", +uno::Any( +OUString("Function TestExtendedMergedSelection\n" + // Merge A1:B2 cell range + " oActiveSheet = ThisComponent.CurrentController.ActiveSheet\n" + " oRange = oActiveSheet.getCellRangeByName(\"A1:B2\")\n" + " ThisComponent.getCurrentController.Select(oRange)\n" + " oActiveCell = ThisComponent.CurrentSelection\n" + " oActiveCell.Merge(True)\n" + // Select A1:B3 range and check for its implementation name + " oRange = oActiveSheet.getCellRangeByName(\"A1:B3\")\n" + " ThisComponent.getCurrentController.Select(oRange)\n" + " TestExtendedMergedSelection = ThisComponent.CurrentSelection.ImplementationName\n" + "End Function\n"))); + +Any aRet = executeMacro("vnd.sun.Star.script:TestLibrary.TestModule.TestExtendedMergedSelection?" +"language=Basic=document"); +// Without the fix in place, this test would have failed with +// - Expected : ScCellRangeObj +// - Actual : ScCellObj +// i.e. the selection was interpreted as a single cell instead of a range +CPPUNIT_ASSERT_EQUAL(Any(OUString("ScCellRangeObj")), aRet); +} + ScMacrosTest::ScMacrosTest() : UnoApiXmlTest("/sc/qa/extras/testdocuments") { diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index f8940594746c..f58bf3782eb5 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -873,13 +874,20 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() ScMarkType eMarkType = rViewData.GetSimpleArea(aRange); if ( nTabs == 1 && (eMarkType == SC_MARK_SIMPLE) ) { -// tdf#147122 - return cell object when a simple selection is merged +// tdf#154803 - check if range is entirely merged ScDocument& rDoc = pDocSh->GetDocument(); -const ScPatternAttr* pMarkPattern = rDoc.GetPattern(aRange.aStart); +const ScMergeAttr* pMergeAttr = rDoc.GetAttr(aRange.aStart, ATTR_MERGE); +SCCOL nColSpan = 1; +SCROW nRowSpan = 1; +if (pMergeAttr && pMergeAttr->IsMerged()) +{ +nColSpan = pMergeAttr->GetColMerge(); +nRowSpan = pMergeAttr->GetRowMerge(); +} +// tdf#147122 - return cell object when a simple selection is entirely merged if (aRange.aStart == aRange.aEnd -||
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/srchdlg.cxx | 24 +--- svx/source/tbxctrls/tbunosearchcontrollers.cxx | 36 +++-- 2 files changed, 36 insertions(+), 24 deletions(-) New commits: commit 695f08911f40ab8d457c7c7e37bf87bb301ef98d Author: Andreas Heinisch AuthorDate: Mon Apr 17 11:07:35 2023 +0200 Commit: Andreas Heinisch CommitDate: Wed Apr 19 18:25:20 2023 +0200 tdf#154818 - Find bar: remember and reuse last search string In addition, the search items are rearranged to their usage order. Change-Id: I4f4bdfd869a981726ef84060e93c178502eaefef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150485 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 69483c124770..4805bbd8159e 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -1591,20 +1591,22 @@ void SvxSearchDialog::Remember_Impl( const OUString , bool _bSearch ) std::vector* pArr = _bSearch ? : weld::ComboBox* pListBox = _bSearch ? m_xSearchLB.get() : m_xReplaceLB.get(); -// ignore identical strings -if (std::find(pArr->begin(), pArr->end(), rStr) != pArr->end()) -return; +// tdf#154818 - rearrange the search items +const auto nPos = pListBox->find_text(rStr); +if (nPos != -1) +{ +pListBox->remove(nPos); +pArr->erase(pArr->begin() + nPos); +} +else if (pListBox->get_count() >= nRememberSize) +{ +// delete oldest entry at maximum occupancy (ListBox and Array) +pListBox->remove(nRememberSize - 1); +pArr->erase(pArr->begin() + nRememberSize - 1); +} pArr->insert(pArr->begin(), rStr); pListBox->insert_text(0, rStr); - -// delete oldest entry at maximum occupancy (ListBox and Array) -size_t nArrSize = pArr->size(); -if (nArrSize > nRememberSize) -{ -pListBox->remove(nArrSize - 1); -pArr->erase(pArr->begin() + nArrSize - 1); -} } void SvxSearchDialog::TemplatesChanged_Impl( SfxStyleSheetBasePool& rPool ) diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 9611f4d686c0..d43222fe4e32 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -60,6 +60,7 @@ #include #include #include +#include #include @@ -222,17 +223,15 @@ FindTextFieldControl::FindTextFieldControl( vcl::Window* pParent, void FindTextFieldControl::Remember_Impl(const OUString& rStr) { -const sal_Int32 nCount = m_xWidget->get_count(); - -for (sal_Int32 i=0; iget_text(i)) -return; -} +if (rStr.isEmpty()) +return; -if (nCount == m_nRememberSize) +// tdf#154818 - rearrange the search items +const auto nPos = m_xWidget->find_text(rStr); +if (nPos != -1) +m_xWidget->remove(nPos); +else if (m_xWidget->get_count() >= m_nRememberSize) m_xWidget->remove(m_nRememberSize - 1); - m_xWidget->insert_text(0, rStr); } @@ -261,10 +260,17 @@ void FindTextFieldControl::SetTextToSelected_Impl() m_xWidget->set_entry_text(aString); m_aChangeHdl.Call(*m_xWidget); } -else if (get_count() > 0) +else { -// Else, prepopulate with last search word (fdo#84256) -m_xWidget->set_entry_text(m_xWidget->get_text(0)); +// tdf#154818 - reuse last search string +SvtViewOptions aDlgOpt(EViewType::Dialog, m_xWidget->get_help_id()); +if (aDlgOpt.Exists()) +{ +css::uno::Any aUserItem = aDlgOpt.GetUserItem("UserItem"); +aUserItem >>= aString; +// prepopulate with last search word (fdo#84256) +m_xWidget->set_entry_text(aString); +} } } @@ -330,7 +336,11 @@ IMPL_LINK(FindTextFieldControl, KeyInputHdl, const KeyEvent&, rKeyEvent, bool) void FindTextFieldControl::ActivateFind(bool bShift) { -Remember_Impl(m_xWidget->get_active_text()); +// tdf#154818 - remember last search string +const OUString aLastSearchString = m_xWidget->get_active_text(); +SvtViewOptions aDlgOpt(EViewType::Dialog, m_xWidget->get_help_id()); +aDlgOpt.SetUserItem("UserItem", css::uno::Any(aLastSearchString)); +Remember_Impl(aLastSearchString); vcl::Window* pWindow = GetParent(); ToolBox* pToolBox = static_cast(pWindow);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sc/qa sc/source
sc/qa/extras/macros-test.cxx| 34 ++ sc/source/ui/unoobj/viewuno.cxx | 18 +- 2 files changed, 47 insertions(+), 5 deletions(-) New commits: commit 752f0aa9d25a286d70a5627d466ce9e76c84fba6 Author: Andreas Heinisch AuthorDate: Fri Apr 14 14:29:12 2023 +0200 Commit: Xisco Fauli CommitDate: Wed Apr 19 08:21:00 2023 +0200 tdf#154803 - Check if range is entirely merged Regression from commit b9411e587586750f36ba9009b5f1e29fe461d8b5 where I missinterpreted the check to get merged cells. Regression: tdf#147122 - Return cell object when a simple selection is merged Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145378 Change-Id: I2e39599a206cf102b1da8c7fc4bb2d8c0a4b106c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150412 Tested-by: Jenkins Reviewed-by: Andreas Heinisch Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150581 diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index d1af2ae52846..f22412771033 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -73,6 +73,7 @@ public: void testShapeLayerId(); void testFunctionAccessIndirect(); void testTdf147122(); +void testTdf154803(); CPPUNIT_TEST_SUITE(ScMacrosTest); CPPUNIT_TEST(testStarBasic); @@ -109,6 +110,7 @@ public: CPPUNIT_TEST(testShapeLayerId); CPPUNIT_TEST(testFunctionAccessIndirect); CPPUNIT_TEST(testTdf147122); +CPPUNIT_TEST(testTdf154803); CPPUNIT_TEST_SUITE_END(); }; @@ -960,6 +962,38 @@ void ScMacrosTest::testTdf147122() CPPUNIT_ASSERT_EQUAL(Any(OUString("This is a test")), aRet); } +void ScMacrosTest::testTdf154803() +{ +mxComponent = loadFromDesktop("private:factory/scalc"); + +css::uno::Reference xDocScr(mxComponent, UNO_QUERY_THROW); +auto xLibs = xDocScr->getBasicLibraries(); +auto xLibrary = xLibs->createLibrary("TestLibrary"); +xLibrary->insertByName( +"TestModule", +uno::Any( +OUString("Function TestExtendedMergedSelection\n" + // Merge A1:B2 cell range + " oActiveSheet = ThisComponent.CurrentController.ActiveSheet\n" + " oRange = oActiveSheet.getCellRangeByName(\"A1:B2\")\n" + " ThisComponent.getCurrentController.Select(oRange)\n" + " oActiveCell = ThisComponent.CurrentSelection\n" + " oActiveCell.Merge(True)\n" + // Select A1:B3 range and check for its implementation name + " oRange = oActiveSheet.getCellRangeByName(\"A1:B3\")\n" + " ThisComponent.getCurrentController.Select(oRange)\n" + " TestExtendedMergedSelection = ThisComponent.CurrentSelection.ImplementationName\n" + "End Function\n"))); + +Any aRet = executeMacro("vnd.sun.Star.script:TestLibrary.TestModule.TestExtendedMergedSelection?" +"language=Basic=document"); +// Without the fix in place, this test would have failed with +// - Expected : ScCellRangeObj +// - Actual : ScCellObj +// i.e. the selection was interpreted as a single cell instead of a range +CPPUNIT_ASSERT_EQUAL(Any(OUString("ScCellRangeObj")), aRet); +} + ScMacrosTest::ScMacrosTest() : UnoApiXmlTest("/sc/qa/extras/testdocuments") { diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index f8940594746c..f58bf3782eb5 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -873,13 +874,20 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() ScMarkType eMarkType = rViewData.GetSimpleArea(aRange); if ( nTabs == 1 && (eMarkType == SC_MARK_SIMPLE) ) { -// tdf#147122 - return cell object when a simple selection is merged +// tdf#154803 - check if range is entirely merged ScDocument& rDoc = pDocSh->GetDocument(); -const ScPatternAttr* pMarkPattern = rDoc.GetPattern(aRange.aStart); +const ScMergeAttr* pMergeAttr = rDoc.GetAttr(aRange.aStart, ATTR_MERGE); +SCCOL nColSpan = 1; +SCROW nRowSpan = 1; +if (pMergeAttr && pMergeAttr->IsMerged()) +{ +nColSpan = pMergeAttr->GetColMerge(); +nRowSpan = pMergeAttr->GetRowMerge(); +} +// tdf#147122 - return cell object when a simple selection is entirely merged if (aRange.aStart == aRange.aEnd -|| (pMarkPattern -&& pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, false) - == SfxItemState::SET)) +|| (aRange.aEnd.Col() -
[Libreoffice-commits] core.git: sw/qa
sw/qa/uitest/findBar/tdf154269.py | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) New commits: commit 11a25339abfb957ea51614b67bbff26cb606f3a2 Author: Andreas Heinisch AuthorDate: Mon Apr 17 17:17:21 2023 +0200 Commit: Andreas Heinisch CommitDate: Tue Apr 18 14:20:44 2023 +0200 tdf#154269 - Respect FindReplaceRememberedSearches: add unit test Change-Id: I72db7964b512a40c4b81b218b2cae60ab34d47c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150522 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sw/qa/uitest/findBar/tdf154269.py b/sw/qa/uitest/findBar/tdf154269.py index d5752093b2b6..aebab770ca35 100755 --- a/sw/qa/uitest/findBar/tdf154269.py +++ b/sw/qa/uitest/findBar/tdf154269.py @@ -15,21 +15,21 @@ class tdf154269(UITestCase): def test_tdf154269(self): with self.ui_test.create_doc_in_start_center("writer"): -# Open quick search -self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar") xWriterDoc = self.xUITest.getTopFocusWindow() -xFind = xWriterDoc.getChild("find") +xWriterEdit = xWriterDoc.getChild("writer_edit") # Generate a search history with more than 10 entries (A to Z) for searchTerm in map(chr, range(65, 91)): -# Search twice to generate a search history -xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) -xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"})) -xFind.executeAction("TYPE", mkPropertyValues({"TEXT": searchTerm})) -xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) -xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ESC"})) - self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar") +xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+f"})) +xFind = xWriterDoc.getChild("find") +xFindBar = xWriterDoc.getChild("FindBar") +xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) +xFind.executeAction("TYPE", mkPropertyValues({"TEXT":searchTerm})) +xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"})) +xFindBar.executeAction("CLICK", mkPropertyValues({"POS":"0"})) +xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+f"})) +xFind = xWriterDoc.getChild("find") # The default value of FindReplaceRememberedSearches has been respected self.assertEqual("10", get_state_as_dict(xFind)["EntryCount"])
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/extras/macros-test.cxx| 32 sc/source/ui/unoobj/viewuno.cxx | 18 +- 2 files changed, 45 insertions(+), 5 deletions(-) New commits: commit 10f2e8363076fb9217b4fc8acf12b4d9c13328cc Author: Andreas Heinisch AuthorDate: Fri Apr 14 14:29:12 2023 +0200 Commit: Andreas Heinisch CommitDate: Tue Apr 18 12:40:49 2023 +0200 tdf#154803 - Check if range is entirely merged Regression from commit b9411e587586750f36ba9009b5f1e29fe461d8b5 where I missinterpreted the check to get merged cells. Regression: tdf#147122 - Return cell object when a simple selection is merged Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145378 Change-Id: I2e39599a206cf102b1da8c7fc4bb2d8c0a4b106c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150412 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index dd971e36dec1..1135fbd38f69 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -911,6 +911,38 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf147122) CPPUNIT_ASSERT_EQUAL(Any(OUString("This is a test")), aRet); } +CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf154803) +{ +mxComponent = loadFromDesktop("private:factory/scalc"); + +css::uno::Reference xDocScr(mxComponent, UNO_QUERY_THROW); +auto xLibs = xDocScr->getBasicLibraries(); +auto xLibrary = xLibs->createLibrary("TestLibrary"); +xLibrary->insertByName( +"TestModule", +uno::Any( +OUString("Function TestExtendedMergedSelection\n" + // Merge A1:B2 cell range + " oActiveSheet = ThisComponent.CurrentController.ActiveSheet\n" + " oRange = oActiveSheet.getCellRangeByName(\"A1:B2\")\n" + " ThisComponent.getCurrentController.Select(oRange)\n" + " oActiveCell = ThisComponent.CurrentSelection\n" + " oActiveCell.Merge(True)\n" + // Select A1:B3 range and check for its implementation name + " oRange = oActiveSheet.getCellRangeByName(\"A1:B3\")\n" + " ThisComponent.getCurrentController.Select(oRange)\n" + " TestExtendedMergedSelection = ThisComponent.CurrentSelection.ImplementationName\n" + "End Function\n"))); + +Any aRet = executeMacro("vnd.sun.Star.script:TestLibrary.TestModule.TestExtendedMergedSelection?" +"language=Basic=document"); +// Without the fix in place, this test would have failed with +// - Expected : ScCellRangeObj +// - Actual : ScCellObj +// i.e. the selection was interpreted as a single cell instead of a range +CPPUNIT_ASSERT_EQUAL(Any(OUString("ScCellRangeObj")), aRet); +} + CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf116127) { mxComponent = loadFromDesktop("private:factory/scalc"); diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index 96b055250c72..bfde44272010 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -873,13 +874,20 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() ScMarkType eMarkType = rViewData.GetSimpleArea(aRange); if ( nTabs == 1 && (eMarkType == SC_MARK_SIMPLE) ) { -// tdf#147122 - return cell object when a simple selection is merged +// tdf#154803 - check if range is entirely merged ScDocument& rDoc = pDocSh->GetDocument(); -const ScPatternAttr* pMarkPattern = rDoc.GetPattern(aRange.aStart); +const ScMergeAttr* pMergeAttr = rDoc.GetAttr(aRange.aStart, ATTR_MERGE); +SCCOL nColSpan = 1; +SCROW nRowSpan = 1; +if (pMergeAttr && pMergeAttr->IsMerged()) +{ +nColSpan = pMergeAttr->GetColMerge(); +nRowSpan = pMergeAttr->GetRowMerge(); +} +// tdf#147122 - return cell object when a simple selection is entirely merged if (aRange.aStart == aRange.aEnd -|| (pMarkPattern -&& pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, false) - == SfxItemState::SET)) +|| (aRange.aEnd.Col() - aRange.aStart.Col() == nColSpan - 1 +&& aRange.aEnd.Row() - aRange.aStart.Row() == nRowSpan - 1)) pObj = new ScCellObj( pDocSh, aRange.aStart ); else pObj = new ScCellRangeObj( pDocSh, aRange );
[Libreoffice-commits] core.git: svx/source sw/qa vcl/source
svx/source/inc/findtextfield.hxx |3 ++ svx/source/tbxctrls/tbunosearchcontrollers.cxx | 12 +--- sw/qa/uitest/findBar/tdf154269.py | 36 + vcl/source/uitest/uiobject.cxx |1 4 files changed, 48 insertions(+), 4 deletions(-) New commits: commit b8349ca053753bb0dc713933628a1575a70677d3 Author: Andreas Heinisch AuthorDate: Wed Apr 12 12:13:17 2023 +0200 Commit: Andreas Heinisch CommitDate: Sat Apr 15 11:33:08 2023 +0200 tdf#154269 - Respect FindReplaceRememberedSearches expert option in quick find Change-Id: I88c1bed647bf6f77953ccd9921e515c1246fa96f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150273 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/svx/source/inc/findtextfield.hxx b/svx/source/inc/findtextfield.hxx index eb1b6cc11ee5..8cfa98f03242 100644 --- a/svx/source/inc/findtextfield.hxx +++ b/svx/source/inc/findtextfield.hxx @@ -64,6 +64,9 @@ private: void FocusIn(); void ActivateFind(bool bShift); + +// tdf#154269 - respect FindReplaceRememberedSearches expert option +sal_uInt16 m_nRememberSize; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 304eb8123c56..9611f4d686c0 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -73,8 +74,6 @@ constexpr OUStringLiteral COMMAND_FINDALL = u".uno:FindAll"; constexpr OUStringLiteral COMMAND_MATCHCASE = u".uno:MatchCase"; constexpr OUStringLiteral COMMAND_SEARCHFORMATTED = u".uno:SearchFormattedDisplayString"; -const sal_Int32 REMEMBER_SIZE = 10; - class CheckButtonItemWindow final : public InterimItemWindow { public: @@ -214,6 +213,11 @@ FindTextFieldControl::FindTextFieldControl( vcl::Window* pParent, m_xWidget->set_size_request(250, -1); SetSizePixel(m_xWidget->get_preferred_size()); + +// tdf#154269 - respect FindReplaceRememberedSearches expert option +m_nRememberSize = officecfg::Office::Common::Misc::FindReplaceRememberedSearches::get(); +if (m_nRememberSize < 1) +m_nRememberSize = 1; } void FindTextFieldControl::Remember_Impl(const OUString& rStr) @@ -226,8 +230,8 @@ void FindTextFieldControl::Remember_Impl(const OUString& rStr) return; } -if (nCount == REMEMBER_SIZE) -m_xWidget->remove(REMEMBER_SIZE-1); +if (nCount == m_nRememberSize) +m_xWidget->remove(m_nRememberSize - 1); m_xWidget->insert_text(0, rStr); } diff --git a/sw/qa/uitest/findBar/tdf154269.py b/sw/qa/uitest/findBar/tdf154269.py new file mode 100755 index ..d5752093b2b6 --- /dev/null +++ b/sw/qa/uitest/findBar/tdf154269.py @@ -0,0 +1,36 @@ +# -*- 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 uitest.uihelper.common import get_state_as_dict +from libreoffice.uno.propertyvalue import mkPropertyValues + +class tdf154269(UITestCase): + +def test_tdf154269(self): + +with self.ui_test.create_doc_in_start_center("writer"): +# Open quick search +self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar") +xWriterDoc = self.xUITest.getTopFocusWindow() +xFind = xWriterDoc.getChild("find") + +# Generate a search history with more than 10 entries (A to Z) +for searchTerm in map(chr, range(65, 91)): +# Search twice to generate a search history +xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) +xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"})) +xFind.executeAction("TYPE", mkPropertyValues({"TEXT": searchTerm})) +xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) +xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ESC"})) + self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar") + +# The default value of FindReplaceRememberedSearches has been respected +self.assertEqual("10", get_state_as_dict(xFind)["EntryCount"]) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 38079425a41d..623591e7e218 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -1224,6 +1224,7 @@ StringMap ComboBoxUIObject::get_state() { StringMap aMap =
[Libreoffice-commits] core.git: sc/inc sc/qa
sc/inc/global.hxx|3 ++- sc/qa/extras/macros-test.cxx | 37 + 2 files changed, 39 insertions(+), 1 deletion(-) New commits: commit e8de03a18ed8684ed94d93b09aa1662ba799e877 Author: Andreas Heinisch AuthorDate: Mon Apr 10 19:44:38 2023 +0200 Commit: Andreas Heinisch CommitDate: Wed Apr 12 11:36:39 2023 +0200 tdf#116127 - Add EDITATTR to ALL flags to check for valid function inputs Otherwise, the function clearcontents does not accept the EDITATTR flag as a valid input. Change-Id: I8381014da7110d060167a814d9ea02e347d5a92b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150191 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 1e42e6060d0e..fb5af9e3e451 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -165,7 +165,8 @@ enum class InsertDeleteFlags : sal_uInt16 FORGETCAPTIONS = 0x2000, /// Internal use only (d undo): do not delete caption objects of cell notes. ATTRIB = HARDATTR | STYLES, CONTENTS = VALUE | DATETIME | STRING | NOTE | FORMULA | OUTLINE | SPARKLINES, -ALL = CONTENTS | ATTRIB | OBJECTS | SPARKLINES, +// tdf#116127 - add EDITATTR to ALL flags in order to check for valid function inputs +ALL = CONTENTS | ATTRIB | OBJECTS | SPARKLINES | EDITATTR, /// Copy flags for auto/series fill functions: do not touch notes and drawing objects. AUTOFILL = ALL & ~(NOTE | OBJECTS) }; diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index ec41a2fbe4a9..caa788e7a1f6 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -911,6 +911,43 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf147122) CPPUNIT_ASSERT_EQUAL(Any(OUString("This is a test")), aRet); } +CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf116127) +{ +mxComponent = loadFromDesktop("private:factory/scalc"); + +css::uno::Reference xDocScr(mxComponent, UNO_QUERY_THROW); +auto xLibs = xDocScr->getBasicLibraries(); +auto xLibrary = xLibs->createLibrary("TestLibrary"); +xLibrary->insertByName( +"TestModule", +uno::Any(OUString( +"Function TestClearContents\n" +// Insert test string into cell A1 +" oActiveSheet = ThisComponent.CurrentController.ActiveSheet\n" +" oActiveCell = oActiveSheet.getCellRangeByName(\"A1\")\n" +" oActiveCell.setString(\"Italic Test\")\n" +// Create a text cursor and and change the first letter to italic +" oCursor = oActiveCell.Text.createTextCursor()\n" +" oCursor.gotoStart(False)\n" +" oCursor.goRight(1, True)\n" +" oCursor.CharPosture = com.sun.star.awt.FontSlant.ITALIC\n" +// Clear contents using EDITATTR cell flag to clear the italic char posture +" oActiveCell.clearContents(com.sun.star.sheet.CellFlags.EDITATTR)\n" +// Check the char posture of the first letter +" oCursor.gotoStart(False)\n" +" oCursor.goRight(1, True)\n" +" TestClearContents = oCursor.CharPosture <> com.sun.star.awt.FontSlant.ITALIC\n" +"End Function\n"))); + +Any aRet = executeMacro("vnd.sun.Star.script:TestLibrary.TestModule.TestClearContents?" +"language=Basic=document"); +// Without the fix in place, this test would have failed with +// - Expected : true +// - Actual : false +// i.e. the formatting within parts of the cell contents (EDITATTR) were not deleted +CPPUNIT_ASSERT_EQUAL(Any(true), aRet); +} + ScMacrosTest::ScMacrosTest() : UnoApiXmlTest("/sc/qa/extras/testdocuments") {
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sc/qa sc/source
sc/qa/unit/ucalc.cxx| 28 sc/source/core/tool/reffind.cxx |4 ++-- 2 files changed, 30 insertions(+), 2 deletions(-) New commits: commit 832f91b104fe0605558748b688570f443eccce26 Author: Andreas Heinisch AuthorDate: Thu Apr 6 17:38:52 2023 +0200 Commit: Adolfo Jayme Barrientos CommitDate: Sat Apr 8 06:52:25 2023 +0200 tdf#113027 - Allow cycling cell reference types including whitespaces A formula containing a remote reference to a sheet including a whitespace in its name does not correctly handle switching from relative to absolute cell references using the EXCEL R1C1 formular grammar. Change-Id: I3391f4e8f57993899b5e97f0a173b624b5ef0b22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150109 Tested-by: Jenkins Reviewed-by: Andreas Heinisch Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150130 Reviewed-by: Adolfo Jayme Barrientos diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index e5aa8515c663..84ffe142ef81 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -95,6 +95,7 @@ public: void testInput(); void testColumnIterator(); void testTdf66613(); +void testTdf113027(); void testTdf90698(); void testTdf114406(); void testTdf93951(); @@ -246,6 +247,7 @@ public: CPPUNIT_TEST(testInput); CPPUNIT_TEST(testColumnIterator); CPPUNIT_TEST(testTdf66613); +CPPUNIT_TEST(testTdf113027); CPPUNIT_TEST(testTdf90698); CPPUNIT_TEST(testTdf114406); CPPUNIT_TEST(testTdf93951); @@ -701,6 +703,32 @@ void Test::testTdf66613() m_pDoc->DeleteTab(nSecondTab); } +void Test::testTdf113027() +{ +// Insert some sheets including a whitespace in their name and switch the grammar to R1C1 +CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Sheet 1")); +CPPUNIT_ASSERT(m_pDoc->InsertTab(1, "Sheet 2")); +FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1); + +// Add a formula containing a remote reference, i.e., to another sheet +const ScAddress aScAddress(0, 0, 0); +const OUString aFormula = "='Sheet 2'!RC"; +m_pDoc->SetString(aScAddress, aFormula); + +// Switch from relative to absolute cell reference +ScRefFinder aFinder(aFormula, aScAddress, *m_pDoc, m_pDoc->GetAddressConvention()); +aFinder.ToggleRel(0, aFormula.getLength()); + +// Without the fix in place, this test would have failed with +// - Expected: ='Sheet 2'!R1C1 +// - Actual : ='Sheet 2'!RC +// i.e. the cell reference was not changed from relative to absolute +CPPUNIT_ASSERT_EQUAL(OUString("='Sheet 2'!R1C1"), aFinder.GetText()); + +m_pDoc->DeleteTab(0); +m_pDoc->DeleteTab(1); +} + void Test::testTdf90698() { CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test")); diff --git a/sc/source/core/tool/reffind.cxx b/sc/source/core/tool/reffind.cxx index 778d46a1de4e..c2851c7ff247 100644 --- a/sc/source/core/tool/reffind.cxx +++ b/sc/source/core/tool/reffind.cxx @@ -91,7 +91,7 @@ sal_Int32 FindEndPosR1C1(const sal_Unicode* p, sal_Int32 nStartPos, sal_Int32 nE if (*p == '\'') { // Skip until the closing quote. -for (; nNewEnd <= nEndPos; ++p, ++nNewEnd) +for (++p; nNewEnd <= nEndPos; ++p, ++nNewEnd) if (*p == '\'') break; if (nNewEnd > nEndPos) @@ -100,7 +100,7 @@ sal_Int32 FindEndPosR1C1(const sal_Unicode* p, sal_Int32 nStartPos, sal_Int32 nE else if (*p == '[') { // Skip until the closing bracket. -for (; nNewEnd <= nEndPos; ++p, ++nNewEnd) +for (++p; nNewEnd <= nEndPos; ++p, ++nNewEnd) if (*p == ']') break; if (nNewEnd > nEndPos)
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sc/source
sc/source/core/data/table6.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f2fb7d930b10626d9987b0ed52cc8e6a281c0f0d Author: Andreas Heinisch AuthorDate: Mon Apr 3 12:58:27 2023 +0200 Commit: Xisco Fauli CommitDate: Fri Apr 7 21:49:24 2023 +0200 tdf#89920 - Handle embedded newline in Calc's search cell Update short-circuited boolean expression so the least expensive subexpressions will be executed first Change-Id: I8c924e00e8de809f3e6df2828f8537185e71c18c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149891 Tested-by: Jenkins Reviewed-by: Andreas Heinisch (cherry picked from commit 8fc316fb65e0d4b78ec881aa79f4184602b96f54) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150140 Reviewed-by: Xisco Fauli diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 1ea4a5ace99d..a6b03f6b3d8d 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -257,7 +257,7 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, sc::Colum pFCell->SetMatColsRows( nMatCols, nMatRows ); aCol[nCol].SetFormulaCell(nRow, pFCell); } -else if (aString.indexOf('\n') != -1 && eCellType != CELLTYPE_FORMULA) +else if (eCellType != CELLTYPE_FORMULA && aString.indexOf('\n') != -1) { ScFieldEditEngine& rEngine = rDocument.GetEditEngine(); rEngine.SetTextCurrentDefaults(aString);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sc/qa sc/source
sc/qa/extras/macros-test.cxx| 28 sc/qa/extras/testdocuments/tdf89920.ods |binary sc/source/core/data/table6.cxx | 15 --- 3 files changed, 32 insertions(+), 11 deletions(-) New commits: commit 002ff93e2319385716571adec633bbf97930158e Author: Andreas Heinisch AuthorDate: Mon Mar 13 08:49:27 2023 +0100 Commit: Xisco Fauli CommitDate: Fri Apr 7 18:45:39 2023 +0200 tdf#89920 - Handle embedded newline in Calc's search cell If the replaced string contains a newline after find and replace, insert an edit cell in order to handle an embedded line correctly regardless of the content in the source cell. Change-Id: Ic8a5fc80b85546897572a228511b319cd5a8b9aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148752 Tested-by: Jenkins Reviewed-by: Andreas Heinisch Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149950 diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index 24379362bed5..d1af2ae52846 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -48,6 +48,7 @@ public: void testTdf104902(); void testTdf64639(); void testTdf142033(); +void testTdf89920(); void testPasswordProtectedUnicodeString(); void testPasswordProtectedArrayInUserType(); void testTdf131296_legacy(); @@ -82,6 +83,7 @@ public: CPPUNIT_TEST(testTdf104902); CPPUNIT_TEST(testTdf64639); CPPUNIT_TEST(testTdf142033); +CPPUNIT_TEST(testTdf89920); CPPUNIT_TEST(testPasswordProtectedUnicodeString); CPPUNIT_TEST(testPasswordProtectedArrayInUserType); CPPUNIT_TEST(testTdf131296_legacy); @@ -326,6 +328,32 @@ void ScMacrosTest::testTdf142033() CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + u"newlines"), rDoc.GetString(ScAddress(1,1,0))); } +void ScMacrosTest::testTdf89920() +{ +loadFromURL(u"tdf89920.ods"); + + executeMacro("vnd.sun.Star.script:Standard.Module1.SearchAndReplaceNewline?language=Basic&" + "location=document"); + +// Export to ODS +saveAndReload("calc8"); + +xmlDocUniquePtr pContentXml = parseExport("content.xml"); +CPPUNIT_ASSERT(pContentXml); + +assertXPathContent(pContentXml, + "/office:document-content/office:body/office:spreadsheet/table:table[1]/" + "table:table-row[1]/table:table-cell[1]/text:p[1]", + "aa bb"); + +// Without the fix in place, this test would have failed here with +// - Expression: xmlXPathNodeSetGetLength(pXmlNodes) > 0 +assertXPathContent(pContentXml, + "/office:document-content/office:body/office:spreadsheet/table:table[1]/" + "table:table-row[1]/table:table-cell[1]/text:p[2]", + "cc dd"); +} + void ScMacrosTest::testPasswordProtectedUnicodeString() { const OUString sCorrectString(u"English Русский 中文"); diff --git a/sc/qa/extras/testdocuments/tdf89920.ods b/sc/qa/extras/testdocuments/tdf89920.ods new file mode 100644 index ..216a5cc75d9d Binary files /dev/null and b/sc/qa/extras/testdocuments/tdf89920.ods differ diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 1f0fc1efbf3d..1ea4a5ace99d 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -35,14 +35,11 @@ namespace { -bool lcl_GetTextWithBreaks( const EditTextObject& rData, ScDocument* pDoc, OUString& rVal ) +void lcl_GetTextWithBreaks( const EditTextObject& rData, ScDocument* pDoc, OUString& rVal ) { -// true = more than 1 paragraph - EditEngine& rEngine = pDoc->GetEditEngine(); rEngine.SetText(rData); rVal = rEngine.GetText(); -return ( rEngine.GetParagraphCount() > 1 ); } } @@ -81,7 +78,6 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, sc::Colum pNote = nullptr; } -bool bMultiLine = false; CellType eCellType = aCell.getType(); switch (rSearchItem.GetCellType()) { @@ -90,7 +86,7 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, sc::Colum if ( eCellType == CELLTYPE_FORMULA ) aString = aCell.getFormula()->GetFormula(rDocument.GetGrammar()); else if ( eCellType == CELLTYPE_EDIT ) -bMultiLine = lcl_GetTextWithBreaks(*aCell.getEditText(), , aString); +lcl_GetTextWithBreaks(*aCell.getEditText(), , aString); else { if( !bSearchFormatted ) @@ -102,7 +98,7 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, sc::Colum } case SvxSearchCellType::VALUE: if ( eCellType == CELLTYPE_EDIT ) -bMultiLine = lcl_GetTextWithBreaks(*aCell.getEditText(), , aString); +
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/ucalc.cxx| 26 ++ sc/source/core/tool/reffind.cxx |4 ++-- 2 files changed, 28 insertions(+), 2 deletions(-) New commits: commit 40e3e9fd1c501cc1978d4370b6392701ccd42a71 Author: Andreas Heinisch AuthorDate: Thu Apr 6 17:38:52 2023 +0200 Commit: Andreas Heinisch CommitDate: Fri Apr 7 14:00:42 2023 +0200 tdf#113027 - Allow cycling cell reference types including whitespaces A formula containing a remote reference to a sheet including a whitespace in its name does not correctly handle switching from relative to absolute cell references using the EXCEL R1C1 formular grammar. Change-Id: I3391f4e8f57993899b5e97f0a173b624b5ef0b22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150109 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 8563ef8283c3..aa8dbc32b220 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -450,6 +450,32 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf66613) m_pDoc->DeleteTab(nSecondTab); } +CPPUNIT_TEST_FIXTURE(Test, testTdf113027) +{ +// Insert some sheets including a whitespace in their name and switch the grammar to R1C1 +CPPUNIT_ASSERT(m_pDoc->InsertTab(0, "Sheet 1")); +CPPUNIT_ASSERT(m_pDoc->InsertTab(1, "Sheet 2")); +FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1); + +// Add a formula containing a remote reference, i.e., to another sheet +const ScAddress aScAddress(0, 0, 0); +const OUString aFormula = "='Sheet 2'!RC"; +m_pDoc->SetString(aScAddress, aFormula); + +// Switch from relative to absolute cell reference +ScRefFinder aFinder(aFormula, aScAddress, *m_pDoc, m_pDoc->GetAddressConvention()); +aFinder.ToggleRel(0, aFormula.getLength()); + +// Without the fix in place, this test would have failed with +// - Expected: ='Sheet 2'!R1C1 +// - Actual : ='Sheet 2'!RC +// i.e. the cell reference was not changed from relative to absolute +CPPUNIT_ASSERT_EQUAL(OUString("='Sheet 2'!R1C1"), aFinder.GetText()); + +m_pDoc->DeleteTab(0); +m_pDoc->DeleteTab(1); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf90698) { CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test")); diff --git a/sc/source/core/tool/reffind.cxx b/sc/source/core/tool/reffind.cxx index ab276196d399..ac080ae5a56e 100644 --- a/sc/source/core/tool/reffind.cxx +++ b/sc/source/core/tool/reffind.cxx @@ -91,7 +91,7 @@ sal_Int32 FindEndPosR1C1(const sal_Unicode* p, sal_Int32 nStartPos, sal_Int32 nE if (*p == '\'') { // Skip until the closing quote. -for (; nNewEnd <= nEndPos; ++p, ++nNewEnd) +for (++p; nNewEnd <= nEndPos; ++p, ++nNewEnd) if (*p == '\'') break; if (nNewEnd > nEndPos) @@ -100,7 +100,7 @@ sal_Int32 FindEndPosR1C1(const sal_Unicode* p, sal_Int32 nStartPos, sal_Int32 nE else if (*p == '[') { // Skip until the closing bracket. -for (; nNewEnd <= nEndPos; ++p, ++nNewEnd) +for (++p; nNewEnd <= nEndPos; ++p, ++nNewEnd) if (*p == ']') break; if (nNewEnd > nEndPos)
[Libreoffice-commits] core.git: sw/uiconfig
sw/uiconfig/swriter/ui/outlinenumberingpage.ui |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit b51bf9594384d822a2778bf6bf3ecdeed9ef3e7f Author: Andreas Heinisch AuthorDate: Wed Apr 5 12:44:21 2023 +0200 Commit: Andreas Heinisch CommitDate: Wed Apr 5 18:48:32 2023 +0200 tdf#146312 - Chapter numbering dialog: adapt extended tooltip for [None] Change-Id: I71cddd45a336d6e201e23fdf1c93928ec2928a0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149987 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sw/uiconfig/swriter/ui/outlinenumberingpage.ui b/sw/uiconfig/swriter/ui/outlinenumberingpage.ui index 68af7bf1383d..dfcf1e299e7e 100644 --- a/sw/uiconfig/swriter/ui/outlinenumberingpage.ui +++ b/sw/uiconfig/swriter/ui/outlinenumberingpage.ui @@ -180,9 +180,10 @@ True False True +Select the paragraph style to assign to the selected outline level. Select [None] to skip the outline level. -Select the paragraph style to assign to the selected outline level. +Select the paragraph style to assign to the selected outline level. Select [None] to skip the outline level.
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/uitest/autofilter/autofilter.py |2 ++ sc/qa/uitest/autofilter2/tdf97340.py |3 +++ sc/source/ui/cctrl/checklistmenu.cxx | 12 +++- sc/source/ui/inc/checklistmenu.hxx|4 4 files changed, 20 insertions(+), 1 deletion(-) New commits: commit 37928bef1c23f30df04bc7e95fcbc202c8cb4299 Author: Andreas Heinisch AuthorDate: Mon Apr 3 12:43:51 2023 +0200 Commit: Andreas Heinisch CommitDate: Tue Apr 4 18:13:08 2023 +0200 tdf#151206 - Sc Auto Filter: filter items after search edit timeout In addition, UI tests have been adapted to address the timeout of the search process. Change-Id: Id9d78896e45da43734346654762c3541b8c07ba2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149958 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/sc/qa/uitest/autofilter/autofilter.py b/sc/qa/uitest/autofilter/autofilter.py index f792c0fdad33..8ffba26539a5 100644 --- a/sc/qa/uitest/autofilter/autofilter.py +++ b/sc/qa/uitest/autofilter/autofilter.py @@ -154,6 +154,7 @@ class AutofilterTest(UITestCase): xSearchEdit = xFloatWindow.getChild("search_edit") xSearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT" : "11"})) +self.ui_test.wait_until_property_is_updated(xList, "Children", str(1)) self.assertEqual(1, len(xList.getChildren())) self.assertEqual("11", get_state_as_dict(xList.getChild('0'))['Text']) @@ -179,6 +180,7 @@ class AutofilterTest(UITestCase): xSearchEdit = xFloatWindow.getChild("search_edit") xSearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT" : "22"})) +self.ui_test.wait_until_property_is_updated(xList, "Children", str(1)) self.assertEqual(1, len(xList.getChildren())) self.assertEqual("22", get_state_as_dict(xList.getChild('0'))['Text']) diff --git a/sc/qa/uitest/autofilter2/tdf97340.py b/sc/qa/uitest/autofilter2/tdf97340.py index 31e41ff6c358..884caa00a5db 100644 --- a/sc/qa/uitest/autofilter2/tdf97340.py +++ b/sc/qa/uitest/autofilter2/tdf97340.py @@ -29,11 +29,14 @@ class tdf97340(UITestCase): xsearchEdit = xFloatWindow.getChild("search_edit") xsearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT":" "})) +self.ui_test.wait_until_property_is_updated(xTreeList, "Children", str(0)) self.assertEqual(0, len(xTreeList.getChildren())) xsearchEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"})) #tdf#133785, without the fix in place, it would have been 0 +self.ui_test.wait_until_property_is_updated(xTreeList, "Children", str(8)) +# Number of children differs due to xTreeList.getChildren() returns only direct descendants self.assertEqual(2, len(xTreeList.getChildren())) self.assertEqual("2016", get_state_as_dict(xTreeList.getChild('0'))['Text']) self.assertEqual("2017", get_state_as_dict(xTreeList.getChild('1'))['Text']) diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index a89d852e6de0..456b0fe8b76a 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -507,6 +507,7 @@ ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent, ScViewData , mbIsPoppedUp(false) , maOpenTimer(this) , maCloseTimer(this) +, maSearchEditTimer("ScCheckListMenuControl maSearchEditTimer") { mxTreeChecks->set_clicks_to_toggle(1); mxListChecks->set_clicks_to_toggle(1); @@ -583,6 +584,9 @@ ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent, ScViewData // bulk_insert_for_each mxTreeChecks->set_size_request(mnCheckWidthReq, nChecksHeight); mxListChecks->set_size_request(mnCheckWidthReq, nChecksHeight); + +maSearchEditTimer.SetTimeout(EDIT_UPDATEDATA_TIMEOUT); +maSearchEditTimer.SetInvokeHandler(LINK(this, ScCheckListMenuControl, SearchEditTimeoutHdl)); } void ScCheckListMenuControl::GrabFocus() @@ -612,6 +616,7 @@ void ScCheckListMenuControl::DropPendingEvents() ScCheckListMenuControl::~ScCheckListMenuControl() { +maSearchEditTimer.Stop(); EndPopupMode(); for (auto& rMenuItem : maMenuItems) rMenuItem.mxSubMenuWin.reset(); @@ -739,7 +744,7 @@ namespace } } -IMPL_LINK_NOARG(ScCheckListMenuControl, EdModifyHdl, weld::Entry&, void) +IMPL_LINK_NOARG(ScCheckListMenuControl, SearchEditTimeoutHdl, Timer*, void) { OUString aSearchText = mxEdSearch->get_text(); aSearchText = ScGlobal::getCharClass().lowercase( aSearchText ); @@ -875,6 +880,11 @@ IMPL_LINK_NOARG(ScCheckListMenuControl, EdModifyHdl, weld::Entry&, void) } } +IMPL_LINK_NOARG(ScCheckListMenuControl, EdModifyHdl, weld::Entry&, void) +{ +maSearchEditTimer.Start(); +} + IMPL_LINK_NOARG(ScCheckListMenuControl, EdActivateHdl, weld::Entry&, bool) {
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - svl/source
svl/source/numbers/zforfind.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 738eed58c12e74b1dd0d1d8f8d741448bde17c2c Author: Andreas Heinisch AuthorDate: Tue Mar 7 16:02:22 2023 +0100 Commit: Caolán McNamara CommitDate: Mon Apr 3 21:03:46 2023 +0200 tdf#117037 - Support Unicode minus (0x2212) in the number scanner Change-Id: I5b2cd4f3d6ac23e10dc0745819c7955d0a8ff170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148432 Tested-by: Jenkins Reviewed-by: Eike Rathke (cherry picked from commit 34510e6e57e58fb27071564f546bbd420404e66d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148963 Reviewed-by: Caolán McNamara diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 029b2b556d0f..792766553bf2 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -906,6 +906,7 @@ inline bool ImpSvNumberInputScan::GetTime100SecSep( std::u16string_view rString, * Read a sign including brackets * '+' => 1 * '-' => -1 + * u'−' => -1 * '(' => -1, bNegCheck = 1 * else => 0 */ @@ -921,6 +922,8 @@ int ImpSvNumberInputScan::GetSign( std::u16string_view rString, sal_Int32& nPos bNegCheck = true; [[fallthrough]]; case '-': +// tdf#117037 - unicode minus (0x2212) +case u'−': nPos++; return -1; default:
[Libreoffice-commits] core.git: sw/source
sw/source/ui/misc/outline.cxx | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) New commits: commit a7b79f7e1ac4aa1dc4744dced45903f9ecc7f351 Author: Andreas Heinisch AuthorDate: Mon Apr 3 09:20:13 2023 +0200 Commit: Andreas Heinisch CommitDate: Mon Apr 3 15:20:08 2023 +0200 tdf#146312 - Chapter numbering dialog: show paragraph style [None] in preview Change-Id: Icb576df2f0de255aba9fdfddad81b654a48c6c36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149948 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index d72a003db02e..429cfb71915c 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -581,16 +581,11 @@ IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, weld::ComboBox&, rBox, void ) for( i = 0; i < MAXLEVEL; ++i) m_pCollNames[i] = m_aSaveCollNames[i]; -if(aCollName == m_aNoFormatName) -m_pCollNames[nTmpLevel].clear(); -else -{ -m_pCollNames[nTmpLevel] = aCollName; -// template already in use? -for( i = 0; i < MAXLEVEL; ++i) -if(i != nTmpLevel && m_pCollNames[i] == aCollName ) -m_pCollNames[i].clear(); -} +m_pCollNames[nTmpLevel] = aCollName; +// template already in use? +for( i = 0; i < MAXLEVEL; ++i) +if(i != nTmpLevel && m_pCollNames[i] == aCollName ) +m_pCollNames[i].clear(); // search the oldname and put it into the current entries if( !sOldName.isEmpty() )
[Libreoffice-commits] core.git: sc/source
sc/source/core/data/table6.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8fc316fb65e0d4b78ec881aa79f4184602b96f54 Author: Andreas Heinisch AuthorDate: Mon Apr 3 12:58:27 2023 +0200 Commit: Andreas Heinisch CommitDate: Mon Apr 3 14:36:15 2023 +0200 tdf#89920 - Handle embedded newline in Calc's search cell Update short-circuited boolean expression so the least expensive subexpressions will be executed first Change-Id: I8c924e00e8de809f3e6df2828f8537185e71c18c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149891 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 1ea4a5ace99d..a6b03f6b3d8d 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -257,7 +257,7 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, sc::Colum pFCell->SetMatColsRows( nMatCols, nMatRows ); aCol[nCol].SetFormulaCell(nRow, pFCell); } -else if (aString.indexOf('\n') != -1 && eCellType != CELLTYPE_FORMULA) +else if (eCellType != CELLTYPE_FORMULA && aString.indexOf('\n') != -1) { ScFieldEditEngine& rEngine = rDocument.GetEditEngine(); rEngine.SetTextCurrentDefaults(aString);