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


Again one small patch to simplify HTML export code.

This patch is licensed under LGPLv3+/MPL. This will also hold for all
future patches I submit to this list, unless I state otherwise.

Harri
From 425bd69f8968101a84ec510b1e880fa4b2c51244 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= <hatapitk@iki.fi>
Date: Thu, 6 Oct 2011 20:58:11 +0300
Subject: [PATCH] Remove code related to previously disabled HTML 3.2 export

---
 cui/source/tabpages/page.cxx      |   11 ++---------
 svtools/inc/svtools/htmlcfg.hxx   |    1 -
 sw/source/filter/html/wrthtml.cxx |    7 ++-----
 sw/source/ui/shells/textsh.cxx    |    5 +----
 4 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 59977eb..fe0af32 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -89,9 +89,6 @@ public:
     /** Returns the HTML export mode, as read from the configuration. */
     inline sal_Int32            GetExportMode() const { return mnExpMode; }
 
-    /** Returns true, if the current HTML export mode is set to HTML 3.2. */
-    inline bool                 IsExportModeHTML32() const { return mnExpMode == 0; } // 0 == 
HTML_CFG_HTML32, see offmgr/htmlcfg.hxx
-
     virtual void    Commit();
     virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& _rPropertyNames);
 
@@ -310,10 +307,6 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) :
                     0 != (pItem = pShell->GetItem(SID_HTML_MODE))))
         bWeb = 0 != (((const SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON);
 
-    // #109989# get the HTML export setting from configuration.
-    // !! This is a hack, see comments in SvxHtmlExportModeConfigItem_Impl class above.
-    bool bHTML32 = SvxHtmlExportModeConfigItem_Impl().IsExportModeHTML32();
-
     //  fill text flow listbox with valid entries
     aTextFlowBox.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_LTR_HORI ), FRMDIR_HORI_LEFT_TOP 
);
     if( bCTL )
@@ -328,8 +321,8 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) :
         }
     }
 
-    // #109989# show the text direction box in Writer/Web too, but only, if HTML export mode is 
not HTML3.2.
-    if( !(bWeb && bHTML32) && (bCJK || bCTL) &&
+    // #109989# show the text direction box in Writer/Web too
+    if( (bCJK || bCTL) &&
         SFX_ITEM_UNKNOWN < rAttr.GetItemState(GetWhich( SID_ATTR_FRAMEDIRECTION )))
     {
         aTextFlowLbl.Show();
diff --git a/svtools/inc/svtools/htmlcfg.hxx b/svtools/inc/svtools/htmlcfg.hxx
index e73a385..9b35b7b 100644
--- a/svtools/inc/svtools/htmlcfg.hxx
+++ b/svtools/inc/svtools/htmlcfg.hxx
@@ -38,7 +38,6 @@
 
 // !!!be aware!!!: the following defines are _not_ used as values in the configuration file
 //                  this is because of compatibility reasons
-#define HTML_CFG_HTML32     0   // Html 3.2
 #define HTML_CFG_MSIE       1   // Internet Explorer
 #define HTML_CFG_WRITER     2   // Writer
 #define HTML_CFG_NS40       3   // Netscape 4.0
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 4a7cd31..ddc377f 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -162,8 +162,7 @@ sal_uLong SwHTMLWriter::WriteStream()
     if( HTML_CFG_NS40==nExportMode )
         nHTMLMode |= HTMLMODE_BORDER_NONE;
 
-    if( HTML_CFG_HTML32!=nExportMode )
-        nHTMLMode |= HTMLMODE_FONT_GENERIC;
+    nHTMLMode |= HTMLMODE_FONT_GENERIC;
 
     if( HTML_CFG_NS40==nExportMode )
         nHTMLMode |= HTMLMODE_NO_CONTROL_CENTERING;
@@ -906,9 +905,7 @@ const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 &rHeaderAttrs )
 {
     rtl::OStringBuffer sOut;
     sOut.append(OOO_STRING_SVTOOLS_HTML_doctype).append(' ')
-        .append(HTML_CFG_HTML32==nExportMode ?
-            OOO_STRING_SVTOOLS_HTML_doctype32 :
-            OOO_STRING_SVTOOLS_HTML_doctype40);
+        .append(OOO_STRING_SVTOOLS_HTML_doctype40);
     HTMLOutFuncs::Out_AsciiTag( Strm(), sOut.makeStringAndClear().getStr() );
 
     // baue den Vorspann
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index e46d7d3..5835e5c 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -515,10 +515,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
         {
             SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
             sal_uInt16 nExport = rHtmlOpt.GetExportMode();
-            if( HTML_CFG_MSIE == nExport ||
-                HTML_CFG_HTML32 == nExport ||
-                HTML_CFG_MSIE == nExport ||
-                HTML_CFG_HTML32 == nExport )
+            if( HTML_CFG_MSIE == nExport )
             {
                 bSingleCol = sal_True;
             }
-- 
1.7.6.3

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.