Makefile.gbuild | 5 bin/update/create_full_mar.py | 30 -- bin/update/create_full_mar_for_languages.py | 71 ----- bin/update/create_partial_update.py | 41 --- bin/update/tools.py | 30 -- chart2/qa/extras/chart2import.cxx | 11 chart2/qa/extras/data/pptx/tdf146487.pptx |binary chart2/source/controller/main/ShapeController.cxx | 2 editeng/source/misc/acorrcfg.cxx | 5 external/onlineupdate/UnpackedTarball_onlineupdate.mk | 1 external/onlineupdate/inifiles.patch | 11 external/onlineupdate/lo.patch | 98 +++---- officecfg/registry/data/org/openoffice/Office/Accelerators.xcu | 1 oox/inc/drawingml/chart/plotareaconverter.hxx | 3 oox/inc/drawingml/chart/typegroupconverter.hxx | 3 oox/source/drawingml/chart/chartspaceconverter.cxx | 14 - oox/source/drawingml/chart/plotareaconverter.cxx | 10 oox/source/drawingml/chart/typegroupconverter.cxx | 9 oox/source/drawingml/table/predefined-table-styles.cxx | 20 + oox/source/drawingml/table/tablecell.cxx | 12 sc/source/ui/view/gridwin.cxx | 133 +++++----- sd/qa/unit/data/pptx/tdf156718.pptx |binary sd/qa/unit/import-tests.cxx | 70 +++++ solenv/bin/modules/installer/globals.pm | 1 solenv/bin/modules/installer/simplepackage.pm | 31 -- sw/CppunitTest_sw_ooxmlexport21.mk | 14 + sw/Module_sw.mk | 1 sw/qa/extras/layout/data/sdt+framePr.docx |binary sw/qa/extras/layout/layout3.cxx | 36 ++ sw/qa/extras/odfexport/data/tdf106733.fodt | 66 ++++ sw/qa/extras/odfexport/odfexport2.cxx | 20 + sw/qa/extras/ooxmlexport/data/tdf153909_followTextFlow.docx |binary sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport21.cxx | 68 +++++ sw/qa/uitest/data/tdf159102.fodt | 61 ++++ sw/qa/uitest/writer_tests8/tdf159102.py | 81 ++++++ sw/source/core/layout/anchoreddrawobject.cxx | 10 sw/source/core/layout/fly.cxx | 13 sw/source/core/text/portxt.cxx | 12 sw/source/core/undo/untbl.cxx | 9 sw/source/uibase/docvw/edtwin.cxx | 35 +- sw/source/uibase/inc/edtwin.hxx | 3 sw/source/uibase/utlui/content.cxx | 4 writerfilter/source/dmapper/DomainMapper.cxx | 20 + writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 writerfilter/source/dmapper/SdtHelper.hxx | 1 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx | 14 - xmloff/inc/xmlprop.hxx | 1 xmloff/source/text/txtprmap.cxx | 4 49 files changed, 743 insertions(+), 346 deletions(-)
New commits: commit 3e0a49fde0ac7821b96abd7b28c54ed441ac7079 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Jan 19 11:48:01 2024 +0000 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:26 2024 +0100 use a ScopeGuard to restore the original map mode in these cases the original map mode was *not* always restored, but the intent seems to be like the others that the mapmode should be the same on exit as on enter. Change-Id: Id7b668a9977c4c84df5234288baca8bd6f4232e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162276 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 30be376c86e5..3ae1a37f5066 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -6192,10 +6192,16 @@ void ScGridWindow::DeleteCopySourceOverlay() void ScGridWindow::UpdateCopySourceOverlay() { - MapMode aDrawMode = GetDrawMapMode(); - MapMode aOldMode = GetMapMode(); - if ( aOldMode != aDrawMode ) - SetMapMode( aDrawMode ); + const MapMode aDrawMode = GetDrawMapMode(); + const MapMode aOldMode = GetMapMode(); + comphelper::ScopeGuard aMapModeGuard( + [&aOldMode, &aDrawMode, this] { + if (aOldMode != aDrawMode) + SetMapMode(aOldMode); + } + ); + if (aOldMode != aDrawMode) + SetMapMode(aDrawMode); DeleteCopySourceOverlay(); @@ -6246,9 +6252,6 @@ void ScGridWindow::UpdateCopySourceOverlay() xOverlayManager->add(*pDashedBorder); mpOOSelectionBorder->append(std::move(pDashedBorder)); } - - if ( aOldMode != aDrawMode ) - SetMapMode( aOldMode ); } static std::vector<tools::Rectangle> convertPixelToLogical( @@ -6439,10 +6442,16 @@ void ScGridWindow::UpdateCursorOverlay() { ScDocument& rDoc = mrViewData.GetDocument(); - MapMode aDrawMode = GetDrawMapMode(); - MapMode aOldMode = GetMapMode(); - if ( aOldMode != aDrawMode ) - SetMapMode( aDrawMode ); + const MapMode aDrawMode = GetDrawMapMode(); + const MapMode aOldMode = GetMapMode(); + comphelper::ScopeGuard aMapModeGuard( + [&aOldMode, &aDrawMode, this] { + if (aOldMode != aDrawMode) + SetMapMode(aOldMode); + } + ); + if (aOldMode != aDrawMode) + SetMapMode(aDrawMode); // Existing OverlayObjects may be transformed in later versions. // For now, just re-create them. @@ -6601,9 +6610,6 @@ void ScGridWindow::UpdateCursorOverlay() } } } - - if ( aOldMode != aDrawMode ) - SetMapMode( aOldMode ); } void ScGridWindow::GetCellSelection(std::vector<tools::Rectangle>& rLogicRects) @@ -6771,10 +6777,16 @@ void ScGridWindow::DeleteAutoFillOverlay() void ScGridWindow::UpdateAutoFillOverlay() { - MapMode aDrawMode = GetDrawMapMode(); - MapMode aOldMode = GetMapMode(); - if ( aOldMode != aDrawMode ) - SetMapMode( aDrawMode ); + const MapMode aDrawMode = GetDrawMapMode(); + const MapMode aOldMode = GetMapMode(); + comphelper::ScopeGuard aMapModeGuard( + [&aOldMode, &aDrawMode, this] { + if (aOldMode != aDrawMode) + SetMapMode(aOldMode); + } + ); + if (aOldMode != aDrawMode) + SetMapMode(aDrawMode); DeleteAutoFillOverlay(); @@ -6853,9 +6865,6 @@ void ScGridWindow::UpdateAutoFillOverlay() mpOOAutoFill.reset(new sdr::overlay::OverlayObjectList); mpOOAutoFill->append(std::move(pOverlay)); } - - if ( aOldMode != aDrawMode ) - SetMapMode( aOldMode ); } void ScGridWindow::DeleteDragRectOverlay() commit 0cb53fab810e464b4c604209874b8bf98c7d95a8 Author: Stephan Bergmann <[email protected]> AuthorDate: Mon Jan 22 11:49:45 2024 +0100 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:26 2024 +0100 Create MAR updates from msi rather than from archive ...as the former is more convenient for release engineering (see the discussion in the comments at <https://gerrit.libreoffice.org/c/core/+/162157/1#message-8d7ebbcc64a87ee8e4a073ae1a05e3b74f5a3d6a> "Also enable --with-package-format=archive for LibreOfficeWin64.conf"). Instead of ONLINEUPDATE_MAR_OLDARCHIVE and ONLINEUPDATE_MAR_OLDMETADATA make variables, the create-partial-info target now only needs an ONLINEUPDATE_MAR_OLDMSI make variable. TODO: There are two issues when comparing the content of msi files (extracted with msiexec /a), which the old code comparing the content of archives had tried to somewhat (but not fully) address with the metadata files that I had invented (and now reverted): For one, msiexec /a also extracts content that would normally be installed somewhere else in the system (e.g., it extracts Fonts, System, and System64 directories). Differences in those directories will cause a MAR update to create those directories in the installation directory, rather than to update the corresponding files in their actual locations. For another, optional components are not recognized as such, but their content must be added to the MAR file as add/patch-if, not as plain add/patch. To work around that, for now *all* files are added as add/patch-if, conditional on the files themselves. Thus, addition of files will cause a MAR update to miss them. (As they now exclusively operate on msi files, the create-update-info and create-partial-info targets are no longer meaningful for non-Windows platforms, so drop the non-Windows bin/update/create_full_mar_for_languages.py part.) Change-Id: Ifb55b5e7d1a201b4f50a27cb449a634b96c2e29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162399 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> (cherry picked from commit 1dd40d6f488c46a0946ea773cb7a741f34bbb49f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162374 Reviewed-by: Michael Stahl <[email protected]> diff --git a/Makefile.gbuild b/Makefile.gbuild index 3dce54520b27..c7c176ede5f1 100644 --- a/Makefile.gbuild +++ b/Makefile.gbuild @@ -42,9 +42,6 @@ create-update-info: rm -rf $(UPDATE_DIR) || true mkdir -p $(MAR_DIR)/language MAR=$(INSTDIR)/program/mar $(if $(filter WNT,$(OS)),$(shell cygpath -u $(SRCDIR)/bin/update/create_full_mar.py),$(SRCDIR)/bin/update/create_full_mar.py) "$(PRODUCTNAME)" "$(WORKDIR)" "$(MAR_NAME_PREFIX)" "$(ONLINEUPDATE_MAR_CERTIFICATEPATH)" "$(ONLINEUPDATE_MAR_CERTIFICATENAME)" "$(ONLINEUPDATE_MAR_BASEURL)" '$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)' - $(if $(filter WNT,$(OS)),, \ - MAR=$(INSTDIR)/program/mar $(SRCDIR)/bin/update/create_full_mar_for_languages.py "$(PRODUCTNAME)" "$(WORKDIR)" "$(MAR_NAME_PREFIX)" "$(ONLINEUPDATE_MAR_CERTIFICATEPATH)" "$(ONLINEUPDATE_MAR_CERTIFICATENAME)" "$(ONLINEUPDATE_MAR_BASEURL)" '$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)' \ - ) upload-update-info: $(eval BUILDID := $(shell git -C $(SRCDIR) log -1 --format=%H)) @@ -60,7 +57,7 @@ create-partial-info: $(eval VERSION := $(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)) $(eval PLATFORM := $(RTL_OS)_$(RTL_ARCH)) $(eval MAR_NAME_PREFIX := $(PRODUCTNAME)_$(VERSION)_$(PLATFORM)_$(BUILDID)) - MBSDIFF=$(WORKDIR)/LinkTarget/Executable/mbsdiff MAR=$(INSTDIR)/program/mar $(if $(filter WNT,$(OS)),$(shell cygpath -u $(SRCDIR)/bin/update/create_partial_update.py),$(SRCDIR)/bin/update/create_partial_update.py) "$(WORKDIR)" "$(MAR_NAME_PREFIX)" LOOnlineUpdater "$(ONLINEUPDATE_MAR_CERTIFICATEPATH)" "$(ONLINEUPDATE_MAR_CERTIFICATENAME)" "$(ONLINEUPDATE_MAR_BASEURL)" "$(PRODUCTNAME)" '$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)' "$(ONLINEUPDATE_MAR_OLDARCHIVE)" "$(ONLINEUPDATE_MAR_OLDMETADATA)" + MBSDIFF=$(WORKDIR)/LinkTarget/Executable/mbsdiff MAR=$(INSTDIR)/program/mar $(if $(filter WNT,$(OS)),$(shell cygpath -u $(SRCDIR)/bin/update/create_partial_update.py),$(SRCDIR)/bin/update/create_partial_update.py) "$(WORKDIR)" "$(MAR_NAME_PREFIX)" LOOnlineUpdater "$(ONLINEUPDATE_MAR_CERTIFICATEPATH)" "$(ONLINEUPDATE_MAR_CERTIFICATENAME)" "$(ONLINEUPDATE_MAR_BASEURL)" "$(PRODUCTNAME)" '$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)' "$(ONLINEUPDATE_MAR_OLDMSI)" # also possible to bypass the dependencies/the gbuild processing by just running # LD_LIBRARY_PATH=instdir/program make cmd cmd='ALL_LANGS="$(ALL_LANGS)" workdir/LinkTarget/Executable/pocheck' diff --git a/bin/update/create_full_mar.py b/bin/update/create_full_mar.py index b4f53c48f163..1c5714e69b67 100755 --- a/bin/update/create_full_mar.py +++ b/bin/update/create_full_mar.py @@ -3,7 +3,6 @@ import sys import glob import os -import re import subprocess import json import argparse @@ -38,35 +37,20 @@ def main(): target_dir = update_path.get_update_dir() temp_dir = update_path.get_current_build_dir() - tar_file_glob = os.path.join(update_path.get_workdir(), "installation", product_name, "archive", "install", "*", f'{product_name}_*_archive*') - tar_files = glob.glob(tar_file_glob) - if len(tar_files) != 1: - raise Exception(f'`{tar_file_glob}` does not match exactly one file') - tar_file = tar_files[0] + msi_file_glob = os.path.join(update_path.get_workdir(), "installation", product_name, "msi", "install", "*", f'{product_name}_*.msi') + msi_files = glob.glob(msi_file_glob) + if len(msi_files) != 1: + raise Exception(f'`{msi_file_glob}` does not match exactly one file') + msi_file = msi_files[0] - uncompress_dir = uncompress_file_to_dir(tar_file, temp_dir) - - metadatafile = os.path.join( - update_path.get_workdir(), 'installation', product_name, 'archive', 'install', 'metadata') - ifsfile = os.path.join(update_path.get_mar_dir(), 'ifs') - with open(metadatafile) as meta, open(ifsfile, 'w') as ifs: - for l in meta: - m = re.fullmatch('(skip|cond) (.*)', l.rstrip()) - if m and m.group(2).startswith(f'{product_name}/'): - path = m.group(2)[len(f'{product_name}/'):] - if m.group(1) == 'skip': - os.remove(os.path.join(uncompress_dir, path)) - else: - ifs.write(f'"{path}" "{path}" ') + uncompress_dir = uncompress_file_to_dir(msi_file, temp_dir) mar_file = make_complete_mar_name(target_dir, filename_prefix) path = os.path.join( workdir, 'UnpackedTarball/onlineupdate/tools/update-packaging/make_full_update.sh') os.putenv('MOZ_PRODUCT_VERSION', version) os.putenv('MAR_CHANNEL_ID', 'LOOnlineUpdater') - subprocess.call([ - path, convert_to_native(mar_file), convert_to_native(uncompress_dir), - convert_to_native(ifsfile)]) + subprocess.call([path, convert_to_native(mar_file), convert_to_native(uncompress_dir)]) sign_mar_file(target_dir, certificate_path, certificate_name, mar_file, filename_prefix) diff --git a/bin/update/create_full_mar_for_languages.py b/bin/update/create_full_mar_for_languages.py deleted file mode 100755 index d431ecaf6d1a..000000000000 --- a/bin/update/create_full_mar_for_languages.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import os -import subprocess -import json - -from tools import uncompress_file_to_dir, get_file_info - -from path import UpdaterPath -from signing import sign_mar_file - - -def make_complete_mar_name(target_dir, filename_prefix, language): - filename = filename_prefix + "_" + language + "_complete_langpack.mar" - return os.path.join(target_dir, filename) - - -def create_lang_infos(mar_file_name, language, url): - data = {'lang': language, - 'complete': get_file_info(mar_file_name, url) - } - return data - - -def main(): - if len(sys.argv) < 8: - print( - "Usage: create_full_mar_for_languages.py $PRODUCTNAME $WORKDIR $TARGETDIR $TEMPDIR $FILENAMEPREFIX $CERTIFICATEPATH $CERTIFICATENAME $BASEURL $VERSION") - sys.exit(1) - - certificate_path = sys.argv[4] - certificate_name = sys.argv[5] - base_url = sys.argv[6] - filename_prefix = sys.argv[3] - workdir = sys.argv[2] - product_name = sys.argv[1] - version = sys.argv[7] - - updater_path = UpdaterPath(workdir) - target_dir = updater_path.get_update_dir() - temp_dir = updater_path.get_language_dir() - - language_pack_dir = os.path.join(workdir, "installation", product_name + "_languagepack", "archive", "install") - language_packs = os.listdir(language_pack_dir) - lang_infos = [] - for language in language_packs: - if language == 'log': - continue - - language_dir = os.path.join(language_pack_dir, language) - language_file = os.path.join(language_dir, os.listdir(language_dir)[0]) - - directory = uncompress_file_to_dir(language_file, os.path.join(temp_dir, language)) - - mar_file_name = make_complete_mar_name(target_dir, filename_prefix, language) - - os.putenv('MOZ_PRODUCT_VERSION', version) - os.putenv('MAR_CHANNEL_ID', 'LOOnlineUpdater') - subprocess.call([os.path.join(workdir, 'UnpackedTarball/onlineupdate/tools/update-packaging/make_full_update.sh'), mar_file_name, directory]) - - sign_mar_file(target_dir, certificate_path, certificate_name, mar_file_name, filename_prefix) - - lang_infos.append(create_lang_infos(mar_file_name, language, base_url)) - - with open(os.path.join(target_dir, "complete_lang_info.json"), "w") as language_info_file: - json.dump({'languages': lang_infos}, language_info_file, indent=4) - - -if __name__ == '__main__': - main() diff --git a/bin/update/create_partial_update.py b/bin/update/create_partial_update.py index 88a4553d6a36..8c49bd9159fd 100755 --- a/bin/update/create_partial_update.py +++ b/bin/update/create_partial_update.py @@ -29,10 +29,9 @@ def main(): base_url = sys.argv[6] product_name = sys.argv[7] version = sys.argv[8] - old_archive = sys.argv[9] - old_metadata = sys.argv[10] + old_msi = sys.argv[9] - old_uncompress_dir = uncompress_file_to_dir(old_archive, updater_path.get_previous_build_dir()) + old_uncompress_dir = uncompress_file_to_dir(old_msi, updater_path.get_previous_build_dir()) versionini = os.path.join(old_uncompress_dir, 'program', 'version.ini') #TODO: Linux, macOS old_build_id = None with open(versionini) as f: @@ -44,33 +43,12 @@ def main(): if old_build_id is None: raise Exception(f'Cannot find buildid in {versionini}') - #TODO: check for problematic changes between old and new metadata - with open(old_metadata) as meta: - for l in meta: - m = re.fullmatch('skip (.*)', l.rstrip()) - if m and m.group(1).startswith(f'{product_name}/'): - path = m.group(1)[len(f'{product_name}/'):] - os.remove(os.path.join(old_uncompress_dir, path)) - - new_tar_file_glob = os.path.join(updater_path.get_workdir(), "installation", product_name, "archive", "install", "*", f'{product_name}_*_archive*') - new_tar_files = glob.glob(new_tar_file_glob) - if len(new_tar_files) != 1: - raise Exception(f'`{new_tar_file_glob}` does not match exactly one file') - new_tar_file = new_tar_files[0] - new_uncompress_dir = uncompress_file_to_dir(new_tar_file, updater_path.get_current_build_dir()) - - new_metadata = os.path.join( - updater_path.get_workdir(), 'installation', product_name, 'archive', 'install', 'metadata') - ifsfile = os.path.join(updater_path.get_mar_dir(), 'ifs') - with open(new_metadata) as meta, open(ifsfile, 'w') as ifs: - for l in meta: - m = re.fullmatch('(skip|cond) (.*)', l.rstrip()) - if m and m.group(2).startswith(f'{product_name}/'): - path = m.group(2)[len(f'{product_name}/'):] - if m.group(1) == 'skip': - os.remove(os.path.join(new_uncompress_dir, path)) - else: - ifs.write(f'"{path}" "{path}" ') + new_msi_file_glob = os.path.join(updater_path.get_workdir(), "installation", product_name, "msi", "install", "*", f'{product_name}_*.msi') + new_msi_files = glob.glob(new_msi_file_glob) + if len(new_msi_files) != 1: + raise Exception(f'`{new_msi_file_glob}` does not match exactly one file') + new_msi_file = new_msi_files[0] + new_uncompress_dir = uncompress_file_to_dir(new_msi_file, updater_path.get_current_build_dir()) update_dir = updater_path.get_update_dir() @@ -80,8 +58,7 @@ def main(): os.putenv('MOZ_PRODUCT_VERSION', version) os.putenv('MAR_CHANNEL_ID', 'LOOnlineUpdater') subprocess.call([os.path.join(workdir, 'UnpackedTarball/onlineupdate/tools/update-packaging/make_incremental_update.sh'), convert_to_native(mar_file), - convert_to_native(old_uncompress_dir), convert_to_native(new_uncompress_dir), - convert_to_native(ifsfile)]) + convert_to_native(old_uncompress_dir), convert_to_native(new_uncompress_dir)]) sign_mar_file(update_dir, certificate_path, certificate_name, mar_file, mar_name_prefix) diff --git a/bin/update/tools.py b/bin/update/tools.py index ab38d10f4b57..6bc3f7971fc8 100644 --- a/bin/update/tools.py +++ b/bin/update/tools.py @@ -1,30 +1,20 @@ import os import hashlib -import zipfile -import tarfile +import subprocess +from path import convert_to_native -def uncompress_file_to_dir(compressed_file, uncompress_dir): - extension = os.path.splitext(compressed_file)[1] +def uncompress_file_to_dir(compressed_file, uncompress_dir): os.makedirs(uncompress_dir, exist_ok=True) - if extension == '.gz': - with tarfile.open(compressed_file) as tar: - tar.extractall(uncompress_dir) - elif extension == '.zip': - with zipfile.ZipFile(compressed_file) as zip_file: - zip_file.extractall(uncompress_dir) - - uncompress_dir = os.path.join(uncompress_dir, os.listdir(uncompress_dir)[0]) - if " " in os.listdir(uncompress_dir)[0]: - print("replacing whitespace in directory name") - os.rename(os.path.join(uncompress_dir, os.listdir(uncompress_dir)[0]), - os.path.join(uncompress_dir, os.listdir(uncompress_dir)[0].replace(" ", "_"))) - else: - print("Error: unknown extension " + extension) - - return os.path.join(uncompress_dir, os.listdir(uncompress_dir)[0]) + if subprocess.call([ + 'msiexec', '/a', convert_to_native(compressed_file).replace('/', '\'), + '/quiet', + 'TARGETDIR=' + convert_to_native(uncompress_dir).replace('/', '\')]) != 0: + raise Exception(f'msiexec failed') + + return uncompress_dir BUF_SIZE = 1048576 diff --git a/external/onlineupdate/UnpackedTarball_onlineupdate.mk b/external/onlineupdate/UnpackedTarball_onlineupdate.mk index 43c189b84a18..166ede0a6b9b 100644 --- a/external/onlineupdate/UnpackedTarball_onlineupdate.mk +++ b/external/onlineupdate/UnpackedTarball_onlineupdate.mk @@ -21,7 +21,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,onlineupdate, \ ifeq ($(OS),WNT) $(eval $(call gb_UnpackedTarball_add_patches,onlineupdate, \ external/onlineupdate/cygpath.patch \ - external/onlineupdate/inifiles.patch \ )) endif diff --git a/external/onlineupdate/inifiles.patch b/external/onlineupdate/inifiles.patch deleted file mode 100644 index 1d285f09af1b..000000000000 --- a/external/onlineupdate/inifiles.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- tools/update-packaging/make_incremental_update.sh -+++ tools/update-packaging/make_incremental_update.sh -@@ -226,7 +227,7 @@ - patchsize=$(get_file_size "$patchfile") - fullsize=$(get_file_size "$workdir/$f") - -- if [ $patchsize -lt $fullsize ]; then -+ if [ $patchsize -lt $fullsize ] && [ "$f" != program/setup.ini ] && [ "$f" != program/version.ini ]; then - make_patch_instruction "$f" "$updatemanifestv3" - mv -f "$patchfile" "$workdir/$f.patch" - rm -f "$workdir/$f" diff --git a/external/onlineupdate/lo.patch b/external/onlineupdate/lo.patch index ce4f2e4c77ec..debb7a5b3bbf 100644 --- a/external/onlineupdate/lo.patch +++ b/external/onlineupdate/lo.patch @@ -225,49 +225,49 @@ } --- tools/update-packaging/common.sh +++ tools/update-packaging/common.sh -@@ -76,6 +76,15 @@ +@@ -76,17 +76,8 @@ forced= fi -+ if [ -n "$IFSFILE" ]; then -+ ifsline=$(grep -F " \"$f\"" "$IFSFILE") -+ if [ -n "$ifsline" ]; then -+ testfile=$(printf '%s' "$ifsline" | cut -f 2 -d '"') -+ verbose_notice " add-if \"$testfile\" \"$f\"" -+ echo "add-if \"$testfile\" \"$f\"" >> "$filev3" -+ return -+ fi -+ fi - is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/') - if [ $is_extension = "1" ]; then - # Use the subdirectory of the extensions folder as the file to test -@@ -113,6 +122,15 @@ +- is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/') +- if [ $is_extension = "1" ]; then +- # Use the subdirectory of the extensions folder as the file to test +- # before performing this add instruction. +- testdir=$(echo "$f" | sed 's/\(.*distribution\/extensions\/[^\/]*\)\/.*//') +- verbose_notice " add-if \"$testdir\" \"$f\"" +- echo "add-if \"$testdir\" \"$f\"" >> "$filev3" +- else +- verbose_notice " add \"$f\"$forced" +- echo "add \"$f\"" >> "$filev3" +- fi ++ verbose_notice " add-if \"$f\" \"$f\"$forced" ++ echo "add-if \"$f\" \"$f\"" >> "$filev3" + } + + check_for_add_if_not_update() { +@@ -113,17 +104,8 @@ f="$1" filev3="$2" -+ if [ -n "$IFSFILE" ]; then -+ ifsline=$(grep -F " \"$f\"" "$IFSFILE") -+ if [ -n "$ifsline" ]; then -+ testfile=$(printf '%s' "$ifsline" | cut -f 2 -d '"') -+ verbose_notice " patch-if \"$testfile\" \"$f.patch\" \"$f\"" -+ echo "patch-if \"$testfile\" \"$f.patch\" \"$f\"" >> "$filev3" -+ return -+ fi -+ fi - is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/') - if [ $is_extension = "1" ]; then - # Use the subdirectory of the extensions folder as the file to test +- is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/') +- if [ $is_extension = "1" ]; then +- # Use the subdirectory of the extensions folder as the file to test +- # before performing this add instruction. +- testdir=$(echo "$f" | sed 's/\(.*distribution\/extensions\/[^\/]*\)\/.*//') +- verbose_notice " patch-if \"$testdir\" \"$f.patch\" \"$f\"" +- echo "patch-if \"$testdir\" \"$f.patch\" \"$f\"" >> "$filev3" +- else +- verbose_notice " patch \"$f.patch\" \"$f\"" +- echo "patch \"$f.patch\" \"$f\"" >> "$filev3" +- fi ++ verbose_notice " patch-if \"$f\" \"$f.patch\" \"$f\"" ++ echo "patch-if \"$f\" \"$f.patch\" \"$f\"" >> "$filev3" + } + + append_remove_instructions() { --- tools/update-packaging/make_full_update.sh +++ tools/update-packaging/make_full_update.sh -@@ -45,6 +45,7 @@ - - archive="$1" - targetdir="$2" -+IFSFILE=$3 - # Prevent the workdir from being inside the targetdir so it isn't included in - # the update mar. - if [ $(echo "$targetdir" | grep -c '\/$') = 1 ]; then -@@ -53,9 +54,10 @@ +@@ -53,9 +53,10 @@ fi workdir="$targetdir.work" updatemanifestv3="$workdir/updatev3.manifest" @@ -279,7 +279,7 @@ # Generate a list of all files in the target directory. pushd "$targetdir" -@@ -66,7 +68,6 @@ +@@ -66,7 +67,6 @@ if [ ! -f "precomplete" ]; then if [ ! -f "Contents/Resources/precomplete" ]; then notice "precomplete file is missing!" @@ -287,7 +287,7 @@ fi fi -@@ -99,7 +100,7 @@ +@@ -99,7 +99,7 @@ $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$targetdir/$f" > "$workdir/$f" copy_perm "$targetdir/$f" "$workdir/$f" @@ -296,7 +296,7 @@ done # Append remove instructions for any dead files. -@@ -110,7 +111,7 @@ +@@ -110,7 +110,7 @@ $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3" mar_command="$mar_command -C \"$workdir\" -c output.mar" @@ -307,15 +307,7 @@ # cleanup --- tools/update-packaging/make_incremental_update.sh +++ tools/update-packaging/make_incremental_update.sh -@@ -104,6 +104,7 @@ - archive="$1" - olddir="$2" - newdir="$3" -+IFSFILE=$4 - # Prevent the workdir from being inside the targetdir so it isn't included in - # the update mar. - if [ $(echo "$newdir" | grep -c '\/$') = 1 ]; then -@@ -112,9 +113,10 @@ +@@ -112,9 +112,10 @@ fi workdir="$(mktemp -d)" updatemanifestv3="$workdir/updatev3.manifest" @@ -327,7 +319,7 @@ # Generate a list of all files in the target directory. pushd "$olddir" -@@ -135,7 +137,6 @@ +@@ -135,7 +136,6 @@ if [ ! -f "precomplete" ]; then if [ ! -f "Contents/Resources/precomplete" ]; then notice "precomplete file is missing!" @@ -335,7 +327,7 @@ fi fi -@@ -170,7 +171,7 @@ +@@ -170,7 +170,7 @@ $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f" copy_perm "$newdir/$f" "$workdir/$f" make_add_if_not_instruction "$f" "$updatemanifestv3" @@ -344,7 +336,7 @@ continue 1 fi -@@ -180,7 +181,7 @@ +@@ -180,7 +180,7 @@ $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f" copy_perm "$newdir/$f" "$workdir/$f" make_add_instruction "$f" "$updatemanifestv3" 1 @@ -353,7 +345,7 @@ continue 1 fi -@@ -227,11 +228,11 @@ +@@ -227,11 +227,11 @@ make_patch_instruction "$f" "$updatemanifestv3" mv -f "$patchfile" "$workdir/$f.patch" rm -f "$workdir/$f" @@ -367,7 +359,7 @@ fi fi else -@@ -270,7 +271,7 @@ +@@ -270,7 +270,7 @@ fi @@ -376,7 +368,7 @@ done notice "" -@@ -302,7 +303,7 @@ +@@ -302,7 +302,7 @@ $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3" mar_command="$mar_command -C \"$workdir\" -c output.mar" diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm index d210cefa179a..045d9d6afde9 100644 --- a/solenv/bin/modules/installer/globals.pm +++ b/solenv/bin/modules/installer/globals.pm @@ -185,7 +185,6 @@ BEGIN $installer::globals::is_copy_only_project = 0; $installer::globals::is_simple_packager_project = 0; $installer::globals::patch_user_dir = 0; - $installer::globals::record_archive_metadata = 0; $installer::globals::languagepack = 0; $installer::globals::helppack = 0; $installer::globals::refresh_includepaths = 0; diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm index 5eb3345e854d..93c4e6e0d0cf 100644 --- a/solenv/bin/modules/installer/simplepackage.pm +++ b/solenv/bin/modules/installer/simplepackage.pm @@ -47,12 +47,8 @@ sub check_simple_packager_project $installer::globals::is_simple_packager_project = 1; $installer::globals::patch_user_dir = 1; } - elsif( $installer::globals::packageformat eq "archive" ) - { - $installer::globals::is_simple_packager_project = 1; - $installer::globals::record_archive_metadata = 1; - } - elsif( $installer::globals::packageformat eq "dmg" ) + elsif(( $installer::globals::packageformat eq "archive" ) || + ( $installer::globals::packageformat eq "dmg" ) ) { $installer::globals::is_simple_packager_project = 1; } @@ -616,9 +612,6 @@ sub create_simple_package # stripping files ?! if (( $installer::globals::strip ) && ( ! $installer::globals::iswindowsbuild )) { strip_libraries($filesref, $languagestringref); } - my @archive_metadata_skip; - my @archive_metadata_cond; - # copy Files installer::logger::print_message( "... copying files ... " ); installer::logger::include_header_into_logfile("Copying files:"); @@ -669,18 +662,6 @@ sub create_simple_package } } } - - if ($installer::globals::record_archive_metadata) - { - if ($onefile->{'Styles'} =~ /(ASSEMBLY|ASSIGNCOMPONENT|FONT)/) - { - push(@archive_metadata_skip, $onefile->{'destination'}); - } - elsif ($onefile->{'modules'} =~ /^gid_Module_(Langpack|Optional)_/) - { - push(@archive_metadata_cond, $onefile->{'destination'}); - } - } } # creating Links @@ -749,14 +730,6 @@ sub create_simple_package create_package($installdir, $installdir, $packagename, $allvariables, $includepatharrayref, $languagestringref, ".dmg"); } - if ($installer::globals::record_archive_metadata) - { - open(HANDLE, '>', "$installer::globals::csp_installdir/../metadata") or die $!; - print HANDLE "skip $_ " foreach (sort(@archive_metadata_skip)); - print HANDLE "cond $_ " foreach (sort(@archive_metadata_cond)); - close HANDLE; - } - # Analyzing the log file installer::worker::clean_output_tree(); # removing directories created in the output tree commit 858562228a03353db0577880aacf7f345fc6d772 Author: Noel Grandin <[email protected]> AuthorDate: Mon Jan 22 11:39:42 2024 +0200 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:26 2024 +0100 fix bug in renaming chart objects introduced by commit c5bb73cae7c172ad0f02f8c67dd57b53337f1d78 Author: Kohei Yoshida <[email protected]> Date: Tue Jan 31 16:03:46 2012 -0500 Get the whole thing to build after the method sig change in SdrObject. Change-Id: I1ca887d09857f6476980381853a9ae4946fd03e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162364 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> (cherry picked from commit 0ad94d52c022a0acb20be21b5a1dfcf445e12f0c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162377 Reviewed-by: Michael Stahl <[email protected]> diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx index 97715b07c295..115229de0e57 100644 --- a/chart2/source/controller/main/ShapeController.cxx +++ b/chart2/source/controller/main/ShapeController.cxx @@ -440,7 +440,7 @@ void ShapeController::executeDispatch_RenameObject() if ( pDlg->Execute() == RET_OK ) { pDlg->GetName(aName); - if (pSelectedObj->GetName() == aName) + if (pSelectedObj->GetName() != aName) { pSelectedObj->SetName( aName ); } commit e65a1683aa73e93cd3944b1176c38acc57e7dff9 Author: Justin Luth <[email protected]> AuthorDate: Sat Jan 20 19:54:54 2024 -0500 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:26 2024 +0100 tdf#154703 writerfilter framePr: avoid unexpected frame borders This fixes my regressive 7.6 commit 31ea6305b6a763ee48f639562313d9bd109a2923 The text's first border checked (the left one) returned void because the property SetState was DONTCARE. Then it SETS the text's left border to be nothing (I presume to remove the border from the paragraph since it is moving it onto frame). Well, apparently that act of setting one border sets all of them (which makes sense since it would be one box item, and once the box item exists, it has a definition for each border). Therefore on the the next steps of the for loop, the remaining borders will exist (as nothing) and be dutifully moved to the frame. Apparently the default for a frame is a box with DEFINED borders, so omitting the moving of a nothing border resulted in a stray edge. make CppunitTest_sw_ooxmlexport21 \ CPPUNIT_TEST_NAME=testTdf159207_footerFramePrBorder Change-Id: I217d02678b368f70643be91c4466927b4ca53988 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162409 Tested-by: Jenkins Reviewed-by: Justin Luth <[email protected]> (cherry picked from commit f43efd5473862edbdad0feb7f78c7be02914e997) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162375 Reviewed-by: Michael Stahl <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docx b/sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docx new file mode 100644 index 000000000000..7a4c54cc5c75 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx index 3a5ae1f394ea..cdcdfe778577 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx @@ -44,6 +44,24 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153909_followTextFlow, "tdf153909_followTextFlow CPPUNIT_ASSERT(nTableTop > nRectBottom); } +CPPUNIT_TEST_FIXTURE(Test, testTdf159207_footerFramePrBorder) +{ + loadFromFile(u"tdf159207_footerFramePrBorder.docx"); // re-imports as editeng Frame/Shape + + // given a doc with footer paragraphs frame (with a top border, but no left border) + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), + uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xFrame0(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + auto aBorder = getProperty<table::BorderLine2>(xFrame0, "LeftBorder"); + sal_uInt32 nBorderWidth + = aBorder.OuterLineWidth + aBorder.InnerLineWidth + aBorder.LineDistance; + // Without patch it failed with Expected 0, Actual 26 + CPPUNIT_ASSERT_EQUAL_MESSAGE("Left border:", static_cast<sal_uInt32>(0), nBorderWidth); + + // TODO: there SHOULD BE a top border, and even if loaded, it would be lost on re-import... +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index db2a71270331..cea1585e42fe 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1731,7 +1731,11 @@ static void lcl_MoveBorderPropertiesToFrame(std::vector<beans::PropertyValue>& r aValue.Name = sPropertyName; aValue.Value = xTextRangeProperties->getPropertyValue(sPropertyName); if( nProperty < 4 ) + { xTextRangeProperties->setPropertyValue( sPropertyName, uno::Any(table::BorderLine2())); + if (!aValue.Value.hasValue()) + aValue.Value <<= table::BorderLine2(); + } else // border spacing { sal_Int32 nDistance = 0; commit 4031c9206fc738d3dd2367f1ca8f24a14b18ebd0 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Jan 19 11:43:36 2024 +0000 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:26 2024 +0100 use a ScopeGuard to restore the original map mode in all these cases the original map mode was always restored so there is no change for these examples. Change-Id: Iec24b2cd269b9408dac6404e054b3bb989ec7744 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162306 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 30ed30b1117a41f016aa5b09ce21d2cb3004fdc3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162275 Reviewed-by: Michael Stahl <[email protected]> diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index c307b2a0ce59..30be376c86e5 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -6625,10 +6625,16 @@ void ScGridWindow::DeleteSelectionOverlay() void ScGridWindow::UpdateSelectionOverlay() { - MapMode aDrawMode = GetDrawMapMode(); - MapMode aOldMode = GetMapMode(); - if ( aOldMode != aDrawMode ) - SetMapMode( aDrawMode ); + const MapMode aDrawMode = GetDrawMapMode(); + const MapMode aOldMode = GetMapMode(); + comphelper::ScopeGuard aMapModeGuard( + [&aOldMode, &aDrawMode, this] { + if (aOldMode != aDrawMode) + SetMapMode(aOldMode); + } + ); + if (aOldMode != aDrawMode) + SetMapMode(aDrawMode); DeleteSelectionOverlay(); std::vector<tools::Rectangle> aRects; @@ -6700,9 +6706,6 @@ void ScGridWindow::UpdateSelectionOverlay() ScInputHandler::SendReferenceMarks(pViewShell, aReferenceMarks); } } - - if ( aOldMode != aDrawMode ) - SetMapMode( aOldMode ); } void ScGridWindow::UpdateHighlightOverlay() @@ -6865,10 +6868,16 @@ void ScGridWindow::UpdateDragRectOverlay() bool bInPrintTwips = comphelper::LibreOfficeKit::isCompatFlagSet( comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs); - MapMode aDrawMode = GetDrawMapMode(); - MapMode aOldMode = GetMapMode(); - if ( aOldMode != aDrawMode ) - SetMapMode( aDrawMode ); + const MapMode aDrawMode = GetDrawMapMode(); + const MapMode aOldMode = GetMapMode(); + comphelper::ScopeGuard aMapModeGuard( + [&aOldMode, &aDrawMode, this] { + if (aOldMode != aDrawMode) + SetMapMode(aOldMode); + } + ); + if (aOldMode != aDrawMode) + SetMapMode(aDrawMode); DeleteDragRectOverlay(); @@ -7021,9 +7030,6 @@ void ScGridWindow::UpdateDragRectOverlay() pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, aRectsString); } } - - if ( aOldMode != aDrawMode ) - SetMapMode( aOldMode ); } void ScGridWindow::DeleteHeaderOverlay() @@ -7033,10 +7039,16 @@ void ScGridWindow::DeleteHeaderOverlay() void ScGridWindow::UpdateHeaderOverlay() { - MapMode aDrawMode = GetDrawMapMode(); - MapMode aOldMode = GetMapMode(); - if ( aOldMode != aDrawMode ) - SetMapMode( aDrawMode ); + const MapMode aDrawMode = GetDrawMapMode(); + const MapMode aOldMode = GetMapMode(); + comphelper::ScopeGuard aMapModeGuard( + [&aOldMode, &aDrawMode, this] { + if (aOldMode != aDrawMode) + SetMapMode(aOldMode); + } + ); + if (aOldMode != aDrawMode) + SetMapMode(aDrawMode); DeleteHeaderOverlay(); @@ -7067,9 +7079,6 @@ void ScGridWindow::UpdateHeaderOverlay() mpOOHeader->append(std::move(pOverlay)); } } - - if ( aOldMode != aDrawMode ) - SetMapMode( aOldMode ); } void ScGridWindow::DeleteShrinkOverlay() @@ -7079,10 +7088,16 @@ void ScGridWindow::DeleteShrinkOverlay() void ScGridWindow::UpdateShrinkOverlay() { - MapMode aDrawMode = GetDrawMapMode(); - MapMode aOldMode = GetMapMode(); - if ( aOldMode != aDrawMode ) - SetMapMode( aDrawMode ); + const MapMode aDrawMode = GetDrawMapMode(); + const MapMode aOldMode = GetMapMode(); + comphelper::ScopeGuard aMapModeGuard( + [&aOldMode, &aDrawMode, this] { + if (aOldMode != aDrawMode) + SetMapMode(aOldMode); + } + ); + if (aOldMode != aDrawMode) + SetMapMode(aDrawMode); DeleteShrinkOverlay(); @@ -7134,9 +7149,6 @@ void ScGridWindow::UpdateShrinkOverlay() mpOOShrink->append(std::move(pOverlay)); } } - - if ( aOldMode != aDrawMode ) - SetMapMode( aOldMode ); } void ScGridWindow::DeleteSparklineGroupOverlay() @@ -7146,9 +7158,14 @@ void ScGridWindow::DeleteSparklineGroupOverlay() void ScGridWindow::UpdateSparklineGroupOverlay() { - MapMode aDrawMode = GetDrawMapMode(); - - MapMode aOldMode = GetMapMode(); + const MapMode aDrawMode = GetDrawMapMode(); + const MapMode aOldMode = GetMapMode(); + comphelper::ScopeGuard aMapModeGuard( + [&aOldMode, &aDrawMode, this] { + if (aOldMode != aDrawMode) + SetMapMode(aOldMode); + } + ); if (aOldMode != aDrawMode) SetMapMode(aDrawMode); @@ -7197,9 +7214,6 @@ void ScGridWindow::UpdateSparklineGroupOverlay() } } } - - if (aOldMode != aDrawMode) - SetMapMode(aOldMode); } // #i70788# central method to get the OverlayManager safely commit a6e6cb064fd450c5ee0a9f6809e986b189875ac8 Author: Mike Kaganski <[email protected]> AuthorDate: Mon Jan 22 19:10:29 2024 +0600 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:26 2024 +0100 tdf#159259: make sure to set FieldStartRange in sdt helper ... also for field case. Unfortunately, it is not really clear, if the anagement of this could be moved to DomainMapper_Impl. There are several insertion contexts; they may use different insertion points; there maybe could be cases when an inserted content should not go into the current sdt (?). Thus, I didn't put the code into DomainMapper_Impl::appendTextContent(), where the field character is inserted. Instead, I added code to check and set the start range in the same place as for the normal text: we know for sure, that if it were a normal text, we would append it to GetCurrentTextRange()->getEnd() - so do the same for fields. My concern that still stays is that the use of hasUnusedText looks hackish and fragile. Inserted fields don't set it - so the code that depends on empty sdt will not notice it. OTOH, it can't set it: this would break inserting field result for an already inserted command. Possibly all handling of sdt should be refactored at some point. Change-Id: I7a783aab2400d9a9c1f9f2e5607c872cb58d346b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162398 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162427 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/qa/extras/layout/data/sdt+framePr.docx b/sw/qa/extras/layout/data/sdt+framePr.docx new file mode 100644 index 000000000000..d46bcbfaa774 Binary files /dev/null and b/sw/qa/extras/layout/data/sdt+framePr.docx differ diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index 35c5cf669175..9c46d8395a1e 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -2267,6 +2267,42 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159271) assertXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt//SwFieldPortion"_ostr, 1); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159259) +{ + // Given a document with a block sdt with a single field, having framePr aligned to right + createSwDoc("sdt+framePr.docx"); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + // Make sure there is only one page and one paragraph with one line and one anchored object + assertXPath(pXmlDoc, "/root/page"_ostr, 1); + // Without the fix, this would fail: there were two paragraphs + assertXPath(pXmlDoc, "/root/page/body/txt"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout"_ostr, 1); + // Without the fix, this would fail: there was a field portion in the line + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, 0); + // Without the fix, this would fail: there was no anchored objects + assertXPath(pXmlDoc, "/root/page/body/txt/anchored"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly"_ostr, 1); + + const sal_Int32 paraRight + = getXPath(pXmlDoc, "/root/page/body/txt/infos/bounds"_ostr, "right"_ostr).toInt32(); + const sal_Int32 paraHeight + = getXPath(pXmlDoc, "/root/page/body/txt/infos/bounds"_ostr, "height"_ostr).toInt32(); + + CPPUNIT_ASSERT_GREATER(sal_Int32(0), paraRight); + CPPUNIT_ASSERT_GREATER(sal_Int32(0), paraHeight); + + const sal_Int32 flyRight + = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "right"_ostr) + .toInt32(); + const sal_Int32 flyHeight + = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "height"_ostr) + .toInt32(); + + CPPUNIT_ASSERT_EQUAL(paraRight, flyRight); // The fly is right-aligned + CPPUNIT_ASSERT_EQUAL(paraHeight, flyHeight); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 6bb5071a4dd6..903954de033e 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -4479,14 +4479,24 @@ void DomainMapper::lcl_utext(const sal_Unicode *const data_, size_t len) } else if (m_pImpl->IsOpenFieldCommand() && !m_pImpl->IsForceGenericFields()) { - if (bInSdtBlockText && m_pImpl->m_pSdtHelper->hasUnusedText()) - m_pImpl->m_pSdtHelper->createPlainTextControl(); + if (bInSdtBlockText) + { + if (m_pImpl->m_pSdtHelper->hasUnusedText()) + m_pImpl->m_pSdtHelper->createPlainTextControl(); + else if (!m_pImpl->m_pSdtHelper->isFieldStartRangeSet()) + m_pImpl->m_pSdtHelper->setFieldStartRange(GetCurrentTextRange()->getEnd()); + } m_pImpl->AppendFieldCommand(sText); } else if( m_pImpl->IsOpenField() && m_pImpl->IsFieldResultAsString()) { - if (bInSdtBlockText && m_pImpl->m_pSdtHelper->hasUnusedText()) - m_pImpl->m_pSdtHelper->createPlainTextControl(); + if (bInSdtBlockText) + { + if (m_pImpl->m_pSdtHelper->hasUnusedText()) + m_pImpl->m_pSdtHelper->createPlainTextControl(); + else if (!m_pImpl->m_pSdtHelper->isFieldStartRangeSet()) + m_pImpl->m_pSdtHelper->setFieldStartRange(GetCurrentTextRange()->getEnd()); + } /*depending on the success of the field insert operation this result will be set at the field or directly inserted into the text*/ m_pImpl->AppendFieldResult(sText); diff --git a/writerfilter/source/dmapper/SdtHelper.hxx b/writerfilter/source/dmapper/SdtHelper.hxx index 5db799bd1fd2..85b95a48818b 100644 --- a/writerfilter/source/dmapper/SdtHelper.hxx +++ b/writerfilter/source/dmapper/SdtHelper.hxx @@ -171,6 +171,7 @@ public: void setDataBindingStoreItemID(const OUString& sValue) { m_sDataBindingStoreItemID = sValue; } const OUString& GetDataBindingStoreItemID() const { return m_sDataBindingStoreItemID; } + bool isFieldStartRangeSet() const { return m_xFieldStartRange.is(); } void setFieldStartRange(const css::uno::Reference<css::text::XTextRange>& xStartRange) { m_xFieldStartRange = xStartRange; commit a727b254fcfdcb5ecc075093a277a11e223faee3 Author: Tibor Nagy <[email protected]> AuthorDate: Mon Jan 22 11:24:51 2024 +0100 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:26 2024 +0100 tdf#156718 PPTX import: fix the different formatting in table style when the PPTX file only has table style id, but no table style content. Change-Id: Ia3416478716a50beb6837988e98697fd88e916d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162368 Tested-by: Jenkins Reviewed-by: Nagy Tibor <[email protected]> (cherry picked from commit 27a1eccae1763b8efa17c909820f57f84361d308) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162378 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/oox/source/drawingml/table/predefined-table-styles.cxx b/oox/source/drawingml/table/predefined-table-styles.cxx index 451759036835..90fb22e48de7 100644 --- a/oox/source/drawingml/table/predefined-table-styles.cxx +++ b/oox/source/drawingml/table/predefined-table-styles.cxx @@ -231,6 +231,12 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) std::unique_ptr<TableStyle> pTableStyle; pTableStyle.reset(new TableStyle()); + // Text Style definitions for table parts + + bool bFirstRowTextBoldStyle = false; + bool bFirstColTextBoldStyle = false; + bool bLastColTextBoldStyle = false; + // Text Color definitions for table parts ::oox::drawingml::Color wholeTblTextColor; @@ -410,6 +416,7 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) pWholeTblBottomBorder->moLineWidth = 12700; pWholeTblInsideHBorder->moLineWidth = 12700; pWholeTblInsideVBorder->moLineWidth = 12700; + pFirstRowBottomBorder->moLineWidth = 12700; pWholeTblLeftBorder->moPresetDash = XML_solid; pWholeTblRightBorder->moPresetDash = XML_solid; @@ -417,6 +424,7 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) pWholeTblBottomBorder->moPresetDash = XML_solid; pWholeTblInsideHBorder->moPresetDash = XML_solid; pWholeTblInsideVBorder->moPresetDash = XML_solid; + pFirstRowBottomBorder->moPresetDash = XML_solid; // Start to handle all style groups. @@ -557,7 +565,13 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) setBorderLineType(pFirstRowBottomBorder, XML_solidFill); setBorderLineType(pLastRowTopBorder, XML_solidFill); + bFirstRowTextBoldStyle = true; + bFirstColTextBoldStyle = true; + bLastColTextBoldStyle = true; + wholeTblTextColor.setSchemeClr(XML_tx1); + firstRowTextColor.setSchemeClr(XML_tx1); + lastColTextColor.setSchemeClr(XML_tx1); sal_Int32 accent_val; @@ -571,8 +585,6 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); - firstRowTextColor.setSchemeClr(accent_val); - pBand1HFillProperties->maFillColor.setSchemeClr(accent_val); pBand1VFillProperties->maFillColor.setSchemeClr(accent_val); @@ -895,6 +907,10 @@ std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId) pTableStyle->getStyleId() = styleId; pTableStyle->getStyleName() = style_name; + pTableStyle->getFirstRow().getTextBoldStyle() = bFirstRowTextBoldStyle; + pTableStyle->getFirstCol().getTextBoldStyle() = bFirstColTextBoldStyle; + pTableStyle->getLastCol().getTextBoldStyle() = bLastColTextBoldStyle; + pTableStyle->getWholeTbl().getTextColor() = wholeTblTextColor; pTableStyle->getFirstRow().getTextColor() = firstRowTextColor; pTableStyle->getFirstCol().getTextColor() = firstColTextColor; diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx index 687c987fe242..78ec4f61feeb 100644 --- a/oox/source/drawingml/table/tablecell.cxx +++ b/oox/source/drawingml/table/tablecell.cxx @@ -358,10 +358,18 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons } if ( rProperties.isBandRow() ) { + bool bHasFirstColFillColor + = (rProperties.isFirstCol() && rTable.getFirstCol().getFillProperties() + && rTable.getFirstCol().getFillProperties()->maFillColor.isUsed()); + + bool bHasLastColFillColor + = (rProperties.isLastCol() && rTable.getLastCol().getFillProperties() + && rTable.getLastCol().getFillProperties()->maFillColor.isUsed()); + if ( ( !rProperties.isFirstRow() || ( nRow != 0 ) ) && ( !rProperties.isLastRow() || ( nRow != nMaxRow ) ) && - ( !rProperties.isFirstCol() || ( nColumn != 0 ) ) && - ( !rProperties.isLastCol() || ( nColumn != nMaxColumn ) ) ) + ( !rProperties.isFirstCol() || ( nColumn != 0 ) || !bHasFirstColFillColor ) && + ( !rProperties.isLastCol() || ( nColumn != nMaxColumn ) || !bHasLastColFillColor ) ) { sal_Int32 nBand = nRow; if ( rProperties.isFirstRow() ) diff --git a/sd/qa/unit/data/pptx/tdf156718.pptx b/sd/qa/unit/data/pptx/tdf156718.pptx new file mode 100644 index 000000000000..8aeafa155762 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf156718.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index c08e44ea2653..d6beee87693b 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -34,6 +34,7 @@ #include <sax/tools/converter.hxx> #include <com/sun/star/awt/Gradient.hpp> +#include <com/sun/star/awt/FontWeight.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XEventsSupplier.hpp> #include <com/sun/star/presentation/ClickAction.hpp> @@ -203,6 +204,75 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testDocumentLayout) } } +CPPUNIT_TEST_FIXTURE(SdImportTest, testTableStyle) +{ + createSdImpressDoc("pptx/tdf156718.pptx"); + const SdrPage* pPage = GetPage(1); + + sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0)); + CPPUNIT_ASSERT(pTableObj); + + uno::Reference<table::XCellRange> xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xCellPropSet; + uno::Reference<beans::XPropertySet> xRunPropSet; + uno::Reference<text::XTextRange> xParagraph; + uno::Reference<text::XTextRange> xRun; + table::BorderLine2 aBorderLine; + Color nFillColor, nCharColor; + float nFontWeight; + + xCellPropSet.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW); + xParagraph.set(getParagraphFromShape(0, xCellPropSet)); + xRun.set(getRunFromParagraph(0, xParagraph)); + xRunPropSet.set(xRun, uno::UNO_QUERY_THROW); + xRunPropSet->getPropertyValue("CharColor") >>= nCharColor; + xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight; + xCellPropSet->getPropertyValue("BottomBorder") >>= aBorderLine; + CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight); + CPPUNIT_ASSERT_EQUAL_MESSAGE("The bottom border is missing!", true, aBorderLine.LineWidth > 0); + + xCellPropSet.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW); + xParagraph.set(getParagraphFromShape(0, xCellPropSet)); + xRun.set(getRunFromParagraph(0, xParagraph)); + xRunPropSet.set(xRun, uno::UNO_QUERY_THROW); + xRunPropSet->getPropertyValue("CharColor") >>= nCharColor; + xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight; + CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight); + + xCellPropSet.set(xTable->getCellByPosition(2, 0), uno::UNO_QUERY_THROW); + xParagraph.set(getParagraphFromShape(0, xCellPropSet)); + xRun.set(getRunFromParagraph(0, xParagraph)); + xRunPropSet.set(xRun, uno::UNO_QUERY_THROW); + xRunPropSet->getPropertyValue("CharColor") >>= nCharColor; + xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight; + CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight); + + xCellPropSet.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW); + xParagraph.set(getParagraphFromShape(0, xCellPropSet)); + xRun.set(getRunFromParagraph(0, xParagraph)); + xRunPropSet.set(xRun, uno::UNO_QUERY_THROW); + xRunPropSet->getPropertyValue("CharColor") >>= nCharColor; + xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight; + xCellPropSet->getPropertyValue("FillColor") >>= nFillColor; + CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight); + CPPUNIT_ASSERT_EQUAL(Color(0x5b9bd5), nFillColor); + + xCellPropSet.set(xTable->getCellByPosition(2, 1), uno::UNO_QUERY_THROW); + xParagraph.set(getParagraphFromShape(0, xCellPropSet)); + xRun.set(getRunFromParagraph(0, xParagraph)); + xRunPropSet.set(xRun, uno::UNO_QUERY_THROW); + xRunPropSet->getPropertyValue("CharColor") >>= nCharColor; + xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight; + xCellPropSet->getPropertyValue("FillColor") >>= nFillColor; + CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight); + CPPUNIT_ASSERT_EQUAL(Color(0x5b9bd5), nFillColor); +} + CPPUNIT_TEST_FIXTURE(SdImportTest, testFreeformShapeGluePoints) { createSdImpressDoc("pptx/tdf156829.pptx"); commit cbe50ba762b13a12652673a87106c571177a8036 Author: Mike Kaganski <[email protected]> AuthorDate: Thu Jan 18 20:57:52 2024 +0600 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:26 2024 +0100 Related: tdf#159259 Drop obsolete exclusion of framePr inside sdt Commit 73bd937420b9a99e1e35950e3f9dcbcfd874876d (n#780853 fix DOCX import of w:sdtContent in table cell, 2012-09-25) had introduced a restriction, where a framePr was ignored, when inside an sdt. It was required to allow table import, which broke otherwise. Since then, the situation has obviously changed; the test case for the change, added in commit 7ea71eb8a28c4b41949299ff7d4b391486c90eea (n#780853 testcase, 2012-09-25) passes after removal of the check. This check disallows importing sdt in frame. This makes the bugdoc of tdf#159259 to import the sdt in frame. The Lorem Ipsum paragraph is still enclosed into the sdt - to be fixed in a follow-up. Change-Id: I60fbb2dd6f753682217d86e4f8d315f1883c6e83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162258 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit 4d0f2d5ec9f7f988a1493916ae35bac1986c95a8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162384 Reviewed-by: Xisco Fauli <[email protected]> Tested-by: Xisco Fauli <[email protected]> diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 46d52005fa81..6bb5071a4dd6 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2419,8 +2419,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) } break; case NS_ooxml::LN_CT_PPrBase_framePr: - // Avoid frames if we're inside a structured document tag, would just cause outer tables fail to create. - if (!m_pImpl->GetSdt()) { PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH); if( pContext ) commit 0b70fec3a68ddf45b94276d4aa89de83ca717128 Author: Julien Nabet <[email protected]> AuthorDate: Mon Jan 22 18:50:31 2024 +0100 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:26 2024 +0100 tdf#159326: Command-F assigned to both Find and Find and Replace in Calc Regression from e651d9e657f9b61fb45777d6e7edeb5cb95f8d27 German shortcut improvements for Calc (2023-09-27) Change-Id: I4440663025e3eb85c8c73a624769ceec527daa1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162413 Tested-by: Jenkins Reviewed-by: Patrick Luby <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162376 Reviewed-by: Noel Grandin <[email protected]> diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu index 2b3581a76168..2522ff5ac1ec 100644 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -1065,7 +1065,6 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing <node oor:name="F_MOD1" oor:op="replace"> <prop oor:name="Command"> <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US" install:module="macosx">.uno:SearchDialog</value> <value xml:lang="de">.uno:Navigator</value> </prop> </node> commit 4cca03533186dbc6739ea5508e0dcc384eb6a7b8 Author: Patrick Luby <[email protected]> AuthorDate: Sat Jan 13 17:57:56 2024 -0500 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:25 2024 +0100 tdf#159025 skip undo if SwTableNode is a nullptr I don't know what causes the SwTableNode to be a nullptr in the case of tdf#159025, but at least stop the crashing by skipping this undo request. Change-Id: Idad1ed290af215e591018ea58732b77ca504ba01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162031 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> Reviewed-by: Patrick Luby <[email protected]> (cherry picked from commit f414c61f8dd2617baa0851525b8a7a630c5e34da) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162225 diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 6f122e73b6da..72f1c809e227 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -272,7 +272,14 @@ void SwUndoInsTable::UndoImpl(::sw::UndoRedoContext & rContext) SwNodeIndex aIdx( rDoc.GetNodes(), m_nStartNode ); SwTableNode* pTableNd = aIdx.GetNode().GetTableNode(); - OSL_ENSURE( pTableNd, "no TableNode" ); + // tdf#159025 skip undo if SwTableNode is a nullptr + // I don't know what causes the SwTableNode to be a nullptr in the + // case of tdf#159025, but at least stop the crashing by skipping + // this undo request. + SAL_WARN_IF( !pTableNd, "sw.core", "no TableNode" ); + if( !pTableNd ) + return; + pTableNd->DelFrames(); if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() )) commit c3025432d84bfb913c75f1aeefa66497f2d33bde Author: László Németh <[email protected]> AuthorDate: Wed Jan 10 20:41:04 2024 +0100 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:25 2024 +0100 tdf#159102 sw smart justify: fix automatic hyphenation As before with soft hyphens, automatic hyphenation could result too much shrinking, because of calculating with an extra non-existing space in the line. Also try to shrink the line only if a space likely will be available in it. During testing, extend user dictionary temporarily with custom automatic hyphenation to avoid of false tests because of non-available hyphenation patterns. (Note: maybe the other tests with non-user dictionary based automatic hyphenations are not correct.) Follow-up to commit d511367c102ef2ada0f73dbe81744d39865d58ba "tdf#195085 sw smart justify: fix bad shrinking at soft hyphen". Change-Id: I58ecb8f1ea9f55ef2457d7ff4aca6aefa59a6dd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162199 Tested-by: Jenkins Reviewed-by: László Németh <[email protected]> (cherry picked from commit 7c1f4dd740c32050480f3ab678805ad3c4c748bb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162219 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/qa/uitest/data/tdf159102.fodt b/sw/qa/uitest/data/tdf159102.fodt new file mode 100644 index 000000000000..dfe9fc18872b --- /dev/null +++ b/sw/qa/uitest/data/tdf159102.fodt @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document 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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:c alcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns: meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:settings> + <config:config-item-set config:name="ooo:configuration-settings"> + <config:config-item config:name="JustifyLinesWithShrinking" config:type="boolean">true</config:config-item> + <config:config-item config:name="PrinterIndependentLayout" config:type="string">high-resolution</config:config-item> + </config:config-item-set> + </office:settings> + <office:font-face-decls> + <style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss"/> + <style:font-face style:name="Arial1" svg:font-family="Arial" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="36pt" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Calibri" fo:font-size="10pt" fo:language="en" fo:country="US" style:letter-kerning="false" style:font-name-asian="MS Mincho" style:font-size-asian="10pt" style:language-asian="en" style:country-asian="US" style:font-name-complex="Calibri1" style:font-size-complex="10pt" style:language-complex="ar" style:country-complex="SA" fo:hyphenate="true" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false" loext:hyphenation-no-last-word="false" loext:hyphenation-word-char-count="5" loext:hyphenation-zone="no-limit"/> + </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:paragraph-properties fo:margin-top="0pt" fo:margin-bottom="0pt" style:contextual-spacing="false" fo:text-align="start" style:justify-single-word="false" fo:orphans="2" fo:widows="2" style:writing-mode="lr-tb"/> + <style:text-properties style:font-name="Arial" fo:font-family="Arial" style:font-family-generic="swiss" fo:font-size="12pt" fo:language="en" fo:country="GB" style:font-name-asian="Times New Roman1" style:font-family-asian="'Times New Roman'" style:font-family-generic-asian="system" style:font-pitch-asian="variable" style:font-size-asian="12pt" style:font-name-complex="Arial1" style:font-family-complex="Arial" style:font-family-generic-complex="system" style:font-pitch-complex="variable" style:font-size-complex="12pt"/> + </style:style> + </office:styles> + <office:automatic-styles> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"> + <style:paragraph-properties fo:text-align="justify" style:justify-single-word="false"/> + <style:text-properties officeooo:paragraph-rsid="0018cb95"/> + </style:style> + <style:style style:name="T1" style:family="text"> + <style:text-properties fo:font-size="10pt" fo:language="es" fo:country="ES" style:font-size-asian="10pt" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="T2" style:family="text"> + <style:text-properties fo:font-size="10pt" fo:language="es" fo:country="ES" officeooo:rsid="001a9d3d" style:font-size-asian="10pt" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="T3" style:family="text"> + <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="419.56pt" fo:page-height="595.3pt" style:num-format="1" style:print-orientation="portrait" fo:margin-top="21.6pt" fo:margin-bottom="14.4pt" fo:margin-left="36pt" fo:margin-right="36pt" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="31" style:layout-grid-base-height="18pt" style:layout-grid-ruby-height="0pt" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:layout-grid-base-width="10.46pt" style:layout-grid-snap-to="true" style:footnote-max-height="0pt" loext:margin-gutter="0pt"> + <style:footnote-sep style:width="0.51pt" style:distance-before-sep="2.86pt" style:distance-after-sep="2.86pt" 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> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1" draw:style-name="dp1"/> + </office:master-styles> + <office:body> + <office:text> + <text:p text:style-name="P1" loext:marker-style-name="T3"><text:span text:style-name="T1">venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cursus egestas.</text:span></text:p> + <text:p text:style-name="P1" loext:marker-style-name="T3"><text:span text:style-name="T1">venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cur</text:span><text:span text:style-name="T1">sus egestas.</text:span></text:p> + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/uitest/writer_tests8/tdf159102.py b/sw/qa/uitest/writer_tests8/tdf159102.py new file mode 100644 index 000000000000..07152ada3999 --- /dev/null +++ b/sw/qa/uitest/writer_tests8/tdf159102.py @@ -0,0 +1,81 @@ +# -*- 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, get_url_for_data_file +from libreoffice.uno.propertyvalue import mkPropertyValues + +# handle tdf#119908 smart justify with automatic hyphenation + +class tdf159102(UITestCase): + + def set_custom_hyphenation(self): + with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialog: + + xPages = xDialog.getChild("pages") + xLanguageEntry = xPages.getChild('2') # Language Settings + xLanguageEntry.executeAction("EXPAND", tuple()) + xxLanguageEntryWritingAidsEntry = xLanguageEntry.getChild('1') + xxLanguageEntryWritingAidsEntry.executeAction("SELECT", tuple()) # Writing Aids + + # add hyphenation "cur=sus" to the custom dictionary to solve the non-accessible + # hyphenation patterns for the test + + # Select an editable dictionary (list of Ignored words) + dictionaries = xDialog.getChild("lingudicts") + hasEditableDictionary = False + for i in dictionaries.getChildren(): + entry = dictionaries.getChild(i) + entry_label = get_state_as_dict(entry)["Text"] + if entry_label == "List of Ignored Words [All]": + hasEditableDictionary = True + entry.executeAction("SELECT", tuple()) # an editable user dictionary + break + + self.assertEqual(True, hasEditableDictionary) + + # open Edit dialog window + edit = xDialog.getChild("lingudictsedit") + with self.ui_test.execute_blocking_action(edit.executeAction, args=('CLICK', ()), close_button="close") as xEdit: + # write cur=sus into the input box + inputbox = xEdit.getChild("word") + inputbox.executeAction("TYPE", mkPropertyValues({"TEXT": "cur=sus"})) + add = xEdit.getChild("newreplace") + add.executeAction("CLICK", tuple()) + + def test_tdf159102_smart_justify_with_automatic_hyphenation(self): + xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') + with self.ui_test.load_file(get_url_for_data_file("tdf159102.fodt")) as writer_doc: + # we must not depend on the installed hyphenation patterns, + # so extend user dictionary temporarily with the hyphenation cur=sus + self.set_custom_hyphenation() + xToolkit.processEventsToIdle() + # delete the text of the first line + self.xUITest.executeCommand(".uno:GoToEndOfLine") + self.xUITest.executeCommand('.uno:StartOfDocumentSel') + self.xUITest.executeCommand('.uno:Delete') + paragraphs = writer_doc.Text.createEnumeration() + para1 = paragraphs.nextElement() + # This was "stas.", i.e. too much shrinking (accept also " cursus egestas." in the + # case of missing hyphenation patterns on some test platforms). + try: + self.assertEqual("sus egestas.", para1.String) + except AssertionError: + self.assertEqual(" cursus egestas.", para1.String) + + # check next paragraph (containing different text portions) + self.xUITest.executeCommand(".uno:GoDown") + self.xUITest.executeCommand(".uno:GoToEndOfLine") + self.xUITest.executeCommand('.uno:StartOfDocumentSel') + self.xUITest.executeCommand('.uno:Delete') + paragraphs = writer_doc.Text.createEnumeration() + para1 = paragraphs.nextElement() + try: + self.assertEqual("sus egestas.", para1.String) + except AssertionError: + self.assertEqual(" cursus egestas.", para1.String) diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 85691ef21ed2..e58021ef0963 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -325,14 +325,20 @@ bool SwTextPortion::Format_( SwTextFormatInfo &rInf ) // call with an extra space: shrinking can result a new word in the line // and a new space before that, which is also a shrank space - // (except if the line was already broken at a soft hyphen, i.e. inside a word) - if ( aGuess.BreakPos() < TextFrameIndex(rInf.GetText().getLength()) && + // (except if the line was already broken inside a word with hyphenation) + // TODO: handle the case, if the line contains extra amount of spaces + if ( + // no automatic hyphenation + !aGuess.HyphWord().is() && + // no hyphenation at soft hyphen + aGuess.BreakPos() < TextFrameIndex(rInf.GetText().getLength()) && rInf.GetText()[sal_Int32(aGuess.BreakPos())] != CHAR_SOFTHYPHEN ) { ++nSpacesInLine; } - bFull = !aGuess.Guess( *this, rInf, Height(), nSpacesInLine ); + if ( nSpacesInLine > 0 ) + bFull = !aGuess.Guess( *this, rInf, Height(), nSpacesInLine ); } // these are the possible cases: commit 42564de459bb24542119e575fff6c45b5460b314 Author: Mike Kaganski <[email protected]> AuthorDate: Mon Jan 22 12:08:56 2024 +0600 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:25 2024 +0100 tdf#159313: pass properties in correct order Regression after commit c4fc18308074634e9578ad12d94d937f259aa22a (Autocorrect: Add option for autoformat bulleted lists after space, 2023-09-07). Change-Id: I35fafc1441b4f67886a86d4d67764a91146b8ece Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162359 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit ca33b8b35a10243dc13e68c93e7c7512eef937ec) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162289 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Xisco Fauli <[email protected]> diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx index fcafbfca6f0c..616d75c69600 100644 --- a/editeng/source/misc/acorrcfg.cxx +++ b/editeng/source/misc/acorrcfg.cxx @@ -645,7 +645,6 @@ void SvxSwAutoCorrCfg::ImplCommit() css::uno::Any(rParent.bAutoFmtByInput), // "Format/ByInput/Enable" css::uno::Any(rSwFlags.bChgToEnEmDash), // "Format/ByInput/ChangeDash" css::uno::Any(rSwFlags.bSetNumRule), - css::uno::Any(rSwFlags.bSetNumRuleAfterSpace), // "Format/ByInput/ApplyNumbering/Enable" css::uno::Any(rSwFlags.bSetBorder), // "Format/ByInput/ChangeToBorders" css::uno::Any(rSwFlags.bCreateTable), // "Format/ByInput/ChangeToTable" @@ -679,7 +678,9 @@ void SvxSwAutoCorrCfg::ImplCommit() // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset" css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetPitch())), // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch" - css::uno::Any(rSwFlags.bSetDOIAttr)}); + css::uno::Any(rSwFlags.bSetDOIAttr), + css::uno::Any(rSwFlags.bSetNumRuleAfterSpace), // "Format/ByInput/ApplyNumberingAfterSpace" + }); // "Format/Option/SetDOIAttribute" } commit fcf910507e876e0f8a2e49e16746fabe174fff9b Author: Matt K <[email protected]> AuthorDate: Sun Jan 21 12:23:33 2024 -0600 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:25 2024 +0100 tdf#132810 Prevent more crashes on gallery objects This change is a follow-up to https://gerrit.libreoffice.org/c/core/+/161950 where there is still a crash occurring on application close, and a general crash when using gallery objects. The fix is to check for object existence or if the object has the destructor bit set before using the objects. Here is the callstack for the assert that was removed: > swlo.dll!SwClient::GetRegisteredIn() Line 166 C++ swlo.dll!SwContact::GetFormat() Line 112 C++ swlo.dll!SwAnchoredDrawObject::GetFrameFormat() Line 622 C++ swlo.dll!SwAnchoredObject::FindAnchorCharFrame() Line 719 C++ swlo.dll!SwAnchoredObject::GetAnchorFrameContainingAnchPos() Line 132 C++ swlo.dll!SwAnchoredObject::FindPageFrameOfAnchor() Line 697 C++ swlo.dll!SwObjectFormatterLayFrame::AdditionalFormatObjsOnPage() Line 144 C++ swlo.dll!SwObjectFormatterLayFrame::DoFormatObjs() Line 94 C++ swlo.dll!SwObjectFormatter::FormatObjsAtFrame(SwFrame & _rAnchorFrame, const SwPageFrame & _rPageFrame, SwLayAction * _pLayAction) Line 160 C++ swlo.dll!SwLayAction::InternalAction(OutputDevice * pRenderContext) Line 565 C++ swlo.dll!SwLayAction::Action(OutputDevice * pRenderContext) Line 390 C++ swlo.dll!SwViewShell::ImplEndAction(const bool bIdleEnd) Line 308 C++ swlo.dll!SwViewShell::EndAction(const bool bIdleEnd) Line 628 C++ swlo.dll!SwCursorShell::EndAction(const bool bIdleEnd) Line 266 C++ swlo.dll!SwEditShell::EndAllAction() Line 102 C++ swlo.dll!SwWrtShell::Do(SwWrtShell::DoType eDoType, unsigned short nCnt, unsigned short nOffset) Line 60 C++ swlo.dll!SwBaseShell::ExecUndo(SfxRequest & rReq) Line 655 C++ Change-Id: I90bd40f3ae864ec9655340c342ddc16b59d79aba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162349 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit 6840c242684986483624557a405a00e91ea048e9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162370 Reviewed-by: Matt K <[email protected]> Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index 77a19aa8295a..5a9e1245afd8 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -619,13 +619,15 @@ void SwAnchoredDrawObject::InvalidateObjPos() SwFrameFormat* SwAnchoredDrawObject::GetFrameFormat() { - assert(static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFormat()); - return static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFormat(); + if (SwDrawContact* pDC = static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))) + return pDC->GetFormat(); + return nullptr; } const SwFrameFormat* SwAnchoredDrawObject::GetFrameFormat() const { - assert(static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFormat()); - return static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFormat(); + if (SwDrawContact* pDC = static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))) + return pDC->GetFormat(); + return nullptr; } SwRect SwAnchoredDrawObject::GetObjRect() const diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 6e7e6235dcb3..ba57cd6b4cdf 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -2594,12 +2594,15 @@ void SwFrame::RemoveDrawObj( SwAnchoredObject& _rToRemoveObj ) { // Notify accessible layout. #if !ENABLE_WASM_STRIP_ACCESSIBILITY - SwViewShell* pSh = getRootFrame()->GetCurrShell(); - if( pSh ) + if (!mbInDtor) { - SwRootFrame* pLayout = getRootFrame(); - if (pLayout && pLayout->IsAnyShellAccessible()) - pSh->Imp()->DisposeAccessibleObj(_rToRemoveObj.GetDrawObj(), false); + SwViewShell* pSh = getRootFrame()->GetCurrShell(); + if (pSh) + { + SwRootFrame* pLayout = getRootFrame(); + if (pLayout && pLayout->IsAnyShellAccessible()) + pSh->Imp()->DisposeAccessibleObj(_rToRemoveObj.GetDrawObj(), false); + } } #endif commit 1a62a13bc1d351faad2645cb6cc71e44a2223dc3 Author: Mike Kaganski <[email protected]> AuthorDate: Mon Jan 22 02:03:13 2024 +0600 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:25 2024 +0100 tdf#158139: show autotext / word completion tooltips also for delayed flush The problem was that commit 843af72bcc9047867588e29c8e10b84a5e58d70e (make win32 variant AnyInput() not deliver events (tdf#140293), 2021-02-11) made AnyInput ~always return true, when called in SwEditWin::KeyInput. Calling AnyInput(KEYBOARD) there is to query if there are more pending characters. But in its new form on Windows, it tells if there are any keyboard-related window events in the queue, where e.g. WM_KEYUP counts, which is for the same keypress (WM_KEYDOWN) that is being handled right now - even though those messages will not produce new characters. When AnyInput() returns true, a delayed flush timer starts. Only immediate flush was accompanied by tooltips. To make sure that the tooltip is shown also for delayed flush, move the tooltip code into SwEditWin::FlushInBuffer. Store the 'bNormalChar' flag (which controlled if the tooltip was shown) in a new member in SwEditWin. Change-Id: I51686b25f8d86df48ae9574ab8f3eb1d0e6ca985 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162350 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit d49b0c3654e50ff9b74545140e6f19e008009c33) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162372 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index d2c3f0e865d7..073b6b59649e 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -896,6 +896,25 @@ void SwEditWin::FlushInBuffer() return; SwWrtShell& rSh = m_rView.GetWrtShell(); + uno::Reference<frame::XDispatchRecorder> xRecorder + = m_rView.GetViewFrame().GetBindings().GetRecorder(); + + comphelper::ScopeGuard showTooltipGuard( + [this, &rSh] + { + SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); + const bool bAutoTextShown + = rACfg.IsAutoTextTip() && ShowAutoText(rSh.GetChunkForAutoText()); + if (!bAutoTextShown) + { + SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect(); + if (pACorr && pACorr->GetSwFlags().bAutoCompleteWords) + ShowAutoCorrectQuickHelp(rSh.GetPrevAutoCorrWord(*pACorr), *pACorr); + } + }); + if (!m_bMaybeShowTooltipAfterBufferFlush || xRecorder) + showTooltipGuard.dismiss(); + m_bMaybeShowTooltipAfterBufferFlush = false; // generate new sequence input checker if not already done if ( !pCheckIt ) @@ -993,8 +1012,6 @@ void SwEditWin::FlushInBuffer() } } - uno::Reference< frame::XDispatchRecorder > xRecorder = - m_rView.GetViewFrame().GetBindings().GetRecorder(); if ( xRecorder.is() ) { // determine shell @@ -1381,6 +1398,9 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) } } + // Do not show autotext / word completion tooltips in intermediate flushes + m_bMaybeShowTooltipAfterBufferFlush = false; + sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode(); if (nKey == KEY_ESCAPE) @@ -2821,19 +2841,12 @@ KEYINPUT_CHECKTABLE_INSDEL: if( KEY_UP == nKey || KEY_DOWN == nKey || KEY_PAGEUP == nKey || KEY_PAGEDOWN == nKey ) GetView().GetViewFrame().GetBindings().Update( FN_STAT_PAGE ); + m_bMaybeShowTooltipAfterBufferFlush = bNormalChar; + // in case the buffered characters are inserted if( bFlushBuffer && !m_aInBuffer.isEmpty() ) { FlushInBuffer(); - - // maybe show Tip-Help - if (bNormalChar) - { - const bool bAutoTextShown - = pACfg && pACfg->IsAutoTextTip() && ShowAutoText(rSh.GetChunkForAutoText()); - if (!bAutoTextShown && pACorr && pACorr->GetSwFlags().bAutoCompleteWords) - ShowAutoCorrectQuickHelp(rSh.GetPrevAutoCorrWord(*pACorr), *pACorr); - } } // get the word count dialog to update itself diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx index 714e6bcc3be0..ceaa98657fe9 100644 --- a/sw/source/uibase/inc/edtwin.hxx +++ b/sw/source/uibase/inc/edtwin.hxx @@ -122,7 +122,8 @@ class SW_DLLPUBLIC SwEditWin final : public vcl::DocWindow, selection position depending on what has changed lately */ m_bUseInputLanguage: 1, - m_bObjectSelect : 1; + m_bObjectSelect : 1, + m_bMaybeShowTooltipAfterBufferFlush : 1 = false; sal_uInt16 m_nKS_NUMDOWN_Count; // #i23725# sal_uInt16 m_nKS_NUMINDENTINC_Count; commit 2d69963486b7f7341984e4e34ada1a32f30bbf31 Author: László Németh <[email protected]> AuthorDate: Thu Jan 18 14:53:24 2024 +0100 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 23 15:42:25 2024 +0100 tdf#106733 xmloff: keep fo:hyphenate in character formatting In the case of character formatting, map fo:hyphenate to the unused CharNoHyphenation character property to keep it during ODF import/export instead of losing it completely. This is the first step to disable hyphenation for single words or text spans in paragraphs with automatic hyphenation. Note: using fo:hyphenate as character property is part of the ODF standard. Note: the old workaround to disable hyphenation, changing the language of the text to None had got some serious fallbacks: losing spell checking and losing language-dependent text layout (supported by both OpenType and Graphite font engines in LibreOffice). Change-Id: I9565c3efbbb6e6d970fb03710e8c932ad72ab57e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162257 Tested-by: Jenkins Reviewed-by: László Németh <[email protected]> (cherry picked from commit 956f81ebc9d70507a4a976bfe42c99175dbf3632) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162272 Reviewed-by: Michael Stahl <[email protected]> diff --git a/sw/qa/extras/odfexport/data/tdf106733.fodt b/sw/qa/extras/odfexport/data/tdf106733.fodt new file mode 100644 index 000000000000..fa9a02440573 --- /dev/null +++ b/sw/qa/extras/odfexport/data/tdf106733.fodt @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document 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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:c alcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns: meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:font-face-decls> + <style:font-face style:name="DejaVu Sans" svg:font-family="'DejaVu Sans'" style:font-family-generic="swiss"/> + </office:font-face-decls> + <office:styles> + <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="35.46pt" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="DejaVu Sans" fo:font-size="12pt" fo:language="hu" fo:country="HU" style:letter-kerning="true" style:font-name-asian="Noto Serif CJK SC" 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" loext:hyphenation-no-last-word="false" loext:hyphenation-word-char-count="5" loext:hyphenation-zone="no-limit"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text"> + <style:paragraph-properties fo:margin-top="0pt" fo:margin-bottom="7pt" style:contextual-spacing="false" fo:line-height="115%"/> + </style:style> + <style:style style:name="Heading_20_3" style:display-name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="3" style:class="text"> + <style:paragraph-properties fo:margin-top="7pt" fo:margin-bottom="6.01pt" style:contextual-spacing="false"/> + <style:text-properties fo:font-size="14pt" fo:font-weight="bold" style:font-size-asian="14pt" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-weight-complex="bold"/> + </style:style> + <style:style style:name="Strong_20_Emphasis" style:display-name="Strong Emphasis" style:family="text"> + <style:text-properties fo:font-weight="bold" fo:hyphenate="false" style:font-weight-asian="bold" style:font-weight-complex="bold"/> + </style:style> + </office:styles> + <office:automatic-styles> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Text_20_body"> + <loext:graphic-properties draw:fill="none"/> + <style:paragraph-properties fo:margin-left="0pt" fo:margin-right="257.95pt" fo:margin-top="0pt" fo:margin-bottom="7pt" style:contextual-spacing="false" fo:line-height="115%" fo:text-align="justify" style:justify-single-word="false" fo:hyphenation-ladder-count="no-limit" fo:text-indent="0pt" style:auto-text-indent="false" fo:background-color="transparent"/> + <style:text-properties fo:language="en" fo:country="US" officeooo:rsid="1d851e57" officeooo:paragraph-rsid="0007570c" style:language-complex="ar" style:country-complex="SA" fo:hyphenate="true" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false" loext:hyphenation-no-last-word="false" loext:hyphenation-word-char-count="no-limit" loext:hyphenation-zone="no-limit"/> + </style:style> + <style:style style:name="P3" style:family="paragraph" style:parent-style-name="Text_20_body"> + <loext:graphic-properties draw:fill="none"/> + <style:paragraph-properties fo:margin-left="0pt" fo:margin-right="257.95pt" fo:margin-top="0pt" fo:margin-bottom="7pt" style:contextual-spacing="false" fo:line-height="115%" fo:text-align="justify" style:justify-single-word="false" fo:hyphenation-ladder-count="no-limit" fo:text-indent="0pt" style:auto-text-indent="false" fo:background-color="transparent"/> + <style:text-properties fo:language="en" fo:country="US" officeooo:paragraph-rsid="0007570c" style:language-complex="ar" style:country-complex="SA" fo:hyphenate="true" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false" loext:hyphenation-no-last-word="false" loext:hyphenation-word-char-count="no-limit" loext:hyphenation-zone="no-limit"/> + </style:style> + <style:style style:name="P4" style:family="paragraph" style:parent-style-name="Heading_20_3"> + <style:text-properties officeooo:paragraph-rsid="0007570c"/> + </style:style> + <style:style style:name="T6" style:family="text"> + <style:text-properties fo:language="en" fo:country="US" fo:font-style="italic" fo:font-weight="bold" officeooo:rsid="1d851e57" fo:hyphenate="false" style:font-style-asian="italic" style:font-weight-asian="bold" style:language-complex="ar" style:country-complex="SA" style:font-style-complex="italic" style:font-weight-complex="bold"/> + </style:style> + <style:style style:name="T8" style:family="text"> + <style:text-properties fo:font-weight="bold" officeooo:rsid="1d851e57" style:font-weight-asian="bold" style:font-weight-complex="bold"/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="595.3pt" fo:page-height="841.89pt" style:num-format="1" style:print-orientation="portrait" fo:margin-top="56.69pt" fo:margin-bottom="56.69pt" fo:margin-left="56.69pt" fo:margin-right="56.69pt" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="20.01pt" style:layout-grid-ruby-height="10.01pt" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0pt" loext:margin-gutter="0pt"> -e ... etc. - the rest is truncated
