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


Attached patches remove the special case where border settings tab disappears 
from paragraph settings dialog when Writer is in HTML editor mode and "HTML 
3.2" is selected as format option for HTML export. The second patch enables 
exporting the borders in this mode as well.

Although CSS styles were not in use when HTML 3.2 was standardized I think 
these days it is reasonable to export the styles anyway.

Harri
From 1ac00e10e3eac9341e9edcc3d249db6ecf35fc0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= <hatapitk@iki.fi>
Date: Mon, 1 Aug 2011 22:12:21 +0300
Subject: [PATCH 1/2] Enable paragraph border settings in HTML editor for all
 HTML variants

Previously border settings were not available in paragraph format dialog
when HTML export format was "HTML 3.2". This was confusing since documents
with borders could still be imported and you could even access the border
dialog with suitably configured shortcut key.
---
 sw/source/ui/chrdlg/pardlg.cxx  |   12 ++++--------
 sw/source/ui/config/viewopt.cxx |    6 +++---
 sw/source/ui/fmtui/tmpdlg.cxx   |    2 --
 3 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx
index 5e85e3f..359e619 100644
--- a/sw/source/ui/chrdlg/pardlg.cxx
+++ b/sw/source/ui/chrdlg/pardlg.cxx
@@ -161,14 +161,10 @@ SwParaDlg::SwParaDlg(Window *pParent,
         {
             RemoveTabPage(TP_BACKGROUND);
         }
-        if(!bHtmlMode || (nHtmlMode & HTMLMODE_PARA_BORDER))
-        {
-            OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc 
fail!");
-            OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc 
fail!");
-            AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 
pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
-        }
-        else
-            RemoveTabPage(TP_BORDER);
+
+        OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc 
fail!");
+        OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc 
fail!");
+        AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 
pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
     }
 
     if (nDefPage)
diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index afe6d06..5ca8f19 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -338,18 +338,18 @@ sal_uInt16                GetHtmlMode(const SwDocShell* pShell)
         switch ( rHtmlOpt.GetExportMode() )
         {
             case HTML_CFG_MSIE_40:
-                nRet |= HTMLMODE_PARA_BORDER|HTMLMODE_SMALL_CAPS|
+                nRet |= HTMLMODE_SMALL_CAPS|
                         HTMLMODE_SOME_STYLES|
                         HTMLMODE_FULL_STYLES|HTMLMODE_GRAPH_POS|
                         HTMLMODE_FULL_ABS_POS|HTMLMODE_SOME_ABS_POS;
             break;
             case HTML_CFG_NS40:
-                nRet |= HTMLMODE_PARA_BORDER|HTMLMODE_SOME_STYLES|
+                nRet |= HTMLMODE_SOME_STYLES|
                         HTMLMODE_FRM_COLUMNS|HTMLMODE_BLINK|HTMLMODE_GRAPH_POS|
                         HTMLMODE_SOME_ABS_POS;
             break;
             case HTML_CFG_WRITER:
-                nRet |= HTMLMODE_PARA_BORDER|HTMLMODE_SMALL_CAPS|
+                nRet |= HTMLMODE_SMALL_CAPS|
                         HTMLMODE_SOME_STYLES|
                         HTMLMODE_FRM_COLUMNS|HTMLMODE_FULL_STYLES|
                         HTMLMODE_BLINK|HTMLMODE_DROPCAPS|HTMLMODE_GRAPH_POS|
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index c802f1b..26a02f8 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -218,8 +218,6 @@ SwTemplateDlg::SwTemplateDlg(Window*                        pParent,
                     RemoveTabPage(TP_BACKGROUND);
                     RemoveTabPage(TP_DROPCAPS);
                 }
-                if(!(nHtmlMode & HTMLMODE_PARA_BORDER))
-                    RemoveTabPage(TP_BORDER);
             }
             else
             {
-- 
1.7.5.4

From 6da9496d745f13973f3e7841ee7ed2cad2fe554e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= <hatapitk@iki.fi>
Date: Wed, 3 Aug 2011 18:09:11 +0300
Subject: [PATCH 2/2] Enable export of basic CSS styles in HTML 3.2 mode

Although "style" does not seem to be valid attribute in HTML 3.2
it is harmless to export it. This simplifies the code and makes
the exported HTML more useful in modern browsers.
---
 sw/source/ui/config/viewopt.cxx |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index 5ca8f19..7cdc31a 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -333,24 +333,21 @@ sal_uInt16                GetHtmlMode(const SwDocShell* pShell)
     sal_uInt16 nRet = 0;
     if(!pShell || PTR_CAST(SwWebDocShell, pShell))
     {
-        nRet = HTMLMODE_ON;
+        nRet = HTMLMODE_ON | HTMLMODE_SOME_STYLES;
         SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
         switch ( rHtmlOpt.GetExportMode() )
         {
             case HTML_CFG_MSIE_40:
                 nRet |= HTMLMODE_SMALL_CAPS|
-                        HTMLMODE_SOME_STYLES|
                         HTMLMODE_FULL_STYLES|HTMLMODE_GRAPH_POS|
                         HTMLMODE_FULL_ABS_POS|HTMLMODE_SOME_ABS_POS;
             break;
             case HTML_CFG_NS40:
-                nRet |= HTMLMODE_SOME_STYLES|
-                        HTMLMODE_FRM_COLUMNS|HTMLMODE_BLINK|HTMLMODE_GRAPH_POS|
+                nRet |= HTMLMODE_FRM_COLUMNS|HTMLMODE_BLINK|HTMLMODE_GRAPH_POS|
                         HTMLMODE_SOME_ABS_POS;
             break;
             case HTML_CFG_WRITER:
                 nRet |= HTMLMODE_SMALL_CAPS|
-                        HTMLMODE_SOME_STYLES|
                         HTMLMODE_FRM_COLUMNS|HTMLMODE_FULL_STYLES|
                         HTMLMODE_BLINK|HTMLMODE_DROPCAPS|HTMLMODE_GRAPH_POS|
                         HTMLMODE_FULL_ABS_POS|HTMLMODE_SOME_ABS_POS;
-- 
1.7.5.4


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.