From 7d08664be4d9a949718ce66e3bc974105a10284c Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Mon, 3 Feb 2020 00:28:04 +0200 Subject: tdf#129568 Rename the default table style As it turns out, UI names of table styles are leaking into documents, and changing those names actually breaks the import of documents from previous versions. The problem is that a table style itself is saved using its programmatic name, but is referenced by tables using its UI name. So after changing the UI name, these no longer map. It's still possible to manually reapply the style, but if not doing this and just saving, the style and its child cell styles will be silently lost. Moreover, if the given document is of fodt type, it's not even possible to save it (even not as "save as" to odt). Obviously, the issue isn't just with renaming. The same happens also with documents created with a different UI language (even English). Fortunately, up to now English UI names were identical to the programmatic ones. So the first thing we can do is to accept both kinds of names for table:template-name. This way, we solved the problem for documents created in an English UI, and in addition made them work in non-English UI (unlike before). As for export, we want to always writes programmatic names, so newly edited documents will continue to work regardless of future UI changes or UI language switching (and also stay compatible with older versions). For the fodt export failure, changed the order of things in SwXTextTableStyle::replaceByName, as setting a new box breaks SwXTextCellStyle::getName in this specific case. Also changed cell styles to be named using the parent style's programmatic name, so new documents won't have this problem when opened in older versions. This also fixed part of the PythonTest_sw_python failure. The remaining PythonTest_sw_python failure was about the "TableTemplateName" UNO API property of a table, which didn't work with programmatic names. That's a real bug by itself, and was fixed. Also an explicit test was added, to make sure the API always returns the programmatic name. Finally, an odf export test was added. It tests files with both old-style UI names, and new-style programmatic names. Styles should be correctly imported, used by the table, and survive export. Change-Id: I45dfda193813fea184dc42e5e75544ebc05d4a92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87826 Reviewed-by: Maxim Monastirsky Tested-by: Maxim Monastirsky --- sw/qa/extras/odfexport/data/tdf129568.fodt | 368 +++++++++++++++++++++++++++++ 1 file changed, 368 insertions(+) create mode 100644 sw/qa/extras/odfexport/data/tdf129568.fodt (limited to 'sw/qa/extras/odfexport/data/tdf129568.fodt') diff --git a/sw/qa/extras/odfexport/data/tdf129568.fodt b/sw/qa/extras/odfexport/data/tdf129568.fodt new file mode 100644 index 000000000000..30256a6cd5be --- /dev/null +++ b/sw/qa/extras/odfexport/data/tdf129568.fodt @@ -0,0 +1,368 @@ + + + + 2020-02-03T11:01:15.2025491202020-02-03T11:02:08.562696933PT55S2LibreOffice/6.3.4.2.0$Linux_X86_64 LibreOffice_project/30$Build-2 + + + 0 + 0 + 25137 + 13522 + true + false + + + view2 + 4165 + 2616 + 0 + 0 + 25135 + 13520 + 0 + 1 + false + 100 + false + false + + + + + false + true + true + true + 0 + true + true + + false + false + true + false + false + false + true + true + false + false + false + false + false + false + false + false + false + true + true + false + false + true + 1284982 + false + + false + true + false + false + false + true + false + false + false + true + 1284982 + + true + false + false + true + false + true + true + false + true + false + false + false + 0 + false + true + high-resolution + false + false + false + true + false + false + false + true + true + + true + false + false + true + false + false + false + + true + false + false + 1 + true + false + false + 0 + false + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3