From a5698f1a0fb8bf8775f1a098ae9ee09de968d632 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 24 Sep 2019 17:04:21 +0200 Subject: [PATCH] Related: tdf#124600 sw anchored object allow overlap: add ODT filter Expose the AllowOverlap shape property as . Change-Id: I6b6e08c67224ac7d4fb87046ea8accf94cdb583f Reviewed-on: https://gerrit.libreoffice.org/79462 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- include/xmloff/xmltoken.hxx | 1 + .../OpenDocument-schema-v1.3+libreoffice.rng | 6 ++++++ sw/qa/extras/odfexport/data/allow-overlap.odt | Bin 0 -> 9853 bytes sw/qa/extras/odfexport/odfexport.cxx | 11 +++++++++++ xmloff/source/core/xmltoken.cxx | 1 + xmloff/source/text/txtprmap.cxx | 2 ++ xmloff/source/token/tokens.txt | 1 + 7 files changed, 22 insertions(+) create mode 100644 sw/qa/extras/odfexport/data/allow-overlap.odt 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 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. + + + + + + diff --git a/sw/qa/extras/odfexport/data/allow-overlap.odt b/sw/qa/extras/odfexport/data/allow-overlap.odt new file mode 100644 index 0000000000000000000000000000000000000000..b23f5b360b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?iT_DGeBiaK=tmZO~ZhJi4C1f*eX=n6|K+F$D3< zo(?9th^{>+4`0V*_-@ck%`O|oK#Fd&2s|dUZ>*`WJ%KAogMniJ{(j@gi<|$W{A(M@ zFVydMi2Q=czEpqh7x{(zy#)FTm;ZCW$=?d1f42D->JKUI*Y(nGSbhnlf6ww$2>ex0 zk^kG4{}fFBp6924`Kw6&hUd=$>fbZ{*`k2oG5v?2`u9A4wy5PdJbxBg|DNfm==rN$ z{f6n6;QIG0f9@AG%71(MKLyx7^ZZqU{bh~O3(wyPvOmY*YlxpC{&ynZAH8~+WB~c^ z#9smaEcrqGA^H79?)x>U|M@cfCDHt47W#|U__7b{A8F@bQGbo}f1w6({~Y)K75Ufj t`4_U{#k>C*O#c=6*9r9(a+c_CrdI`NsF(a106=~DF}}>h93(%l{txr5we xShape = getShape(1); + // Without the accompanying fix in place, this test would have failed with: + // - Expression: !getProperty(xShape, "AllowOverlap") + // i.e. the custom AllowOverlap=false shape property was lost on import/export. + CPPUNIT_ASSERT(!getProperty(xShape, "AllowOverlap")); + xShape = getShape(2); + CPPUNIT_ASSERT(!getProperty(xShape, "AllowOverlap")); +} + DECLARE_ODFEXPORT_TEST(testSignatureLineProperties, "signatureline-properties.fodt") { uno::Reference 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 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