[PATCH] Remove unused HTMLMODE_FIRSTLINE

Harri Pitkänen hatapitk at iki.fi
Sat Mar 31 23:27:11 PDT 2012


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

------=_20120401094235_86293--




More information about the LibreOffice mailing list