summaryrefslogtreecommitdiff
path: root/sw/CppunitTest_sw_ooxmlexport5.mk
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2020-02-03 00:28:04 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2020-02-05 10:11:17 +0100
commit7d08664be4d9a949718ce66e3bc974105a10284c (patch)
tree53f7ef660ebd436568e28a957166bb373c6848d6 /sw/CppunitTest_sw_ooxmlexport5.mk
parent9811796aba7360fc5b7230a8b314a56fbf6ab27a (diff)
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 <momonasmon@gmail.com> Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'sw/CppunitTest_sw_ooxmlexport5.mk')
0 files changed, 0 insertions, 0 deletions