[Libreoffice-commits] core.git: cui/source sw/source
cui/source/tabpages/backgrnd.cxx |2 -- sw/source/ui/table/tabledlg.cxx |5 + 2 files changed, 1 insertion(+), 6 deletions(-) New commits: commit 3791159628d26364c391330d9bfc67d081d291f9 Author: Harri Pitkänen Date: Sun Apr 12 13:21:24 2015 +0300 Remove checks for HTMLMODE_SOME_STYLES HTMLMODE_SOME_STYLES is enabled if we are in HTML mode (it is enabled for all HTML modes). These checks for conditionally disabling some table background controls are not needed anymore. Change-Id: I10fb73a67ac4bba250da4cea79ff6bae427a1613 Reviewed-on: https://gerrit.libreoffice.org/15264 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 7465f02..795b8b9 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -1588,8 +1588,6 @@ IMPL_LINK( SvxBackgroundTabPage, TblDestinationHdl_Impl, ListBox*, pBox ) nWhich = pTableBck_Impl->nCellWhich; break; case TBL_DEST_ROW: -if((nHtmlMode & HTMLMODE_ON) && !(nHtmlMode & HTMLMODE_SOME_STYLES)) -m_pLbSelect->Disable(); pActItem = pTableBck_Impl->pRowBrush; nWhich = pTableBck_Impl->nRowWhich; break; diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 0f49309..4f9f8a4 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -1222,10 +1222,7 @@ void SwTableTabDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); if (nId == m_nBackgroundId) { -sal_Int32 nFlagType = SVX_SHOW_TBLCTL; -if(!( m_nHtmlMode & HTMLMODE_ON ) || -m_nHtmlMode & HTMLMODE_SOME_STYLES) -nFlagType |= SVX_SHOW_SELECTOR; +sal_Int32 nFlagType = SVX_SHOW_TBLCTL | SVX_SHOW_SELECTOR; aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlagType)); rPage.PageCreated(aSet); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source
cui/source/tabpages/paragrph.cxx | 24 +--- 1 file changed, 5 insertions(+), 19 deletions(-) New commits: commit 0466ab0c66c514dd53676483cab2fb2c60e60667 Author: Harri Pitkänen Date: Sat Oct 25 11:20:08 2014 +0300 Remove checks for HTMLMODE_SOME_STYLES HTMLMODE_SOME_STYLES is enabled for all supported HTML export modes so there is never need to disable these elements in the paragraph dialog. Change-Id: I43df54a6ce900c8a9f957522eb85ca67b6cd756f Reviewed-on: https://gerrit.libreoffice.org/12091 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index ad93257..f5b2148 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -576,16 +576,6 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) m_pRegisterFL->Hide(); m_pRegisterCB->Hide(); m_pAutoCB->Hide(); - -if(!(nHtmlMode & HTMLMODE_SOME_STYLES)) // IE or SW -{ -m_pRightLabel->Disable(); -m_pRightIndent->Disable(); -m_pTopDist->Disable(); //HTML3.2 and NS 3.0 -m_pBottomDist->Disable(); -m_pFLineIndent->Disable(); -m_pFLineLabel->Disable(); -} } // this sets the min/max limits; do this _after_ setting the values, @@ -1019,17 +1009,13 @@ SvxParaAlignTabPage::SvxParaAlignTabPage( vcl::Window* pParent, const SfxItemSet m_pLastLineLB->SetSelectHdl( LINK( this, SvxParaAlignTabPage, LastLineHdl_Impl ) ); m_pTextDirectionLB->SetSelectHdl( LINK( this, SvxParaAlignTabPage, TextDirectionHdl_Impl ) ); -sal_uInt16 nHtmlMode = GetHtmlMode_Impl(rSet); -if(!(nHtmlMode & HTMLMODE_ON) || (0 != (nHtmlMode & HTMLMODE_SOME_STYLES)) ) +if( aLangOptions.IsCTLFontEnabled() ) { -if( aLangOptions.IsCTLFontEnabled() ) -{ -m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), FRMDIR_HORI_LEFT_TOP ); -m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), FRMDIR_HORI_RIGHT_TOP ); -m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), FRMDIR_ENVIRONMENT ); +m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), FRMDIR_HORI_LEFT_TOP ); +m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), FRMDIR_HORI_RIGHT_TOP ); +m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), FRMDIR_ENVIRONMENT ); -m_pPropertiesFL->Show(); -} +m_pPropertiesFL->Show(); } setPreviewsToSamePlace(pParent, this); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/10/3610/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/09/4609/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/10/3610/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/09/4609/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/09/4609/4'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/50/2950/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/09/4609/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/13/6013/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/13/6013/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/47/8947/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/47/8947/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/88/488/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/filter/html/css1atr.cxx |4 sw/source/filter/html/htmlatr.cxx |3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) New commits: commit 2b531388388853342d6ecefcbeb2027f22f8728c Author: Harri Pitkänen Date: Sat Apr 12 13:46:54 2014 +0300 Enable letter-spacing for Firefox HTML export Kerning (letter-spacing in CSS) was disabled for Firefox HTML export mode. There is no need to do that since Firefox does support this feature. Change-Id: I237063d52f50d79517bf83d5d1904f2164095d31 Reviewed-on: https://gerrit.libreoffice.org/8947 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index fa65155..1e51c69 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -2577,10 +2577,6 @@ static Writer& OutCSS1_SvxKerning( Writer& rWrt, const SfxPoolItem& rHt ) { SwHTMLWriter& rHTMLWrt = (SwHTMLWriter&)rWrt; -// Only export Kerning-Item, if the Style supports it fully -if( !rHTMLWrt.IsHTMLMode(HTMLMODE_FULL_STYLES) ) -return rWrt; - sal_Int16 nValue = ((const SvxKerningItem&)rHt).GetValue(); if( nValue ) { diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 216a925..e8c4156 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -1349,8 +1349,7 @@ HTMLOnOffState HTMLEndPosLst::GetHTMLItemState( const SfxPoolItem& rItem ) break; case RES_CHRATR_KERNING: -if( IsHTMLMode(HTMLMODE_FULL_STYLES) ) -eState = HTML_STYLE_VALUE; +eState = HTML_STYLE_VALUE; break; case RES_CHRATR_BACKGROUND: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/ui/chrdlg/pardlg.cxx | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) New commits: commit 745f594556f690b57918bc32579157acc5598336 Author: Harri Pitkänen Date: Sat Sep 21 11:01:56 2013 +0300 Enable Drop Caps for Firefox HTML compatibility mode Drop Caps tab was disabled in paragraph options when Firefox was selected in HTML compatibility options and Writer was in HTML editor mode. There is no need to do that. Firefox and all modern browsers will display drop caps correctly if they are exported from LibreOffice. Change-Id: I9ee0d9647b8e8ed7c57c4b08dc4995ef1b8f91f3 Reviewed-on: https://gerrit.libreoffice.org/6013 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx index 3106894..a964eb0 100644 --- a/sw/source/ui/chrdlg/pardlg.cxx +++ b/sw/source/ui/chrdlg/pardlg.cxx @@ -134,14 +134,9 @@ SwParaDlg::SwParaDlg(Window *pParent, m_nParaNumPara = AddTabPage("labelTP_NUMPARA", SwParagraphNumTabPage::Create, SwParagraphNumTabPage::GetRanges); else RemoveTabPage("labelTP_NUMPARA"); -if(!bHtmlMode || (nHtmlMode & HTMLMODE_FULL_STYLES)) -{ -m_nParaDrpCps = AddTabPage("labelTP_DROPCAPS", SwDropCapsPage::Create, SwDropCapsPage::GetRanges); -} -else -{ -RemoveTabPage("labelTP_DROPCAPS"); -} + +m_nParaDrpCps = AddTabPage("labelTP_DROPCAPS", SwDropCapsPage::Create, SwDropCapsPage::GetRanges); + if(!bHtmlMode || (nHtmlMode & (HTMLMODE_SOME_STYLES|HTMLMODE_FULL_STYLES))) { OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: i18nlangtag/source include/i18nlangtag svtools/source
i18nlangtag/source/isolang/isolang.cxx |2 ++ include/i18nlangtag/lang.h |2 ++ svtools/source/misc/langtab.src|2 ++ 3 files changed, 6 insertions(+) New commits: commit 30213582c73f2dec6d4a980560192720f2f426ab Author: Harri Pitkänen Date: Wed Jun 19 10:07:32 2013 +0300 Add Cornish and Pite Sami to the list of spelling languages Add Cornish (kw-UK) and Pite Sami (sje-SE) to the list of available spell checking languages to support spell checkers that are being currently developed: https://victorio.uit.no/langtech/trunk/langs/cor https://victorio.uit.no/langtech/trunk/langs/sje Change-Id: I2f95fe5339e7cc31d64fa13cf2f74268b159215e Reviewed-on: https://gerrit.libreoffice.org/4609 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx index c830673..a27331f 100644 --- a/i18nlangtag/source/isolang/isolang.cxx +++ b/i18nlangtag/source/isolang/isolang.cxx @@ -514,6 +514,8 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] = { LANGUAGE_USER_SIDAMA,"sid", "ET" }, { LANGUAGE_USER_NKO, "nqo", "GN" }, { LANGUAGE_USER_UDMURT,"udm", "RU" }, +{ LANGUAGE_USER_CORNISH, "kw", "UK" }, +{ LANGUAGE_USER_SAMI_PITE_SWEDEN, "sje", "SE" }, { LANGUAGE_MULTIPLE, "mul", "" }, // multiple languages, many languages are used { LANGUAGE_UNDETERMINED, "und", "" }, // undetermined language, language cannot be identified { LANGUAGE_NONE, "zxx", "" }, // added to ISO 639-2 on 2006-01-11: Used to declare the absence of linguistic information diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h index 53724c9..c2281cb 100644 --- a/include/i18nlangtag/lang.h +++ b/include/i18nlangtag/lang.h @@ -557,6 +557,8 @@ typedef unsigned short LanguageType; #define LANGUAGE_USER_NKO 0x0686 #define LANGUAGE_USER_UDMURT0x0687 #define LANGUAGE_USER_TIBETAN_INDIA 0x8051 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_TIBETAN)) */ +#define LANGUAGE_USER_CORNISH 0x0688 +#define LANGUAGE_USER_SAMI_PITE_SWEDEN 0x843B /* makeLangID( 0x21, getPrimaryLanguage( LANGUAGE_SAMI_NORTHERN_NORWAY)) */ #define LANGUAGE_USER_PRIV_JOKER0xFFEB /* privateuse "*" (sic! bad! nasty!), primary 0x3eb, sub 0x3f */ #define LANGUAGE_USER_PRIV_COMMENT 0xFFEC /* privateuse "x-comment", primary 0x3ec, sub 0x3f */ diff --git a/svtools/source/misc/langtab.src b/svtools/source/misc/langtab.src index f85ef6a..15abc14 100644 --- a/svtools/source/misc/langtab.src +++ b/svtools/source/misc/langtab.src @@ -363,6 +363,8 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE < "N'ko" ; LANGUAGE_USER_NKO ; > ; < "Udmurt" ; LANGUAGE_USER_UDMURT ; > ; < "Tibetan (India)" ; LANGUAGE_USER_TIBETAN_INDIA ; > ; +< "Cornish" ; LANGUAGE_USER_CORNISH ; > ; +< "Sami, Pite (Sweden)" ; LANGUAGE_USER_SAMI_PITE_SWEDEN ; > ; }; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/filter/html/htmlsect.cxx | 10 -- sw/source/filter/html/svxcss1.cxx | 22 ++ sw/source/filter/html/svxcss1.hxx |2 ++ sw/source/filter/html/swhtml.hxx |2 +- sw/source/filter/html/wrthtml.cxx | 18 +- 5 files changed, 38 insertions(+), 16 deletions(-) New commits: commit 15f8a130e2e1a3c920b02ad034d09e547e69ea57 Author: Harri Pitkänen Date: Sat Apr 20 12:53:53 2013 +0300 Use instead of when exporting multi-column sections Commit da45a0e255f77d002c35438e9c2a17fecdde6d81 added CSS column-count property to the exported non-standard MULTICOL element. With this change we are also able to import multi-column DIVs into multi-column sections. Now we can change the exported element from MULTICOL into DIV which actually works in browsers supporting this feature. Importing legacy MULTICOL elements is still supported. Change-Id: I55bea40326904de7f137e996a000a7d213fa0593 Reviewed-on: https://gerrit.libreoffice.org/3610 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 025c513..82a4b80 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -128,6 +128,12 @@ void SwHTMLParser::NewDivision( int nToken ) aItemSet, aPropInfo, &aLang, &aDir ); if( bStyleParsed ) { +if ( aPropInfo.nColumnCount >= 2 ) +{ +delete pCntxt; +NewMultiCol( aPropInfo.nColumnCount ); +return; +} bPositioned = HTML_DIVISION_ON == nToken && aClass.Len() && CreateContainer( aClass, aItemSet, aPropInfo, pCntxt ); @@ -532,11 +538,11 @@ sal_Bool SwHTMLParser::EndSections( sal_Bool bLFStripped ) return bSectionClosed; } -void SwHTMLParser::NewMultiCol() +void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) { String aId, aStyle, aClass, aLang, aDir; long nWidth = 100; -sal_uInt16 nCols = 0, nGutter = 10; +sal_uInt16 nCols = columnsFromCss, nGutter = 10; sal_Bool bPrcWidth = sal_True; const HTMLOptions& rHTMLOptions = GetOptions(); diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index 7a5c944..600b447 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -471,6 +471,8 @@ void SvxCSS1PropertyInfo::Merge( const SvxCSS1PropertyInfo& rProp ) if( USHRT_MAX != rProp.nRightBorderDistance ) nRightBorderDistance = rProp.nRightBorderDistance; +nColumnCount = rProp.nColumnCount; + if( rProp.eFloat != SVX_ADJUST_END ) eFloat = rProp.eFloat; @@ -1359,6 +1361,25 @@ static void ParseCSS1_color( const CSS1Expression *pExpr, } } + +static void ParseCSS1_column_count( const CSS1Expression *pExpr, + SfxItemSet& /*rItemSet*/, + SvxCSS1PropertyInfo &rPropInfo, + const SvxCSS1Parser& /*rParser*/ ) +{ +OSL_ENSURE( pExpr, "no expression" ); + +if ( pExpr->GetType() == CSS1_NUMBER ) +{ +double columnCount = pExpr->GetNumber(); +if ( columnCount >= 2 ) +{ +rPropInfo.nColumnCount = columnCount; +} +} +} + + static void ParseCSS1_direction( const CSS1Expression *pExpr, SfxItemSet &rItemSet, SvxCSS1PropertyInfo& /*rPropInfo*/, @@ -3123,6 +3144,7 @@ static CSS1PropEntry aCSS1PropFnTab[] = CSS1_PROP_ENTRY(border_left), CSS1_PROP_ENTRY(border), CSS1_PROP_ENTRY(color), +CSS1_PROP_ENTRY(column_count), CSS1_PROP_ENTRY(direction), CSS1_PROP_ENTRY(float), CSS1_PROP_ENTRY(font_size), diff --git a/sw/source/filter/html/svxcss1.hxx b/sw/source/filter/html/svxcss1.hxx index 05d1c53..91af20a 100644 --- a/sw/source/filter/html/svxcss1.hxx +++ b/sw/source/filter/html/svxcss1.hxx @@ -119,6 +119,8 @@ public: sal_uInt16 nLeftBorderDistance; sal_uInt16 nRightBorderDistance; +sal_uInt16 nColumnCount; + long nLeft, nTop; long nWidth, nHeight; long nLeftMargin, nRightMargin; diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index d628185..33af70b 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -601,7 +601,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient sal_Bool EndSections( sal_Bool bLFStripped ); // -void NewMultiCol(); +void NewMultiCol( sal_uInt16 columnsFromCss=0 ); void EndMultiCol(); // diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 3f3368d..8042027 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtm
[Libreoffice-commits] core.git: sfx2/inc sw/source
sfx2/inc/sfx2/htmlmode.hxx |1 - sw/source/filter/html/css1atr.cxx |9 - sw/source/filter/html/css1kywd.cxx |1 + sw/source/filter/html/css1kywd.hxx |1 + sw/source/filter/html/wrthtml.cxx | 14 ++ sw/source/filter/html/wrthtml.hxx |2 +- sw/source/ui/config/viewopt.cxx|4 ++-- 7 files changed, 19 insertions(+), 13 deletions(-) New commits: commit da45a0e255f77d002c35438e9c2a17fecdde6d81 Author: Harri Pitkänen Date: Sat Mar 23 12:10:15 2013 +0200 Remove HTMLMODE_FRM_COLUMNS and export column-count CSS attribute For multi-column sections in Writer, HTMLMODE_FRM_COLUMNS controlled whether column settings for the section were exported to html or not. This was disabled for Internet Explorer and enabled for other browsers. The export was implemented using non-standard MULTICOL html element and did not actually work in any modern browser (apparently only some versions of Netscape have ever supported this). This patch - exports the column count also using "column-count" CSS attribute which is supported by latest versions of Opera and IE. Firefox and Webkit based browsers would currently require -moz-column-count and -webkit-column-count but I have not added these since the browsers will likely stop requiring the prefix in the future anyway. - removes HTMLMODE_FRM_COLUMNS conditional so that this export will happen with all html compatibility options, including IE. Remaining issue: Using the MULTICOL element (as opposed to DIV element) confuses at least Opera so that it ignores all style attributes applied on the element. But corresponding html import code in LibreOffice still relies on MULTICOL. I will work on a separate patch to add support for column-count CSS attribute to the import code and switch export to use DIV instead. Change-Id: I82a065fdda0e074fbfcd0007e6ff6e46185be3f5 Reviewed-on: https://gerrit.libreoffice.org/2950 Reviewed-by: Petr Mladek Tested-by: Petr Mladek diff --git a/sfx2/inc/sfx2/htmlmode.hxx b/sfx2/inc/sfx2/htmlmode.hxx index 90af4b2..0ce8e43 100644 --- a/sfx2/inc/sfx2/htmlmode.hxx +++ b/sfx2/inc/sfx2/htmlmode.hxx @@ -21,7 +21,6 @@ #define HTMLMODE_ON 0x0001 #define HTMLMODE_PARA_DISTANCE 0x0004 -#define HTMLMODE_FRM_COLUMNS0x0010 #define HTMLMODE_SOME_STYLES0x0020 /* mind. MS IE */ #define HTMLMODE_FULL_STYLES0x0040 /* == SW */ #define HTMLMODE_PARA_BLOCK 0x0100 diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 500b66c..1625050 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -2271,7 +2272,7 @@ void SwHTMLWriter::OutCSS1_TableCellBorderHack(SwFrmFmt const& rFrmFmt) } } -void SwHTMLWriter::OutCSS1_SectionFmtOptions( const SwFrmFmt& rFrmFmt ) +void SwHTMLWriter::OutCSS1_SectionFmtOptions( const SwFrmFmt& rFrmFmt, const SwFmtCol *pCol ) { SwCSS1OutMode aMode( *this, CSS1_OUTMODE_STYLE_OPT_ON | CSS1_OUTMODE_ENCODE| @@ -2282,6 +2283,12 @@ void SwHTMLWriter::OutCSS1_SectionFmtOptions( const SwFrmFmt& rFrmFmt ) if( SFX_ITEM_SET==rItemSet.GetItemState( RES_BACKGROUND, sal_False, &pItem ) ) OutCSS1_SvxBrush( *this, *pItem, CSS1_BACKGROUND_SECTION, 0 ); +if (pCol) +{ +OString sColumnCount(OString::number(static_cast(pCol->GetNumCols(; +OutCSS1_PropertyAscii(sCSS1_P_column_count, sColumnCount); +} + if( !bFirstCSS1Property ) Strm() << '\"'; } diff --git a/sw/source/filter/html/css1kywd.cxx b/sw/source/filter/html/css1kywd.cxx index 4117052..ef3a0eb 100644 --- a/sw/source/filter/html/css1kywd.cxx +++ b/sw/source/filter/html/css1kywd.cxx @@ -219,6 +219,7 @@ sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_height, "height" ); sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_float, "float" ); +sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_column_count, "column-count" ); // Strings fuer Positioning diff --git a/sw/source/filter/html/css1kywd.hxx b/sw/source/filter/html/css1kywd.hxx index 0b4bd5d..35a0481 100644 --- a/sw/source/filter/html/css1kywd.hxx +++ b/sw/source/filter/html/css1kywd.hxx @@ -229,6 +229,7 @@ extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_height, "height" ); extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_float, "float" ); +extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_column_count, "column-count" ); // Strings fuer Positioning diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index fc9181d..78f7e7a 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -469,15 +469,13 @@ sal_uLong SwHTMLWriter::WriteStream() return nWarn; } -static const SwFmtCol *lcl_html_GetFmtCol( con
Re: export HTML
Hi! On Sunday 04 November 2012, Rob Snelders wrote: > The export-option in the options-dialog -> Load/Save -> > HTML-compatibility states that you can save for LibreOffice Writer, > Internet Explorer and Netscape Navigator. Looking at the code that > states Netscape 4-compatibility. > But has this still any value? As the browsers are for basic HTML > compatible for some years. I think that the Netscape output also works > in Internet Explorer. I have been (very slowly) working on simplifying HTML export modes for some time. So far all of the differences between the modes have turned out to be useless with modern browsers. At this point the difference between the remaining three formats (IE, Netscape, Writer) is just that Netscape does not support "full styles" and IE does not support HTMLMODE_FRM_COLUMNS (whatever that means). So I'm fairly sure that we could remove the whole option and just use the "LibreOffice Writer" mode unconditionally. But I haven't yet had the time to look at this carefully enough to be sure. Harri ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [PATCH] [PUSHED] Cleanup related to always enabled HTMLMODE_SOME_ABS_POS
On Friday 25 May 2012, Tor Lillqvist wrote: > Looks fine, pushed, thanks. I do see more (presumably equally > unnecessary) tests of HTMLMODE_SOME_ABS_POS in the code, at least in > opengrok, though? Yes. I didn't have time to check and fix them all at once but I will write another patch to completely remove HTMLMODE_SOME_ABS_POS later. Harri ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Cleanup related to always enabled HTMLMODE_SOME_ABS_POS
HTMLMODE_SOME_ABS_POS is enabled in all HTML export modes and thus code checking for it is not needed anymore. Harri>From 182cac61c22d23e991f89c3493977c7b81356a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= Date: Thu, 24 May 2012 17:41:37 +0300 Subject: [PATCH] Cleanup related to always enabled HTMLMODE_SOME_ABS_POS HTMLMODE_SOME_ABS_POS is enabled in all HTML export modes and thus code checking for it is not needed anymore. Change-Id: I416adc2fc6242daf9fa4ccaa9b2634138c5e17d0 --- sw/source/ui/frmdlg/frmdlg.cxx |5 + sw/source/ui/frmdlg/wrap.cxx |2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx index 2266141..e8a31ef 100644 --- a/sw/source/ui/frmdlg/frmdlg.cxx +++ b/sw/source/ui/frmdlg/frmdlg.cxx @@ -109,8 +109,6 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame, switch( m_nDlgType ) { case DLG_FRM_STD: -if(0 == (nHtmlMode & HTMLMODE_SOME_ABS_POS)) -RemoveTabPage(TP_BORDER); RemoveTabPage(TP_COLUMN); // no break case DLG_FRM_OLE: @@ -121,8 +119,7 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame, RemoveTabPage(RID_SVXPAGE_GRFCROP); break; } -if( 0 == (nHtmlMode & HTMLMODE_SOME_ABS_POS) || -m_nDlgType != DLG_FRM_STD ) +if( m_nDlgType != DLG_FRM_STD ) RemoveTabPage(TP_BACKGROUND); } diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index 07f0428..6969489 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -519,7 +519,6 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) aWrapTransparentCB.Enable( bEnable && !bHtmlMode && nSur == SURROUND_THROUGHT ); if(bHtmlMode) { -sal_Bool bSomeAbsPos = 0 != (nHtmlMode & HTMLMODE_SOME_ABS_POS); const SwFmtHoriOrient& rHori = (const SwFmtHoriOrient&)rSet.Get(RES_HORI_ORIENT); sal_Int16 eHOrient = rHori.GetHoriOrient(); sal_Int16 eHRelOrient = rHori.GetRelationOrient(); @@ -551,7 +550,6 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) || ( (FLY_AT_CHAR == nAnchorId) && (eHRelOrient != text::RelOrientation::PRINT_AREA)) || (FLY_AT_PARA == nAnchorId)) -&& bSomeAbsPos && (eHOrient != text::HoriOrientation::RIGHT)); if(aNoWrapRB.IsChecked() && !aNoWrapRB.IsEnabled()) { -- 1.7.10 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[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. Harri>From 26abdf32a398dc2bfcea60e751e0a1b3edb984c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= 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_STYLES0x0020 /* mind. MS IE */ #define HTMLMODE_FULL_STYLES0x0040 /* == 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(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 ) -
[Libreoffice] [PATCH] Support Komi-Zyrian and Komi-Permyak as text language for spell checking
Attached patch (against master) adds two new languages (Komi-Zyrian and Komi-Permyak) to the list of possible text languages. Please check if the language codes I added to i18npool/inc/i18npool/lang.h are correct. I could not find these languages in any Microsoft language lists. These languages are very closely related and Komi-Zyrian is the more widely used so I used the same pattern for language codes as is used with LANGUAGE_USER_TETUN and LANGUAGE_USER_TETUN_TIMOR_LESTE. With this patch I was able to select these languages as text languages and I even got a prototype spell checker (based on http://giellatekno.uit.no/doc/lang/kom/index.html) working with them. Harri>From 0d005c807426748ff27ee3a0c9137f4256ac3301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= Date: Fri, 27 Jan 2012 20:28:45 +0200 Subject: [PATCH] Support Komi-Zyrian and Komi-Permyak as text language for spell checking --- i18npool/inc/i18npool/lang.h|2 ++ i18npool/source/isolang/isolang.cxx |2 ++ svtools/source/misc/langtab.src |2 ++ 3 files changed, 6 insertions(+), 0 deletions(-) diff --git a/i18npool/inc/i18npool/lang.h b/i18npool/inc/i18npool/lang.h index 177d2a7..502afdd 100644 --- a/i18npool/inc/i18npool/lang.h +++ b/i18npool/inc/i18npool/lang.h @@ -538,6 +538,8 @@ typedef unsigned short LanguageType; #define LANGUAGE_USER_KEYID 0x0666 /* key id pseudolanguage */ #define LANGUAGE_USER_PALI_LATIN0x0667 #define LANGUAGE_USER_KYRGYZ_CHINA 0x0668 /* not derived from LANGUAGE_KIRGHIZ as these may be different scripts, see http://www.omniglot.com/writing/kirghiz.htm */ +#define LANGUAGE_USER_KOMI_ZYRIAN 0x0669 +#define LANGUAGE_USER_KOMI_PERMYAK 0x0A69 #endif /* INCLUDED_I18NPOOL_LANG_H */ diff --git a/i18npool/source/isolang/isolang.cxx b/i18npool/source/isolang/isolang.cxx index 610ea7f..00af58c 100644 --- a/i18npool/source/isolang/isolang.cxx +++ b/i18npool/source/isolang/isolang.cxx @@ -483,6 +483,8 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] = { LANGUAGE_USER_KEYID, "qtz", "" }, // key id pseudolanguage used for UI testing { LANGUAGE_USER_PALI_LATIN,"pli", "" }, // Pali with Latin script { LANGUAGE_USER_KYRGYZ_CHINA, "ky", "CN" }, +{ LANGUAGE_USER_KOMI_ZYRIAN, "kpv", "" }, +{ LANGUAGE_USER_KOMI_PERMYAK, "koi", "" }, { LANGUAGE_NONE, "zxx", "" }, // added to ISO 639-2 on 2006-01-11: Used to declare the absence of linguistic information { LANGUAGE_DONTKNOW,"", "" }// marks end of table }; diff --git a/svtools/source/misc/langtab.src b/svtools/source/misc/langtab.src index 01b2846..fc83ec7 100644 --- a/svtools/source/misc/langtab.src +++ b/svtools/source/misc/langtab.src @@ -344,6 +344,8 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE < "KeyID" ; LANGUAGE_USER_KEYID ; > ; < "Pali Latin" ; LANGUAGE_USER_PALI_LATIN ; > ; < "Kyrgyz (China)" ; LANGUAGE_USER_KYRGYZ_CHINA ; > ; +< "Komi-Zyrian" ; LANGUAGE_USER_KOMI_ZYRIAN ; > ; +< "Komi-Permyak" ; LANGUAGE_USER_KOMI_PERMYAK ; > ; }; }; -- 1.7.8.3 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] Cherry pick request: Fix always-false condition of FullCommentURL
Release notes for 3.5 mention a new feature for grammar checker developers, the FullCommentURL property. I tried to use it but could not get any visible results with 3.5beta2. Then I looked at git history and noticed that the following fix from László Németh seems to be present only on master: http://cgit.freedesktop.org/libreoffice/core/commit/?id=e2812dd41916cb90c28782b855a100edb4b681b0 I think it would make sense to cherry pick that to libreoffice-3-5. Harri ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] Add genitive and partitive month names for fi_FI locale
Add genitive and partitive month names and remove hardcoded case suffixes from predefined date formats. One format incorrectly had case suffixes added to abbreviated month names. Harri From 8e9b6d7668fa42bd5da33c8d54cd083b486ce96e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= Date: Sun, 27 Nov 2011 19:01:52 +0200 Subject: [PATCH] Add genitive and partitive month names for fi_FI locale Add genitive and partitive month names and remove hardcoded case suffixes from predefined date formats. One format incorrectly had case suffixes added to abbreviated month names. --- i18npool/source/localedata/data/fi_FI.xml | 134 +++- 1 files changed, 129 insertions(+), 5 deletions(-) diff --git a/i18npool/source/localedata/data/fi_FI.xml b/i18npool/source/localedata/data/fi_FI.xml index 1f7747d..7980be9 100644 --- a/i18npool/source/localedata/data/fi_FI.xml +++ b/i18npool/source/localedata/data/fi_FI.xml @@ -87,7 +87,7 @@ P.K. - P. "ta" + P. PP.KK.VV @@ -105,22 +105,22 @@ P. KKK. - P. "ta" + P. P. - NN P. KKK"ta" VV + NN P. KKK VV NN PP. KKK VV - NN P. "ta" + NN P. - P. "ta" + P. KK-PP @@ -286,6 +286,130 @@ joulukuu + + + jan + tammi + tammikuun + + + feb + helmi + helmikuun + + + mar + maalis + maaliskuun + + + apr + huhti + huhtikuun + + + may + touko + toukokuun + + + jun + kesä + kesäkuun + + + jul + heinä + heinäkuun + + + aug + elo + elokuun + + + sep + syys + syyskuun + + + oct + loka + lokakuun + + + nov + marras + marraskuun + + + dec + joulu + joulukuun + + + + + jan + tammi + tammikuuta + + + feb + helmi + helmikuuta + + + mar + maalis + maaliskuuta + + + apr + huhti + huhtikuuta + + + may + touko + toukokuuta + + + jun + kesä + kesäkuuta + + + jul + heinä + heinäkuuta + + + aug + elo + elokuuta + + + sep + syys + syyskuuta + + + oct + loka + lokakuuta + + + nov + marras + marraskuuta + + + dec + joulu + joulukuuta + + bc -- 1.7.7.3 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] Enable :first-letter CSS pseudo-class for all browsers in HTML export
Previously when drop caps were specified in a paragraph style (not as direct formatting) export to HTML was implemented with :first-letter pseudo-class for "LibreOffice Writer" and through styling individual characters for other browsers. Since all browsers used these days (even obsolete ones like IE 5.5) support :first-letter there seems to be no reason to maintain this difference. This patch unifies all export modes to use :first-letter in such cases. Harri From d37995fee3f6bc94cd63679f987a2ee65662a2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= Date: Tue, 22 Nov 2011 20:24:52 +0200 Subject: [PATCH] Enable :first-letter CSS pseudo-class for all browsers in HTML export Previously when drop caps were specified in a paragraph style (not as direct formatting) export to HTML was implemented with :first-letter pseudo-class for "LibreOffice Writer" and through styling individual characters for other browsers. Since all browsers used these days (even obsolete ones like IE 5.5) support :first-letter there seems to be no reason to maintain this difference. This patch unifies all export modes to use :first-letter in such cases. --- sfx2/inc/sfx2/htmlmode.hxx|1 - sw/source/filter/html/css1atr.cxx |6 ++ sw/source/filter/html/htmlatr.cxx |2 +- sw/source/ui/config/viewopt.cxx |1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/sfx2/inc/sfx2/htmlmode.hxx b/sfx2/inc/sfx2/htmlmode.hxx index 65e41f6..63b0bfe 100644 --- a/sfx2/inc/sfx2/htmlmode.hxx +++ b/sfx2/inc/sfx2/htmlmode.hxx @@ -35,7 +35,6 @@ #define HTMLMODE_SOME_STYLES0x0020 /* mind. MS IE */ #define HTMLMODE_FULL_STYLES0x0040 /* == SW */ #define HTMLMODE_PARA_BLOCK 0x0100 -#define HTMLMODE_DROPCAPS 0x0200 #define HTMLMODE_FIRSTLINE 0x0400 /* First-line intent with Spacer == NS 3.0 */ #define HTMLMODE_SOME_ABS_POS 0x2000 #define HTMLMODE_RESERVED1 0x4000 diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 69efd26..d3d8174 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -1381,8 +1381,7 @@ static sal_Bool OutCSS1Rule( SwHTMLWriter& rHTMLWrt, const String& rSelector, sal_Bool bCheckForPseudo ) { sal_Bool bScriptDependent = sal_False; -if( SwHTMLWriter::HasScriptDependentItems( rItemSet, -rHTMLWrt.IsHTMLMode(HTMLMODE_DROPCAPS) && bHasClass ) ) +if( SwHTMLWriter::HasScriptDependentItems( rItemSet, bHasClass ) ) { bScriptDependent = sal_True; String aSelector( rSelector ); @@ -1778,8 +1777,7 @@ static Writer& OutCSS1_SwFmt( Writer& rWrt, const SwFmt& rFmt, // Drop-Caps ausgeben const SfxPoolItem *pItem; -if( rHTMLWrt.IsHTMLMode(HTMLMODE_DROPCAPS) && -SFX_ITEM_SET==aItemSet.GetItemState( RES_PARATR_DROP, sal_False, &pItem )) +if( SFX_ITEM_SET==aItemSet.GetItemState( RES_PARATR_DROP, sal_False, &pItem )) { String sOut( aSelector ); sOut.Append( ':'); diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index c7d2847..3259cc0 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -648,7 +648,7 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt, pFmtInfo = new SwHTMLFmtInfo( &rFmt, rWrt.pDoc, rHWrt.pTemplate, rHWrt.bCfgOutStyles, rHWrt.eLang, rHWrt.nCSS1Script, - !rHWrt.IsHTMLMode(HTMLMODE_DROPCAPS) ); + false ); rHWrt.aTxtCollInfos.C40_PTR_INSERT( SwHTMLFmtInfo, pFmtInfo ); String aName( rFmt.GetName() ); if( 0 != rHWrt.aScriptParaStyles.count( aName ) ) diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx index 0ac6f96..5524fe2 100644 --- a/sw/source/ui/config/viewopt.cxx +++ b/sw/source/ui/config/viewopt.cxx @@ -348,7 +348,6 @@ sal_uInt16 GetHtmlMode(const SwDocShell* pShell) break; case HTML_CFG_WRITER: nRet |= HTMLMODE_FRM_COLUMNS|HTMLMODE_FULL_STYLES| -HTMLMODE_DROPCAPS| HTMLMODE_SOME_ABS_POS; break; } -- 1.7.7.1 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] Enable features behind HTMLMODE_FULL_ABS_POS for all HTML export modes
HTMLMODE_FULL_ABS_POS appears to have been used for enabling accurate margin settings for absolutely positioned graphics objects. If it was disabled one could not set (in HTML editor mode) separate margins for left and right (or bottom/top) sides of the image. The setting was disabled for Netscape and enabled for other browsers. This patch removes the setting and unconditionally enables the feature in HTML editor mode. All modern browsers support margin-{left,right,bottom,top} CSS properties. Harri From 3773ce91815b57add5646247d86e4ce1c6f3613e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= Date: Tue, 8 Nov 2011 19:36:21 +0200 Subject: [PATCH] Enable features behind HTMLMODE_FULL_ABS_POS for all HTML export modes HTMLMODE_FULL_ABS_POS appears to have been used for enabling accurate margin settings for absolutely positioned graphics objects. If it was disabled one could not set (in HTML editor mode) separate margins for left and right (or bottom/top) sides of the image. The setting was disabled for Netscape and enabled for other browsers. This patch removes the setting and unconditionally enables the feature in HTML editor mode. All modern browsers support margin-{left,right,bottom,top} CSS properties. --- cui/source/tabpages/border.cxx | 11 --- cui/source/tabpages/swpossizetabpage.cxx |5 - sfx2/inc/sfx2/htmlmode.hxx |1 - sw/source/ui/config/viewopt.cxx |4 ++-- sw/source/ui/frmdlg/frmpage.cxx |7 --- sw/source/ui/frmdlg/wrap.cxx | 21 - 6 files changed, 2 insertions(+), 47 deletions(-) diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index 98d62e9..d6c474f 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -559,17 +559,6 @@ void SvxBorderTabPage::Reset( const SfxItemSet& rSet ) aLbShadowColor.Disable(); aFlShadow .Disable(); -sal_uInt16 nLBCount = aLbLineStyle.GetEntryCount(); -// ist es ein Absatzdialog, dann alle Linien fuer -// Sw-Export, sonst ist die Page nicht da -if(!(mbHorEnabled || mbVerEnabled) - && 0 == (nHtmlMode & HTMLMODE_FULL_ABS_POS) && -SFX_ITEM_AVAILABLE > rSet.GetItemState(GetWhich( SID_ATTR_PARA_LINESPACE ))) -{ -for( sal_uInt16 i = nLBCount - 1; i > LINESTYLE_HTML_MAX; --i) -aLbLineStyle.RemoveEntry(i); -} - if( !(nSWMode & SW_BORDER_MODE_TABLE) ) { aUserDefFT.Disable(); diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index 2d08ded..7874eaa 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -895,11 +895,6 @@ void SvxSwPosSizeTabPage::Reset( const SfxItemSet& rSet) if(m_bHtmlMode) { -if( 0 == (m_nHtmlMode & HTMLMODE_FULL_ABS_POS)) -{ -m_aHeightFT .Enable( sal_False ); -m_aHeightMF .Enable( sal_False ); -} if( 0 == (m_nHtmlMode & HTMLMODE_SOME_ABS_POS)) { if(GetAnchorType() == TextContentAnchorType_AT_PAGE) diff --git a/sfx2/inc/sfx2/htmlmode.hxx b/sfx2/inc/sfx2/htmlmode.hxx index ce1af6f..65e41f6 100644 --- a/sfx2/inc/sfx2/htmlmode.hxx +++ b/sfx2/inc/sfx2/htmlmode.hxx @@ -37,7 +37,6 @@ #define HTMLMODE_PARA_BLOCK 0x0100 #define HTMLMODE_DROPCAPS 0x0200 #define HTMLMODE_FIRSTLINE 0x0400 /* First-line intent with Spacer == NS 3.0 */ -#define HTMLMODE_FULL_ABS_POS 0x1000 #define HTMLMODE_SOME_ABS_POS 0x2000 #define HTMLMODE_RESERVED1 0x4000 #define HTMLMODE_RESERVED0 0x8000 diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx index a34679c..32093ab 100644 --- a/sw/source/ui/config/viewopt.cxx +++ b/sw/source/ui/config/viewopt.cxx @@ -340,7 +340,7 @@ sal_uInt16 GetHtmlMode(const SwDocShell* pShell) { case HTML_CFG_MSIE: nRet |= HTMLMODE_FULL_STYLES| -HTMLMODE_FULL_ABS_POS|HTMLMODE_SOME_ABS_POS; +HTMLMODE_SOME_ABS_POS; break; case HTML_CFG_NS40: nRet |= HTMLMODE_FRM_COLUMNS| @@ -349,7 +349,7 @@ sal_uInt16 GetHtmlMode(const SwDocShell* pShell) case HTML_CFG_WRITER: nRet |= HTMLMODE_FRM_COLUMNS|HTMLMODE_FULL_STYLES| HTMLMODE_DROPCAPS| -HTMLMODE_FULL_ABS_POS|HTMLMODE_SOME_ABS_POS; +HTMLMODE_SOME_ABS_POS; break; } } diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index b321d49..744ab01 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -908,13 +908,6 @@ void SwFrmPage::Reset( const S
[Libreoffice] [PATCH] Export blinking text attribute to HTML in all HTML export modes
Previously blinking was not exported in IE mode. IE still does not support blinking (neither does Chrome or Safari) but the extra tag does not make things any worse and allows importing the HTML back to LibreOffice without loss of formatting. Code is also simplified by removing conditionals for options that no longer need to be (or can be) disabled. Harri From a481b25e03c4e72fdcf4a565859d98fe1244b451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= Date: Wed, 26 Oct 2011 21:48:17 +0300 Subject: [PATCH] Export blinking text attribute to HTML in all HTML export modes Previously blinking was not exported in IE mode. IE still does not support blinking (neither does Chrome or Safari) but the extra tag does not make things any worse and allows importing the HTML back to LibreOffice without loss of formatting. Code is also simplified by removing conditionals for options that no longer need to be disabled. --- cui/source/tabpages/backgrnd.cxx |2 -- cui/source/tabpages/chardlg.cxx |3 +-- sfx2/inc/sfx2/htmlmode.hxx|3 --- sw/source/filter/html/css1atr.cxx |2 +- sw/source/filter/html/htmlatr.cxx |7 +++ sw/source/ui/config/viewopt.cxx | 10 -- 6 files changed, 9 insertions(+), 18 deletions(-) diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 8d27b17..b466ea8 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -1086,8 +1086,6 @@ void SvxBackgroundTabPage::ShowSelector() if(nHtmlMode & HTMLMODE_ON) { -if(!(nHtmlMode & HTMLMODE_GRAPH_POS)) -aBtnPosition.Enable(sal_False); aBtnArea.Enable(sal_False); } } diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index a92019e..9d320b4 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -2686,8 +2686,7 @@ void SvxCharEffectsPage::DisableControls( sal_uInt16 nDisable ) void SvxCharEffectsPage::EnableFlash() { -if ( !( ( m_nHtmlMode & HTMLMODE_ON ) && !( m_nHtmlMode & HTMLMODE_BLINK ) ) ) -m_aBlinkingBtn.Show(); +m_aBlinkingBtn.Show(); } // --- diff --git a/sfx2/inc/sfx2/htmlmode.hxx b/sfx2/inc/sfx2/htmlmode.hxx index f4db27a..ce1af6f 100644 --- a/sfx2/inc/sfx2/htmlmode.hxx +++ b/sfx2/inc/sfx2/htmlmode.hxx @@ -31,15 +31,12 @@ #define HTMLMODE_ON 0x0001 #define HTMLMODE_PARA_DISTANCE 0x0004 -#define HTMLMODE_SMALL_CAPS 0x0008 #define HTMLMODE_FRM_COLUMNS0x0010 #define HTMLMODE_SOME_STYLES0x0020 /* mind. MS IE */ #define HTMLMODE_FULL_STYLES0x0040 /* == SW */ -#define HTMLMODE_BLINK 0x0080 #define HTMLMODE_PARA_BLOCK 0x0100 #define HTMLMODE_DROPCAPS 0x0200 #define HTMLMODE_FIRSTLINE 0x0400 /* First-line intent with Spacer == NS 3.0 */ -#define HTMLMODE_GRAPH_POS 0x0800 #define HTMLMODE_FULL_ABS_POS 0x1000 #define HTMLMODE_SOME_ABS_POS 0x2000 #define HTMLMODE_RESERVED1 0x4000 diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 5905b72..33bd07a 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -2510,7 +2510,7 @@ static Writer& OutCSS1_SvxTxtLn_SvxCrOut_SvxBlink( Writer& rWrt, } const sal_Char *pBStr = 0; -if( pBItem && rHTMLWrt.IsHTMLMode(HTMLMODE_BLINK) ) +if( pBItem ) { if( !pBItem->GetValue() ) { diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 2d56070..7354b6c 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -1475,9 +1475,8 @@ HTMLOnOffState HTMLEndPosLst::GetHTMLItemState( const SfxPoolItem& rItem ) break; case RES_CHRATR_BLINK: -if( IsHTMLMode(HTMLMODE_BLINK) ) -eState = ((const SvxBlinkItem&)rItem).GetValue() ? HTML_ON_VALUE - : HTML_OFF_VALUE; +eState = ((const SvxBlinkItem&)rItem).GetValue() ? HTML_ON_VALUE + : HTML_OFF_VALUE; break; case RES_CHRATR_COLOR: @@ -3030,7 +3029,7 @@ static Writer& OutHTML_SwFlyCnt( Writer& rWrt, const SfxPoolItem& rHt ) static Writer& OutHTML_SwBlink( Writer& rWrt, const SfxPoolItem& rHt ) { SwHTMLWriter& rHTMLWrt = (SwHTMLWriter&)rWrt; -if( rHTMLWrt.bOutOpts || !rHTMLWrt.IsHTMLMode(HTMLMODE_BLINK) ) +if( rHTMLWrt.bOutOpts ) return rWrt; if( ((const SvxBlinkItem&)rHt).GetValue() ) diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx index 4d50236..a34679c 100644 --- a/sw/source/ui/config/viewopt.cxx +++ b/sw/source/ui/config/viewopt.cxx @@ -339,18 +339,16 @@ sal_uInt16 GetHtmlMode(const SwDocShell* pShell)
[Libreoffice] [PATCH] Remove code related to previously disabled HTML 3.2 export
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?= 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_Int32GetExportMode() 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 voidCommit(); 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 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] HTML export cleanup
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?= 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_401 // 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 @@ voidSvxHtmlOptions::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_BoolSvxHtmlOptions::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 ||
Re: [Libreoffice] [PATCH][PUSHED] Consistent paragraph border handling for HTML export
On Wednesday 10 August 2011, Cedric Bosdonnat wrote: > Your patches are fine for me and I pushed them to master branch. > However, they make me think that HTML 3.2 export is probably not a > useful option anymore... is there still a browser that can't handle any > more recent version of HTML? I don't think there is, at least among the major browsers released within past five years or so. > I'ld be in favor of dropping that option > completely or at least update it to something like HTML 4. My ultimate goal is to reach a point where we could drop all browser specific or legacy HTML formats and just have one HTML export format that works in all browsers (or at least in those that 99 % of people use). Or if it turns out to be impossible, just have the smallest set of variants that are needed in the real world. With luck something based on HTML 4, CSS 2.1 and some subset of CSS 3 might work pretty much everywhere. If not, then options like "HTML 4", "HTML 5" and "HTML 5 + LibreOffice specific extensions" could be used in place of the current selection. The reason why I chose to approach this problem by making single features more consistent is that this way the risk of accidentally removing or breaking some useful features seems lower. That said, I don't see much risk in dropping the 3.2 export since any of the other export formats should render at least as well in old and new browsers. I could write a patch to do just that unless there are objections. Harri ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] Consistent paragraph border handling for HTML export
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?= 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?= 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_
[Libreoffice] [PATCH] Improvements to import/export of character attributes in HTML filter
Attached patches implement import of CSS text-transform property and extend the import and export to work with all HTML browser compatibility options. Contributed under LGPLv3+ and MPL. Harri From 8eea1bf955f6f2cb7c0e0622b0b2fa6975cee3db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= Date: Sat, 18 Jun 2011 15:57:14 +0300 Subject: [PATCH 1/2] Import and export character case transformations unconditionally to/from HTML Import small caps and export small caps, lowecase, uppercase and titlecase transformations unconditionally to/from HTML. Previously import and export was limited by browser compatibility settings but all mainstream browsers released within last 5 years or so should support the relevant CSS attributes. --- sw/source/filter/html/css1atr.cxx |3 --- sw/source/filter/html/htmlatr.cxx |4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 92a149b..d980b55 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -2561,9 +2561,6 @@ static Writer& OutCSS1_SvxCaseMap( Writer& rWrt, const SfxPoolItem& rHt ) { SwHTMLWriter& rHTMLWrt = (SwHTMLWriter&)rWrt; -if( !rHTMLWrt.IsHTMLMode(HTMLMODE_SMALL_CAPS) ) -return rWrt; - switch( ((const SvxCaseMapItem&)rHt).GetCaseMap() ) { case SVX_CASEMAP_NOT_MAPPED: diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 2d10e6f..f7a0ec1 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -1505,8 +1505,8 @@ HTMLOnOffState HTMLEndPosLst::GetHTMLItemState( const SfxPoolItem& rItem ) break; case RES_CHRATR_CASEMAP: -if( IsHTMLMode(HTMLMODE_SMALL_CAPS) ) -eState = HTML_STYLE_VALUE; +eState = HTML_STYLE_VALUE; +break; case RES_CHRATR_KERNING: if( IsHTMLMode(HTMLMODE_FULL_STYLES) ) -- 1.7.5.4 From e0d8e9114c6778bb534a61ee0f50dcf11a393ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= Date: Sat, 18 Jun 2011 21:12:01 +0300 Subject: [PATCH 2/2] Support CSS text-transform property in HTML import --- sw/source/filter/html/svxcss1.cxx | 35 +++ 1 files changed, 35 insertions(+), 0 deletions(-) diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index 117ef4e..2fcf673 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -128,6 +128,14 @@ static CSS1PropertyEnum const aFontVariantTable[] = { 0, 0 } }; +static CSS1PropertyEnum const aTextTransformTable[] = +{ +{ sCSS1_PV_uppercase, SVX_CASEMAP_VERSALIEN }, +{ sCSS1_PV_lowercase, SVX_CASEMAP_GEMEINE }, +{ sCSS1_PV_capitalize, SVX_CASEMAP_TITEL }, +{ 0, 0 } +}; + static CSS1PropertyEnum const aDirectionTable[] = { { sCSS1_PV_ltr, FRMDIR_HORI_LEFT_TOP }, @@ -1314,6 +1322,32 @@ static void ParseCSS1_font_variant( const CSS1Expression *pExpr, } } +static void ParseCSS1_text_transform( const CSS1Expression *pExpr, +SfxItemSet &rItemSet, +SvxCSS1PropertyInfo& /*rPropInfo*/, +const SvxCSS1Parser& /*rParser*/ ) +{ +OSL_ENSURE( pExpr, "no expression" ); + +// none | capitalize | uppercase | lowercase + +switch( pExpr->GetType() ) +{ +case CSS1_IDENT: +{ +sal_uInt16 nCaseMap; +if( SvxCSS1Parser::GetEnum( aTextTransformTable, pExpr->GetString(), +nCaseMap ) ) +{ +rItemSet.Put( SvxCaseMapItem( (SvxCaseMap)nCaseMap, +aItemIds.nCaseMap ) ); +} +} +default: +; +} +} + /* */ static void ParseCSS1_color( const CSS1Expression *pExpr, @@ -3140,6 +3174,7 @@ static CSS1PropEntry aCSS1PropFnTab[] = CSS1_PROP_ENTRY(text_align), CSS1_PROP_ENTRY(text_decoration), CSS1_PROP_ENTRY(text_indent), +CSS1_PROP_ENTRY(text_transform), CSS1_PROP_ENTRY(margin_left), CSS1_PROP_ENTRY(margin_right), CSS1_PROP_ENTRY(margin_top), -- 1.7.5.4 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] Support font effects "Capitals", "Lowercase" and "Title" in HTML export
On Sunday 12 June 2011, Harri Pitkänen wrote: > Export Writer font effects "Capitals", "Lowercase" and "Title" (see Format > -> Character -> Font effects) to HTML using CSS text-transform property. By the way, this change does nothing if HTML compatibility option (Options -> Load/Save -> HTML Compatibility) is set to Netscape Navigator. This is not nice since it seems to be the default... I would think that removing these obsolete browsers from compatibility options would be the best thing to do. It should be possible to serve all modern browsers with single html output, or am I missing something? The change does work if you choose "LibreOffice Writer" as the compatibility option. Harri ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] Support font effects "Capitals", "Lowercase" and "Title" in HTML export
Export Writer font effects "Capitals", "Lowercase" and "Title" (see Format -> Character -> Font effects) to HTML using CSS text-transform property. Corresponding import code is not yet done, I will get to that soon. Contributed under LGPLv3+ and MPL. Harri From 3b0ee298fcc0150f8e77abb2b4006568a1974b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20Pitk=C3=A4nen?= Date: Sun, 12 Jun 2011 18:42:03 +0300 Subject: [PATCH] Support font effects "Capitals", "Lowercase" and "Title" in HTML export Export Writer font effects "Capitals", "Lowercase" and "Title" (see Format -> Character -> Font effects) to HTML using CSS text-transform property. Corresponding import code is not yet implemented. --- sw/source/filter/html/css1atr.cxx | 21 +++-- sw/source/filter/html/css1kywd.cxx |5 + sw/source/filter/html/css1kywd.hxx |5 + 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 9bf6ea4..92a149b 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -2564,18 +2564,27 @@ static Writer& OutCSS1_SvxCaseMap( Writer& rWrt, const SfxPoolItem& rHt ) if( !rHTMLWrt.IsHTMLMode(HTMLMODE_SMALL_CAPS) ) return rWrt; -const sal_Char *pStr = 0; switch( ((const SvxCaseMapItem&)rHt).GetCaseMap() ) { -case SVX_CASEMAP_NOT_MAPPED: pStr = sCSS1_PV_normal; break; -case SVX_CASEMAP_KAPITAELCHEN: pStr = sCSS1_PV_small_caps; break; +case SVX_CASEMAP_NOT_MAPPED: +rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_variant, sCSS1_PV_normal ); +break; +case SVX_CASEMAP_KAPITAELCHEN: +rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_variant, sCSS1_PV_small_caps ); +break; +case SVX_CASEMAP_VERSALIEN: +rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_text_transform, sCSS1_PV_uppercase ); +break; +case SVX_CASEMAP_GEMEINE: +rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_text_transform, sCSS1_PV_lowercase ); +break; +case SVX_CASEMAP_TITEL: +rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_text_transform, sCSS1_PV_capitalize ); +break; default: ; } -if( pStr ) -rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_variant, pStr ); - return rWrt; } diff --git a/sw/source/filter/html/css1kywd.cxx b/sw/source/filter/html/css1kywd.cxx index ba7ab32..7874c6f 100644 --- a/sw/source/filter/html/css1kywd.cxx +++ b/sw/source/filter/html/css1kywd.cxx @@ -109,6 +109,11 @@ sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_extra_bold, "extra-bold" ); sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_lighter, "lighter" ); sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_bolder, "bolder" ); +sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_text_transform, "text-transform" ); + +sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_capitalize, "capitalize" ); +sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_uppercase, "uppercase" ); +sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_lowercase, "lowercase" ); sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_font_size, "font-size" ); diff --git a/sw/source/filter/html/css1kywd.hxx b/sw/source/filter/html/css1kywd.hxx index e3f8f05..539ad90 100644 --- a/sw/source/filter/html/css1kywd.hxx +++ b/sw/source/filter/html/css1kywd.hxx @@ -102,6 +102,11 @@ extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_font_variant, "font-variant" ); //sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_normal, "normal" ); extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_small_caps, "small-caps" ); +extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_text_transform, "text-transform" ); + +extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_capitalize, "capitalize" ); +extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_uppercase, "uppercase" ); +extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_lowercase, "lowercase" ); extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_font_weight, "font-weight" ); -- 1.7.5.3 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] Fix for #i93300#: Crash when inserting 32 bit TIFF image
On Wednesday 20 October 2010, Caolán McNamara wrote: > What would be awesome of course is to work on supporting those current > unknown formats :-) Thanks, I will check if there is something I could do to extend the range of supported formats. Harri ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] Fix for #i93300#: Crash when inserting 32 bit TIFF image
The sample documents in the bug had two problems: 32 bit sample size and use of floating point sample format[1]. Neither is supported so this patch adds checks to reject images that have either of these properties. Additionally a sanity check is added to make sure that similar crash (division by zero) cannot be induced by creating a malformed image that specifies the same values for MaxSampleValue and MinSampleValue. Some literals have been changed from 1 to 1UL since the result will be assigned to a variable with ULONG data type. With this change it was actually possible to load the 32 bit image on a 64 bit system but the colors were distorted (probably due to unsupported sample format). So rejecting all 32 bit images still seems to be necessary. This patch has been tested on a 64 bit Linux system using the samples in the bug and some images from libtiff sample collection at ftp://ftp.remotesensing.org/pub/libtiff/pics-3.8.0.tar.gz [1] http://www.awaresystems.be/imaging/tiff/tifftags/sampleformat.html Signed-off-by: Harri Pitkänen --- filter/source/graphicfilter/itiff/itiff.cxx | 18 +++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx index d2c0b60..cd1678a 100644 --- a/filter/source/graphicfilter/itiff/itiff.cxx +++ b/filter/source/graphicfilter/itiff/itiff.cxx @@ -310,6 +310,8 @@ void TIFFReader::ReadTagData( USHORT nTagType, sal_uInt32 nDataLen) case 0x0102: // Bits Per Sample nBitsPerSample = ReadIntData(); OOODEBUG("BitsPerSample",nBitsPerSample); +if ( nBitsPerSample >= 32 ) // 32 bit and larger samples are not supported +bStatus = FALSE; break; case 0x0103: // Compression @@ -462,7 +464,7 @@ void TIFFReader::ReadTagData( USHORT nTagType, sal_uInt32 nDataLen) case 0x0140: { // Color Map USHORT nVal; ULONG i; -nNumColors= ( 1 << nBitsPerSample ); +nNumColors= ( 1UL << nBitsPerSample ); if ( nDataType == 3 && nNumColors <= 256) { pColorMap = new ULONG[ 256 ]; @@ -489,6 +491,13 @@ void TIFFReader::ReadTagData( USHORT nTagType, sal_uInt32 nDataLen) OOODEBUG("ColorMap (Anzahl Farben:)", nNumColors); break; } + +case 0x0153: { // SampleFormat +ULONG nSampleFormat = ReadIntData(); +if ( nSampleFormat == 3 ) // IEEE floating point samples are not supported yet +bStatus = FALSE; +break; +} } if ( pTIFF->GetError() ) @@ -1037,7 +1046,7 @@ void TIFFReader::MakePalCol( void ) pColorMap = new ULONG[ 256 ]; if ( nPhotometricInterpretation <= 1 ) { -nNumColors = 1 << nBitsPerSample; +nNumColors = 1UL << nBitsPerSample; if ( nNumColors > 256 ) nNumColors = 256; pAcc->SetPaletteEntryCount( (USHORT)nNumColors ); @@ -1238,7 +1247,10 @@ BOOL TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) if ( bStatus ) { if ( nMaxSampleValue == 0 ) -nMaxSampleValue = ( 1 << nBitsPerSample ) - 1; +nMaxSampleValue = ( 1UL << nBitsPerSample ) - 1; + +if ( nMaxSampleValue <= nMinSampleValue ) +bStatus = FALSE; if ( nPhotometricInterpretation == 2 || nPhotometricInterpretation == 5 || nPhotometricInterpretation == 6 ) nDstBitsPerPixel = 24; ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] cppcheck fixes under libs-core
- unopage.cxx and unoshap2.cxx: remove redundant null checks for pointers that have already been checked for null value - odma_datasupplier.cxx: fix memory leak if NODMQueryExecute returns with error Harri diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index 4504c99..e4f9abb 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -330,8 +330,7 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape if(pObj == NULL) return; -if(pShape) -pShape->Create( pObj, this ); +pShape->Create( pObj, this ); if( mpModel ) mpModel->SetChanged(); diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index b0c48b7..10fd236 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -249,8 +249,7 @@ void SAL_CALL SvxShapeGroup::add( const uno::Reference< drawing::XShape >& xShap // Establish connection between new SdrObject and its wrapper before // inserting the new shape into the group. There a new wrapper // would be created when this connection would not already exist. -if(pShape) -pShape->Create( pSdrShape, mxPage.get() ); +pShape->Create( pSdrShape, mxPage.get() ); if( mpModel ) mpModel->SetChanged(); diff --git a/ucb/source/ucp/odma/odma_datasupplier.cxx b/ucb/source/ucp/odma/odma_datasupplier.cxx index 86d1326..8225175 100644 --- a/ucb/source/ucp/odma/odma_datasupplier.cxx +++ b/ucb/source/ucp/odma/odma_datasupplier.cxx @@ -288,8 +288,11 @@ sal_Bool DataSupplier::getResult( sal_uInt32 nIndex ) DWORD dwFlags = ODM_SPECIFIC; odm = NODMQueryExecute(ContentProvider::getHandle(), sQuery,dwFlags, lpszDMSList, pQueryId ); -if(odm != ODM_SUCCESS) +if(odm != ODM_SUCCESS) { +delete[] pQueryId; +delete[] lpszDMSList; return sal_False; +} sal_uInt16 nCount = 10; sal_uInt16 nMaxCount = 10; ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] Updated Finnish translation
Up to date Finnish translation can be merged from here: http://www.puimula.org/htp/libreoffice/fi-l10n/latest/lo-build-fi.po Harri ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] cppcheck error in sal/osl/unx/profile.c
This patch closes a file that would be left open if memory allocation fails. The cppcheck error was [profile.c:248]: (error) Memory leak: pFile Harri diff --git a/sal/osl/unx/profile.c b/sal/osl/unx/profile.c index 95e9606..cccf745 100644 --- a/sal/osl/unx/profile.c +++ b/sal/osl/unx/profile.c @@ -245,6 +245,7 @@ static oslProfile SAL_CALL osl_psz_openProfile(const sal_Char *pszProfileName, o if ( pProfile == 0 ) { +closeFileImpl(pFile, Flags); return 0; } ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice