[Libreoffice-commits] core.git: include/xmloff schema/libreoffice sw/qa xmloff/source

2021-09-28 Thread Miklos Vajna (via logerrit)
 include/xmloff/xmlstyle.hxx |2 +
 include/xmloff/xmltoken.hxx |2 +
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |9 
 sw/qa/extras/odfexport/data/style-link.fodt |   15 +++
 sw/qa/extras/odfexport/odfexport2.cxx   |   21 ++
 xmloff/source/core/xmltoken.cxx |2 +
 xmloff/source/style/prstylei.cxx|   24 
 xmloff/source/style/styleexp.cxx|   13 ++
 xmloff/source/style/xmlstyle.cxx|3 +
 xmloff/source/token/tokens.txt  |1 
 10 files changed, 92 insertions(+)

New commits:
commit 05f863844d9a5613250e8d787e32752b270ec4d3
Author: Miklos Vajna 
AuthorDate: Tue Sep 28 09:37:10 2021 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 28 10:27:20 2021 +0200

sw: paragraph styles: add ODT filter for a linked character style

And the same in the other direction: link a para style from a char
style.

With this, the ODT filter is on par with the DOCX one for this feature.

Change-Id: Idd994b933672ab47a5f87a75c92abc137d3c73b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122753
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/xmloff/xmlstyle.hxx b/include/xmloff/xmlstyle.hxx
index 184fd19eb379..04a74b841a15 100644
--- a/include/xmloff/xmlstyle.hxx
+++ b/include/xmloff/xmlstyle.hxx
@@ -44,6 +44,7 @@ class XMLOFF_DLLPUBLIC SvXMLStyleContext : public 
SvXMLImportContext
 OUString maAutoName;
 OUString maParentName;// Will be moved to XMLPropStyle soon
 OUString maFollow;// Will be moved to XMLPropStyle soon
+OUString maLinked;
 bool mbHidden;
 
 XmlStyleFamily mnFamily;
@@ -79,6 +80,7 @@ public:
 const OUString&  GetAutoName() const { return maAutoName; }
 const OUString&  GetParentName() const { return maParentName; }
 const OUString&  GetFollow() const { return maFollow; }
+const OUString&  GetLinked() const { return maLinked; }
 
 XmlStyleFamily GetFamily() const { return mnFamily; }
 
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index e4b2314527f0..c8dedd84b4b2 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -3437,6 +3437,8 @@ namespace xmloff::token {
 XML_RTL,
 XML_SYMMETRIC,
 
+XML_LINKED_STYLE_NAME,
+
 XML_TOKEN_END
 };
 
diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index a0f8711d092b..0c467fdc3780 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -2731,4 +2731,13 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
 
   
 
+  
+  
+
+  
+
+  
+
+  
+
 
diff --git a/sw/qa/extras/odfexport/data/style-link.fodt 
b/sw/qa/extras/odfexport/data/style-link.fodt
new file mode 100644
index ..76c36c698845
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/style-link.fodt
@@ -0,0 +1,15 @@
+
+
+  
+
+
+  
+  
+
+  
+  
+
+  
+
+  
+
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx 
b/sw/qa/extras/odfexport/odfexport2.cxx
index bb05521f08fc..c73dc611db04 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -184,6 +184,27 @@ DECLARE_ODFEXPORT_TEST(testListFormatOdt, "listformat.odt")
 }
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testStyleLink)
+{
+// Given a document with a para and a char style that links each other, 
when loading that
+// document:
+load(mpTestDocumentPath, "style-link.fodt");
+
+// Then make sure the char style links the para one:
+uno::Any aCharStyle = getStyles("CharacterStyles")->getByName("List 
Paragraph Char");
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: List Paragraph
+// - Actual  :
+// i.e. the linked style was lost on import.
+CPPUNIT_ASSERT_EQUAL(OUString("List Paragraph"), 
getProperty(aCharStyle, "LinkStyle"));
+uno::Any aParaStyle = getStyles("ParagraphStyles")->getByName("List 
Paragraph");
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: List Paragraph Char
+// - Actual  :
+// i.e. the linked style was lost on import.
+CPPUNIT_ASSERT_EQUAL(OUString("List Paragraph Char"), 
getProperty(aParaStyle, "LinkStyle"));
+}
+
 // This test started in LO 7.2. Use the odfexport.cxx if you intend to 
backport to 7.1.
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 1e682a39fcb1..52ecd9038cbb 100644
--- 

[Libreoffice-commits] core.git: include/xmloff schema/libreoffice sw/qa xmloff/source

2021-02-03 Thread Miklos Vajna (via logerrit)
 include/xmloff/xmltoken.hxx |1 
 schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng |   12 ++-
 sw/qa/extras/odfexport/data/gutter-left.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx|   13 
 xmloff/source/core/xmltoken.cxx |1 
 xmloff/source/style/PageMasterStyleMap.cxx  |3 ++
 xmloff/source/token/tokens.txt  |1 
 7 files changed, 30 insertions(+), 1 deletion(-)

New commits:
commit 11e91719ef362e38b3b92e525763a5a89f4eeecb
Author: Miklos Vajna 
AuthorDate: Wed Feb 3 15:36:03 2021 +0100
Commit: Miklos Vajna 
CommitDate: Wed Feb 3 16:55:51 2021 +0100

tdf#91920 sw page gutter margin: add ODF filter

Note that the context filter is not set, since fo:margin affects left
margin, but should not affect the gutter margin.

Also put the new entry at the end, but before the header and footer
sections, so the attribute is written to the correct XML element.

Change-Id: I3588d4e76cd713efed168eb93b9456bba96727fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110375
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index cba305a70610..96bff94874dd 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -3397,6 +3397,7 @@ namespace xmloff::token {
 XML_PAGE_CONTENT_TOP,
 
 XML_PAGE_CONTENT_BOTTOM,
+XML_MARGIN_GUTTER,
 
 XML_TOKEN_END
 };
diff --git a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng 
b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
index 0c0b41ef4ca9..89913cbf7e63 100644
--- a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
+++ b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
@@ -2291,7 +2291,6 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
 
   
 
-  
   
   
 
@@ -2304,6 +2303,17 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
 
   
 
+  
+  
+
+  
+
+  
+
+  
+
+  
+
   
   
 
diff --git a/sw/qa/extras/odfexport/data/gutter-left.odt 
b/sw/qa/extras/odfexport/data/gutter-left.odt
new file mode 100644
index ..a5ce541ef078
Binary files /dev/null and b/sw/qa/extras/odfexport/data/gutter-left.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index 15704c8eeaad..98712ae76fdc 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2686,5 +2686,18 @@ DECLARE_ODFEXPORT_EXPORTONLY_TEST(tdf135942, 
"nestedTableInFooter.odt")
 assertXPath(pXmlDoc, 
"/office:document-styles/office:automatic-styles/style:style[@style:family='table']",
 2);
 }
 
+DECLARE_ODFEXPORT_TEST(testGutterLeft, "gutter-left.odt")
+{
+uno::Reference xPageStyle;
+getStyles("PageStyles")->getByName("Standard") >>= xPageStyle;
+sal_Int32 nGutterMargin{};
+xPageStyle->getPropertyValue("GutterMargin") >>= nGutterMargin;
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1270
+// - Actual  : 0
+// i.e. gutter margin was lost.
+CPPUNIT_ASSERT_EQUAL(static_cast(1270), nGutterMargin);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index bc8b04334ead..a75b152fb23b 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3394,6 +3394,7 @@ namespace xmloff::token {
 TOKEN( "page-content-top",XML_PAGE_CONTENT_TOP ),
 
 TOKEN( "page-content-bottom", XML_PAGE_CONTENT_BOTTOM ),
+TOKEN("margin-gutter", XML_MARGIN_GUTTER),
 
 #if OSL_DEBUG_LEVEL > 0
 { 0, nullptr, std::nullopt,   XML_TOKEN_END }
diff --git a/xmloff/source/style/PageMasterStyleMap.cxx 
b/xmloff/source/style/PageMasterStyleMap.cxx
index 18519b9132dc..d7b9f41e8f02 100644
--- a/xmloff/source/style/PageMasterStyleMap.cxx
+++ b/xmloff/source/style/PageMasterStyleMap.cxx
@@ -31,6 +31,8 @@ using namespace ::xmloff::token;
 MAP(name, prefix, token, type|XML_TYPE_PROP_PAGE_LAYOUT, context, 
SvtSaveOptions::ODFSVER_012)
 #define PLMAP_ODF13(name,prefix,token,type,context) \
 MAP(name, prefix, token, type|XML_TYPE_PROP_PAGE_LAYOUT, context, 
SvtSaveOptions::ODFSVER_013)
+#define PLMAP_EXT(name,prefix,token,type,context) \
+MAP(name, prefix, token, type|XML_TYPE_PROP_PAGE_LAYOUT, context, 
SvtSaveOptions::ODFSVER_FUTURE_EXTENDED)
 #define HFMAP(name,prefix,token,type,context) \
 MAP(name, prefix, token, type|XML_TYPE_PROP_HEADER_FOOTER, context, 
SvtSaveOptions::ODFSVER_010)
 
@@ -153,6 +155,7 @@ const XMLPropertyMapEntry 

[Libreoffice-commits] core.git: include/xmloff schema/libreoffice sw/qa xmloff/source

2020-10-29 Thread Szabolcs Toth (via logerrit)
 include/xmloff/xmltoken.hxx |2 ++
 schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng |2 ++
 sw/qa/extras/odfexport/data/page-content-top.odt|binary
 sw/qa/extras/odfexport/odfexport.cxx|9 +
 xmloff/source/core/xmltoken.cxx |2 ++
 xmloff/source/style/xmlexppr.cxx|6 ++
 xmloff/source/text/txtprhdl.cxx |2 ++
 xmloff/source/token/tokens.txt  |1 +
 8 files changed, 24 insertions(+)

New commits:
commit bc9049851fd7e914fd695bcfb3c9a94a19634ce0
Author: Szabolcs Toth 
AuthorDate: Thu Oct 15 16:13:08 2020 +0200
Commit: László Németh 
CommitDate: Thu Oct 29 17:52:48 2020 +0100

tdf#137627 sw top page border orientation: add ODF

Map between RelOrientation::PAGE_PRINT_AREA_TOP and
loext:vertical-rel="page-content-top".

Follow-up of commit 1c593e1916c9164c7db71da2017cfc26972f8e9f
(tdf#133045 sw: add shape alignment to the top page border).
See also commit 65b7873aab5deec7157328047e869a6385e0a74a
(sw from-bottom relative orientation: add ODF filter).

Change-Id: I9bff7a9507152262dda7d126fa3e7e1bee6a8276
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104554
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 1b7a932f9399..99b94be7e2cc 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -3368,6 +3368,8 @@ namespace xmloff::token {
 
 XML_RESOLVED,
 
+XML_PAGE_CONTENT_TOP,
+
 XML_PAGE_CONTENT_BOTTOM,
 
 XML_TOKEN_END
diff --git a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng 
b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
index 9167044ca87e..0c0b41ef4ca9 100644
--- a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
+++ b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
@@ -2291,11 +2291,13 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
 
   
 
+  
   
   
 
   
 
+  page-content-top
   page-content-bottom
 
   
diff --git a/sw/qa/extras/odfexport/data/page-content-top.odt 
b/sw/qa/extras/odfexport/data/page-content-top.odt
new file mode 100644
index ..755d50242e4e
Binary files /dev/null and b/sw/qa/extras/odfexport/data/page-content-top.odt 
differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index 6c1f2d6ccff8..8767b76110bb 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2624,6 +2624,15 @@ DECLARE_ODFEXPORT_TEST(testRovasNumbering, 
"rovas-numbering.odt")
  aMap["NumberingType"].get());
 }
 
+DECLARE_ODFEXPORT_TEST(testPageContentTop, "page-content-top.odt")
+{
+CPPUNIT_ASSERT_EQUAL(1, getShapes());
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+uno::Reference xShape(getShape(1), uno::UNO_QUERY);
+sal_Int16 nExpected = text::RelOrientation::PAGE_PRINT_AREA_TOP;
+CPPUNIT_ASSERT_EQUAL(nExpected, getProperty(xShape, 
"VertOrientRelation"));
+}
+
 DECLARE_ODFEXPORT_TEST(testPageContentBottom, "page-content-bottom.odt")
 {
 CPPUNIT_ASSERT_EQUAL(1, getShapes());
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index d78de79842aa..23186f625a75 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3365,6 +3365,8 @@ namespace xmloff::token {
 // For recording whether comments/annotations are resolved
 TOKEN( "resolved",XML_RESOLVED ),
 
+TOKEN( "page-content-top",XML_PAGE_CONTENT_TOP ),
+
 TOKEN( "page-content-bottom", XML_PAGE_CONTENT_BOTTOM ),
 
 #if OSL_DEBUG_LEVEL > 0
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index b65669aed3c3..893e0fb36ee4 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -1080,6 +1080,12 @@ void SvXMLExportPropertyMapper::_exportXML(
 XML_NAMESPACE_LO_EXT,
 
mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
 }
+if (IsXMLToken(aValue, XML_PAGE_CONTENT_TOP))
+{
+sName = rNamespaceMap.GetQNameByKey(
+XML_NAMESPACE_LO_EXT,
+
mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
+}
 }
 
 rAttrList.AddAttribute( sName, aValue );
diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx
index d430c09a8878..77dbcb1bdd27 100644
--- a/xmloff/source/text/txtprhdl.cxx
+++ b/xmloff/source/text/txtprhdl.cxx
@@ -153,6 

[Libreoffice-commits] core.git: include/xmloff schema/libreoffice sw/qa xmloff/source

2020-05-06 Thread Miklos Vajna (via logerrit)
 include/xmloff/xmltoken.hxx |2 +
 schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng |   11 ++
 sw/qa/extras/odfexport/data/page-content-bottom.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx|7 ++
 xmloff/source/core/xmltoken.cxx |2 +
 xmloff/source/style/xmlexppr.cxx|   13 ++--
 xmloff/source/text/txtprhdl.cxx |2 +
 xmloff/source/text/txtprmap.cxx |6 +
 xmloff/source/token/tokens.txt  |1 
 9 files changed, 42 insertions(+), 2 deletions(-)

New commits:
commit 65b7873aab5deec7157328047e869a6385e0a74a
Author: Miklos Vajna 
AuthorDate: Wed Apr 29 12:31:25 2020 +0200
Commit: Miklos Vajna 
CommitDate: Wed May 6 18:39:59 2020 +0200

sw from-bottom relative orientation: add ODF filter

Map between RelOrientation::PAGE_PRINT_AREA_BOTTOM and
loext:vertical-rel="page-content-bottom".

Change-Id: I1d614bf7c82a76285f4268b8008e08c25ef9b7f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93120
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index d84f17d03ce6..0f646baa40ca 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -3357,6 +3357,8 @@ namespace xmloff::token {
 
 XML_RESOLVED,
 
+XML_PAGE_CONTENT_BOTTOM,
+
 XML_TOKEN_END
 };
 
diff --git a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng 
b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
index 7491e0ec1c8d..a61f6da11f71 100644
--- a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
+++ b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
@@ -2391,6 +2391,17 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
 
   
 
+  
+  
+
+  
+
+  page-content-bottom
+
+  
+
+  
+
   
   
 
diff --git a/sw/qa/extras/odfexport/data/page-content-bottom.odt 
b/sw/qa/extras/odfexport/data/page-content-bottom.odt
new file mode 100644
index ..263ca7df40a1
Binary files /dev/null and 
b/sw/qa/extras/odfexport/data/page-content-bottom.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index 89cf753241d9..1b8bc8a57728 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2418,5 +2418,12 @@ DECLARE_ODFEXPORT_TEST(testArabicZero5Numbering, 
"arabic-zero5-numbering.odt")
  aMap["NumberingType"].get());
 }
 
+DECLARE_ODFEXPORT_TEST(testPageContentBottom, "page-content-bottom.odt")
+{
+uno::Reference xShape(getShape(1), uno::UNO_QUERY);
+sal_Int16 nExpected = text::RelOrientation::PAGE_PRINT_AREA_BOTTOM;
+CPPUNIT_ASSERT_EQUAL(nExpected, getProperty(xShape, 
"VertOrientRelation"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 624c7684330c..9fab6ca983ef 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3353,6 +3353,8 @@ namespace xmloff::token {
 // For recording whether comments/annotations are resolved
 TOKEN( "resolved",XML_RESOLVED ),
 
+TOKEN( "page-content-bottom", XML_PAGE_CONTENT_BOTTOM ),
+
 #if OSL_DEBUG_LEVEL > 0
 { 0, nullptr, std::nullopt,   XML_TOKEN_END }
 #else
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index 188f510c0fe8..cec29f36374c 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -1030,10 +1030,10 @@ void SvXMLExportPropertyMapper::_exportXML(
 if( bRemove )
 rAttrList.RemoveAttribute( sName );
 
+// We don't seem to have a generic mechanism to write an attribute 
in the extension
+// namespace in case of certain attribute values only, so do this 
manually.
 if 
(IsXMLToken(mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex), 
XML_WRITING_MODE))
 {
-// We don't seem to have a generic mechanism to write an 
attribute in the extension
-// namespace in case of certain attribute values only, so do 
this manually.
 if (IsXMLToken(aValue, XML_BT_LR))
 {
 sName = rNamespaceMap.GetQNameByKey(
@@ -1041,6 +1041,15 @@ void SvXMLExportPropertyMapper::_exportXML(
 
mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex));
 }
 }
+else if 
(IsXMLToken(mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex), 
XML_VERTICAL_REL))
+{
+  

[Libreoffice-commits] core.git: include/xmloff schema/libreoffice sw/qa xmloff/source

2019-09-24 Thread Miklos Vajna (via logerrit)
 include/xmloff/xmltoken.hxx |1 +
 schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng |6 ++
 sw/qa/extras/odfexport/data/allow-overlap.odt   |binary
 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(+)

New commits:
commit a5698f1a0fb8bf8775f1a098ae9ee09de968d632
Author: Miklos Vajna 
AuthorDate: Tue Sep 24 17:04:21 2019 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 24 18:45:40 2019 +0200

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

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 ..b23f5b360b85
Binary files /dev/null and b/sw/qa/extras/odfexport/data/allow-overlap.odt 
differ
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 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(