avmedia/inc/mediacontrol.hxx | 1 avmedia/source/framework/MediaControlBase.cxx | 47 +- avmedia/source/framework/mediacontrol.cxx | 11 avmedia/source/framework/mediaitem.cxx | 124 ++++--- avmedia/source/gstreamer/gstplayer.cxx | 21 - avmedia/source/gstreamer/gstplayer.hxx | 1 comphelper/source/misc/docpasswordhelper.cxx | 31 + configure.ac | 4 dictionaries | 2 download.lst | 6 editeng/source/editeng/impedit3.cxx | 8 external/libxslt/UnpackedTarball_libxslt.mk | 1 external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 | 69 ---- external/libxslt/rpath.patch.0 | 2 include/avmedia/MediaControlBase.hxx | 1 include/avmedia/mediaitem.hxx | 26 - oox/inc/drawingml/customshapeproperties.hxx | 6 oox/qa/unit/data/testTdf132557_footerCustomShapes.pptx |binary oox/qa/unit/drawingml.cxx | 29 + oox/source/drawingml/customshapeproperties.cxx | 7 oox/source/drawingml/shape.cxx | 5 oox/source/ppt/pptshape.cxx | 15 sc/qa/extras/macros-test.cxx | 40 ++ sc/qa/extras/testdocuments/tdf104902.ods |binary sc/qa/uitest/calc_tests8/tdf147086.py | 55 +++ sc/source/core/data/bcaslot.cxx | 2 sc/source/core/data/table2.cxx | 15 sc/source/ui/docshell/impex.cxx | 37 ++ sc/source/ui/view/viewfunc.cxx | 17 - sfx2/source/commandpopup/CommandPopup.cxx | 1 shell/source/unix/exec/shellexec.cxx | 3 sw/inc/doc.hxx | 2 sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx |binary sw/qa/extras/layout/data/keep-with-next-fly.fodt | 146 +++++++++ sw/qa/extras/layout/data/table_cell_overlap.fodt | 161 ++++++++++ sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt |binary sw/qa/extras/layout/layout.cxx | 61 +++ sw/qa/extras/layout/layout2.cxx | 58 +++ sw/qa/extras/uiwriter/uiwriter3.cxx | 53 +++ sw/qa/uitest/table/tdf146145.py | 47 ++ sw/source/core/docnode/ndtbl1.cxx | 22 + sw/source/core/frmedt/fetab.cxx | 12 sw/source/core/layout/findfrm.cxx | 3 sw/source/core/layout/flowfrm.cxx | 12 sw/source/core/layout/wsfrm.cxx | 4 sw/source/core/txtnode/atrfld.cxx | 2 sw/source/core/unocore/unodraw.cxx | 2 sw/source/uibase/uiview/viewstat.cxx | 20 + 48 files changed, 958 insertions(+), 234 deletions(-)
New commits: commit 1432b56c5b85eb70b88ed250a84f2d1fdd0ac9b8 Author: Renwa Hiwa <renwa...@gmail.com> AuthorDate: Thu Feb 17 16:30:37 2022 +0000 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:45 2022 +0100 Better handling of terminals LIBREOFFICE-3MQTR80G Change-Id: Ifa52d7f65aae473056202b46788c5870a8ce38c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130089 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx index cdde6a81e02d..2535fbb18e7f 100644 --- a/shell/source/unix/exec/shellexec.cxx +++ b/shell/source/unix/exec/shellexec.cxx @@ -138,7 +138,8 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar } else if (pathname.endsWithIgnoreAsciiCase(".class") || pathname.endsWithIgnoreAsciiCase(".fileloc") || pathname.endsWithIgnoreAsciiCase(".inetloc") - || pathname.endsWithIgnoreAsciiCase(".jar")) + || pathname.endsWithIgnoreAsciiCase(".jar") + || pathname.endsWithIgnoreAsciiCase(".terminal")) { dir = true; } commit 7f89bda5c3e57fd4234004765e9bfa3ce7499e32 Author: Rafael Lima <rafael.palma.l...@gmail.com> AuthorDate: Fri Feb 18 02:27:11 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:45 2022 +0100 tdf#143817 Fix HUD deleting text contents in Writer Change-Id: Ie28388016c475907c5d8fbe51906bc4a01d6b0d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130091 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit 3c94a0f7729f1638ab3b273a186c48de859cfb49) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130092 diff --git a/sfx2/source/commandpopup/CommandPopup.cxx b/sfx2/source/commandpopup/CommandPopup.cxx index 473155f89a00..7575a5794b32 100644 --- a/sfx2/source/commandpopup/CommandPopup.cxx +++ b/sfx2/source/commandpopup/CommandPopup.cxx @@ -246,6 +246,7 @@ IMPL_LINK(CommandListBox, TreeViewKeyPress, const KeyEvent&, rKeyEvent, bool) else if (rKeyEvent.GetKeyCode().GetCode() == KEY_RETURN) { RowActivated(*mpCommandTreeView); + return true; } return false; commit ba62151132f6d21e172f71209e901a9dd737283c Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Feb 17 09:57:34 2022 +0000 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:45 2022 +0100 Refetch in case SwTextNode::InsertItem causes it to be deleted Change-Id: Ie189ae4d37ffc33e58bb405f2521d1ae02a9997b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130025 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx b/sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx new file mode 100755 index 000000000000..add554ae9596 Binary files /dev/null and b/sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx differ diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 4d04857e7199..e61a66850001 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1141,6 +1141,8 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SwFormatFlyCnt aFormat( pFormat ); pNd->InsertItem(aFormat, pInternalPam->GetPoint() ->nContent.GetIndex(), 0 ); + //Refetch in case SwTextNode::InsertItem causes it to be deleted + pFormat = GetFrameFormat(); } else { commit 6cb52953d317123a36c4d9e9c2d6b3b5624eff73 Author: Tünde Tóth <toth.tu...@nisz.hu> AuthorDate: Mon Feb 7 11:58:16 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:44 2022 +0100 tdf#147086 OOXML export: don't save the empty editing password Saving with opening password, but without editing password resulted read-only documents (only on their original path: saving, i.e. copying the file in a different path was a workaround for the lost permission). Regression from commit 1b53c1dfc76f08ca7df40a0673aa50eca700d072 (tdf#144374 DOCX: export the password for editing). Change-Id: I2759dc876ee7668d00eee0aa81490c9d1e0c272b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129593 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130060 Tested-by: Jenkins diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx index 71f92db48d00..952368bc91ed 100644 --- a/comphelper/source/misc/docpasswordhelper.cxx +++ b/comphelper/source/misc/docpasswordhelper.cxx @@ -111,23 +111,26 @@ DocPasswordHelper::GenerateNewModifyPasswordInfoOOXML(std::u16string_view aPassw { uno::Sequence<beans::PropertyValue> aResult; - uno::Sequence<sal_Int8> aSalt = GenerateRandomByteSequence(16); - OUStringBuffer aBuffer; - comphelper::Base64::encode(aBuffer, aSalt); - OUString sSalt = aBuffer.toString(); + if (!aPassword.empty()) + { + uno::Sequence<sal_Int8> aSalt = GenerateRandomByteSequence(16); + OUStringBuffer aBuffer; + comphelper::Base64::encode(aBuffer, aSalt); + OUString sSalt = aBuffer.toString(); - sal_Int32 const nIterationCount = 100000; - OUString sAlgorithm("SHA-512"); + sal_Int32 const nIterationCount = 100000; + OUString sAlgorithm("SHA-512"); - const OUString sHash(GetOoxHashAsBase64(OUString(aPassword), sSalt, nIterationCount, - comphelper::Hash::IterCount::APPEND, sAlgorithm)); + const OUString sHash(GetOoxHashAsBase64(OUString(aPassword), sSalt, nIterationCount, + comphelper::Hash::IterCount::APPEND, sAlgorithm)); - if (!sHash.isEmpty()) - { - aResult = { comphelper::makePropertyValue("algorithm-name", sAlgorithm), - comphelper::makePropertyValue("salt", sSalt), - comphelper::makePropertyValue("iteration-count", nIterationCount), - comphelper::makePropertyValue("hash", sHash) }; + if (!sHash.isEmpty()) + { + aResult = { comphelper::makePropertyValue("algorithm-name", sAlgorithm), + comphelper::makePropertyValue("salt", sSalt), + comphelper::makePropertyValue("iteration-count", nIterationCount), + comphelper::makePropertyValue("hash", sHash) }; + } } return aResult; diff --git a/sc/qa/uitest/calc_tests8/tdf147086.py b/sc/qa/uitest/calc_tests8/tdf147086.py new file mode 100755 index 000000000000..906f79075b59 --- /dev/null +++ b/sc/qa/uitest/calc_tests8/tdf147086.py @@ -0,0 +1,55 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from org.libreoffice.unotest import systemPathToFileUrl +from uitest.uihelper.common import select_by_text +from tempfile import TemporaryDirectory +import os.path + +#Bug 147086 - Password in .xlsx creates readonly sheet + +class tdf147086(UITestCase): + + def test_tdf147086(self): + + with TemporaryDirectory() as tempdir: + xFilePath = os.path.join(tempdir, "tdf147086_tmp.xlsx") + + with self.ui_test.create_doc_in_start_center("calc"): + # Save the document + with self.ui_test.execute_dialog_through_command(".uno:Save", close_button="") as xSaveDialog: + xFileName = xSaveDialog.getChild("file_name") + xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": xFilePath})) + xFileTypeCombo = xSaveDialog.getChild("file_type") + select_by_text(xFileTypeCombo, "Excel 2007–365 (.xlsx)") + xPasswordCheckButton = xSaveDialog.getChild("password") + xPasswordCheckButton.executeAction("CLICK", tuple()) + xOpen = xSaveDialog.getChild("open") + + with self.ui_test.execute_dialog_through_action(xOpen, "CLICK", close_button="") as xPasswordDialog: + xReadonly = xPasswordDialog.getChild("readonly") + xReadonly.executeAction("CLICK", tuple()) + + xOk = xPasswordDialog.getChild("ok") + # XLSX confirmation dialog is displayed + with self.ui_test.execute_dialog_through_action(xOk, "CLICK", close_button="save"): + pass + + with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document: + + self.assertTrue(document.isReadonly()) + + self.xUITest.executeCommand(".uno:EditDoc") + + self.assertFalse(document.isReadonly()) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: commit 6aa4d8478758b7bd7e96f2d07ee8bc793ef855da Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Thu Feb 17 11:04:01 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:44 2022 +0100 libxslt: upgrade to release 1.1.35 Fixes CVE-2021-30560 Change-Id: I334662ddc40955780321133be9aee23858e04dc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130022 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/download.lst b/download.lst index 86dddcb13d4d..61c5f6e2faf7 100644 --- a/download.lst +++ b/download.lst @@ -193,9 +193,9 @@ export XMLSEC_TARBALL := xmlsec1-1.2.33.tar.gz export LIBXML_SHA256SUM := c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92 export LIBXML_VERSION_MICRO := 12 export LIBXML_TARBALL := libxml2-2.9.$(LIBXML_VERSION_MICRO).tar.gz -export LIBXSLT_SHA256SUM := 98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f -export LIBXSLT_VERSION_MICRO := 34 -export LIBXSLT_TARBALL := libxslt-1.1.$(LIBXSLT_VERSION_MICRO).tar.gz +export LIBXSLT_SHA256SUM := 8247f33e9a872c6ac859aa45018bc4c4d00b97e2feac9eebc10c93ce1f34dd79 +export LIBXSLT_VERSION_MICRO := 35 +export LIBXSLT_TARBALL := libxslt-1.1.$(LIBXSLT_VERSION_MICRO).tar.xz export LPSOLVE_SHA256SUM := 171816288f14215c69e730f7a4f1c325739873e21f946ff83884b350574e6695 export LPSOLVE_TARBALL := 26b3e95ddf3d9c077c480ea45874b3b8-lp_solve_5.5.tar.gz export LXML_SHA256SUM := 940caef1ec7c78e0c34b0f6b94fe42d0f2022915ffc78643d28538a5cfd0f40e diff --git a/external/libxslt/UnpackedTarball_libxslt.mk b/external/libxslt/UnpackedTarball_libxslt.mk index 5bde97637e25..7d39cb1e3478 100644 --- a/external/libxslt/UnpackedTarball_libxslt.mk +++ b/external/libxslt/UnpackedTarball_libxslt.mk @@ -21,7 +21,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,libxslt,\ external/libxslt/libxslt-msvc.patch.2) \ external/libxslt/libxslt-1.1.26-memdump.patch \ external/libxslt/rpath.patch.0 \ - external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 b/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 deleted file mode 100644 index f82c2e4f77ee..000000000000 --- a/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 +++ /dev/null @@ -1,69 +0,0 @@ -From e2584eed1c84c18f16e42188c30d2c3d8e3e8853 Mon Sep 17 00:00:00 2001 -From: Chun-wei Fan <fanchun...@src.gnome.org> -Date: Tue, 12 Nov 2019 17:37:05 +0800 -Subject: [PATCH] win32: Add configuration for profiler - -Without this the generated xsltconfig.h will not be complete as there -will be a configuration variable that is left in the header, breaking -builds. - -This will allow one to enable or disable profiler support in Windows -builds, and the default is to enable this. ---- - win32/configure.js | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/win32/configure.js b/win32/configure.js -index 56694cce..12c99f30 100644 ---- a/win32/configure.js -+++ b/win32/configure.js -@@ -47,6 +47,7 @@ var withIconv = true; - var withZlib = false; - var withCrypto = true; - var withModules = false; -+var withProfiler = true; - /* Win32 build options. */ - var dirSep = "\\"; - var compiler = "msvc"; -@@ -106,6 +107,7 @@ function usage() - txt += " zlib: Use zlib library (" + (withZlib? "yes" : "no") + ")\n"; - txt += " crypto: Enable Crypto support (" + (withCrypto? "yes" : "no") + ")\n"; - txt += " modules: Enable Module support (" + (withModules? "yes" : "no") + ")\n"; -+ txt += " profiler: Enable Profiler support (" + (withProfiler? "yes" : "no") + ")\n"; - txt += "\nWin32 build options, default value given in parentheses:\n\n"; - txt += " compiler: Compiler to be used [msvc|mingw] (" + compiler + ")\n"; - txt += " cruntime: C-runtime compiler option (only msvc) (" + cruntime + ")\n"; -@@ -192,6 +194,7 @@ function discoverVersion() - vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0")); - vf.WriteLine("WITH_CRYPTO=" + (withCrypto? "1" : "0")); - vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0")); -+ vf.WriteLine("WITH_PROFILER=" + (withProfiler? "1" : "0")); - vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0")); - vf.WriteLine("STATIC=" + (buildStatic? "1" : "0")); - vf.WriteLine("PREFIX=" + buildPrefix); -@@ -240,6 +243,8 @@ function configureXslt() - of.WriteLine(s.replace(/\@WITH_DEBUGGER\@/, withDebugger? "1" : "0")); - } else if (s.search(/\@WITH_MODULES\@/) != -1) { - of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? "1" : "0")); -+ } else if (s.search(/\@WITH_PROFILER\@/) != -1) { -+ of.WriteLine(s.replace(/\@WITH_PROFILER\@/, withProfiler? "1" : "0")); - } else if (s.search(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/) != -1) { - of.WriteLine(s.replace(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/, "NULL")); - } else -@@ -343,6 +348,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) { - withCrypto = strToBool(arg.substring(opt.length + 1, arg.length)); - else if (opt == "modules") - withModules = strToBool(arg.substring(opt.length + 1, arg.length)); -+ else if (opt == "profiler") -+ withProfiler = strToBool(arg.substring(opt.length + 1, arg.length)); - else if (opt == "compiler") - compiler = arg.substring(opt.length + 1, arg.length); - else if (opt == "cruntime") -@@ -477,6 +484,7 @@ txtOut += " Use iconv: " + boolToStr(withIconv) + "\n"; - txtOut += " With zlib: " + boolToStr(withZlib) + "\n"; - txtOut += " Crypto: " + boolToStr(withCrypto) + "\n"; - txtOut += " Modules: " + boolToStr(withModules) + "\n"; -+txtOut += " Profiler: " + boolToStr(withProfiler) + "\n"; - txtOut += "\n"; - txtOut += "Win32 build configuration\n"; - txtOut += "-------------------------\n"; diff --git a/external/libxslt/rpath.patch.0 b/external/libxslt/rpath.patch.0 index 78c4859251df..798bccec750e 100644 --- a/external/libxslt/rpath.patch.0 +++ b/external/libxslt/rpath.patch.0 @@ -7,4 +7,4 @@ +hardcode_libdir_flag_spec= ;; - netbsd*) + netbsd* | netbsdelf*-gnu) commit 551cd530625bada7d453d8a7659a9a0e5a1b7753 Author: Eike Rathke <er...@redhat.com> AuthorDate: Wed Feb 16 16:56:52 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:44 2022 +0100 Resolves: tdf#147398 Test Intersects() instead of Contains(), tdf#119083 Regression from commit 8406139062d9ffe1daed32aefe4e261c6c55d63e CommitDate: Mon Dec 6 15:45:35 2021 +0100 process broadcasts for adjacent cells together (tdf#119083) that changed single cell broadcasts to blocks of rows broadcasts and - if (rAreaRange.Contains( rAddress)) + if (rAreaRange.Contains( rRange)) but a block of rows may be distributed over several broadcast areas so rRange is not contained within one rAreaRange and thus was not broadcasted. Testing for intersection instead fixes this. Change-Id: I10700296ebc897e4b7b7752e0e6bcb480085b487 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130027 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins (cherry picked from commit a1f21d7094deb6f1ae5388718f2bc28eecd5737a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130012 Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index de772399e0e8..d2243eab1817 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -304,7 +304,7 @@ bool ScBroadcastAreaSlot::AreaBroadcast( const ScHint& rHint) ScBroadcastArea* pArea = (*aIter).mpArea; const ScRange& rAreaRange = pArea->GetRange(); - if (rAreaRange.In( rRange)) + if (rAreaRange.Intersects( rRange)) { if (pArea->IsGroupListening()) { commit 662cb7936aa451d64a85e90b0a5e8e7fdf0e3ab4 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Feb 16 13:38:47 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:44 2022 +0100 configure.ac: Update kf5 include/lib check to work with KF5 >= 5.91 The 'kcoreaddons_version.h' header was moved to the 'KCoreAddons' subdirectory in kcoreaddons commit commit d971ba9bb27a3e8f18a116692fdf98c1729ac244 Author: Ahmad Samir <a.samir...@gmail.com> Date: Sat Jan 15 14:14:13 2022 +0200 Install kcoreaddons_version.h in /usr/include/KF5/KCoreAddons/ Instead of /usr/include/KF5/kcoreaddons_version.h. For more details see: https://invent.kde.org/frameworks/kservice/-/merge_requests/79 GIT_SILENT Adapt the KF5 check to check for the 'KFileWidget' header and the 'libKF5KIOFileWidgets.so' library instead. This is more exact anyway, since we require KIOFileWidgets, and the previous check didn't ensure that. (So in case only KF5CoreAddons but not KIOFileWidgets was installed, configure would previously pass, but the build fail.) [1] https://invent.kde.org/frameworks/kcoreaddons/-/commit/d971ba9bb27a3e8f18a116692fdf98c1729ac244 Change-Id: I7ecf7f29dce85e1a6e6b0d4f2519fa37ab04ca84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129996 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> (cherry picked from commit 5fd5e42bf28a7910321c6b6d76257e7386839fbc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130007 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/configure.ac b/configure.ac index 5326327f0e52..d5d5a0692e42 100644 --- a/configure.ac +++ b/configure.ac @@ -13095,8 +13095,8 @@ then kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel" fi - kf5_test_include="KF5/kcoreaddons_version.h" - kf5_test_library="libKF5CoreAddons.so" + kf5_test_include="KF5/KIOFileWidgets/KFileWidget" + kf5_test_library="libKF5KIOFileWidgets.so" kf5_libdirs="$qt5_libdir $kf5_libdirs" dnl kf5 KDE4 support compatibility installed commit 11ff5678a00d626aa577c67b730993e17d5ca4ce Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Wed Feb 16 09:54:54 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:43 2022 +0100 for unallocated columns check default column attributes (tdf#132057) The problem was that this was returning false for the protected attribute just because a column was not allocated, but the default attributes had the flag set (so if the column had been allocated first it would have the flag set too). Change-Id: I2ef1ef40cafb7e8fc6f7b561c0a376af63f2ad26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129984 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lu...@collabora.com> (cherry picked from commit a717029e217621482ef799731f945090c6d6be4b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130015 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index f78a17fe3eed..027e61d0ab7b 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -2217,15 +2217,12 @@ const ScPatternAttr* ScTable::GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, S bool ScTable::HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, HasAttrFlags nMask ) const { - if ( nCol1 >= aCol.size() ) - return false; - if ( nCol2 >= aCol.size() ) - nCol2 = aCol.size() - 1; // Rows above range, doesn't contains flags - - bool bFound = false; - for (SCCOL i=nCol1; i<=nCol2 && !bFound; i++) - bFound |= aCol[i].HasAttrib( nRow1, nRow2, nMask ); - return bFound; + for(SCCOL nCol = nCol1; nCol <= nCol2 && nCol < aCol.size(); ++nCol ) + if( aCol[nCol].HasAttrib( nRow1, nRow2, nMask )) + return true; + if( nCol2 >= aCol.size()) + return aDefaultColAttrArray.HasAttrib( nRow1, nRow2, nMask ); + return false; } bool ScTable::HasAttribSelection( const ScMarkData& rMark, HasAttrFlags nMask ) const commit 33c39e3ef252dbca74643f5fd70f101b75733a31 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Wed Feb 16 17:32:15 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:43 2022 +0100 sw: layout: allow keep-with-next paragraph with fly to move back The problem is that a paragraph that has the fo:keep-with-next="always" and also a fly anchored at-char or at-para with style:flow-with-text="true" will never move to the previous page, even with space available. In SwContentFrame::MakeAll() it will first MoveBwd() and then go into the special case "if ( bKeep && bMoveable )" which calls Calc() on the next frame. But this fails to move the next frame because of SwFlowFrame::IsPrevObjMove() finding the fly with a mis-matching mpVertPosOrientFrame - that will not be fixed until the first SwContentFrame::MakeAll() is done and SwObjectFormatter::FormatObjsAtFrame() is called. But SwContentFrame::MakeAll() first detects that the frame is not on the same page as the next one despite bKeep, so it MoveFwd() again. This happens already in OOo 3.3. IsJoinLocked() should be a reasonably good heuristic for "is the previous frame being formatted". Change-Id: I86996dcb3d0c46fcb99ec9ad463569abbb8b99f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130033 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 38e7c18188f1c5310898181db87686774be3c040) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130014 Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sw/qa/extras/layout/data/keep-with-next-fly.fodt b/sw/qa/extras/layout/data/keep-with-next-fly.fodt new file mode 100644 index 000000000000..13d6785f4e1f --- /dev/null +++ b/sw/qa/extras/layout/data/keep-with-next-fly.fodt @@ -0,0 +1,146 @@ +<?xml version='1.0' encoding='UTF-8'?> +<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns :config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="ur n:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:meta><meta:creation-date>2022-02-16T15:01:24.088191425</meta:creation-date><dc:date>2022-02-16T15:16:50.103419678</dc:date><meta:editing-duration>PT15M29S</meta:editing-duration><meta:editing-cycles>1</meta:editing-cycles><meta:document-statistic meta:table-count="0" meta:image-count="1" meta:object-count="0" meta:page-count="2" meta:paragraph-count="1" meta:word-count="5" meta:character-count="26" meta:non-whitespace-character-count="22"/><meta:generator>LibreOfficeDev/7.4.0.0.alpha0$Linux_X86_64 LibreOffice_project/16748887dd277bd63034e07b5e2a86740235b315</meta:generator></office:meta> + <office:font-face-decls> + <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/> + <style:font-face style:name="Lohit Devanagari1" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Source Han Serif CN" svg:font-family="'Source Han Serif CN'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <draw:gradient draw:name="gradient" draw:style="linear" draw:start-color="#000000" draw:end-color="#ffffff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0deg" draw:border="0%"/> + <draw:hatch draw:name="hatch" draw:style="single" draw:color="#3465a4" draw:distance="0.02cm" draw:rotation="0"/> + <style:default-style style:family="graphic"> + <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/> + <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false"> + <style:tab-stops/> + </style:paragraph-properties> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" loext:color-lum-mod="100%" loext:color-lum-off="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/> + </style:default-style> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/> + </style:default-style> + <style:default-style style:family="table"> + <style:table-properties table:border-model="collapsing"/> + </style:default-style> + <style:default-style style:family="table-row"> + <style:table-row-properties fo:keep-together="auto"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <style:style style:name="Graphics" style:family="graphic"> + <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" style:wrap="dynamic" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/> + </style:style> + <text:outline-style style:name="Outline"> + <text:outline-level-style text:level="1" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="2" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="3" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="4" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="5" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="6" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="7" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="8" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="9" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="10" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + </text:outline-style> + <text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/> + <text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/> + <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/> + </office:styles> + <office:automatic-styles> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name=""> + <loext:graphic-properties draw:fill-gradient-name="gradient" draw:fill-hatch-name="hatch"/> + <style:paragraph-properties style:page-number="auto" fo:break-before="auto" fo:break-after="auto"/> + <style:text-properties/> + </style:style> + <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name=""> + <loext:graphic-properties draw:fill-gradient-name="gradient" draw:fill-hatch-name="hatch"/> + <style:paragraph-properties style:page-number="auto" fo:break-before="auto" fo:break-after="auto" fo:keep-with-next="always"/> + <style:text-properties/> + </style:style> + <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics"> + <style:graphic-properties style:horizontal-pos="center" style:horizontal-rel="paragraph" style:mirror="none" fo:clip="rect(0cm, 0cm, 0cm, 0cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard" style:flow-with-text="true"/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="10.5cm" fo:page-height="14.801cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm" loext:margin-gutter="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> + <number:number-style style:name="N0"> + <number:number number:min-integer-digits="1"/> + </number:number-style> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + </office:master-styles> + <office:body> + <office:text text:use-soft-page-breaks="true"> + <text:variable-decls> + <text:variable-decl office:value-type="float" text:name="abc"/> + </text:variable-decls> + <text:sequence-decls> + <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/> + <text:sequence-decl text:display-outline-level="0" text:name="Table"/> + <text:sequence-decl text:display-outline-level="0" text:name="Text"/> + <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/> + <text:sequence-decl text:display-outline-level="0" text:name="Figure"/> + </text:sequence-decls> + <text:p text:style-name="P1"><text:variable-set text:name="abc" text:formula="ooow:1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" office:value-type="float" office:value="INF" style:data-style-name="N0">** Expression is faulty **</text:variable-set></text:p> + <text:p text:style-name="P2"><draw:frame draw:style-name="fr1" draw:name="Image1" text:anchor-type="char" svg:width="0.503cm" svg:height="0.503cm" draw:z-index="0"><draw:image draw:mime-type="image/png"> + <office:binary-data>iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAABGdBTUEAANbY1E9YMgAAABl0 + RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFpSURBVHjaYvz//z8DtQBAADER + o+jjZGuibAQIICZiDOK/cgzFwEnrV/4HYXS1AAHERIxBR58yMiAb2DtzM1b1AAHERIxBIIBu + IDYAEEBMxBjE0bgdxcBL3vcZLl16jaEPIICYiDFIU9MSw8BeoeUYhgEEEBMxBnFx8WE1EN3L + AAHERIxBIECMgQABxAhKtPgM+vbtE9xmGP/69eMMP+o9wWLW0kD9OlYM/LlHGQECiAndoKg/ + USgGgTTmdS8C0yA+zIUgdeguBAggljtWdQwMVkDXACWMjd0ZXRun/Id5DWTA9C23GSaVxoEN + zISoARvoamnBYF2/hPHs2Z3/z0JdDhBADCBvIuPkhsn/QeDr14//QWwQjY0PVYeiFyCA8OaA + 3cdPoEQAiI8PAAQQEwMVAUAAsWATBAX0jx9fsWrAJQ4CAAGE1TBQwOMC9+9fwikHEEBYDQPF + IAzIe8TglEMHAAHESM2SFiDAADEwCe4BJwcYAAAAAElFTkSuQmCC + </office:binary-data> + </draw:image> + </draw:frame><text:soft-page-break/></text:p> + <text:p text:style-name="Standard"/> + </office:text> + </office:body> +</office:document> \ No newline at end of file diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 85a685ff2b44..74b0d1e1aad3 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2616,6 +2616,58 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf112290) assertXPath(pXml, "/root/page/body/txt/LineBreak[2]", "Line", "Xxxx Xxxx"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testKeepWithNextPlusFlyFollowTextFlow) +{ + createSwDoc(DATA_DIRECTORY, "keep-with-next-fly.fodt"); + + { + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + // 3 text frames on page 1 + assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds", "bottom", "7540"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "height", "276"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/bounds", "height", "276"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly/infos/bounds", "top", "1694"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/bounds", "height", "276"); + assertXPath(pXmlDoc, "/root/page", 1); + discardDumpedLayout(); + } + + dispatchCommand(mxComponent, ".uno:Fieldnames", {}); + Scheduler::ProcessEventsToIdle(); + + { + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + // 1 text frame on page 1, and some empty space + assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds", "bottom", "7540"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "height", "5796"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "bottom", "7213"); + // 2 text frames on page 2 + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/infos/bounds", "height", "276"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly/infos/bounds", "top", "10093"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/infos/bounds", "height", "276"); + assertXPath(pXmlDoc, "/root/page", 2); + discardDumpedLayout(); + } + + dispatchCommand(mxComponent, ".uno:Fieldnames", {}); + Scheduler::ProcessEventsToIdle(); + + { + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + // 3 text frames on page 1 + assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds", "bottom", "7540"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "height", "276"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/bounds", "height", "276"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly/infos/bounds", "top", "1694"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/bounds", "height", "276"); + assertXPath(pXmlDoc, "/root/page", 1); + discardDumpedLayout(); + } +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122607) { createSwDoc(DATA_DIRECTORY, "tdf122607.odt"); diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 53f3881f1d56..c53512b2763a 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1139,6 +1139,18 @@ bool SwFlowFrame::IsPrevObjMove() const OSL_ENSURE( SwFlowFrame::CastFlowFrame( pPre ), "new flowfrm?" ); if( SwFlowFrame::CastFlowFrame( pPre )->IsAnFollow( this ) ) return false; + if (SwFlowFrame::CastFlowFrame(pPre)->IsJoinLocked()) + { + SwBorderAttrAccess baa(SwFrame::GetCache(), pPre); + SwBorderAttrs const& rAttrs(*baa.Get()); + if (SwFlowFrame::CastFlowFrame(pPre)->IsKeep(rAttrs.GetAttrSet().GetKeep(), pPre->GetBreakItem())) + { // pPre is currently being formatted - maybe it moved back but + // its objects still have the old page's body as + // mpVertPosOrientFrame and SwContentFrame::MakeAll() is calling + // pNxt->Calc() in this case so allow this frame to move back + return false; // too, else pPre is forced to move forward again. + } + } SwLayoutFrame* pPreUp = pPre->GetUpper(); // If the upper is a SectionFrame, or a column of a SectionFrame, we're // allowed to protrude out of it. However, we need to respect the commit 58555b46fa5017099242d3c519e91ca2680429b3 Author: László Németh <nem...@numbertext.org> AuthorDate: Mon Feb 14 19:13:37 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:43 2022 +0100 tdf#146622 sw crash fix: don't delete already deleted rows Delete tables and rows removed also tables and table rows with tracked row deletion/insertion. This resulted not only lost change tracking, but a crashing Undo. Crash regression from commit 99059a1ececa3621c2fe46fabdd79eed9d626c42 "tdf#143359 sw: track deletion of empty table rows". Non-tracked deletion of the tracked row changes was a temporary solution for the missing UI of tracked row changes, implemented in commit 05366b8e6683363688de8708a3d88cf144c7a2bf "tdf#60382 sw offapi: add change tracking of table/row deletion". Note: UI was added in commit f348440e17debacbcba9153e238e010e8c020bdc "tdf#146120 sw: show tracked table changes with different color", commit 95c003d75e0f8b255344715a35358072b5eba99d "tdf#146145 sw: 1-click Accept/Reject of table row changes", commit 84fbb3398f7486f00e7b7dea415e1ea2510a9535 "tdf#146144 sw: add tooltip to table rows with change tracking", commit eebe4747d2d13545004937bb0267ccfc8ab9d63f "tdf#144270 sw: manage tracked table (row) deletion/insertion", commit f481c2c8e74bded11fac754e493560391229dbcd "tdf#144057 sw track changes: hide deleted table rows" and commit 23846867ea32667ccf328c36142394dd6aaee8ba "tdf#147182 sw: accept/reject all changes of a table selection". (cherry-picked from commit 95213407dfcbf34056037d60243ff915340d1a2e) Change-Id: I384b750b0d3626fa8b3f256c7eaf5b93f382e4e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130011 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 831c59d2cc05..f7749190e3ea 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1491,6 +1491,8 @@ public: /// rNotTracked = false means that the row was deleted or inserted with its tracked cell content /// bAll: delete all table rows without selection void SetRowNotTracked( const SwCursor& rCursor, const SvxPrintItem &rNotTracked, bool bAll = false ); + /// don't call SetRowNotTracked() for rows with tracked row change + static bool HasRowNotTracked( const SwCursor& rCursor ); void SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ); void SetTabLineStyle( const SwCursor& rCursor, const Color* pColor, bool bSetLine, diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index cf8c4e07e9b6..d2123c33b20c 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -1890,6 +1890,59 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132744) CPPUNIT_ASSERT_EQUAL(1, getShapes()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf146622) +{ + SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "TC-table-del-add.docx"); + CPPUNIT_ASSERT(pDoc); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + CPPUNIT_ASSERT(pWrtShell); + + CPPUNIT_ASSERT_MESSAGE("redlining should be on", + pDoc->getIDocumentRedlineAccess().IsRedlineOn()); + + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), + uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xTables->getCount()); + uno::Reference<container::XNameAccess> xTableNames = xTablesSupplier->getTextTables(); + CPPUNIT_ASSERT(xTableNames->hasByName("Table1")); + uno::Reference<text::XTextTable> xTable1(xTableNames->getByName("Table1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xTable1->getRows()->getCount()); + + dispatchCommand(mxComponent, ".uno:DeleteRows", {}); + + // This was 3 (deleting the already deleted row with change tracking) + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xTable1->getRows()->getCount()); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + Scheduler::ProcessEventsToIdle(); + + dispatchCommand(mxComponent, ".uno:DeleteRows", {}); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xTable1->getRows()->getCount()); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + Scheduler::ProcessEventsToIdle(); + + dispatchCommand(mxComponent, ".uno:DeleteRows", {}); + // This was 2 (deleting the already deleted table with change tracking) + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xTables->getCount()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xTable1->getRows()->getCount()); + + // check that the first table was deleted with change tracking + dispatchCommand(mxComponent, ".uno:AcceptAllTrackedChanges", {}); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); + + // Undo AcceptAllTrackedChanges and DeleteRows + dispatchCommand(mxComponent, ".uno:Undo", {}); + dispatchCommand(mxComponent, ".uno:Undo", {}); + + // now only the second table deleted by AcceptAllTrackedChanges + dispatchCommand(mxComponent, ".uno:AcceptAllTrackedChanges", {}); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135014) { createSwDoc(); diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 1cb5fc651b6c..4d0e38b794ab 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -540,6 +540,28 @@ bool SwDoc::GetRowBackground( const SwCursor& rCursor, std::unique_ptr<SvxBrushI return bRet; } +bool SwDoc::HasRowNotTracked( const SwCursor& rCursor ) +{ + SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); + if( !pTableNd ) + return false; + + std::vector<SwTableLine*> aRowArr; // For Lines collecting + ::lcl_CollectLines( aRowArr, rCursor, true ); + + if( aRowArr.empty() ) + return false; + + for( auto pLn : aRowArr ) + { + auto pHasTextChangesOnlyProp = pLn->GetFrameFormat()->GetAttrSet().GetItem<SvxPrintItem>(RES_PRINT); + if ( !pHasTextChangesOnlyProp || pHasTextChangesOnlyProp->GetValue() ) + // there is a not deleted row in the table selection + return true; + } + return false; +} + void SwDoc::SetRowNotTracked( const SwCursor& rCursor, const SvxPrintItem &rNew, bool bAll ) { SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index f388067c27c5..ec9968271d3d 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -332,8 +332,11 @@ bool SwFEShell::DeleteRow(bool bCompleteTable) // and set IsNoTracked table line property to false if ( GetDoc()->GetDocShell()->IsChangeRecording() ) { + // all rows have already had tracked row change in the table selection + if ( !SwDoc::HasRowNotTracked( *getShellCursor( false ) ) ) + return false; + SwEditShell* pEditShell = GetDoc()->GetEditShell(); - SwRedlineTable::size_type nOldRedlineCount = pEditShell->GetRedlineCount(); StartUndo(bCompleteTable ? SwUndoId::UI_TABLE_DELETE : SwUndoId::ROW_DELETE); StartAllAction(); @@ -347,12 +350,7 @@ bool SwFEShell::DeleteRow(bool bCompleteTable) EndAllActionAndCall(); EndUndo(bCompleteTable ? SwUndoId::UI_TABLE_DELETE : SwUndoId::ROW_DELETE); - - // track row deletion only if there were tracked text changes - // FIXME redline count can be the same in special cases, e.g. adding a - // new tracked deletion with removing an own tracked insertion... - if ( nOldRedlineCount != pEditShell->GetRedlineCount() ) - return true; + return true; } StartAllAction(); commit f60fe1c587f38e5a7ad5748466df09643bc23f31 Author: Eike Rathke <er...@redhat.com> AuthorDate: Tue Feb 15 15:49:45 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:43 2022 +0100 Resolves: tdf#147421 Do not use OUString::replaceAll() to strip null-bytes It reallocates and concatenates for each replacement so for massive amounts takes ages. Change-Id: Ibe1673fd4775c5b95833000669c1a24e718fd77c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129971 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins (cherry picked from commit 4b0c17609c2cca326bbcc9e8488a327a4a9ea952) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129938 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 5d8e755c18f6..1c21a67562e2 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1766,10 +1766,41 @@ void ScImportExport::EmbeddedNullTreatment( OUString & rStr ) // The normal case is no embedded NULL, check first before de-/allocating // ustring stuff. - sal_Unicode cNull = 0; - if (rStr.indexOf( cNull) >= 0) + const sal_Unicode cNull = 0; + sal_Int32 i; + if ((i = rStr.indexOf( cNull)) >= 0) { - rStr = rStr.replaceAll( std::u16string_view( &cNull, 1), ""); + // Do not use OUString::replaceAll(...,""), in case of repeated null + // bytes that reallocates for each and for massive amounts takes + // ~endless. See tdf#147421 with 3577016 trailing null-bytes. + const sal_Int32 nLen = rStr.getLength(); + OUStringBuffer aBuf( nLen); + sal_Int32 s = 0; + sal_Unicode const * const p = rStr.getStr(); + do + { + // Append good substring. + aBuf.append( p + s, i - s); + // Skip all cNull. + while (++i < nLen && *(p+i) == cNull) + ; + // Find next cNull after good if characters left, else end. + if (i < nLen) + { + s = i; + i = rStr.indexOf( cNull, i); + } + else + { + s = nLen; + } + } + while (0 <= i && i < nLen); + // Append good trailing substring, if any. + if (s < nLen) + aBuf.append( p + s, nLen - s); + + rStr = aBuf.makeStringAndClear(); } } commit 98c854c8a17a59297bd19bc366505ef40bf2f35b Author: Andreas Heinisch <andreas.heini...@yahoo.de> AuthorDate: Thu Dec 30 19:57:10 2021 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:42 2022 +0100 tdf#104902 - Handle embedded newline in Calc's .uno:EnterString Change-Id: I6377aebb06b6e6873ce61984a887d9e16eecd361 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127766 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de> (cherry picked from commit 44d237c375b7ef9a5a61a2f752bd19b57649ffbd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129932 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index a774129f5ae7..1811c27b6c70 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -49,6 +49,7 @@ public: void testPasswordProtectedStarBasic(); void testTdf114427(); void testRowColumn(); + void testTdf104902(); void testTdf142033(); void testPasswordProtectedUnicodeString(); void testPasswordProtectedArrayInUserType(); @@ -75,6 +76,7 @@ public: CPPUNIT_TEST(testPasswordProtectedStarBasic); CPPUNIT_TEST(testTdf114427); CPPUNIT_TEST(testRowColumn); + CPPUNIT_TEST(testTdf104902); CPPUNIT_TEST(testTdf142033); CPPUNIT_TEST(testPasswordProtectedUnicodeString); CPPUNIT_TEST(testPasswordProtectedArrayInUserType); @@ -327,6 +329,44 @@ void ScMacrosTest::testMacroButtonFormControlXlsxExport() assertXPath(pWorkbookDoc, "//x:workbook/definedNames", 0); } +void ScMacrosTest::testTdf104902() +{ + OUString aFileName; + createFileURL(u"tdf104902.ods", aFileName); + uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileName, "com.sun.star.sheet.SpreadsheetDocument"); + + Any aRet; + Sequence<sal_Int16> aOutParamIndex; + Sequence<Any> aOutParam; + Sequence<uno::Any> aParams; + + SfxObjectShell::CallXScript( + xComponent, + "vnd.sun.Star.script:Standard.Module1.display_bug?language=Basic&location=document", + aParams, aRet, aOutParamIndex, aOutParam); + + // Export to ODS + saveAndReload(xComponent, "calc8"); + CPPUNIT_ASSERT(xComponent); + + SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(xComponent); + + CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell); + ScDocShell* pDocSh = static_cast<ScDocShell*>(pFoundShell); + ScDocument& rDoc = pDocSh->GetDocument(); + + CPPUNIT_ASSERT_EQUAL(OUString("string no newlines"), rDoc.GetString(ScAddress(0, 0, 0))); + + // Without the fix in place, this test would have failed with + // - Expected: string with + // newlines + // - Actual : string withnewlines + CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + u"newlines"), rDoc.GetString(ScAddress(0, 1, 0))); + + css::uno::Reference<css::util::XCloseable> xCloseable(xComponent, css::uno::UNO_QUERY_THROW); + xCloseable->close(true); +} + void ScMacrosTest::testTdf142033() { OUString aFileName; diff --git a/sc/qa/extras/testdocuments/tdf104902.ods b/sc/qa/extras/testdocuments/tdf104902.ods new file mode 100644 index 000000000000..8524522fdcd3 Binary files /dev/null and b/sc/qa/extras/testdocuments/tdf104902.ods differ diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index ecaa0a2cdf8a..95020795aceb 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -77,6 +77,7 @@ #include <comphelper/lok.hxx> #include <conditio.hxx> #include <columnspanset.hxx> +#include <stringutil.hxx> #include <memory> @@ -578,10 +579,24 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, } else { + ScFieldEditEngine& rEngine = rDoc.GetEditEngine(); for (const auto& rTab : rMark) { bool bNumFmtSet = false; - rFunc.SetNormalString( bNumFmtSet, ScAddress( nCol, nRow, rTab ), rString, false ); + const ScAddress aScAddress(nCol, nRow, rTab); + + // tdf#104902 - handle embedded newline + if (ScStringUtil::isMultiline(rString)) + { + rEngine.SetTextCurrentDefaults(rString); + rDoc.SetEditText(aScAddress, rEngine.CreateTextObject()); + pDocSh->AdjustRowHeight(nRow, nRow, rTab); + } + else + { + rFunc.SetNormalString(bNumFmtSet, aScAddress, rString, false); + } + if (bNumFmtSet) { /* FIXME: if set on any sheet results in changed only on commit 5d7b9c132f4abed6ca6b9d0042bddfd5268f8c47 Author: László Németh <nem...@numbertext.org> AuthorDate: Fri Feb 11 08:58:05 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:42 2022 +0100 tdf#147435 sw: enable Accept Change for table selection Accept/Reject Track Change options were only enabled for table selections, if the first cell of the selected cell range contains a redline. Now they are enabled, when arbitrary cell of the table selection contains a redline. Note: if the selected columns don't contain any redlines and any tracked row changes, but the adjacent not selected columns contain a redline, there is a false Enable. Follow-up to commit 23846867ea32667ccf328c36142394dd6aaee8ba "tdf#147182 sw: accept/reject all changes of a table selection". Change-Id: I1d7af04aa3fe5232bb1ff7f9af6116bcdc621ae7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129811 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit c4f6fee3bea0d8618b5815e60304ff9359ccd21c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129934 Tested-by: Jenkins diff --git a/sw/qa/uitest/table/tdf146145.py b/sw/qa/uitest/table/tdf146145.py index a082ea780018..357ce82a45f7 100644 --- a/sw/qa/uitest/table/tdf146145.py +++ b/sw/qa/uitest/table/tdf146145.py @@ -107,4 +107,51 @@ class tdf146145(UITestCase): xToolkit.processEventsToIdle() self.assertEqual(len(tables[0].getRows()), 3) + def test_Related_tdf147182(self): + with self.ui_test.load_file(get_url_for_data_file("TC-table-del-add.docx")) as self.document: + + # Check enabling Accept/Reject Track Change icons + # and Accept Change/Reject Change context menu items + # on table rows with tracked deletion or insertion + + # enable Track Changes toolbar + self.xUITest.executeCommand(".uno:AvailableToolbars?Toolbar:string=changes") + + xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') + xToolkit.processEventsToIdle() + + # cursor at changed text: Accept Track Change is enabled + self.assertTrue(self.is_enabled_Accept_Track_Change()) + + # cursor in a changed row, but not at changed text: Accept Track Change is enabled now + self.xUITest.executeCommand(".uno:GoRight") + xToolkit.processEventsToIdle() + # This was false + self.assertTrue(self.is_enabled_Accept_Track_Change()) + + # delete first row + self.xUITest.executeCommand(".uno:AcceptTrackedChange") + xToolkit.processEventsToIdle() + # disabled Accept Track Change + while self.is_enabled_Accept_Track_Change(): + time.sleep(0.1) + self.assertFalse(self.is_enabled_Accept_Track_Change()) + + # delete first row + self.xUITest.executeCommand(".uno:SelectAll") + self.xUITest.executeCommand(".uno:SelectAll") + xToolkit.processEventsToIdle() + # This was false + while not self.is_enabled_Accept_Track_Change(): + time.sleep(0.1) + self.assertTrue(self.is_enabled_Accept_Track_Change()) + + # delete all changes in the selected table + self.xUITest.executeCommand(".uno:AcceptTrackedChange") + xToolkit.processEventsToIdle() + while self.is_enabled_Accept_Track_Change(): + time.sleep(0.1) + # disabled Accept Track Change + self.assertFalse(self.is_enabled_Accept_Track_Change()) + # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index e7ab14f6c3f8..e75cabc3d368 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -389,10 +389,28 @@ void SwView::GetState(SfxItemSet &rSet) redline = nullptr; if( redline == nullptr ) { + // for table selections, GetCursor() gives only PaM of the first cell, + // so extend the redline limit to end of last cell of the selection + // TODO: adjust this for column selections, where the selected columns + // don't contain any redlines and any tracked row changes, but the + // adjacent not selected columns do to avoid false Enable + std::unique_ptr<SwPosition> pSelectionEnd; + if ( m_pWrtShell->IsTableMode() && + m_pWrtShell->GetTableCursor()->GetSelectedBoxesCount() ) + { + const SwSelBoxes& rBoxes = m_pWrtShell->GetTableCursor()->GetSelectedBoxes(); + const SwStartNode *pSttNd = rBoxes.back()->GetSttNd(); + const SwNode* pEndNode = pSttNd->GetNodes()[pSttNd->EndOfSectionIndex()]; + pSelectionEnd.reset(new SwPosition(*pEndNode)); + } + else + pSelectionEnd.reset( + new SwPosition(pCursor->End()->nNode, pCursor->End()->nContent)); + for(; index < table.size(); ++index ) { const SwRangeRedline* tmp = table[ index ]; - if( *tmp->Start() >= *pCursor->End()) + if( *tmp->Start() >= *pSelectionEnd ) break; if( tmp->HasMark() && tmp->IsVisible()) { commit 29b5fd100e49f21f807bdf0fe306a7767233c23e Author: Attila Szűcs <szucs.atti...@nisz.hu> AuthorDate: Mon Feb 14 08:43:08 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:42 2022 +0100 tdf#146704 sw: fix regression of endnote layout in sections Endnotes collected at the end of sections moved to a new page. Regression from commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88 "tdf#139336 sw: fix extra pages of multicolumn sections with footnotes". Co-authored-by: Tibor Nagy (NISZ) Change-Id: I36568e33b04ba8024ceef6b3ea84b71fb375e2a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129896 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit 9a457c24ab2731c99f1a5fa1d28f68788e6977f3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129936 Tested-by: Jenkins diff --git a/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt b/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt new file mode 100644 index 000000000000..660dcb70df0b Binary files /dev/null and b/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 3ef61970f5ae..85a685ff2b44 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3719,6 +3719,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf135035) CPPUNIT_ASSERT_GREATER(nParentWidth, nFly3Width); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf146704_EndnoteInSection) +{ + SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf146704_EndnoteInSection.odt"); + CPPUNIT_ASSERT(pDoc); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + // Without the fix, the endnote placed to 2. page + assertXPath(pXmlDoc, "/root/page", 1); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage) { SwDoc* pDoc diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 445d3e29dcd6..d100e24526a4 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -458,8 +458,9 @@ SwFootnoteBossFrame* SwFrame::FindFootnoteBossFrame( bool bFootnotes ) // similar case can be reached with a page break + FootnoteAtEnd setting SwSectionFrame* pSectframe = pRet->FindSctFrame(); bool bMoveToPageFrame = false; + // tdf146704: only if it is really a footnote, not an endnote. // tdf54465: compatibility flag to make old odt files keep these full page sections. - if (pSectframe + if (bFootnotes && pSectframe && pSectframe->GetFormat()->getIDocumentSettingAccess().get( DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND)) { commit 11a1254d87f649ebafad7aedf2c741321b7330fb Author: Eike Rathke <er...@redhat.com> AuthorDate: Tue Feb 15 17:36:55 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:41 2022 +0100 Update git submodules * Update dictionaries from branch 'libreoffice-7-3' to d5c7b77c5828e3e7ded8bd09dbb0a59665f30523 - There is no EO country, eo-EO is a bad language tag Change-Id: Ia96d31b61d3eab009609f3d8cd8d78228449ccc4 Reviewed-on: https://gerrit.libreoffice.org/c/dictionaries/+/129973 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 5314824424e7efbba66df57cafafa7ae246b5b31) Reviewed-on: https://gerrit.libreoffice.org/c/dictionaries/+/129937 Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/dictionaries b/dictionaries index ea693b5eae63..d5c7b77c5828 160000 --- a/dictionaries +++ b/dictionaries @@ -1 +1 @@ -Subproject commit ea693b5eae635edf5c6da4cda695724b335a8681 +Subproject commit d5c7b77c5828e3e7ded8bd09dbb0a59665f30523 commit 86fe9bba1e6f8640a48ca8c4a6955021254b6bec Author: Andreas Heinisch <andreas.heini...@yahoo.de> AuthorDate: Mon Feb 14 18:29:03 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:41 2022 +0100 tdf#143709 - Create repaint rectangle with the old text size Otherwise, the repaint rectangle uses the new text size, which may lead to visual artifacts, if the old text size exceeds the new one. Change-Id: I9b49755bf6b8c453e319e2a4081d58bf2e433cd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129920 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de> (cherry picked from commit 7c00544d672f0fc0f08c12f5fd9cd53fdbe96733) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129935 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index a0e4eb43b913..19d942eeb911 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -425,7 +425,11 @@ void ImpEditEngine::FormatDoc() tools::Long nNewHeight = CalcTextHeight(&nNewHeightNTP); tools::Long nDiff = nNewHeight - nCurTextHeight; if ( nDiff ) + { + aInvalidRect.Union(tools::Rectangle::Justify( + { 0, nNewHeight }, { getWidthDirectionAware(aPaperSize), nCurTextHeight })); aStatus.GetStatusWord() |= !IsEffectivelyVertical() ? EditStatusFlags::TextHeightChanged : EditStatusFlags::TEXTWIDTHCHANGED; + } nCurTextHeight = nNewHeight; nCurTextHeightNTP = nNewHeightNTP; @@ -450,10 +454,6 @@ void ImpEditEngine::FormatDoc() } } - if (nDiff) - aInvalidRect.Union(tools::Rectangle::Justify( - { 0, nNewHeight }, { getWidthDirectionAware(aPaperSize), nCurTextHeight })); - if (!aRepaintParas.empty()) { auto CombineRepaintParasAreas = [&](const LineAreaInfo& rInfo) { commit 650b2d6a8c16db3ab2930177484e2f43b29a8dec Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Mon Feb 14 16:18:37 2022 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:41 2022 +0100 tdf#146848 sw: fix assert about input field in undo nodes These should not be updated. soffice.bin: sw/source/core/txtnode/atrfld.cxx:713: void SwTextInputField::UpdateTextNodeContent(const rtl::OUString&): Assertion `IsFieldInDoc() && "<SwTextInputField::UpdateTextNodeContent(..)> - misusage as Input Field is not in document content."' failed. 3 SwTextInputField::UpdateTextNodeContent(rtl::OUString const&) 4 SwTextInputField::NotifyContentChange(SwFormatField&) at sw/source/core/txtnode/atrfld.cxx:669 5 SwTextField::ExpandTextField(bool) const 6 SwFormatField::UpdateTextNode(SfxPoolItem const*, SfxPoolItem const*) at sw/source/core/txtnode/atrfld.cxx:407 7 SwFormatField::SwClientNotify(SwModify const&, SfxHint const&) 10 SwFieldType::UpdateFields() (this=0x7f7ff2d654b0) at sw/source/core/fields/fldbas.cxx:220 11 sw::DocumentFieldsManager::UpdateFields(bool) 12 SwFEShell::Paste(SwDoc&, bool) at sw/source/core/frmedt/fecopy.cxx:1117 Somehow this causes testTdf139843 to go from 7 to 6 pages, but opening the bugdoc shows it as 6 pages too, not sure what's going on there. Change-Id: Ie25b2b2c4d8fd262850da31cbade5e121e9ec361 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129919 Tested-by: Michael Stahl <michael.st...@allotropia.de> Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 71e8a947753d359bd5b4d1174f4d6332eaf4a309) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129933 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index c9ced5ea7a1d..079c8a4b1226 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -299,7 +299,7 @@ void SwFormatField::UpdateTextNode(const SfxPoolItem* pOld, const SfxPoolItem* p return; } - if( !mpTextField ) + if (!IsFieldInDoc()) return; // don't do anything, especially not expand! commit 00bf76a3f7cadefb1d9dd77fc511f7fdb8d37f73 Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Mon Feb 14 07:33:56 2022 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:41 2022 +0100 tdf#132557: PPTX import: Workaround for slide footer shape presets It appears that placeholder shapes with service names: - com.sun.star.presentation.TitleTextShape - com.sun.star.presentation.DateTimeShape - com.sun.star.presentation.FooterShape - com.sun.star.presentation.SlideNumberShape ... Are unable to have custom shapes in Impress. (i.e. can't be ellipse, triangle etc.). These presets get specified in OOXML with <a:prstGeom prst="ellipse"/> inside spPr (shape properties). Therefore with similar results to the PPT import, a workaround is applied where slide footers which have non default shapes are imported with com.sun.star.drawing.CustomShapes service. The layout/master footers are left as is since if they were to be imported as CustomShapes they would appear on each slide even if the slide had those footers enabled or not. Change-Id: Ic8a8ab3f6dfb7367ecd2c619ce888bf77abef460 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129889 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <ke...@collabora.com> (cherry picked from commit 6df267780c4d41b41101c1be0a954b2f16ee8012) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129931 Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/oox/inc/drawingml/customshapeproperties.hxx b/oox/inc/drawingml/customshapeproperties.hxx index 55bf387282dc..779003412fbb 100644 --- a/oox/inc/drawingml/customshapeproperties.hxx +++ b/oox/inc/drawingml/customshapeproperties.hxx @@ -124,6 +124,12 @@ public: sal_Int32 getArcNum() { return mnArcNum++; } + /** + Returns whether or not the current CustomShapeProperties + represent a default shape preset that is rectangular. + */ + bool representsDefaultShape() const; + private: sal_Int32 mnShapePresetType; diff --git a/oox/qa/unit/data/testTdf132557_footerCustomShapes.pptx b/oox/qa/unit/data/testTdf132557_footerCustomShapes.pptx new file mode 100755 index 000000000000..4dbf3717d1fd Binary files /dev/null and b/oox/qa/unit/data/testTdf132557_footerCustomShapes.pptx differ diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx index ccfa0fa80633..9ae434717fb8 100644 --- a/oox/qa/unit/drawingml.cxx +++ b/oox/qa/unit/drawingml.cxx @@ -480,6 +480,35 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testPptxTheme) xPortion->getPropertyValue("CharColorLumOff").get<sal_Int32>()); } +CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf132557_footerCustomShapes) +{ + // slide with date, footer, slide number with custom shapes + OUString aURL + = m_directories.getURLFromSrc(DATA_DIRECTORY) + "testTdf132557_footerCustomShapes.pptx"; + // When importing the document: + load(aURL); + + uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(getComponent(), uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), + uno::UNO_QUERY); + + // Test if we were able to import the footer shapes with CustomShape service. + uno::Reference<drawing::XShape> xShapeDateTime(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"), + xShapeDateTime->getShapeType()); + // Without the accompanying fix in place, this test would have failed with: + // An uncaught exception of type com.sun.star.lang.IndexOutOfBoundsException + // i.e. the shape wasn't on the slide there since it was imported as a property, not a shape. + + uno::Reference<drawing::XShape> xShapeFooter(xDrawPage->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"), + xShapeFooter->getShapeType()); + + uno::Reference<drawing::XShape> xShapeSlideNum(xDrawPage->getByIndex(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"), + xShapeSlideNum->getShapeType()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index 977afab04a6a..efe7c0ad03af 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -88,6 +88,13 @@ sal_Int32 CustomShapeProperties::GetCustomShapeGuideValue( const std::vector< Cu return nIndex; } +bool CustomShapeProperties::representsDefaultShape() const +{ + return !((getShapePresetType() >= 0 || maPath2DList.size() > 0) && + getShapePresetType() != XML_Rect && + getShapePresetType() != XML_rect); +} + CustomShapeProperties::PresetDataMap CustomShapeProperties::maPresetDataMap; static OUString GetConnectorShapeType( sal_Int32 nType ) diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index d36f01ee7eab..cd800f892030 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -748,9 +748,8 @@ Reference< XShape > const & Shape::createAndInsert( // Use custom shape instead of GraphicObjectShape if the image is cropped to // shape. Except rectangle, which does not require further cropping bool bIsCroppedGraphic = (aServiceName == "com.sun.star.drawing.GraphicObjectShape" && - (mpCustomShapePropertiesPtr->getShapePresetType() >= 0 || mpCustomShapePropertiesPtr->getPath2DList().size() > 0) && - mpCustomShapePropertiesPtr->getShapePresetType() != XML_Rect && - mpCustomShapePropertiesPtr->getShapePresetType() != XML_rect); + !mpCustomShapePropertiesPtr->representsDefaultShape()); + // ToDo: Why is ConnectorShape here treated as custom shape, but below with start and end point? bool bIsCustomShape = ( aServiceName == "com.sun.star.drawing.CustomShape" || aServiceName == "com.sun.star.drawing.ConnectorShape" || diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index b703f615d0cf..d88e6df7bfee 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -19,6 +19,7 @@ #include <oox/ppt/pptshape.hxx> #include <oox/core/xmlfilterbase.hxx> +#include <drawingml/customshapeproperties.hxx> #include <drawingml/textbody.hxx> #include <drawingml/textparagraph.hxx> #include <drawingml/textfield.hxx> @@ -149,6 +150,10 @@ bool PPTShape::IsPlaceHolderCandidate(const SlidePersist& rSlidePersist) const return false; if (rParagraphs.front()->getRuns().size() != 1) return false; + // If the placeholder has a shape other than rectangle, + // we have to place it in the slide as a CustomShape. + if (!mpCustomShapePropertiesPtr->representsDefaultShape()) + return false; return ShapeHasNoVisualPropertiesOnImport(*this); } @@ -326,6 +331,16 @@ void PPTShape::addShape( } } + // Since it is not possible to represent custom shaped placeholders in Impress + // Need to use service name css.drawing.CustomShape if they have a non default shape. + // This workaround has the drawback of them not really being processed as placeholders + // so it is only done for slide footers... + if ((mnSubType == XML_sldNum || mnSubType == XML_dt || mnSubType == XML_ftr) + && meShapeLocation == Slide && !mpCustomShapePropertiesPtr->representsDefaultShape()) + { + sServiceName = "com.sun.star.drawing.CustomShape"; + } + SAL_INFO("oox.ppt","shape service: " << sServiceName); if (mnSubType && getSubTypeIndex().has() && meShapeLocation == Layout) commit 7cdfeecbc63b1897fc6fcb9079b58b6e99fe38f3 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Feb 14 10:31:17 2022 +0000 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:40 2022 +0100 Related: tdf#100007 pause state not always updating "play" state to off if I press pause then the UI gets stuck with both pause and stop pressed in, the check against time here seems insufficient so change merge and the setters to return true if there was a real change and use that as the guard to update the UI Change-Id: I550624fa3dcd5655d715a1f965bba9345b25ded7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129846 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/avmedia/inc/mediacontrol.hxx b/avmedia/inc/mediacontrol.hxx index 33c063fc9dad..6b004626ff83 100644 --- a/avmedia/inc/mediacontrol.hxx +++ b/avmedia/inc/mediacontrol.hxx @@ -66,7 +66,6 @@ private: MediaItem maItem; bool mbLocked; MediaControlStyle meControlStyle; - double mfTime; }; } diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx index 55286145bb39..4c8026a88804 100644 --- a/avmedia/source/framework/mediacontrol.cxx +++ b/avmedia/source/framework/mediacontrol.cxx @@ -39,8 +39,7 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl maChangeTimeIdle( "avmedia MediaControl Change Time Idle" ), maItem( 0, AVMediaSetMask::ALL ), mbLocked( false ), - meControlStyle( eControlStyle ), - mfTime(0.0) + meControlStyle( eControlStyle ) { mxPlayToolBox = m_xBuilder->weld_toolbar("playtoolbox"); mxTimeSlider = m_xBuilder->weld_scale("timeslider"); @@ -116,11 +115,11 @@ void MediaControl::UpdateURLField(MediaItem const & tempItem) void MediaControl::setState( const MediaItem& rItem ) { - double fTime = rItem.getTime(); - if( !mbLocked && fTime != mfTime) + if (mbLocked) + return; + bool bChanged = maItem.merge(rItem); + if (bChanged) { - mfTime = fTime; - maItem.merge( rItem ); if( rItem.getURL().isEmpty() && meControlStyle == MediaControlStyle::SingleLine ) mxPlayToolBox->set_sensitive(false); UpdateToolBoxes( maItem ); diff --git a/avmedia/source/framework/mediaitem.cxx b/avmedia/source/framework/mediaitem.cxx index 127ad8af243f..0a53cf5d4d39 100644 --- a/avmedia/source/framework/mediaitem.cxx +++ b/avmedia/source/framework/mediaitem.cxx @@ -178,187 +178,201 @@ bool MediaItem::PutValue( const css::uno::Any& rVal, sal_uInt8 ) return bRet; } - -void MediaItem::merge( const MediaItem& rMediaItem ) +bool MediaItem::merge(const MediaItem& rMediaItem) { + bool bChanged = false; + const AVMediaSetMask nMaskSet = rMediaItem.getMaskSet(); if( AVMediaSetMask::URL & nMaskSet ) - setURL( rMediaItem.getURL(), rMediaItem.getTempURL(), rMediaItem.getReferer() ); + bChanged |= setURL(rMediaItem.getURL(), rMediaItem.getTempURL(), rMediaItem.getReferer()); if( AVMediaSetMask::MIME_TYPE & nMaskSet ) - setMimeType( rMediaItem.getMimeType() ); + bChanged |= setMimeType(rMediaItem.getMimeType()); if (nMaskSet & AVMediaSetMask::GRAPHIC) - setGraphic(rMediaItem.getGraphic()); + bChanged |= setGraphic(rMediaItem.getGraphic()); if( AVMediaSetMask::STATE & nMaskSet ) - setState( rMediaItem.getState() ); + bChanged |= setState( rMediaItem.getState() ); if( AVMediaSetMask::DURATION & nMaskSet ) - setDuration( rMediaItem.getDuration() ); + bChanged |= setDuration(rMediaItem.getDuration()); if( AVMediaSetMask::TIME & nMaskSet ) - setTime( rMediaItem.getTime() ); + bChanged |= setTime(rMediaItem.getTime()); if( AVMediaSetMask::LOOP & nMaskSet ) - setLoop( rMediaItem.isLoop() ); + bChanged |= setLoop(rMediaItem.isLoop()); if( AVMediaSetMask::MUTE & nMaskSet ) - setMute( rMediaItem.isMute() ); + bChanged |= setMute(rMediaItem.isMute()); if( AVMediaSetMask::VOLUMEDB & nMaskSet ) - setVolumeDB( rMediaItem.getVolumeDB() ); + bChanged |= setVolumeDB(rMediaItem.getVolumeDB()); if( AVMediaSetMask::ZOOM & nMaskSet ) - setZoom( rMediaItem.getZoom() ); -} + bChanged |= setZoom(rMediaItem.getZoom()); + return bChanged; +} AVMediaSetMask MediaItem::getMaskSet() const { return m_pImpl->m_nMaskSet; } - -void MediaItem::setURL( const OUString& rURL, const OUString& rTempURL, const OUString& rReferer ) +bool MediaItem::setURL(const OUString& rURL, const OUString& rTempURL, const OUString& rReferer) { m_pImpl->m_nMaskSet |= AVMediaSetMask::URL; - m_pImpl->m_URL = rURL; - m_pImpl->m_TempFileURL = rTempURL; - m_pImpl->m_Referer = rReferer; + bool bChanged = rURL != m_pImpl->m_URL || rTempURL != m_pImpl->m_TempFileURL || rReferer != m_pImpl->m_Referer; + if (bChanged) + { + m_pImpl->m_URL = rURL; + m_pImpl->m_TempFileURL = rTempURL; + m_pImpl->m_Referer = rReferer; + } + return bChanged; } - const OUString& MediaItem::getURL() const { return m_pImpl->m_URL; } - const OUString& MediaItem::getTempURL() const { return m_pImpl->m_TempFileURL; } - const OUString& MediaItem::getReferer() const { return m_pImpl->m_Referer; } - -void MediaItem::setMimeType( const OUString& rMimeType ) +bool MediaItem::setMimeType(const OUString& rMimeType) { m_pImpl->m_nMaskSet |= AVMediaSetMask::MIME_TYPE; - m_pImpl->m_sMimeType = rMimeType; + bool bChanged = rMimeType != m_pImpl->m_sMimeType; + if (bChanged) + m_pImpl->m_sMimeType = rMimeType; + return bChanged; } - OUString MediaItem::getMimeType() const { return !m_pImpl->m_sMimeType.isEmpty() ? m_pImpl->m_sMimeType : AVMEDIA_MIMETYPE_COMMON; } -void MediaItem::setGraphic(const Graphic& rGraphic) +bool MediaItem::setGraphic(const Graphic& rGraphic) { m_pImpl->m_nMaskSet |= AVMediaSetMask::GRAPHIC; - m_pImpl->m_aGraphic = rGraphic; + bool bChanged = rGraphic != m_pImpl->m_aGraphic; + if (bChanged) + m_pImpl->m_aGraphic = rGraphic; + return bChanged; } const Graphic & MediaItem::getGraphic() const { return m_pImpl->m_aGraphic; } -void MediaItem::setState( MediaState eState ) +bool MediaItem::setState(MediaState eState) { - m_pImpl->m_eState = eState; m_pImpl->m_nMaskSet |= AVMediaSetMask::STATE; + bool bChanged = eState != m_pImpl->m_eState; + if (bChanged) + m_pImpl->m_eState = eState; + return bChanged; } - MediaState MediaItem::getState() const { return m_pImpl->m_eState; } - -void MediaItem::setDuration( double fDuration ) +bool MediaItem::setDuration(double fDuration) { - m_pImpl->m_fDuration = fDuration; m_pImpl->m_nMaskSet |= AVMediaSetMask::DURATION; + bool bChanged = fDuration != m_pImpl->m_fDuration; + if (bChanged) + m_pImpl->m_fDuration = fDuration; + return bChanged; } - double MediaItem::getDuration() const { return m_pImpl->m_fDuration; } - -void MediaItem::setTime( double fTime ) +bool MediaItem::setTime(double fTime) { - m_pImpl->m_fTime = fTime; m_pImpl->m_nMaskSet |= AVMediaSetMask::TIME; + bool bChanged = fTime != m_pImpl->m_fTime; + if (bChanged) + m_pImpl->m_fTime = fTime; + return bChanged; } - double MediaItem::getTime() const { return m_pImpl->m_fTime; } - -void MediaItem::setLoop( bool bLoop ) +bool MediaItem::setLoop(bool bLoop) { - m_pImpl->m_bLoop = bLoop; m_pImpl->m_nMaskSet |= AVMediaSetMask::LOOP; + bool bChanged = bLoop != m_pImpl->m_bLoop; + if (bChanged) + m_pImpl->m_bLoop = bLoop; + return bChanged; } - bool MediaItem::isLoop() const { return m_pImpl->m_bLoop; } - -void MediaItem::setMute( bool bMute ) +bool MediaItem::setMute(bool bMute) { - m_pImpl->m_bMute = bMute; m_pImpl->m_nMaskSet |= AVMediaSetMask::MUTE; + bool bChanged = bMute != m_pImpl->m_bMute; + if (bChanged) + m_pImpl->m_bMute = bMute; + return bChanged; } - bool MediaItem::isMute() const { return m_pImpl->m_bMute; } - -void MediaItem::setVolumeDB( sal_Int16 nDB ) +bool MediaItem::setVolumeDB(sal_Int16 nDB) { - m_pImpl->m_nVolumeDB = nDB; m_pImpl->m_nMaskSet |= AVMediaSetMask::VOLUMEDB; + bool bChanged = nDB != m_pImpl->m_nVolumeDB; + if (bChanged) + m_pImpl->m_nVolumeDB = nDB; + return bChanged; } - sal_Int16 MediaItem::getVolumeDB() const { return m_pImpl->m_nVolumeDB; } - -void MediaItem::setZoom( css::media::ZoomLevel eZoom ) +bool MediaItem::setZoom(css::media::ZoomLevel eZoom) { - m_pImpl->m_eZoom = eZoom; m_pImpl->m_nMaskSet |= AVMediaSetMask::ZOOM; + bool bChanged = eZoom != m_pImpl->m_eZoom; + if (bChanged) + m_pImpl->m_eZoom = eZoom; + return bChanged; } - css::media::ZoomLevel MediaItem::getZoom() const { return m_pImpl->m_eZoom; } - OUString GetFilename(OUString const& rSourceURL) { uno::Reference<uri::XUriReferenceFactory> const xUriFactory( diff --git a/include/avmedia/mediaitem.hxx b/include/avmedia/mediaitem.hxx index a19c2319315b..ab9418607cb7 100644 --- a/include/avmedia/mediaitem.hxx +++ b/include/avmedia/mediaitem.hxx @@ -85,39 +85,39 @@ public: virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; - void merge( const MediaItem& rMediaItem ); + bool merge(const MediaItem& rMediaItem); AVMediaSetMask getMaskSet() const; - void setState( MediaState eState ); + bool setState(MediaState eState); MediaState getState() const; - void setDuration( double fDuration ); + bool setDuration(double fDuration); double getDuration() const; - void setTime( double fTime ); + bool setTime(double fTime); double getTime() const; - void setLoop( bool bLoop ); + bool setLoop(bool bLoop); bool isLoop() const; - void setMute( bool bMute ); + bool setMute(bool bMute); bool isMute() const; - void setVolumeDB( sal_Int16 nDB ); + bool setVolumeDB(sal_Int16 nDB); sal_Int16 getVolumeDB() const; - void setZoom( ::css::media::ZoomLevel eZoom ); + bool setZoom(css::media::ZoomLevel eZoom); ::css::media::ZoomLevel getZoom() const; - void setURL( const OUString& rURL, - const OUString& rTempURL, - const OUString& rReferer); + bool setURL(const OUString& rURL, + const OUString& rTempURL, + const OUString& rReferer); const OUString& getURL() const; - void setMimeType( const OUString& rMimeType ); + bool setMimeType(const OUString& rMimeType); OUString getMimeType() const; - void setGraphic(const Graphic& rGraphic); + bool setGraphic(const Graphic& rGraphic); const Graphic & getGraphic() const; const OUString& getTempURL() const; commit d58f32800a9ad0e37378478fd78c9539c2af3c8a Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Feb 14 10:59:34 2022 +0000 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:40 2022 +0100 update play/pause/stop when one of the other changes so (esp under gtk) that when pause is enabled and pause is clicked again that it remains visually enabled Change-Id: I779bb1491d2473db926b8075a0b574ef5767337d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129927 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/avmedia/source/framework/MediaControlBase.cxx b/avmedia/source/framework/MediaControlBase.cxx index c572bed7d0e6..dc83204d4228 100644 --- a/avmedia/source/framework/MediaControlBase.cxx +++ b/avmedia/source/framework/MediaControlBase.cxx @@ -133,6 +133,28 @@ void MediaControlBase::InitializeWidgets() mxTimeSlider->set_tooltip_text( AvmResId( AVMEDIA_STR_POSITION )); } +void MediaControlBase::UpdatePlayState(const MediaItem& rMediaItem) +{ + if (rMediaItem.getState() == MediaState::Play) + { + mxPlayToolBox->set_item_active("play", true); + mxPlayToolBox->set_item_active("pause", false); + mxPlayToolBox->set_item_active("stop", false); + } + else if( rMediaItem.getState() == MediaState::Pause ) + { + mxPlayToolBox->set_item_active("play", false); + mxPlayToolBox->set_item_active("pause", true); + mxPlayToolBox->set_item_active("stop", false); + } + else + { + mxPlayToolBox->set_item_active("play", false); + mxPlayToolBox->set_item_active("pause", false); + mxPlayToolBox->set_item_active("stop", true); + } +} + void MediaControlBase::UpdateToolBoxes(const MediaItem& rMediaItem) { const bool bValidURL = !rMediaItem.getURL().isEmpty(); @@ -150,24 +172,7 @@ void MediaControlBase::UpdateToolBoxes(const MediaItem& rMediaItem) { mxPlayToolBox->set_sensitive(true); mxMuteToolBox->set_sensitive(true); - if( rMediaItem.getState() == MediaState::Play ) - { - mxPlayToolBox->set_item_active("play", true); - mxPlayToolBox->set_item_active("pause", false); - mxPlayToolBox->set_item_active("stop", false); - } - else if( rMediaItem.getState() == MediaState::Pause ) - { - mxPlayToolBox->set_item_active("play", false); - mxPlayToolBox->set_item_active("pause", true); - mxPlayToolBox->set_item_active("stop", false); - } - else - { - mxPlayToolBox->set_item_active("play", false); - mxPlayToolBox->set_item_active("pause", false); - mxPlayToolBox->set_item_active("stop", true); - } + UpdatePlayState(rMediaItem); mxPlayToolBox->set_item_active("loop", rMediaItem.isLoop()); mxMuteToolBox->set_item_active("mute", rMediaItem.isMute()); if (!mbCurrentlySettingZoom) @@ -226,15 +231,21 @@ void MediaControlBase::SelectPlayToolBoxItem( MediaItem& aExecItem, MediaItem co aExecItem.setTime( 0.0 ); else aExecItem.setTime( aItem.getTime() ); + + UpdatePlayState(aExecItem); } else if (rId == "pause") { aExecItem.setState( MediaState::Pause ); + + UpdatePlayState(aExecItem); } else if (rId == "stop") { aExecItem.setState( MediaState::Stop ); aExecItem.setTime( 0.0 ); + + UpdatePlayState(aExecItem); } else if (rId == "mute") { diff --git a/include/avmedia/MediaControlBase.hxx b/include/avmedia/MediaControlBase.hxx index 3d4464ce0424..1379a4364f33 100644 --- a/include/avmedia/MediaControlBase.hxx +++ b/include/avmedia/MediaControlBase.hxx @@ -63,6 +63,7 @@ protected: void UpdateVolumeSlider( MediaItem const & aMediaItem ); void UpdateTimeSlider( MediaItem const & aMediaItem ); void UpdateTimeField( MediaItem const & aMediaItem, double fTime ); + void UpdatePlayState(const MediaItem& rMediaItem); void SelectPlayToolBoxItem( MediaItem& aExecItem, MediaItem const & aItem, std::string_view rId); void disposeWidgets(); }; commit af4469c47a9e6023ecf6d3bd5df6c1f36d90cb22 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Feb 13 21:26:46 2022 +0000 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 18 12:35:40 2022 +0100 Related: tdf#34759 ditch PlayPending hack and use GST_STATE_TARGET which seems to resolve the various problems here like that pressing stop makes it rewind to start but continue to play and that rewind/seek makes it start when it shouldn't Change-Id: I3df44f82205b7e81ecbc4ac86240e02d52a92e62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129928 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index f25ec5c6bb0c..397fe8809d93 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -284,7 +284,6 @@ Player::Player() : mbUseGtkSink( false ), mbFakeVideo (false ), mnUnmutedVolume( 0 ), - mbPlayPending ( false ), mbMuted( false ), mbLooping( false ), mbInitialized( false ), @@ -384,7 +383,6 @@ void Player::processMessage( GstMessage *message ) switch( GST_MESSAGE_TYPE( message ) ) { case GST_MESSAGE_EOS: gst_element_set_state( mpPlaybin, GST_STATE_READY ); - mbPlayPending = false; if (mbLooping) start(); break; @@ -400,9 +398,6 @@ void Player::processMessage( GstMessage *message ) { gst_video_overlay_expose(mpXOverlay); } - - if (mbPlayPending) - mbPlayPending = ((newstate == GST_STATE_READY) || (newstate == GST_STATE_PAUSED)); } break; default: @@ -531,7 +526,6 @@ void Player::preparePlaybin( std::u16string_view rURL, GstElement *pSink ) if (mpPlaybin != nullptr) { gst_element_set_state( mpPlaybin, GST_STATE_NULL ); - mbPlayPending = false; g_object_unref( mpPlaybin ); } @@ -596,7 +590,6 @@ bool Player::create( const OUString& rURL ) preparePlaybin( rURL, gst_element_factory_make( "fakesink", nullptr ) ); gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); - mbPlayPending = false; bRet = true; } ... etc. - the rest is truncated