Export Writer font effects "Capitals", "Lowercase" and "Title" (see Format ->
Character -> Font effects) to HTML using CSS text-transform property.
Corresponding import code is not yet done, I will get to that soon.
Contributed under LGPLv3+ and MPL.
Harri
From 3b0ee298fcc0150f8e77abb2b4006568a1974b69 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= <hatapitk@iki.fi>
Date: Sun, 12 Jun 2011 18:42:03 +0300
Subject: [PATCH] Support font effects "Capitals", "Lowercase" and "Title" in
HTML export
Export Writer font effects "Capitals", "Lowercase" and "Title" (see
Format -> Character -> Font effects) to HTML using CSS text-transform
property. Corresponding import code is not yet implemented.
---
sw/source/filter/html/css1atr.cxx | 21 +++++++++++++++------
sw/source/filter/html/css1kywd.cxx | 5 +++++
sw/source/filter/html/css1kywd.hxx | 5 +++++
3 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 9bf6ea4..92a149b 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -2564,18 +2564,27 @@ static Writer& OutCSS1_SvxCaseMap( Writer& rWrt, const SfxPoolItem& rHt )
if( !rHTMLWrt.IsHTMLMode(HTMLMODE_SMALL_CAPS) )
return rWrt;
- const sal_Char *pStr = 0;
switch( ((const SvxCaseMapItem&)rHt).GetCaseMap() )
{
- case SVX_CASEMAP_NOT_MAPPED: pStr = sCSS1_PV_normal; break;
- case SVX_CASEMAP_KAPITAELCHEN: pStr = sCSS1_PV_small_caps; break;
+ case SVX_CASEMAP_NOT_MAPPED:
+ rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_variant, sCSS1_PV_normal );
+ break;
+ case SVX_CASEMAP_KAPITAELCHEN:
+ rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_variant, sCSS1_PV_small_caps );
+ break;
+ case SVX_CASEMAP_VERSALIEN:
+ rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_text_transform, sCSS1_PV_uppercase );
+ break;
+ case SVX_CASEMAP_GEMEINE:
+ rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_text_transform, sCSS1_PV_lowercase );
+ break;
+ case SVX_CASEMAP_TITEL:
+ rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_text_transform, sCSS1_PV_capitalize );
+ break;
default:
;
}
- if( pStr )
- rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_variant, pStr );
-
return rWrt;
}
diff --git a/sw/source/filter/html/css1kywd.cxx b/sw/source/filter/html/css1kywd.cxx
index ba7ab32..7874c6f 100644
--- a/sw/source/filter/html/css1kywd.cxx
+++ b/sw/source/filter/html/css1kywd.cxx
@@ -109,6 +109,11 @@ sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_extra_bold, "extra-bold" );
sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_lighter, "lighter" );
sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_bolder, "bolder" );
+sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_text_transform, "text-transform" );
+
+sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_capitalize, "capitalize" );
+sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_uppercase, "uppercase" );
+sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_lowercase, "lowercase" );
sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_font_size, "font-size" );
diff --git a/sw/source/filter/html/css1kywd.hxx b/sw/source/filter/html/css1kywd.hxx
index e3f8f05..539ad90 100644
--- a/sw/source/filter/html/css1kywd.hxx
+++ b/sw/source/filter/html/css1kywd.hxx
@@ -102,6 +102,11 @@ extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_font_variant, "font-variant" );
//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_normal, "normal" );
extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_small_caps, "small-caps" );
+extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_text_transform, "text-transform" );
+
+extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_capitalize, "capitalize" );
+extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_uppercase, "uppercase" );
+extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_lowercase, "lowercase" );
extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_font_weight, "font-weight" );
--
1.7.5.3
Context
- [Libreoffice] [PATCH] Support font effects "Capitals", "Lowercase" and "Title" in HTML export · Harri Pitkänen
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.