summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-02-03 16:56:49 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-03-02 00:06:24 +0100
commite941720d5c3e6a555c2405d5f8d9de6c37150e27 (patch)
tree2f8303f0c59da3827c914995e5a1ade2129f6cf4
parent21305ff47a1bee1fa4787bf792fb3ecdb10d4863 (diff)
tdf#139301 fix OOXML-compatible preset dash styles
Despite the purpose of the new interoperability styles added in commit b2d8093b19642038631dfb8f1ab6745a380a652c (tdf#127499 added 9 new line styles all are (var) and in line with MSO), collision with commit 57c9bdab377a00649299d1a4c9ed2f9e5e03b84e (tdf#127166, tdf#123903 improve import/export of line styles) resulted still missing interoperability on the user interface: 1) opening an OOXML document, preset styles weren't recognized on the UI, also the preview was a solid line on the Drawing Object Properties toolbar. 2) using the new compatibility preset styles, OOXML export resulted custom styles instead of the intended preset styles. On the UI, now the layout of the first 8 preset dash styles follows the OOXML standard, see 20.1.10.49 ST_PresetLineDashVal (Preset Line Dash Value) in ISO/IEC 29500-1, 2016: dash pattern name (OOXML name) 10 "Dot" (sysDot) 1000 "Long Dot" (dot) 1110 "Dash" (sysDash) 1111000 "Long Dash" (dash) 11111111000 "Double Dash" (lgDash) 11110001000 "Long Dash Dot (dashDot) 111111110001000 "Double Dash Dot" (lgDashDot) 1111111100010001000 "Double Dash Dot Dot" (lgDashDotDot) (Note: missing "Dash Dot" (sysDashDot) and "Dash Dot Dot" (sysDashDotDot) were added only in the master, but not in this back-port, yet, because the commit would contain new translatable strings: 111010 "Dash Dot" (sysDashDot) 11101010 "Dash Dot Dot" (sysDashDotDot)) Remove "Double Dot": it really wasn't an OOXML-compatible preset style, and it has a good replacement among the older styles, the similarly loosely dotted "Fine dotted", which is still supported for back-compatibility. Note: to start the new UI test, use $ (cd sw; make -srj8 UITest_writer_tests7 UITEST_TEST_NAME="tdf139301.tdf139301.test_tdf139301" SAL_USE_VCLPLUGIN=gen) (cherry picked from commit 183c06fc02a50fb117bb6162e4d6e56cdd34fad1) Change-Id: I7f7cf6ea954aad4cb43ef7730b204ed7635f8fb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110403 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--extras/source/palettes/standard.sod15
-rw-r--r--sw/qa/uitest/data/tdf127166_prstDash_Word97.docxbin0 -> 6300 bytes
-rw-r--r--sw/qa/uitest/writer_tests7/tdf139301.py54
3 files changed, 61 insertions, 8 deletions
diff --git a/extras/source/palettes/standard.sod b/extras/source/palettes/standard.sod
index d8b010b1ada1..d7cac47ebdc5 100644
--- a/extras/source/palettes/standard.sod
+++ b/extras/source/palettes/standard.sod
@@ -2,14 +2,13 @@
<office:dash-table xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script">
<draw:stroke-dash draw:name="Dot" draw:style="rect" draw:dots1="1" draw:dots1-length="100%" draw:distance="100%"/>
- <draw:stroke-dash draw:name="Long Dot" draw:style="rect" draw:dots1="1" draw:dots1-length="100%" draw:dots2="1" draw:dots2-length="100%" draw:distance="300%"/>
- <draw:stroke-dash draw:name="Double Dot" draw:style="rect" draw:dots1="1" draw:dots1-length="100%" draw:dots2="1" draw:dots2-length="100%" draw:distance="500%"/>
- <draw:stroke-dash draw:name="Dash" draw:style="rect" draw:dots1="1" draw:dots1-length="300%" draw:distance="300%"/>
- <draw:stroke-dash draw:name="Long Dash" draw:style="rect" draw:dots1="1" draw:dots1-length="600%" draw:distance="300%"/>
- <draw:stroke-dash draw:name="Double Dash" draw:style="rect" draw:dots1="1" draw:dots1-length="1100%" draw:dots2="1" draw:dots2-length="1100%" draw:distance="500%"/>
- <draw:stroke-dash draw:name="Long Dash Dot" draw:style="rect" draw:dots1="1" draw:dots1-length="600%" draw:dots2="1" draw:dots2-length="100%" draw:distance="300%"/>
- <draw:stroke-dash draw:name="Double Dash Dot" draw:style="rect" draw:dots1="1" draw:dots1-length="1100%" draw:dots2="1" draw:dots2-length="100%" draw:distance="500%"/>
- <draw:stroke-dash draw:name="Double Dash Dot Dot" draw:style="rect" draw:dots1="1" draw:dots1-length="1100%" draw:dots2="2" draw:dots2-length="100%" draw:distance="500%"/>
+ <draw:stroke-dash draw:name="Long Dot" draw:style="rect" draw:dots1="1" draw:dots1-length="100%" draw:distance="300%"/>
+ <draw:stroke-dash draw:name="Dash" draw:style="rect" draw:dots1="1" draw:dots1-length="300%" draw:distance="100%"/>
+ <draw:stroke-dash draw:name="Long Dash" draw:style="rect" draw:dots1="1" draw:dots1-length="400%" draw:distance="300%"/>
+ <draw:stroke-dash draw:name="Double Dash" draw:style="rect" draw:dots1="1" draw:dots1-length="800%" draw:distance="300%"/>
+ <draw:stroke-dash draw:name="Long Dash Dot" draw:style="rect" draw:dots1="1" draw:dots1-length="400%" draw:dots2="1" draw:dots2-length="100%" draw:distance="300%"/>
+ <draw:stroke-dash draw:name="Double Dash Dot" draw:style="rect" draw:dots1="1" draw:dots1-length="800%" draw:dots2="1" draw:dots2-length="100%" draw:distance="300%"/>
+ <draw:stroke-dash draw:name="Double Dash Dot Dot" draw:style="rect" draw:dots1="1" draw:dots1-length="800%" draw:dots2="2" draw:dots2-length="100%" draw:distance="300%"/>
<draw:stroke-dash draw:name="Ultrafine Dotted (var)" draw:style="rect" draw:dots1="1" draw:distance="50%"/>
<draw:stroke-dash draw:name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.1799inch"/>
diff --git a/sw/qa/uitest/data/tdf127166_prstDash_Word97.docx b/sw/qa/uitest/data/tdf127166_prstDash_Word97.docx
new file mode 100644
index 000000000000..b89f52fdc5b5
--- /dev/null
+++ b/sw/qa/uitest/data/tdf127166_prstDash_Word97.docx
Binary files differ
diff --git a/sw/qa/uitest/writer_tests7/tdf139301.py b/sw/qa/uitest/writer_tests7/tdf139301.py
new file mode 100644
index 000000000000..74648bcbae71
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf139301.py
@@ -0,0 +1,54 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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
+import org.libreoffice.unotest
+import pathlib
+
+def get_url_for_data_file(file_name):
+ return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+
+class tdf139301(UITestCase):
+
+ def test_tdf139301(self):
+ writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf127166_prstDash_Word97.docx"))
+
+ styles = ('Long Dash', 'Long Dash Dot', 'Long Dot', 'Double Dash', 'Double Dash Dot', 'Double Dash Dot Dot', 'Dash', 'Dash Dot', 'Dash Dot Dot', 'Dot')
+
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ for i in range(len(styles)):
+ # don't check not back-ported styles
+ if styles[i] in ('Dash Dot', 'Dash Dot Dot'):
+ continue
+
+ # select next line shape
+ writer_doc.getCurrentController().select(writer_doc.getDrawPage()[i])
+
+ # wait for available line style setting
+ self.ui_test.wait_until_child_is_available(xWriterEdit, 'metricfield')
+
+ # line setting dialog window
+ self.ui_test.execute_dialog_through_command(".uno:FormatLine")
+ xFormatLineDlg = self.xUITest.getTopFocusWindow()
+
+ # get line style combo box
+ xLineStyle = xFormatLineDlg.getChild("LB_LINE_STYLE")
+
+ # check preset line style
+ style = get_state_as_dict(xLineStyle)['SelectEntryText']
+
+ xOKBtn = xFormatLineDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertEqual(style, styles[i])
+
+ self.ui_test.close_doc()
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: