diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-09-24 17:04:21 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-09-24 18:45:40 +0200 |
commit | a5698f1a0fb8bf8775f1a098ae9ee09de968d632 (patch) | |
tree | f9577d72b0e91bb7bf63c2d05ea4e24937db7411 | |
parent | 75923e132479b64320f78c6913e5d7241c69ad26 (diff) |
Related: tdf#124600 sw anchored object allow overlap: add ODT filter
Expose the AllowOverlap shape property as <style:graphic-properties
loext:allow-overlap="..."/>.
Change-Id: I6b6e08c67224ac7d4fb87046ea8accf94cdb583f
Reviewed-on: https://gerrit.libreoffice.org/79462
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | include/xmloff/xmltoken.hxx | 1 | ||||
-rw-r--r-- | schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng | 6 | ||||
-rw-r--r-- | sw/qa/extras/odfexport/data/allow-overlap.odt | bin | 0 -> 9853 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/core/xmltoken.cxx | 1 | ||||
-rw-r--r-- | xmloff/source/text/txtprmap.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/token/tokens.txt | 1 |
7 files changed, 22 insertions, 0 deletions
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 098dc30fecad..3276d0b8b9c2 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -2494,6 +2494,7 @@ namespace xmloff { namespace token { // Tokens have been renamed and <XML_ITERATIVE> has been added (#i35017#) XML_ONCE_SUCCESSIVE, XML_ONCE_CONCURRENT, + XML_ALLOW_OVERLAP, // Names for OOo format only XML_N_OFFICE_OOO, diff --git a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng index a8b2b55ef20f..089152aaf23b 100644 --- a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng +++ b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng @@ -914,6 +914,12 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1. <rng:ref name="nonNegativeInteger"/> </rng:attribute> </rng:optional> + <!-- TODO no proposal --> + <rng:optional> + <rng:attribute name="loext:allow-overlap"> + <rng:ref name="boolean"/> + </rng:attribute> + </rng:optional> </rng:interleave> </rng:define> diff --git a/sw/qa/extras/odfexport/data/allow-overlap.odt b/sw/qa/extras/odfexport/data/allow-overlap.odt Binary files differnew file mode 100644 index 000000000000..b23f5b360b85 --- /dev/null +++ b/sw/qa/extras/odfexport/data/allow-overlap.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 3d4d0e245451..93f38ca440c1 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -2093,6 +2093,17 @@ DECLARE_ODFEXPORT_TEST(testRubyPosition, "ruby-position.odt") } } +DECLARE_ODFEXPORT_TEST(testAllowOverlap, "allow-overlap.odt") +{ + uno::Reference<drawing::XShape> xShape = getShape(1); + // Without the accompanying fix in place, this test would have failed with: + // - Expression: !getProperty<bool>(xShape, "AllowOverlap") + // i.e. the custom AllowOverlap=false shape property was lost on import/export. + CPPUNIT_ASSERT(!getProperty<bool>(xShape, "AllowOverlap")); + xShape = getShape(2); + CPPUNIT_ASSERT(!getProperty<bool>(xShape, "AllowOverlap")); +} + DECLARE_ODFEXPORT_TEST(testSignatureLineProperties, "signatureline-properties.fodt") { uno::Reference<drawing::XShape> xShape = getShape(1); diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 5ce4b8d8f1a5..1063b9ee7791 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -2494,6 +2494,7 @@ namespace xmloff { namespace token { // Tokens have been renamed and <XML_ITERATIVE> has been added (#i35017#) TOKEN( "once-successive", XML_ONCE_SUCCESSIVE ), TOKEN( "once-concurrent", XML_ONCE_CONCURRENT ), + TOKEN( "allow-overlap", XML_ALLOW_OVERLAP ), // Names for OOo format only TOKEN( "http://openoffice.org/2000/office", XML_N_OFFICE_OOO ), diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 2cd5005dfc64..0136cfee7fce 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -856,6 +856,7 @@ XMLPropertyMapEntry const aXMLFramePropMap[] = MG_E( "IsFollowingTextFlow", STYLE, FLOW_WITH_TEXT, XML_TYPE_BOOL, 0 ), // #i28701# - RES_WRAP_INFLUENCE_ON_OBJPOS MG_E( "WrapInfluenceOnPosition", DRAW, WRAP_INFLUENCE_ON_POSITION, XML_TYPE_WRAP_INFLUENCE_ON_POSITION, 0 ), + MAP_EXT("AllowOverlap", XML_NAMESPACE_LO_EXT, XML_ALLOW_OVERLAP, XML_TYPE_BOOL|XML_TYPE_PROP_GRAPHIC, 0), // special entries for floating frames MG_E( "", DRAW, FRAME_DISPLAY_SCROLLBAR, XML_TYPE_BOOL|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_SCROLLBAR ), @@ -907,6 +908,7 @@ XMLPropertyMapEntry const aXMLShapePropMap[] = MG_E( "HoriOrientRelation", STYLE, HORIZONTAL_REL, XML_TYPE_TEXT_HORIZONTAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_SHAPE_HORIZONTALREL_FRAME ), // RES_WRAP_INFLUENCE_ON_OBJPOS (#i28701#) MG_ED( "WrapInfluenceOnPosition", DRAW, WRAP_INFLUENCE_ON_POSITION, XML_TYPE_WRAP_INFLUENCE_ON_POSITION, 0 ), + MAP_EXT("AllowOverlap", XML_NAMESPACE_LO_EXT, XML_ALLOW_OVERLAP, XML_TYPE_BOOL|XML_TYPE_PROP_GRAPHIC, 0), // UserDefinedAttributes is already contained in the map this one is // chained to. diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt index dbd6f59945b9..5bce19e510af 100644 --- a/xmloff/source/token/tokens.txt +++ b/xmloff/source/token/tokens.txt @@ -2356,6 +2356,7 @@ shrink-to-fit wrap-influence-on-position once-successive once-concurrent +allow-overlap N_OFFICE_OOO_DUMMY N_META_OOO_DUMMY N_STYLE_OOO_DUMMY |