sc/source/filter/xml/xmlstyle.cxx |    2 ++
 sc/source/filter/xml/xmlstyli.cxx |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 686d171303c3e9bbddf885ddfcfa65c5cb019733
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Thu Apr 23 18:53:13 2020 +0200
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri May 8 21:04:57 2020 +0200

    sc: ODF export: style:hyperlink extension element, step 1
    
    Commit 066bdb31f7ff801b7a36c79c43ecbd527ffb2a88 introduced
    style:hyperlink element but it should be in loext namespace.
    
    Allow import from LO_EXT namespace, but keep export to STYLE for
    now because existing LO releases expect that.
    
    Thanks to vmiklos for discovering that such link can be inserted via:
    
    ThisComponent.Sheets(0).getCellByPosition(0, 0).Hyperlink = 
"http://libreoffice.org/";
    
    Change-Id: Id951f4a657fefe1e4af5e1635acca7a96f90ce28
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92800
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    Tested-by: Jenkins

diff --git a/sc/source/filter/xml/xmlstyle.cxx 
b/sc/source/filter/xml/xmlstyle.cxx
index b4d86faca62b..7f38d5217042 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -77,7 +77,9 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] =
     MAP( "HoriJustify", XML_NAMESPACE_FO, XML_TEXT_ALIGN, 
XML_TYPE_PROP_PARAGRAPH|XML_SC_TYPE_HORIJUSTIFY|MID_FLAG_MERGE_PROPERTY, 0 ),
     MAP( "HoriJustify", XML_NAMESPACE_STYLE, XML_TEXT_ALIGN_SOURCE, 
XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_HORIJUSTIFYSOURCE|MID_FLAG_MERGE_PROPERTY, 
0 ),
     MAP( "HoriJustify", XML_NAMESPACE_STYLE, XML_REPEAT_CONTENT, 
XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_HORIJUSTIFYREPEAT|MID_FLAG_MERGE_PROPERTY, 
0 ),
+    // FIXME this was wrongly exported to STYLE namespace since 2013
     MAP_EXT( SC_UNONAME_HYPERLINK, XML_NAMESPACE_STYLE, XML_HYPERLINK, 
XML_TYPE_PROP_TABLE_CELL | XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, 
CTF_SC_HYPERLINK ),
+    MAP_EXT( SC_UNONAME_HYPERLINK, XML_NAMESPACE_LO_EXT, XML_HYPERLINK, 
XML_TYPE_PROP_TABLE_CELL | XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, 
CTF_SC_HYPERLINK ),
     MAP_EXT( SC_UNONAME_CELLHJUS_METHOD, XML_NAMESPACE_CSS3TEXT, 
XML_TEXT_JUSTIFY, XML_TYPE_PROP_PARAGRAPH|XML_SC_TYPE_HORIJUSTIFY_METHOD, 0 ),
     MAP( "IsCellBackgroundTransparent", XML_NAMESPACE_FO, 
XML_BACKGROUND_COLOR, 
XML_TYPE_PROP_TABLE_CELL|XML_TYPE_ISTRANSPARENT|MID_FLAG_MULTI_PROPERTY|MID_FLAG_MERGE_ATTRIBUTE,
 0 ),
     MAP( "IsTextWrapped", XML_NAMESPACE_FO, XML_WRAP_OPTION, 
XML_TYPE_PROP_TABLE_CELL|XML_SC_ISTEXTWRAPPED, 0 ),
diff --git a/sc/source/filter/xml/xmlstyli.cxx 
b/sc/source/filter/xml/xmlstyli.cxx
index b83f6cf06a45..410dea98bb2e 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -304,8 +304,8 @@ SvXMLImportContextRef 
XMLTableCellPropsContext::CreateChildContext( sal_uInt16 n
     // no need for a custom context or indeed a SvXMLTokenMap to grab just the
     // single attribute ( href ) that we are interested in.
     // still though, we will check namespaces etc.
-    if ( ( XML_NAMESPACE_STYLE == nPrefix) &&
-        IsXMLToken(rLocalName, XML_HYPERLINK ) )
+    if ((XML_NAMESPACE_STYLE == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix)
+        && IsXMLToken(rLocalName, XML_HYPERLINK))
     {
         OUString sURL;
         for ( int i=0; i<xAttrList->getLength(); ++i )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to