Previously when drop caps were specified in a paragraph style (not
as direct formatting) export to HTML was implemented with :first-letter
pseudo-class for "LibreOffice Writer" and through styling individual
characters for other browsers. Since all browsers used these days (even
obsolete ones like IE 5.5) support :first-letter there seems to be no
reason to maintain this difference. This patch unifies all export
modes to use :first-letter in such cases.
Harri
From d37995fee3f6bc94cd63679f987a2ee65662a2bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= <hatapitk@iki.fi>
Date: Tue, 22 Nov 2011 20:24:52 +0200
Subject: [PATCH] Enable :first-letter CSS pseudo-class for all browsers in
HTML export
Previously when drop caps were specified in a paragraph style (not
as direct formatting) export to HTML was implemented with :first-letter
pseudo-class for "LibreOffice Writer" and through styling individual
characters for other browsers. Since all browsers used these days (even
obsolete ones like IE 5.5) support :first-letter there seems to be no
reason to maintain this difference. This patch unifies all export
modes to use :first-letter in such cases.
---
sfx2/inc/sfx2/htmlmode.hxx | 1 -
sw/source/filter/html/css1atr.cxx | 6 ++----
sw/source/filter/html/htmlatr.cxx | 2 +-
sw/source/ui/config/viewopt.cxx | 1 -
4 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/sfx2/inc/sfx2/htmlmode.hxx b/sfx2/inc/sfx2/htmlmode.hxx
index 65e41f6..63b0bfe 100644
--- a/sfx2/inc/sfx2/htmlmode.hxx
+++ b/sfx2/inc/sfx2/htmlmode.hxx
@@ -35,7 +35,6 @@
#define HTMLMODE_SOME_STYLES 0x0020 /* mind. MS IE */
#define HTMLMODE_FULL_STYLES 0x0040 /* == SW */
#define HTMLMODE_PARA_BLOCK 0x0100
-#define HTMLMODE_DROPCAPS 0x0200
#define HTMLMODE_FIRSTLINE 0x0400 /* First-line intent with Spacer == NS 3.0 */
#define HTMLMODE_SOME_ABS_POS 0x2000
#define HTMLMODE_RESERVED1 0x4000
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 69efd26..d3d8174 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -1381,8 +1381,7 @@ static sal_Bool OutCSS1Rule( SwHTMLWriter& rHTMLWrt, const String& rSelector,
sal_Bool bCheckForPseudo )
{
sal_Bool bScriptDependent = sal_False;
- if( SwHTMLWriter::HasScriptDependentItems( rItemSet,
- rHTMLWrt.IsHTMLMode(HTMLMODE_DROPCAPS) && bHasClass ) )
+ if( SwHTMLWriter::HasScriptDependentItems( rItemSet, bHasClass ) )
{
bScriptDependent = sal_True;
String aSelector( rSelector );
@@ -1778,8 +1777,7 @@ static Writer& OutCSS1_SwFmt( Writer& rWrt, const SwFmt& rFmt,
// Drop-Caps ausgeben
const SfxPoolItem *pItem;
- if( rHTMLWrt.IsHTMLMode(HTMLMODE_DROPCAPS) &&
- SFX_ITEM_SET==aItemSet.GetItemState( RES_PARATR_DROP, sal_False, &pItem ))
+ if( SFX_ITEM_SET==aItemSet.GetItemState( RES_PARATR_DROP, sal_False, &pItem ))
{
String sOut( aSelector );
sOut.Append( ':');
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index c7d2847..3259cc0 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -648,7 +648,7 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
pFmtInfo = new SwHTMLFmtInfo( &rFmt, rWrt.pDoc, rHWrt.pTemplate,
rHWrt.bCfgOutStyles, rHWrt.eLang,
rHWrt.nCSS1Script,
- !rHWrt.IsHTMLMode(HTMLMODE_DROPCAPS) );
+ false );
rHWrt.aTxtCollInfos.C40_PTR_INSERT( SwHTMLFmtInfo, pFmtInfo );
String aName( rFmt.GetName() );
if( 0 != rHWrt.aScriptParaStyles.count( aName ) )
diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index 0ac6f96..5524fe2 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -348,7 +348,6 @@ sal_uInt16 GetHtmlMode(const SwDocShell* pShell)
break;
case HTML_CFG_WRITER:
nRet |= HTMLMODE_FRM_COLUMNS|HTMLMODE_FULL_STYLES|
- HTMLMODE_DROPCAPS|
HTMLMODE_SOME_ABS_POS;
break;
}
--
1.7.7.1
Context
- [Libreoffice] [PATCH] Enable :first-letter CSS pseudo-class for all browsers 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.