Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


HTMLMODE_FIRSTLINE was disabled in all HTML export modes. It seems to
have been used to add first line indent for paragraphs in Netscape
version 3 but all currently available export modes use CSS for that.

Harri
From 26abdf32a398dc2bfcea60e751e0a1b3edb984c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= <hatapitk@iki.fi>
Date: Sun, 1 Apr 2012 09:27:11 +0300
Subject: [PATCH] Remove unused HTMLMODE_FIRSTLINE

HTMLMODE_FIRSTLINE was disabled in all HTML export modes. It seems to
have been used to add first line indent for paragraphs in Netscape
version 3 but all currently available export modes use CSS for that.
---
 cui/source/tabpages/paragrph.cxx  |    9 ++----
 sfx2/inc/sfx2/htmlmode.hxx        |    1 -
 sw/source/filter/html/htmlatr.cxx |   55 +------------------------------------
 sw/source/ui/shells/txtattr.cxx   |    2 +-
 4 files changed, 5 insertions(+), 62 deletions(-)

diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index a2334b5..24ebdeb 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -611,11 +611,8 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet )
             aRightIndent.Disable();
             aTopDist.Disable();  //HTML3.2 und NS 3.0
             aBottomDist.Disable();
-            if(!(nHtmlMode & HTMLMODE_FIRSTLINE)) //NS 3.0
-            {
-                aFLineIndent.Disable();
-                aFLineLabel.Disable();
-            }
+            aFLineIndent.Disable();
+            aFLineLabel.Disable();
         }
     }
 
@@ -1282,7 +1279,7 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet& rSet )
         aLastLineLB.Hide();
         aLastLineFT.Hide();
         aExpandCB.Hide();
-        if(!(nHtmlMode & (HTMLMODE_FULL_STYLES|HTMLMODE_FIRSTLINE)) )
+        if(!(nHtmlMode & HTMLMODE_FULL_STYLES) )
             aJustify.Disable();
         aSnapToGridCB.Show(sal_False);
     }
diff --git a/sfx2/inc/sfx2/htmlmode.hxx b/sfx2/inc/sfx2/htmlmode.hxx
index 63b0bfe..0cbcda8 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_FIRSTLINE          0x0400 /* First-line intent with Spacer == NS 3.0 */
 #define HTMLMODE_SOME_ABS_POS       0x2000
 #define HTMLMODE_RESERVED1          0x4000
 #define HTMLMODE_RESERVED0          0x8000
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 9d15312..f0121ce 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -120,30 +120,6 @@ HTMLOutEvent aAnchorEventTable[] =
 
 static Writer& OutHTML_SvxAdjust( Writer& rWrt, const SfxPoolItem& rHt );
 
-static Writer& OutHTML_HoriSpacer( Writer& rWrt, sal_Int16 nSize )
-{
-    OSL_ENSURE( nSize>0, "horizontaler SPACER mit negativem Wert?" );
-    if( nSize <= 0 )
-        return rWrt;
-
-    if( Application::GetDefaultDevice() )
-    {
-        nSize = (sal_Int16)Application::GetDefaultDevice()
-            ->LogicToPixel( Size(nSize,0), MapMode(MAP_TWIP) ).Width();
-    }
-
-    rtl::OStringBuffer sOut;
-    sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_spacer).append(' ').
-         append(OOO_STRING_SVTOOLS_HTML_O_type).append('=').
-         append(OOO_STRING_SVTOOLS_HTML_SPTYPE_horizontal).append(' ').
-         append(OOO_STRING_SVTOOLS_HTML_O_size).append('=').
-         append(static_cast<sal_Int32>(nSize)).append('>');
-
-    rWrt.Strm() << sOut.getStr();
-
-    return rWrt;
-}
-
 sal_uInt16 SwHTMLWriter::GetDefListLvl( const String& rNm, sal_uInt16 nPoolId )
 {
     if( nPoolId == RES_POOLCOLL_HTML_DD )
@@ -1077,18 +1053,6 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
             rInfo.aToken = rtl::OString();
     }
 
-    // ??? Warum nicht ueber den Hint-Mechanismus ???
-    if( rHWrt.IsHTMLMode(HTMLMODE_FIRSTLINE) )
-    {
-        const SvxLRSpaceItem& rLRSpaceTmp =
-            pNodeItemSet ? ((const SvxLRSpaceItem &)pNodeItemSet->Get(RES_LR_SPACE))
-                         : rFmt.GetLRSpace();
-        if( rLRSpaceTmp.GetTxtFirstLineOfst() > 0 )
-        {
-            OutHTML_HoriSpacer( rWrt, rLRSpaceTmp.GetTxtFirstLineOfst() );
-        }
-    }
-
     if( nBulletGrfLvl != 255 )
     {
         OSL_ENSURE( aNumInfo.GetNumRule(), "Wo ist die Numerierung geblieben???" );
@@ -2527,24 +2491,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
                 do {
                     if ( pHt->GetEnd() && !pHt->HasDummyChar() )
                     {
-                        if( RES_CHRATR_KERNING == pHt->Which() &&
-                            rHTMLWrt.IsHTMLMode(HTMLMODE_FIRSTLINE) &&
-                            *pHt->GetEnd() - nStrPos == 1 &&
-                            ' ' == rStr.GetChar(nStrPos) &&
-                            ((const SvxKerningItem&)pHt->GetAttr()).GetValue() > 0 )
-                        {
-                            // Wenn erlaubt, wird das Ding als Spacer exportiert
-
-                            bOutChar = sal_False;   // Space nicht ausgeben
-                            bWriteBreak = sal_False;    // der Absatz ist aber auch nicht leer
-                            HTMLOutFuncs::FlushToAscii( rWrt.Strm(), aContext );
-                            OutHTML_HoriSpacer( rWrt,
-                                ((const SvxKerningItem&)pHt->GetAttr()).GetValue() );
-
-                            // Der Hint braucht nun doch nicht weiter
-                            // beruecksichtigt werden.
-                        }
-                        else if( *pHt->GetEnd() != nStrPos )
+                        if( *pHt->GetEnd() != nStrPos )
                         {
                             // Hints mit Ende einsortieren, wenn sie keinen
                             // leeren Bereich aufspannen (Hints, die keinen
diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx
index 9604097..272a9fc 100644
--- a/sw/source/ui/shells/txtattr.cxx
+++ b/sw/source/ui/shells/txtattr.cxx
@@ -605,7 +605,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
                 {
                     bFlag = SVX_ADJUST_BLOCK == eAdjust;
                     sal_uInt16 nHtmlMode = GetHtmlMode(rSh.GetView().GetDocShell());
-                    if((nHtmlMode & HTMLMODE_ON) && !(nHtmlMode & 
(HTMLMODE_FULL_STYLES|HTMLMODE_FIRSTLINE) ))
+                    if((nHtmlMode & HTMLMODE_ON) && !(nHtmlMode & HTMLMODE_FULL_STYLES ))
                     {
                         rSet.DisableItem( nSlot );
                         nSlot = 0;
-- 
1.7.9.1

Context


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.