A few cleanups and removal of HTML 3.2 from HTML export options. In case HTML
3.2 has been previously selected as the HTML variant it will be converted to
Netscape Navigator.
Licensed under LGPL3+/GPL3+/MPL.
Harri
From dcfad39ff54a70cfb52c167a37e32a99396aec2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= <hatapitk@iki.fi>
Date: Sat, 13 Aug 2011 13:40:46 +0300
Subject: [PATCH 1/3] Remove extra #define
HTML_CFG_MSIE was an alias for HTML_CFG_MSIE_40, just use it everywhere
for clarity.
---
cui/source/options/opthtml.cxx | 4 ++--
svtools/inc/svtools/htmlcfg.hxx | 3 +--
svtools/source/config/htmlcfg.cxx | 6 +++---
sw/source/ui/config/viewopt.cxx | 2 +-
sw/source/ui/shells/textsh.cxx | 4 ++--
5 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/cui/source/options/opthtml.cxx b/cui/source/options/opthtml.cxx
index a3016e6..7c1c3ef 100644
--- a/cui/source/options/opthtml.cxx
+++ b/cui/source/options/opthtml.cxx
@@ -41,7 +41,7 @@
const sal_uInt16 aPosToExportArr[] =
{
HTML_CFG_HTML32,
- HTML_CFG_MSIE_40,
+ HTML_CFG_MSIE,
HTML_CFG_NS40,
HTML_CFG_WRITER
};
@@ -225,7 +225,7 @@ IMPL_LINK(OfaHtmlTabPage, ExportHdl_Impl, ListBox*, pBox)
sal_uInt16 nExport = aPosToExportArr[ pBox->GetSelectEntryPos() ];
switch( nExport )
{
- case HTML_CFG_MSIE_40:
+ case HTML_CFG_MSIE:
case HTML_CFG_NS40 :
case HTML_CFG_WRITER :
aPrintExtensionCB.Enable(sal_True);
diff --git a/svtools/inc/svtools/htmlcfg.hxx b/svtools/inc/svtools/htmlcfg.hxx
index c668324..26bb48a 100644
--- a/svtools/inc/svtools/htmlcfg.hxx
+++ b/svtools/inc/svtools/htmlcfg.hxx
@@ -39,8 +39,7 @@
// !!!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_40 1 // Internet Explorer 4.0
-#define HTML_CFG_MSIE HTML_CFG_MSIE_40
+#define HTML_CFG_MSIE 1 // Internet Explorer
#define HTML_CFG_WRITER 2 // Writer
#define HTML_CFG_NS40 3 // Netscape 4.0
#define HTML_CFG_MSIE_40_OLD 4 // Internet Explorer 4.0 - alter Wert
diff --git a/svtools/source/config/htmlcfg.cxx b/svtools/source/config/htmlcfg.cxx
index 338fd0d..fa3759d 100644
--- a/svtools/source/config/htmlcfg.cxx
+++ b/svtools/source/config/htmlcfg.cxx
@@ -163,7 +163,7 @@ void SvxHtmlOptions::Load( const Sequence< OUString >& aNames )
switch( nExpMode )
{
case 0: nExpMode = HTML_CFG_HTML32; break;
- case 1: nExpMode = HTML_CFG_MSIE_40; break;
+ case 1: nExpMode = HTML_CFG_MSIE; break;
case 3: nExpMode = HTML_CFG_WRITER; break;
case 4: nExpMode = HTML_CFG_NS40; break;
case 5: nExpMode = HTML_CFG_MSIE_40_OLD;break;
@@ -233,7 +233,7 @@ void SvxHtmlOptions::Commit()
switch( nExpMode )
{
case HTML_CFG_HTML32: nExpMode = 0; break;
- case HTML_CFG_MSIE_40: nExpMode = 1; break;
+ case HTML_CFG_MSIE: nExpMode = 1; break;
case HTML_CFG_WRITER: nExpMode = 3; break;
case HTML_CFG_NS40: nExpMode = 4; break;
case HTML_CFG_MSIE_40_OLD: nExpMode = 5; break;
@@ -388,7 +388,7 @@ sal_Bool SvxHtmlOptions::IsPrintLayoutExtension() const
sal_Bool bRet = 0 != (pImp->nFlags & HTMLCFG_PRINT_LAYOUT_EXTENSION);
switch( pImp->nExportMode )
{
- case HTML_CFG_MSIE_40:
+ case HTML_CFG_MSIE:
case HTML_CFG_NS40 :
case HTML_CFG_WRITER :
break;
diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index 581ed2a..a34a30d 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -337,7 +337,7 @@ sal_uInt16 GetHtmlMode(const SwDocShell* pShell)
SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
switch ( rHtmlOpt.GetExportMode() )
{
- case HTML_CFG_MSIE_40:
+ case HTML_CFG_MSIE:
nRet |= HTMLMODE_SMALL_CAPS|
HTMLMODE_FULL_STYLES|HTMLMODE_GRAPH_POS|
HTMLMODE_FULL_ABS_POS|HTMLMODE_SOME_ABS_POS;
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index b735310..e46d7d3 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -517,7 +517,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
sal_uInt16 nExport = rHtmlOpt.GetExportMode();
if( HTML_CFG_MSIE == nExport ||
HTML_CFG_HTML32 == nExport ||
- HTML_CFG_MSIE_40 == nExport ||
+ HTML_CFG_MSIE == nExport ||
HTML_CFG_HTML32 == nExport )
{
bSingleCol = sal_True;
@@ -801,7 +801,7 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
{
SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
sal_uInt16 nExport = rHtmlOpt.GetExportMode();
- if(HTML_CFG_MSIE_40 != nExport && HTML_CFG_WRITER != nExport )
+ if(HTML_CFG_MSIE != nExport && HTML_CFG_WRITER != nExport )
rSet.DisableItem(nWhich);
}
}
--
1.7.5.4
From 390d87886c63df5eaba624f225fc0fa63cc4825f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= <hatapitk@iki.fi>
Date: Sat, 20 Aug 2011 10:26:53 +0300
Subject: [PATCH 2/3] Remove HTML_CFG_MSIE_40_OLD
This export format has not been available in the UI but there were still
a few references to it left in the source.
---
svtools/inc/svtools/htmlcfg.hxx | 1 -
svtools/source/config/htmlcfg.cxx | 2 --
2 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/svtools/inc/svtools/htmlcfg.hxx b/svtools/inc/svtools/htmlcfg.hxx
index 26bb48a..e73a385 100644
--- a/svtools/inc/svtools/htmlcfg.hxx
+++ b/svtools/inc/svtools/htmlcfg.hxx
@@ -42,7 +42,6 @@
#define HTML_CFG_MSIE 1 // Internet Explorer
#define HTML_CFG_WRITER 2 // Writer
#define HTML_CFG_NS40 3 // Netscape 4.0
-#define HTML_CFG_MSIE_40_OLD 4 // Internet Explorer 4.0 - alter Wert
#define HTML_CFG_MAX HTML_CFG_NS40
diff --git a/svtools/source/config/htmlcfg.cxx b/svtools/source/config/htmlcfg.cxx
index fa3759d..3fe81421 100644
--- a/svtools/source/config/htmlcfg.cxx
+++ b/svtools/source/config/htmlcfg.cxx
@@ -166,7 +166,6 @@ void SvxHtmlOptions::Load( const Sequence< OUString >& aNames )
case 1: nExpMode = HTML_CFG_MSIE; break;
case 3: nExpMode = HTML_CFG_WRITER; break;
case 4: nExpMode = HTML_CFG_NS40; break;
- case 5: nExpMode = HTML_CFG_MSIE_40_OLD;break;
default: nExpMode = HTML_CFG_NS40; break;
}
@@ -236,7 +235,6 @@ void SvxHtmlOptions::Commit()
case HTML_CFG_MSIE: nExpMode = 1; break;
case HTML_CFG_WRITER: nExpMode = 3; break;
case HTML_CFG_NS40: nExpMode = 4; break;
- case HTML_CFG_MSIE_40_OLD: nExpMode = 5; break;
default: nExpMode = 4; break; // NS40
}
--
1.7.5.4
From 3b9ccc163ba5c940f72ee73272d417a91ea8ae85 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= <hatapitk@iki.fi>
Date: Sat, 20 Aug 2011 12:48:24 +0300
Subject: [PATCH 3/3] Remove HTML 3.2 export option
---
cui/source/options/opthtml.cxx | 15 +++++----------
cui/source/options/opthtml.src | 1 -
svtools/source/config/htmlcfg.cxx | 2 --
sw/source/ui/config/viewopt.cxx | 2 --
4 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/cui/source/options/opthtml.cxx b/cui/source/options/opthtml.cxx
index 7c1c3ef..62dacb0 100644
--- a/cui/source/options/opthtml.cxx
+++ b/cui/source/options/opthtml.cxx
@@ -40,20 +40,17 @@
// Umwandlung der Modi zu den Positionen in der Listbox
const sal_uInt16 aPosToExportArr[] =
{
- HTML_CFG_HTML32,
HTML_CFG_MSIE,
HTML_CFG_NS40,
HTML_CFG_WRITER
};
-//#define DEPRECATED_ENTRY 0xFFFF
-
const sal_uInt16 aExportToPosArr[] =
{
- 0, //HTML 3.2
- 1, //MS Internet Explorer 4.0
- 3, //StarWriter
- 2 //Netscape Navigator 4.0
+ 1, //HTML 3.2 (removed, map to Netscape Navigator 4.0)
+ 0, //MS Internet Explorer 4.0
+ 2, //StarWriter
+ 1 //Netscape Navigator 4.0
};
// -----------------------------------------------------------------------
@@ -185,10 +182,8 @@ void OfaHtmlTabPage::Reset( const SfxItemSet& )
aIgnoreFontNamesCB.Check(rHtmlOpt.IsIgnoreFontFamily());
sal_uInt16 nExport = rHtmlOpt.GetExportMode();
if( nExport >= SAL_N_ELEMENTS( aExportToPosArr ) )
- nExport = 4; // default for bad config entry is NS 4.0
+ nExport = 3; // default for bad config entry is NS 4.0
sal_uInt16 nPosArr = aExportToPosArr[ nExport ];
-// if( nPosArr == DEPRECATED_ENTRY )
-// nPosArr = aExportToPosArr[ 4 ]; // again: NS 4.0 is default
aExportLB.SelectEntryPos( nPosArr );
aExportLB.SaveValue();
diff --git a/cui/source/options/opthtml.src b/cui/source/options/opthtml.src
index 5de010b..4d8c0b5 100644
--- a/cui/source/options/opthtml.src
+++ b/cui/source/options/opthtml.src
@@ -249,7 +249,6 @@ TabPage RID_OFAPAGE_HTMLOPT
DropDown = TRUE ;
StringList =
{
- < "HTML 3.2" ; > ;
< "Microsoft Internet Explorer" ; > ;
< "Netscape Navigator"; > ;
< "%PRODUCTNAME Writer" ; > ;
diff --git a/svtools/source/config/htmlcfg.cxx b/svtools/source/config/htmlcfg.cxx
index 3fe81421..e317b77 100644
--- a/svtools/source/config/htmlcfg.cxx
+++ b/svtools/source/config/htmlcfg.cxx
@@ -162,7 +162,6 @@ void SvxHtmlOptions::Load( const Sequence< OUString >& aNames )
pValues[nProp] >>= nExpMode;
switch( nExpMode )
{
- case 0: nExpMode = HTML_CFG_HTML32; break;
case 1: nExpMode = HTML_CFG_MSIE; break;
case 3: nExpMode = HTML_CFG_WRITER; break;
case 4: nExpMode = HTML_CFG_NS40; break;
@@ -231,7 +230,6 @@ void SvxHtmlOptions::Commit()
switch( nExpMode )
{
- case HTML_CFG_HTML32: nExpMode = 0; break;
case HTML_CFG_MSIE: nExpMode = 1; break;
case HTML_CFG_WRITER: nExpMode = 3; break;
case HTML_CFG_NS40: nExpMode = 4; break;
diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index a34a30d..fa259fc 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -352,8 +352,6 @@ sal_uInt16 GetHtmlMode(const SwDocShell* pShell)
HTMLMODE_BLINK|HTMLMODE_DROPCAPS|HTMLMODE_GRAPH_POS|
HTMLMODE_FULL_ABS_POS|HTMLMODE_SOME_ABS_POS;
break;
- case HTML_CFG_HTML32:
- break;
}
}
return nRet;
--
1.7.5.4
Context
- [Libreoffice] [PATCH] HTML export cleanup · 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.