From 819f0e54f4d19220db50b8ecd006511ee1c9f79b Mon Sep 17 00:00:00 2001 From: Michael Brauer Date: Thu, 16 May 2002 12:08:58 +0000 Subject: #97334#: Process non positive margin correctly in HTML export --- sw/source/filter/html/css1atr.cxx | 35 +++++------------------------------ sw/source/filter/html/htmlatr.cxx | 20 ++++++++++++++++---- sw/source/filter/html/htmlfly.cxx | 6 +++--- sw/source/filter/html/htmltabw.cxx | 6 +++--- sw/source/filter/html/wrthtml.hxx | 12 ++++++------ 5 files changed, 33 insertions(+), 46 deletions(-) (limited to 'sw/source') diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index e129398a5cac..6ccee5eda1e6 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: css1atr.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: mib $ $Date: 2002-03-13 14:20:19 $ + * last change: $Author: mib $ $Date: 2002-05-16 13:08:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -891,34 +891,6 @@ void SwHTMLWriter::OutStyleSheet( const SwPageDesc& rPageDesc, BOOL bUsed ) nDfltBottomMargin = 0; } -#ifdef OLD_MS_IE - -BOOL SwHTMLWriter::IsDfltLRSpace( const SvxLRSpaceItem& rLRItem ) const -{ - // Einen linken Rand kann es durch eine Liste bereits in der - // Umgebung geben - USHORT nLeft = rLRItem.GetTxtLeft() - nLeftMargin; - - // Der Erstzeilen-Einzug kann den Platz fuer eine Numerierung - // enthalten - short nIndent = rLRItem.GetTxtFirstLineOfst() - nFirstLineIndent; - - // Wenn Spacer exportiert werden, wird ein psositiver Erstzeilen-Einzug - // als Spacer exportiert. - return nDfltLeftMargin == nLeft && - nDfltRightMargin == rLRItem.GetRight() && - ( (bCfgSpacer && nIndent > 0) || - nDfltFirstLineIndent == nIndent ); -} - -BOOL SwHTMLWriter::IsDfltULSpace( const SvxULSpaceItem& rULItem ) const -{ - return nDfltTopMargin == rULItem.GetUpper() && - nDfltBottomMargin == rULItem.GetLower(); -} - -#endif - //----------------------------------------------------------------------- // wenn pPseudo gesetzt ist werden Styles-Sheets ausgegeben, @@ -3945,6 +3917,9 @@ SwAttrFnTab aCSS1AttrFnTab = { /************************************************************************* $Log: not supported by cvs2svn $ + Revision 1.14 2002/03/13 14:20:19 mib + #97558#: Don't store LANGUAGE_DEFAULT + Revision 1.13 2001/12/03 09:52:53 mib #95462#: Export COL_AUTO as black instead of white diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index b39953070a85..403988a805de 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: htmlatr.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: mib $ $Date: 2002-03-13 14:20:19 $ + * last change: $Author: mib $ $Date: 2002-05-16 13:08:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -960,8 +960,20 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt, ? rLRSpace.GetTxtLeft() - pFmtInfo->nLeftMargin : 0; - nNewDefListLvl = (nLeftMargin + (rHWrt.nDefListMargin/2)) / - rHWrt.nDefListMargin; + if( nLeftMargin > 0 && rHWrt.nDefListMargin > 0 ) + { + nNewDefListLvl = (nLeftMargin + (rHWrt.nDefListMargin/2)) / + rHWrt.nDefListMargin; + if( nNewDefListLvl == 0 && bForceDL && !bDT ) + nNewDefListLvl = 1; + } + else + { + // If the left margin is 0 or negative, emulating indent + // with
does not work. We then set a def list only if + // the dd style is used. + nNewDefListLvl = (bForceDL&& !bDT) ? 1 : 0; + } BOOL bIsNextTxtNode = rWrt.pDoc->GetNodes()[rWrt.pCurPam->GetPoint()->nNode.GetIndex()+1] diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index 71eeecbed16d..81560a548f6a 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -2,9 +2,9 @@ * * $RCSfile: htmlfly.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: mib $ $Date: 2001-11-23 15:56:03 $ + * last change: $Author: mib $ $Date: 2002-05-16 13:08:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -697,7 +697,7 @@ void SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, aTwipSpc.Width() = ( ((SvxLRSpaceItem*)pItem)->GetLeft() + ((SvxLRSpaceItem*)pItem)->GetRight() ) / 2; - nDfltLeftMargin = nDfltRightMargin = (USHORT)aTwipSpc.Width(); + nDfltLeftMargin = nDfltRightMargin = aTwipSpc.Width(); } if( (nFrmOpts & (HTML_FRMOPT_SPACE|HTML_FRMOPT_MARGINSIZE)) && SFX_ITEM_SET == rItemSet.GetItemState( RES_UL_SPACE, TRUE, &pItem )) diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index b0a080e478cf..4cceaf2d1185 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -2,9 +2,9 @@ * * $RCSfile: htmltabw.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: os $ $Date: 2001-09-28 06:27:53 $ + * last change: $Author: mib $ $Date: 2002-05-16 13:08:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1206,7 +1206,7 @@ Writer& OutHTML_SwTblNode( Writer& rWrt, SwTableNode & rNode, rHTMLWrt.GetNextNumInfo(), "NumInfo fuer naechsten Absatz fehlt!" ); const SvxLRSpaceItem& aLRItem = pFmt->GetLRSpace(); - if( aLRItem.GetLeft() && + if( aLRItem.GetLeft() > 0 && rHTMLWrt.nDefListMargin > 0 && ( !rHTMLWrt.GetNumInfo().GetNumRule() || ( rHTMLWrt.GetNextNumInfo() && (rHTMLWrt.GetNextNumInfo()->IsRestart() || diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index ae9e1a5d1aa2..7b662030e834 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -2,9 +2,9 @@ * * $RCSfile: wrthtml.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: mib $ $Date: 2001-10-24 14:16:17 $ + * last change: $Author: mib $ $Date: 2002-05-16 13:08:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -309,9 +309,9 @@ public: sal_uInt16 nFormCntrlCnt; sal_uInt16 nEndNote; sal_uInt16 nFootNote; - sal_uInt16 nLeftMargin; // linker Einzug (z.B. aus Listen) - sal_uInt16 nDfltLeftMargin; // die dafaults, der nicht geschrieben - sal_uInt16 nDfltRightMargin; // werden muessen (aus der Vorlage) + sal_Int32 nLeftMargin; // linker Einzug (z.B. aus Listen) + sal_Int32 nDfltLeftMargin; // die dafaults, der nicht geschrieben + sal_Int32 nDfltRightMargin; // werden muessen (aus der Vorlage) short nFirstLineIndent; // Erstzeilen-Einzug (aus Listen) short nDfltFirstLineIndent; // nicht zu schreibender default sal_uInt16 nDfltTopMargin; // die defaults, der nicht geschrieben @@ -319,7 +319,7 @@ public: sal_uInt16 nIndentLvl; // wie weit ist eingerueckt? xub_StrLen nWhishLineLen; // wie lang darf eine Zeile werden? sal_uInt16 nDefListLvl; // welcher DL-Level existiert gerade - sal_uInt16 nDefListMargin; // Wie weit wird in DL eingerueckt + sal_Int32 nDefListMargin; // Wie weit wird in DL eingerueckt sal_uInt16 nHeaderFooterSpace; sal_uInt16 nTxtAttrsToIgnore; sal_uInt16 nExportMode; -- cgit