[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.3' - 3 commits - swext/mediawiki vcl/unx

Caolán McNamara caolanm at redhat.com
Fri May 1 13:49:22 PDT 2015


 swext/mediawiki/src/filter/odt2mediawiki.xsl  |   67 ++++++++++++++++++++++----
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx      |    2 
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |    7 ++
 3 files changed, 65 insertions(+), 11 deletions(-)

New commits:
commit a0b8f9ec6df0a82c4fc45709952c39fd3990177b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 24 11:01:50 2015 +0100

    Resolves: tdf#73211 gtk checkboxes need erase afer toggling
    
    because an unchecked checkbox can have a smaller paint area
    than a checked checkbox. This has always bugged me
    
    (cherry picked from commit d194074aa34e3724dd9b93fbc81bf2ba793cd37a)
    
    Conflicts:
    	vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
    
    Change-Id: Iac0f075089611b47c381863a9655445d732bfddc
    Reviewed-on: https://gerrit.libreoffice.org/15510
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    Tested-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index b1e7e23..226ea69 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -441,6 +441,8 @@ void GtkData::initNWF( void )
     pSVData->maNWFData.mnMenuFormatBorderX = xthickness + horizontal_padding;
     pSVData->maNWFData.mnMenuFormatBorderY = ythickness + vertical_padding;
 
+    pSVData->maNWFData.mbCheckBoxNeedsErase = true;
+
     if( SalGetDesktopEnvironment() == "KDE" )
     {
         // #i97196# ensure a widget exists and the style engine was loaded
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 2a1f4e7..ed4c2d0 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1470,7 +1470,12 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
     return false;
 }
 
-void GtkData::initNWF() {}
+void GtkData::initNWF()
+{
+    ImplSVData* pSVData = ImplGetSVData();
+    pSVData->maNWFData.mbCheckBoxNeedsErase = true;
+}
+
 void GtkData::deInitNWF() {}
 
 void GtkSalGraphics::getStyleContext(GtkStyleContext** style, GtkWidget* widget)
commit 12eaf026c3a42de8b03749947485d9851b0d9a6f
Author: Robert Antoni Buj Gelonch <robert.buj at gmail.com>
Date:   Fri Apr 24 12:29:54 2015 +0200

    tdf#75019 bookmarks in exporting to mediawiki
    
    Change-Id: Ieb066d37196a22e67226d59e12c7869c1fc8cc8a
    Reviewed-on: https://gerrit.libreoffice.org/15509
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/swext/mediawiki/src/filter/odt2mediawiki.xsl b/swext/mediawiki/src/filter/odt2mediawiki.xsl
index 7d03510..7198a1f 100644
--- a/swext/mediawiki/src/filter/odt2mediawiki.xsl
+++ b/swext/mediawiki/src/filter/odt2mediawiki.xsl
@@ -516,12 +516,37 @@
 		<variable name="link-ref" select="@xlink:href"/>
 		<choose>
 			<when test="string-length($link-ref) > 0">
-				<variable name="link-label" select="string(.)"/>
-				<text>[</text>
-				<value-of select="$link-ref"/>
-				<text> </text>
-				<value-of select="$link-label"/>
-				<text>]</text>
+				<choose>
+					<when test="starts-with($link-ref, '#')">
+						<text>[[</text>
+						<choose>
+							<when test="contains($link-ref, '_')">
+								<value-of select="translate($link-ref,'_','')"/>
+							</when>
+							<otherwise>
+								<value-of select="$link-ref"/>
+							</otherwise>
+						</choose>
+						<text>|</text>
+						<choose>
+							<when test="text:tab and ancestor::text:index-body">
+								<value-of select="node()[1]"/>
+							</when>
+							<otherwise>
+								<value-of select="string(.)"/>
+							</otherwise>
+						</choose>
+						<text>]]</text>
+					</when>
+
+                                        <otherwise>
+						<text>[</text>
+						<value-of select="$link-ref"/>
+						<text> </text>
+						<value-of select="string(.)"/>
+						<text>]</text>
+					</otherwise>
+				</choose>
 			</when>
 			
 			<otherwise>
@@ -894,6 +919,25 @@
  		<!-- TODO: Output an anchor. -->
  	</template>
 
+	<template match="text:bookmark-start">
+		<if test="boolean(@text:name)">
+			<variable name="bookmark">
+				<choose>
+					<when test="contains(@text:name,'_')">
+						<value-of select="translate(@text:name,'_','')"/>
+					</when>
+					<otherwise>
+						<value-of select="@text:name"/>
+					</otherwise>
+				</choose>
+			</variable>
+			<text>{{anchor|</text>
+			<value-of select="$bookmark"/>
+			<text>}} </text>
+		</if>
+		<apply-templates/>
+	</template>
+
 	<!-- 
 		== Plain text == 
 	-->
commit 8852f26e6e5dfa56279b11ba592d99a115deba26
Author: Robert Antoni Buj Gelonch <robert.buj at gmail.com>
Date:   Thu Apr 23 18:13:06 2015 +0200

    tdf#75360 tdf#90474 line breaks in exporting to mediawiki
    
    Change-Id: I7b6c9c76102fe22fdae6e62472b717358bfcee8b
    Reviewed-on: https://gerrit.libreoffice.org/15497
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/swext/mediawiki/src/filter/odt2mediawiki.xsl b/swext/mediawiki/src/filter/odt2mediawiki.xsl
index 1205536..7d03510 100644
--- a/swext/mediawiki/src/filter/odt2mediawiki.xsl
+++ b/swext/mediawiki/src/filter/odt2mediawiki.xsl
@@ -285,6 +285,7 @@
 			<text> </text>
 			<value-of select="$token"/>
 			<value-of select="$NL"/>
+			<value-of select="$NL"/>
 		</if>
 	</template>
 
@@ -293,6 +294,7 @@
 		<apply-templates/>
 		<text> ==</text>
 		<value-of select="$NL"/>
+		<value-of select="$NL"/>
 	</template>
 
 	<!-- 
@@ -554,7 +556,7 @@
 		== Paragraphs == 
 	 -->
 
-	<template match="text:p[string-length(.) > 0]">
+	<template match="text:p">
 		<variable name="style">
 			<call-template name="mk-style-set">
 				<with-param name="node" select="."/>
@@ -602,7 +604,7 @@
 			-->
 			<choose>
 				<when test="boolean(ancestor::text:list-item)">
-					<text><br/> </text>
+					<text><br/></text>
 				</when>
 				<when test="$code">
 					<variable name="style-right">
@@ -640,12 +642,13 @@
 				</otherwise>
 			</choose>
  		</when>
- 		<when test="boolean(./following-sibling::*[1]/self::text:h) or boolean(./following-sibling::*[1]/self::table:table) or boolean(./following-sibling::*[1]/self::text:bibliography)">
+		<when test="boolean(./following::*[1]/self::text:h) or boolean(./following::*[1]/self::table:table) or boolean(./following::*[1]/self::text:bibliography)">
  			<!-- Newline before following heading or table. -->
  			<value-of select="$NL"/>
  			<value-of select="$NL"/>
  		</when>
- 		<when test="./following-sibling::*[1]/self::text:list and not(ancestor::text:list-item)">
+		<when test="not(./following-sibling::*[1]) and name(./following::*[1])='text:p' and ancestor::text:list-item">
+			<!-- End of the list -->
  			<value-of select="$NL"/>
  			<value-of select="$NL"/>
  		</when>


More information about the Libreoffice-commits mailing list