1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: css1atr.cxx,v $
10 * $Revision: 1.44.138.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
36 #include "hintids.hxx"
37 #include <vcl/svapp.hxx>
38 #ifndef _WRKWIN_HXX //autogen
39 #include <vcl/wrkwin.hxx>
41 #include <svtools/whiter.hxx>
42 #include <svx/boxitem.hxx>
43 #include <svx/ulspitem.hxx>
44 #include <svx/udlnitem.hxx>
45 #include <svx/crsditem.hxx>
46 #include <svx/blnkitem.hxx>
47 #include <svx/cmapitem.hxx>
48 #include <svx/colritem.hxx>
49 #include <svx/fontitem.hxx>
50 #include <svx/fhgtitem.hxx>
51 #include <svx/postitem.hxx>
52 #include <svx/kernitem.hxx>
53 #include <svx/wghtitem.hxx>
54 #include <svx/lspcitem.hxx>
55 #include <svx/adjitem.hxx>
56 #include <svx/lrspitem.hxx>
57 #include <svx/ulspitem.hxx>
58 #include <svx/brshitem.hxx>
59 #include <svx/brkitem.hxx>
60 #include <svx/keepitem.hxx>
61 #include <svx/widwitem.hxx>
62 #include <svx/spltitem.hxx>
63 #include <svx/orphitem.hxx>
64 #include <svx/xoutbmp.hxx>
65 #include <svx/langitem.hxx>
66 #include <svx/frmdiritem.hxx>
67 #include <svtools/htmlout.hxx>
68 #include <svtools/htmlkywd.hxx>
69 #include <svx/htmlmode.hxx>
70 #include <svtools/urihelper.hxx>
71 #include <tools/urlobj.hxx>
72 #include <tools/bigint.hxx>
73 #include <unotools/charclass.hxx>
74 #include <i18npool/mslangid.hxx>
75 #include <charfmt.hxx>
77 #include <fmtfsize.hxx>
78 #include <fmtornt.hxx>
79 #include <fmtpdsc.hxx>
80 #include <fmtlsplt.hxx>
81 #include <pagedesc.hxx>
82 #include <fmtanchr.hxx>
86 #include <viewopt.hxx>
87 #include <swtable.hxx>
89 #include <ftninfo.hxx>
94 #include <dcontact.hxx>
98 #include "charatr.hxx"
100 #include "frmatr.hxx"
101 #include "poolfmt.hxx"
102 #include "fltini.hxx"
103 #include "css1kywd.hxx"
104 #include "wrthtml.hxx"
105 #include "htmlnum.hxx"
107 #include <IDocumentStylePoolAccess.hxx>
108 #include <numrule.hxx>
111 * um nicht immer wieder nach einem Update festzustellen, das irgendwelche
112 * Hint-Ids dazugekommen sind, wird hier definiert, die Groesse der Tabelle
113 * definiert und mit der akt. verglichen. Bei unterschieden wird der
114 * Compiler schon meckern.
116 * diese Section und die dazugeherigen Tabellen muessen in folgenden Files
117 * gepflegt werden: rtf\rtfatr.cxx, sw6\sw6atr.cxx, w4w\w4watr.cxx
119 #if !defined(UNX) && !defined(MSC) && !defined(PPC) && !defined(CSET) && !defined(__MWERKS__) && !defined(WTC) && !defined(__MINGW32__) && !defined(OS2)
121 #define ATTRFNTAB_SIZE 130
122 #if ATTRFNTAB_SIZE != POOLATTR_END - POOLATTR_BEGIN
123 #error Attribut-Tabelle ist ungueltigt. Wurden neue Hint-IDs zugefuegt ??
128 #define HTML_HEADSPACE (12*20)
130 #define CSS1_BACKGROUND_ATTR 1
131 #define CSS1_BACKGROUND_PAGE 2
132 #define CSS1_BACKGROUND_TABLE 3
133 #define CSS1_BACKGROUND_FLY 4
134 #define CSS1_BACKGROUND_SECTION 5
136 #define CSS1_FRMSIZE_WIDTH 0x01
137 #define CSS1_FRMSIZE_VARHEIGHT 0x02
138 #define CSS1_FRMSIZE_MINHEIGHT 0x04
139 #define CSS1_FRMSIZE_FIXHEIGHT 0x08
140 #define CSS1_FRMSIZE_ANYHEIGHT 0x0e
141 #define CSS1_FRMSIZE_PIXEL 0x10
143 using namespace ::com::sun::star
;
145 //-----------------------------------------------------------------------
147 sal_Char __FAR_DATA
CSS1_CONSTASCII_DEF( sCSS1_rule_end
, " }" );
148 sal_Char __FAR_DATA
CSS1_CONSTASCII_DEF( sCSS1_span_tag_end
, "\">" );
149 const sal_Char cCSS1_style_opt_end
= '\"';
151 sal_Char __FAR_DATA
CSS1_CONSTASCII_DEF( sHTML_FTN_fontheight
, "57%" );
153 extern SwAttrFnTab aCSS1AttrFnTab
;
155 static Writer
& OutCSS1_SwFmt( Writer
& rWrt
, const SwFmt
& rFmt
,
156 IDocumentStylePoolAccess
/*SwDoc*/ *pDoc
, SwDoc
*pTemplate
);
157 static Writer
& OutCSS1_SwPageDesc( Writer
& rWrt
, const SwPageDesc
& rFmt
,
158 IDocumentStylePoolAccess
/*SwDoc*/ *pDoc
, SwDoc
*pTemplate
,
159 USHORT nRefPoolId
, BOOL bExtRef
,
161 static Writer
& OutCSS1_SwFtnInfo( Writer
& rWrt
, const SwEndNoteInfo
& rInfo
,
162 SwDoc
*pDoc
, USHORT nNotes
, BOOL bEndNote
);
163 static void OutCSS1_SwFmtDropAttrs( SwHTMLWriter
& rHWrt
,
164 const SwFmtDrop
& rDrop
,
165 const SfxItemSet
*pCharFmtItemSet
=0 );
166 static Writer
& OutCSS1_SvxTxtLn_SvxCrOut_SvxBlink( Writer
& rWrt
,
167 const SvxUnderlineItem
*pUItem
,
168 const SvxOverlineItem
*pOItem
,
169 const SvxCrossedOutItem
*pCOItem
,
170 const SvxBlinkItem
*pBItem
);
171 static Writer
& OutCSS1_SvxFontWeight( Writer
& rWrt
, const SfxPoolItem
& rHt
);
172 static Writer
& OutCSS1_SvxPosture( Writer
& rWrt
, const SfxPoolItem
& rHt
);
173 static Writer
& OutCSS1_SvxULSpace( Writer
& rWrt
, const SfxPoolItem
& rHt
);
174 static Writer
& OutCSS1_SvxLRSpace( Writer
& rWrt
, const SfxPoolItem
& rHt
);
175 static Writer
& OutCSS1_SvxULSpace_SvxLRSpace( Writer
& rWrt
,
176 const SvxULSpaceItem
*pULSpace
,
177 const SvxLRSpaceItem
*pLRSpace
);
178 static Writer
& OutCSS1_SvxULSpace_SvxLRSpace( Writer
& rWrt
,
179 const SfxItemSet
& rItemSet
,
181 static Writer
& OutCSS1_SvxBrush( Writer
& rWrt
, const SfxPoolItem
& rHt
,
182 USHORT nMode
, const String
*pGrfName
);
183 static Writer
& OutCSS1_SvxBrush( Writer
& rWrt
, const SfxPoolItem
& rHt
);
184 static Writer
& OutCSS1_SvxBox( Writer
& rWrt
, const SfxPoolItem
& rHt
);
185 static Writer
& OutCSS1_SwFmtFrmSize( Writer
& rWrt
, const SfxPoolItem
& rHt
,
187 static Writer
& OutCSS1_SvxFmtBreak_SwFmtPDesc_SvxFmtKeep( Writer
& rWrt
,
188 const SfxItemSet
& rItemSet
,
190 static Writer
& OutCSS1_SwFmtLayoutSplit( Writer
& rWrt
, const SfxPoolItem
& rHt
);
192 static void ConvToHex( USHORT nHex
, ByteString
& rStr
)
194 sal_Char aNToABuf
[] = "00";
196 // Pointer an das Bufferende setzen
197 sal_Char
*pStr
= aNToABuf
+ (sizeof(aNToABuf
)-1);
198 for( BYTE n
= 0; n
< 2; ++n
)
200 *(--pStr
) = (sal_Char
)(nHex
& 0xf ) + 48;
206 rStr
.Append( aNToABuf
);
209 static void GetCSS1Color( const Color
& rColor
, ByteString
& rStr
)
213 ConvToHex( rColor
.GetRed(), rStr
);
214 ConvToHex( rColor
.GetGreen(), rStr
);
215 ConvToHex( rColor
.GetBlue(), rStr
);
225 SwCSS1OutMode( SwHTMLWriter
& rHWrt
, USHORT nMode
, BOOL bStartFirst
=TRUE
,
226 const String
*pSelector
=0 ) :
228 nOldMode( rHWrt
.nCSS1OutMode
)
230 rWrt
.nCSS1OutMode
= nMode
;
232 rWrt
.bFirstCSS1Property
= TRUE
;
234 rWrt
.aCSS1Selector
= *pSelector
;
239 rWrt
.nCSS1OutMode
= nOldMode
;
245 void SwHTMLWriter::OutCSS1_Property( const sal_Char
*pProp
,
246 const sal_Char
*pVal
,
247 const String
*pSVal
)
251 if( bFirstCSS1Rule
&& (nCSS1OutMode
& CSS1_OUTMODE_RULE_ON
)!=0 )
253 bFirstCSS1Rule
= FALSE
;
255 ((((sOut
+= '<') += OOO_STRING_SVTOOLS_HTML_style
) += ' ') += OOO_STRING_SVTOOLS_HTML_O_type
) += "=\"text/css\">";
256 Strm() << sOut
.GetBuffer();
259 Strm() << '<' << OOO_STRING_SVTOOLS_HTML_comment
;
264 if( bFirstCSS1Property
)
266 switch( nCSS1OutMode
& CSS1_OUTMODE_ANY_ON
)
268 case CSS1_OUTMODE_SPAN_TAG_ON
:
269 case CSS1_OUTMODE_SPAN_TAG1_ON
:
272 ((((sOut
+= '<') += OOO_STRING_SVTOOLS_HTML_span
) += ' ') += OOO_STRING_SVTOOLS_HTML_O_style
) += "=\"";
276 HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_span
, FALSE
);
281 case CSS1_OUTMODE_RULE_ON
:
283 ByteString
sTmp( aCSS1Selector
, eDestEnc
);
285 (sOut
= sTmp
) += " { ";
289 case CSS1_OUTMODE_STYLE_OPT_ON
:
290 ((sOut
= ' ') += OOO_STRING_SVTOOLS_HTML_O_style
) += "=\"";
293 bFirstCSS1Property
= FALSE
;
301 (sOut
+= pProp
) += ": ";
302 if( nCSS1OutMode
& CSS1_OUTMODE_ENCODE
)
304 // In STYLE-Optionen den String codieren
305 Strm() << sOut
.GetBuffer();
308 HTMLOutFuncs::Out_String( Strm(), String::CreateFromAscii(pVal
),
309 eDestEnc
, &aNonConvertableCharacters
);
311 HTMLOutFuncs::Out_String( Strm(), *pSVal
, eDestEnc
, &aNonConvertableCharacters
);
315 // Im STYLE-Tag des String direct ausgeben
320 ByteString
sTmp( *pSVal
, eDestEnc
);
326 Strm() << sOut
.GetBuffer();
329 static void AddUnitPropertyValue( long nVal
, FieldUnit eUnit
, ByteString
& rOut
)
333 // Vorzeichen extra behandeln
338 // Die umgerechnete Einheit ergibt sich aus (x * nMul)/(nDiv*nFac*10)
342 const sal_Char
*pUnit
;
346 ASSERT( FUNIT_MM
== eUnit
, "Masseinheit wird nicht unterstuetzt" );
349 nMul
= 25400; // 25.4 * 1000
350 nDiv
= 1440; // 72 * 20;
352 pUnit
= sCSS1_UNIT_mm
;
357 ASSERT( FUNIT_CM
== eUnit
, "Masseinheit wird nicht unterstuetzt" );
360 // 0.001cm = 0.57twip
361 nMul
= 25400; // 2.54 * 10000
362 nDiv
= 1440; // 72 * 20;
365 // 0.01cm = 5.7twip (ist zwar ungenau, aber die UI ist auch ungenau)
366 nMul
= 2540; // 2.54 * 1000
367 nDiv
= 1440; // 72 * 20;
370 pUnit
= sCSS1_UNIT_cm
;
374 ASSERT( FUNIT_POINT
== eUnit
, "Masseinheit wird nicht unterstuetzt" );
382 // 0.1pt = 2.0twip (ist zwar ungenau, aber die UI ist auch ungenau)
387 pUnit
= sCSS1_UNIT_pt
;
392 // 0.001pc = 0.24twip
397 // 0.01pc = 2.40twip (ist zwar ungenau, aber die UI ist auch ungenau)
399 nDiv
= 240; // 12 * 20;
402 pUnit
= sCSS1_UNIT_pc
;
412 ASSERT( FUNIT_INCH
== eUnit
, "Masseinheit wird nicht unterstuetzt" );
414 // 0.0001in = 0.144twip
416 nDiv
= 1440; // 72 * 20;
419 // 0.01in = 14.4twip (ist zwar ungenau, aber die UI ist auch ungenau)
421 nDiv
= 1440; // 72 * 20;
424 pUnit
= sCSS1_UNIT_inch
;
429 BOOL bOutLongVal
= TRUE
;
430 if( nVal
> LONG_MAX
/ nMul
)
432 // Zum Unrechnen der Einheit wird ein BigInt benoetigt
433 #ifdef SAL_INT64_IS_STRUCT
434 BigInt
nBigVal( nVal
);
440 if( nBigVal
.IsLong() )
442 // Zum Ausgeben des Wertes reicht ein long.
443 nLongVal
= (long)nBigVal
;
447 BigInt
nBigFac( nFac
);
449 rOut
+= (long)(nBigVal
/ nBigFac
);
450 if( !(nBigVal
% nBigFac
).IsZero() )
453 while( nFac
> 1 && !(nBigVal
% nBigFac
).IsZero() )
457 rOut
+= (int)((nBigVal
/ nBigFac
) % nBig10
);
463 sal_Int64
nBigVal( nVal
);
469 if( nBigVal
<= LONG_MAX
)
471 // Zum Ausgeben des Wertes reicht ein long.
472 nLongVal
= (long)nBigVal
;
476 rOut
+= ByteString::CreateFromInt64( nBigVal
/ (sal_Int64
)nFac
);
477 if( (nBigVal
% (sal_Int64
)nFac
) != 0 )
480 while( nFac
> 1 && (nBigVal
% (sal_Int64
)nFac
) != 0 )
483 rOut
+= ByteString::CreateFromInt64(
484 (nBigVal
/ (sal_Int64
)nFac
) % (sal_Int64
)10 );
493 nLongVal
= nVal
* nMul
;
501 rOut
+= ByteString::CreateFromInt32( nLongVal
/nFac
);
502 if( (nLongVal
% nFac
) != 0 )
505 while( nFac
> 1 && (nLongVal
% nFac
) != 0 )
508 rOut
+= ByteString::CreateFromInt32( (nLongVal
/ nFac
) % 10 );
513 rOut
.Append( pUnit
);
516 void SwHTMLWriter::OutCSS1_UnitProperty( const sal_Char
*pProp
, long nVal
)
519 AddUnitPropertyValue( nVal
, eCSS1Unit
, sOut
);
520 OutCSS1_PropertyAscii( pProp
, sOut
);
523 void SwHTMLWriter::OutCSS1_PixelProperty( const sal_Char
*pProp
, long nVal
,
526 if( nVal
&& Application::GetDefaultDevice() )
528 Size
aSz( bVert
? 0 : nVal
, bVert
? nVal
: 0 );
529 aSz
= Application::GetDefaultDevice()->LogicToPixel( aSz
, MapMode( MAP_TWIP
) );
530 nVal
= bVert
? aSz
.Height() : aSz
.Width();
535 ByteString
sOut( ByteString::CreateFromInt32( nVal
) );
536 sOut
.Append( sCSS1_UNIT_px
);
537 OutCSS1_PropertyAscii( pProp
, sOut
);
540 void SwHTMLWriter::OutCSS1_SfxItemSet( const SfxItemSet
& rItemSet
,
543 // den ItemSet ausgeben, und zwar inklusive aller Attribute
544 Out_SfxItemSet( aCSS1AttrFnTab
, *this, rItemSet
, bDeep
);
546 // ein par Attribute benoetigen eine Spezial-Behandlung
547 const SfxPoolItem
*pItem
= 0;
549 // Underline, Overline, CrossedOut und Blink bilden zusammen eine CSS1-Property
550 // (geht natuerlich nicht bei Hints)
551 if( !IsCSS1Source(CSS1_OUTMODE_HINT
) )
553 const SvxUnderlineItem
*pUnderlineItem
= 0;
554 if( SFX_ITEM_SET
==rItemSet
.GetItemState( RES_CHRATR_UNDERLINE
, bDeep
, &pItem
))
555 pUnderlineItem
= (const SvxUnderlineItem
*)pItem
;
557 const SvxOverlineItem
*pOverlineItem
= 0;
558 if( SFX_ITEM_SET
==rItemSet
.GetItemState( RES_CHRATR_OVERLINE
, bDeep
, &pItem
))
559 pOverlineItem
= (const SvxOverlineItem
*)pItem
;
561 const SvxCrossedOutItem
*pCrossedOutItem
= 0;
562 if( SFX_ITEM_SET
==rItemSet
.GetItemState( RES_CHRATR_CROSSEDOUT
, bDeep
, &pItem
))
563 pCrossedOutItem
= (const SvxCrossedOutItem
*)pItem
;
565 const SvxBlinkItem
*pBlinkItem
= 0;
566 if( SFX_ITEM_SET
==rItemSet
.GetItemState( RES_CHRATR_BLINK
, bDeep
, &pItem
))
567 pBlinkItem
= (const SvxBlinkItem
*)pItem
;
569 if( pUnderlineItem
|| pOverlineItem
|| pCrossedOutItem
|| pBlinkItem
)
570 OutCSS1_SvxTxtLn_SvxCrOut_SvxBlink( *this, pUnderlineItem
,
575 OutCSS1_SvxFmtBreak_SwFmtPDesc_SvxFmtKeep( *this, rItemSet
, bDeep
);
578 if( !bFirstCSS1Property
)
580 // wenn eine Property als Bestandteil einer Style-Option
581 // ausgegeben wurde, muss die Optiomn noch beendet werden
583 switch( nCSS1OutMode
& CSS1_OUTMODE_ANY_OFF
)
585 case CSS1_OUTMODE_SPAN_TAG_OFF
:
586 sOut
= sCSS1_span_tag_end
;
589 case CSS1_OUTMODE_STYLE_OPT_OFF
:
590 sOut
= cCSS1_style_opt_end
;
593 case CSS1_OUTMODE_RULE_OFF
:
594 sOut
= sCSS1_rule_end
;
598 Strm() << sOut
.GetBuffer();
602 void SwHTMLWriter::OutStyleSheet( const SwPageDesc
& rPageDesc
, BOOL bUsed
)
604 bFirstCSS1Rule
= TRUE
;
607 if( IsHTMLMode(HTMLMODE_PRINT_EXT
) )
609 const SwPageDesc
*pFirstPageDesc
= 0;
610 USHORT nFirstRefPoolId
= RES_POOLPAGE_HTML
;
611 bCSS1IgnoreFirstPageDesc
= TRUE
;
613 // Erstmal versuchen wir zu erraten, wie das Dokument so augebaut ist.
614 // Erlaubt sind nur die Vorlagen HTML, erste Seite, linke Seite und
616 // Eine erste Seite wird nur exportiert, wenn die erste Seite auch
617 // wirklich die Vorlage "erste Seite" ist.
618 // Linke und rechte Seiten werden nur exportiert, wenn diese beiden
619 // Vorlagen untereinander verkettet werden.
620 // Wenn andere Vorlagen verwendet werden, wird nur in sehr einfachen
621 // Faellen etwas exportiert.
622 const SwPageDesc
*pPageDesc
= &rPageDesc
;
623 const SwPageDesc
*pFollow
= rPageDesc
.GetFollow();
624 if( RES_POOLPAGE_FIRST
== pPageDesc
->GetPoolFmtId() &&
625 pFollow
!= pPageDesc
&&
626 !IsPoolUserFmt( pFollow
->GetPoolFmtId() ) )
628 // Das Dokument hat eine erste Seite
629 pFirstPageDesc
= pPageDesc
;
631 pFollow
= pPageDesc
->GetFollow();
634 IDocumentStylePoolAccess
* pStylePoolAccess
= getIDocumentStylePoolAccess();
635 if( pPageDesc
== pFollow
)
637 // Das Dokument ist einseitig. Egal welche Seite verwendet wird,
638 // es wird kein zweiseitiges Dokument daraus gemacht.
639 // Die Attributierung wird relativ zur HTML-Seitenvorlage
640 // aus der HTML-Vorlage exportiert.
641 OutCSS1_SwPageDesc( *this, *pPageDesc
, pStylePoolAccess
, pTemplate
,
642 RES_POOLPAGE_HTML
, TRUE
, FALSE
);
643 nFirstRefPoolId
= pFollow
->GetPoolFmtId();
645 else if( (RES_POOLPAGE_LEFT
== pPageDesc
->GetPoolFmtId() &&
646 RES_POOLPAGE_RIGHT
== pFollow
->GetPoolFmtId()) ||
647 (RES_POOLPAGE_RIGHT
== pPageDesc
->GetPoolFmtId() &&
648 RES_POOLPAGE_LEFT
== pFollow
->GetPoolFmtId()) )
650 // Das Dokument ist zweiseitig
651 OutCSS1_SwPageDesc( *this, *pPageDesc
, pStylePoolAccess
, pTemplate
,
652 RES_POOLPAGE_HTML
, TRUE
);
653 OutCSS1_SwPageDesc( *this, *pFollow
, pStylePoolAccess
, pTemplate
,
654 RES_POOLPAGE_HTML
, TRUE
);
655 nFirstRefPoolId
= RES_POOLPAGE_RIGHT
;
656 bCSS1IgnoreFirstPageDesc
= FALSE
;
658 // Alles andere bekommen wir nicht hin.
661 OutCSS1_SwPageDesc( *this, *pFirstPageDesc
, pStylePoolAccess
, pTemplate
,
662 nFirstRefPoolId
, FALSE
);
664 // /Feature: PrintExt
667 // The text body style has to be exported always (if it is changed compared
668 // to the template), because it is used as reference for any style
669 // that maps to <P>, and that's especially the standard style
670 getIDocumentStylePoolAccess()->GetTxtCollFromPool( RES_POOLCOLL_TEXT
, false );
672 // das Default-TextStyle wir nicht mit ausgegeben !!
673 // das 0-Style ist das Default, wird nie ausgegeben !!
674 USHORT nArrLen
= pDoc
->GetTxtFmtColls()->Count();
677 for( i
= 1; i
< nArrLen
; i
++ )
679 const SwTxtFmtColl
* pColl
= (*pDoc
->GetTxtFmtColls())[i
];
680 USHORT nPoolId
= pColl
->GetPoolFmtId();
681 if( !bUsed
|| nPoolId
== RES_POOLCOLL_TEXT
||
682 pDoc
->IsUsed( *pColl
) )
683 OutCSS1_SwFmt( *this, *pColl
, pDoc
, pTemplate
);
686 // das Default-TextStyle wir nicht mit ausgegeben !!
687 nArrLen
= pDoc
->GetCharFmts()->Count();
688 for( i
=1; i
<nArrLen
; i
++ )
690 const SwCharFmt
*pCFmt
= (*pDoc
->GetCharFmts())[i
];
691 USHORT nPoolId
= pCFmt
->GetPoolFmtId();
692 if( !bUsed
|| nPoolId
== RES_POOLCHR_INET_NORMAL
||
693 nPoolId
== RES_POOLCHR_INET_VISIT
||
694 pDoc
->IsUsed( *pCFmt
) )
695 OutCSS1_SwFmt( *this, *pCFmt
, pDoc
, pTemplate
);
698 const SwFtnIdxs
& rIdxs
= pDoc
->GetFtnIdxs();
699 nArrLen
= rIdxs
.Count();
700 USHORT nEnd
= 0, nFtn
= 0;
701 for( i
=0; i
< nArrLen
; i
++ )
703 if( rIdxs
[i
]->GetFtn().IsEndNote() )
708 OutCSS1_SwFtnInfo( *this, pDoc
->GetFtnInfo(), pDoc
, nFtn
, FALSE
);
709 OutCSS1_SwFtnInfo( *this, pDoc
->GetEndNoteInfo(), pDoc
, nEnd
, TRUE
);
711 if( !bFirstCSS1Rule
)
718 HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_style
, FALSE
);
722 bFirstCSS1Rule
= FALSE
;
726 nDfltBottomMargin
= 0;
729 //-----------------------------------------------------------------------
731 // wenn pPseudo gesetzt ist werden Styles-Sheets ausgegeben,
732 // sonst wird nur nach Token und Class fuer ein Format gesucht
733 USHORT
SwHTMLWriter::GetCSS1Selector( const SwFmt
*pFmt
, ByteString
& rToken
,
734 String
& rClass
, USHORT
& rRefPoolId
,
738 rToken
.Erase(); rClass
.Erase();
743 BOOL bChrFmt
= RES_CHRFMT
==pFmt
->Which();
745 // Nach oben die Formate abklappern, bis man auf eine Standard-
746 // oder eine HTML-Tag-Vorlage trifft
747 const SwFmt
*pPFmt
= pFmt
;
748 while( pPFmt
&& !pPFmt
->IsDefault() )
751 USHORT nPoolId
= pPFmt
->GetPoolFmtId();
752 if( USER_FMT
& nPoolId
)
755 const String
& rNm
= pPFmt
->GetName();
756 switch( rNm
.GetChar(0) )
758 // nicht mehr unterstuetzt:
759 // OOO_STRING_SVTOOLS_HTML_author
760 // OOO_STRING_SVTOOLS_HTML_acronym
761 // OOO_STRING_SVTOOLS_HTML_abbreviation
762 // OOO_STRING_SVTOOLS_HTML_deletedtext
763 // OOO_STRING_SVTOOLS_HTML_insertedtext
764 // OOO_STRING_SVTOOLS_HTML_language
765 // OOO_STRING_SVTOOLS_HTML_person
766 case 'B': if( !bChrFmt
&& rNm
.EqualsAscii(OOO_STRING_SVTOOLS_HTML_blockquote
) )
768 rRefPoolId
= RES_POOLCOLL_HTML_BLOCKQUOTE
;
769 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_blockquote
);
772 case 'C': if( bChrFmt
)
774 if( rNm
.EqualsAscii(OOO_STRING_SVTOOLS_HTML_citiation
) )
776 rRefPoolId
= RES_POOLCHR_HTML_CITIATION
;
777 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_citiation
);
779 else if( rNm
.EqualsAscii(OOO_STRING_SVTOOLS_HTML_code
) )
781 rRefPoolId
= RES_POOLCHR_HTML_CODE
;
782 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_code
);
786 case 'D': if( bChrFmt
&& rNm
.EqualsAscii(OOO_STRING_SVTOOLS_HTML_definstance
) )
788 rRefPoolId
= RES_POOLCHR_HTML_DEFINSTANCE
;
789 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_definstance
);
793 USHORT nDefListLvl
= GetDefListLvl( rNm
, nPoolId
);
794 // Die Vorlagen DD 1/DT 1 werden ausgegeben,
795 // aber keine von ihnen abgeleiteten Vorlagen,
796 // auch nicht DD 2/DT 2 etc.
800 (nDeep
|| (nDefListLvl
& 0x0fff) > 1) )
804 else if( nDefListLvl
& HTML_DLCOLL_DD
)
806 rRefPoolId
= RES_POOLCOLL_HTML_DD
;
807 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_dd
);
811 rRefPoolId
= RES_POOLCOLL_HTML_DT
;
812 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_dt
);
817 case 'E': if( bChrFmt
&& rNm
.EqualsAscii( OOO_STRING_SVTOOLS_HTML_emphasis
) )
819 rRefPoolId
= RES_POOLCHR_HTML_EMPHASIS
;
820 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_emphasis
);
823 case 'H': if( !bChrFmt
&& rNm
.EqualsAscii( OOO_STRING_SVTOOLS_HTML_horzrule
) )
824 // HR nicht ausgeben!
827 case 'K': if( bChrFmt
&& rNm
.EqualsAscii( OOO_STRING_SVTOOLS_HTML_keyboard
) )
829 rRefPoolId
= RES_POOLCHR_HTML_KEYBOARD
;
830 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_keyboard
);
833 case 'L': if( !bChrFmt
&& rNm
.EqualsAscii( OOO_STRING_SVTOOLS_HTML_listing
) )
835 // Listing als PRE exportieren bzw. von
836 // PRE abgeleitete Vorlage exportieren
837 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_preformtxt
);
838 rRefPoolId
= RES_POOLCOLL_HTML_PRE
;
839 nDeep
= CSS1_FMT_CMPREF
;
842 case 'P': if( !bChrFmt
&& rNm
.EqualsAscii( OOO_STRING_SVTOOLS_HTML_preformtxt
) )
844 rRefPoolId
= RES_POOLCOLL_HTML_PRE
;
845 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_preformtxt
);
848 case 'S': if( bChrFmt
)
850 if( rNm
.EqualsAscii( OOO_STRING_SVTOOLS_HTML_sample
) )
852 rRefPoolId
= RES_POOLCHR_HTML_SAMPLE
;
853 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_sample
);
855 else if( rNm
.EqualsAscii( OOO_STRING_SVTOOLS_HTML_strong
) )
857 rRefPoolId
= RES_POOLCHR_HTML_STRONG
;
858 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_strong
);
862 case 'T': if( bChrFmt
&& rNm
.EqualsAscii( OOO_STRING_SVTOOLS_HTML_teletype
) )
864 rRefPoolId
= RES_POOLCHR_HTML_TELETYPE
;
865 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_teletype
);
868 case 'V': if( bChrFmt
&& rNm
.EqualsAscii( OOO_STRING_SVTOOLS_HTML_variable
) )
870 rRefPoolId
= RES_POOLCHR_HTML_VARIABLE
;
871 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_variable
);
874 case 'X': if( !bChrFmt
&& rNm
.EqualsAscii( OOO_STRING_SVTOOLS_HTML_xmp
) )
876 // XMP als PRE exportieren (aber nicht die
877 // Vorlage als Style)
878 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_preformtxt
);
879 rRefPoolId
= RES_POOLCOLL_HTML_PRE
;
880 nDeep
= CSS1_FMT_CMPREF
;
885 // Wenn eine PoolId gesetzt ist, entspricht der Name der
886 // Vorlage dem szugehoerigen Token
887 ASSERT( rRefPoolId
!= 0 == rToken
.Len() > 0,
896 case RES_POOLCOLL_HEADLINE_BASE
:
897 case RES_POOLCOLL_STANDARD
:
898 // diese Vorlagen nicht ausgeben
901 case RES_POOLCOLL_TEXT
:
902 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_parabreak
);
904 case RES_POOLCOLL_HEADLINE1
:
905 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_head1
);
907 case RES_POOLCOLL_HEADLINE2
:
908 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_head2
);
910 case RES_POOLCOLL_HEADLINE3
:
911 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_head3
);
913 case RES_POOLCOLL_HEADLINE4
:
914 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_head4
);
916 case RES_POOLCOLL_HEADLINE5
:
917 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_head5
);
919 case RES_POOLCOLL_HEADLINE6
:
920 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_head6
);
922 case RES_POOLCOLL_SENDADRESS
:
923 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_address
);
925 case RES_POOLCOLL_HTML_BLOCKQUOTE
:
926 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_blockquote
);
928 case RES_POOLCOLL_HTML_PRE
:
929 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_preformtxt
);
932 case RES_POOLCOLL_HTML_DD
:
933 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_dd
);
935 case RES_POOLCOLL_HTML_DT
:
936 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_dt
);
939 case RES_POOLCOLL_TABLE
:
942 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_tabledata
);
943 rToken
.Append( ' ' );
944 rToken
.Append( OOO_STRING_SVTOOLS_HTML_parabreak
);
947 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_parabreak
);
949 case RES_POOLCOLL_TABLE_HDLN
:
952 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_tableheader
);
953 rToken
.Append( ' ' );
954 rToken
.Append( OOO_STRING_SVTOOLS_HTML_parabreak
);
957 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_parabreak
);
959 case RES_POOLCOLL_HTML_HR
:
960 // HR nicht ausgeben!
963 case RES_POOLCOLL_FOOTNOTE
:
966 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_parabreak
);
967 rClass
.AssignAscii( OOO_STRING_SVTOOLS_HTML_sdfootnote
);
968 rRefPoolId
= RES_POOLCOLL_TEXT
;
969 nDeep
= CSS1_FMT_CMPREF
;
972 case RES_POOLCOLL_ENDNOTE
:
975 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_parabreak
);
976 rClass
.AssignAscii( OOO_STRING_SVTOOLS_HTML_sdendnote
);
977 rRefPoolId
= RES_POOLCOLL_TEXT
;
978 nDeep
= CSS1_FMT_CMPREF
;
983 case RES_POOLCHR_HTML_EMPHASIS
:
984 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_emphasis
);
986 case RES_POOLCHR_HTML_CITIATION
:
987 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_citiation
);
989 case RES_POOLCHR_HTML_STRONG
:
990 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_strong
);
992 case RES_POOLCHR_HTML_CODE
:
993 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_code
);
995 case RES_POOLCHR_HTML_SAMPLE
:
996 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_sample
);
998 case RES_POOLCHR_HTML_KEYBOARD
:
999 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_keyboard
);
1001 case RES_POOLCHR_HTML_VARIABLE
:
1002 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_variable
);
1004 case RES_POOLCHR_HTML_DEFINSTANCE
:
1005 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_definstance
);
1007 case RES_POOLCHR_HTML_TELETYPE
:
1008 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_teletype
);
1011 case RES_POOLCHR_INET_NORMAL
:
1014 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_anchor
);
1015 pPseudo
->AssignAscii( sCSS1_link
);
1018 case RES_POOLCHR_INET_VISIT
:
1021 rToken
.Assign( OOO_STRING_SVTOOLS_HTML_anchor
);
1022 pPseudo
->AssignAscii( sCSS1_visited
);
1027 // Wenn ein Token gesetzt ist, enthaelt nPoolId die dazugehoerige
1029 if( rToken
.Len() && !rRefPoolId
)
1030 rRefPoolId
= nPoolId
;
1033 if( rToken
.Len() || bStop
)
1035 // Anhalten wenn eine HTML-Tag-Vorlage gefunden wurde
1040 // sonst weitersuchen
1042 pPFmt
= pPFmt
->DerivedFrom();
1048 // Es ist eine HTML-Tag-Vorlage
1050 nDeep
= CSS1_FMT_ISTAG
;
1054 // Es ist keine HTML-Tag-Vorlage und auch keine davon abgeleitete
1057 if( nDeep
> 0 && nDeep
< CSS1_FMT_SPECIAL
)
1059 // Wenn die Vorlage von einer HTML-Vorlage abgeleitet ist,
1060 // wird sie als <TOKEN>.<CLASS> exportiert, sonst als .<CLASS>.
1061 // <CLASS> ergibt sich aus dem Namen der Vorlage durch entfernen
1062 // aller Zeichen vor und inklusive dem ersten '.'
1063 rClass
= pFmt
->GetName();
1064 xub_StrLen nPos
= rClass
.Search( '.' );
1065 if( nPos
!= STRING_NOTFOUND
&& rClass
.Len() > nPos
+1 )
1067 rClass
.Erase( 0, nPos
+1 );
1070 GetAppCharClass().toLower( rClass
);
1071 while( STRING_NOTFOUND
!= rClass
.SearchAndReplace( '.', '-' ) )
1073 while( STRING_NOTFOUND
!= rClass
.SearchAndReplace( ' ', '-' ) )
1075 while( STRING_NOTFOUND
!= rClass
.SearchAndReplace( '_', '-' ) )
1082 static USHORT
GetCSS1Selector( const SwFmt
*pFmt
, String
& rSelector
,
1083 USHORT
& rRefPoolId
)
1089 USHORT nDeep
= SwHTMLWriter::GetCSS1Selector( pFmt
, aToken
, aClass
,
1090 rRefPoolId
, &aPseudo
);
1094 rSelector
= String( aToken
, RTL_TEXTENCODING_ASCII_US
);
1099 (rSelector
+= '.') += aClass
;
1101 (rSelector
+= ':') += aPseudo
;
1107 const SwFmt
*SwHTMLWriter::GetTemplateFmt( USHORT nPoolFmtId
,
1108 IDocumentStylePoolAccess
* pTemplate
/*SwDoc *pTemplate*/)
1110 const SwFmt
*pRefFmt
= 0;
1114 ASSERT( !(USER_FMT
& nPoolFmtId
),
1115 "In der Dok-Vorlage gibt es keine Benutzer-Vorlagen" );
1116 if( POOLGRP_NOCOLLID
& nPoolFmtId
)
1117 pRefFmt
= pTemplate
->GetCharFmtFromPool( nPoolFmtId
);
1119 pRefFmt
= pTemplate
->GetTxtCollFromPool( nPoolFmtId
, false );
1125 const SwFmt
*SwHTMLWriter::GetParentFmt( const SwFmt
& rFmt
, USHORT nDeep
)
1127 ASSERT( nDeep
!= USHRT_MAX
, "GetParent fuer HTML-Vorlage aufgerufen!" );
1128 const SwFmt
*pRefFmt
= 0;
1132 // hier wird die HTML-Tag-Vorlage, von der die Vorlage abgeleitet
1133 // ist als Referenz geholt
1135 for( USHORT i
=nDeep
; i
>0; i
-- )
1136 pRefFmt
= pRefFmt
->DerivedFrom();
1138 if( pRefFmt
&& pRefFmt
->IsDefault() )
1145 BOOL
lcl_css1atr_equalFontItems( const SfxPoolItem
& r1
, const SfxPoolItem
& r2
)
1147 return ((const SvxFontItem
&)r1
).GetFamilyName() ==
1148 ((const SvxFontItem
&)r2
).GetFamilyName() &&
1149 ((const SvxFontItem
&)r1
).GetFamily() ==
1150 ((const SvxFontItem
&)r2
).GetFamily();
1153 void SwHTMLWriter::SubtractItemSet( SfxItemSet
& rItemSet
,
1154 const SfxItemSet
& rRefItemSet
,
1157 const SfxItemSet
*pRefScriptItemSet
)
1159 ASSERT( bSetDefaults
|| bClearSame
,
1160 "SwHTMLWriter::SubtractItemSet: Bei diesen Flags passiert nix" );
1161 SfxItemSet
aRefItemSet( *rRefItemSet
.GetPool(), rRefItemSet
.GetRanges() );
1162 aRefItemSet
.Set( rRefItemSet
);
1164 // und mit dem Attr-Set der Vorlage vergleichen
1165 SfxWhichIter
aIter( rItemSet
);
1166 USHORT nWhich
= aIter
.FirstWhich();
1169 const SfxPoolItem
*pRefItem
, *pItem
;
1170 BOOL bItemSet
= ( SFX_ITEM_SET
==
1171 rItemSet
.GetItemState( nWhich
, FALSE
, &pItem
) );
1174 if( pRefScriptItemSet
)
1178 case RES_CHRATR_FONT
:
1179 case RES_CHRATR_FONTSIZE
:
1180 case RES_CHRATR_LANGUAGE
:
1181 case RES_CHRATR_POSTURE
:
1182 case RES_CHRATR_WEIGHT
:
1183 case RES_CHRATR_CJK_FONT
:
1184 case RES_CHRATR_CJK_FONTSIZE
:
1185 case RES_CHRATR_CJK_LANGUAGE
:
1186 case RES_CHRATR_CJK_POSTURE
:
1187 case RES_CHRATR_CJK_WEIGHT
:
1188 case RES_CHRATR_CTL_FONT
:
1189 case RES_CHRATR_CTL_FONTSIZE
:
1190 case RES_CHRATR_CTL_LANGUAGE
:
1191 case RES_CHRATR_CTL_POSTURE
:
1192 case RES_CHRATR_CTL_WEIGHT
:
1193 bRefItemSet
= ( SFX_ITEM_SET
==
1194 pRefScriptItemSet
->GetItemState( nWhich
, TRUE
, &pRefItem
) );
1197 bRefItemSet
= ( SFX_ITEM_SET
==
1198 aRefItemSet
.GetItemState( nWhich
, FALSE
, &pRefItem
) );
1204 bRefItemSet
= ( SFX_ITEM_SET
==
1205 aRefItemSet
.GetItemState( nWhich
, FALSE
, &pRefItem
) );
1210 if( (bClearSame
|| pRefScriptItemSet
) && bRefItemSet
&&
1211 ( *pItem
== *pRefItem
||
1212 ((RES_CHRATR_FONT
== nWhich
||
1213 RES_CHRATR_CJK_FONT
== nWhich
||
1214 RES_CHRATR_CTL_FONT
== nWhich
) &&
1215 lcl_css1atr_equalFontItems( *pItem
, *pRefItem
)) ) )
1217 // das Attribut ist mit dem gleichen Wert in beiden
1218 // Vorlagen vorhanden und muss nicht ausgegeben werden
1219 rItemSet
.ClearItem( nWhich
);
1224 if( (bSetDefaults
|| pRefScriptItemSet
) && bRefItemSet
)
1226 // das Attribut ist nur in der Referenz vorhanden. Das
1227 // Default muss ggf. ausgegeben werden
1228 rItemSet
.Put( rItemSet
.GetPool()->GetDefaultItem(nWhich
) );
1232 nWhich
= aIter
.NextWhich();
1236 void SwHTMLWriter::PrepareFontList( const SvxFontItem
& rFontItem
,
1238 sal_Unicode cQuote
, BOOL bGeneric
)
1241 const String
& rName
= rFontItem
.GetFamilyName();
1242 BOOL bContainsKeyword
= FALSE
;
1245 xub_StrLen nStrPos
= 0;
1246 while( nStrPos
!= STRING_NOTFOUND
)
1248 String aName
= rName
.GetToken( 0, ';', nStrPos
);
1249 aName
.EraseTrailingChars().EraseLeadingChars();
1253 BOOL bIsKeyword
= FALSE
;
1254 switch( aName
.GetChar( 0 ) )
1258 bIsKeyword
= aName
.EqualsIgnoreCaseAscii( sCSS1_PV_cursive
);
1263 bIsKeyword
= aName
.EqualsIgnoreCaseAscii( sCSS1_PV_fantasy
);
1268 bIsKeyword
= aName
.EqualsIgnoreCaseAscii( sCSS1_PV_monospace
);
1274 aName
.EqualsIgnoreCaseAscii( sCSS1_PV_serif
) ||
1275 aName
.EqualsIgnoreCaseAscii( sCSS1_PV_sans_serif
);
1279 bContainsKeyword
|= bIsKeyword
;
1282 rNames
.AppendAscii( ", " );
1283 if( cQuote
&& !bIsKeyword
)
1286 if( cQuote
&& !bIsKeyword
)
1291 if( !bContainsKeyword
&& bGeneric
)
1293 const sal_Char
*pStr
= 0;
1294 switch( rFontItem
.GetFamily() )
1296 case FAMILY_ROMAN
: pStr
= sCSS1_PV_serif
; break;
1297 case FAMILY_SWISS
: pStr
= sCSS1_PV_sans_serif
; break;
1298 case FAMILY_SCRIPT
: pStr
= sCSS1_PV_cursive
; break;
1299 case FAMILY_DECORATIVE
: pStr
= sCSS1_PV_fantasy
; break;
1300 case FAMILY_MODERN
: pStr
= sCSS1_PV_monospace
; break;
1308 rNames
.AppendAscii( ", " );
1309 rNames
.AppendAscii( pStr
);
1314 sal_Bool
SwHTMLWriter::HasScriptDependentItems( const SfxItemSet
& rItemSet
,
1315 sal_Bool bCheckDropCap
)
1317 static sal_uInt16 aWhichIds
[] =
1319 RES_CHRATR_FONT
, RES_CHRATR_CJK_FONT
, RES_CHRATR_CTL_FONT
,
1320 RES_CHRATR_FONTSIZE
, RES_CHRATR_CJK_FONTSIZE
, RES_CHRATR_CTL_FONTSIZE
,
1321 RES_CHRATR_LANGUAGE
, RES_CHRATR_CJK_LANGUAGE
, RES_CHRATR_CTL_LANGUAGE
,
1322 RES_CHRATR_POSTURE
, RES_CHRATR_CJK_POSTURE
, RES_CHRATR_CTL_POSTURE
,
1323 RES_CHRATR_WEIGHT
, RES_CHRATR_CJK_WEIGHT
, RES_CHRATR_CTL_WEIGHT
,
1327 for( sal_uInt16 i
=0; aWhichIds
[i
]; i
+= 3 )
1329 const SfxPoolItem
*pItem
= 0, *pItemCJK
= 0, *pItemCTL
= 0, *pTmp
;
1330 sal_uInt16 nItemCount
= 0;
1331 if( SFX_ITEM_SET
== rItemSet
.GetItemState( aWhichIds
[i
], sal_False
,
1337 if( SFX_ITEM_SET
== rItemSet
.GetItemState( aWhichIds
[i
+1], sal_False
,
1343 if( SFX_ITEM_SET
== rItemSet
.GetItemState( aWhichIds
[i
+2], sal_False
,
1350 // If some of the items are set, but not all, we need script dependent
1352 if( nItemCount
> 0 && nItemCount
< 3 )
1355 if( 3 == nItemCount
)
1357 // If all items are set, but some of them have different values,
1358 // we need script dependent styles, too. For font items, we have
1359 // to take care about their special HTML/CSS1 representation.
1360 if( RES_CHRATR_FONT
== aWhichIds
[i
] )
1362 if( !lcl_css1atr_equalFontItems( *pItem
, *pItemCJK
) ||
1363 !lcl_css1atr_equalFontItems( *pItem
, *pItemCTL
) ||
1364 !lcl_css1atr_equalFontItems( *pItemCJK
, *pItemCTL
) )
1369 if( !( *pItem
== *pItemCJK
) ||
1370 !( *pItem
== *pItemCTL
) ||
1371 !( *pItemCJK
== *pItemCTL
) )
1377 const SfxPoolItem
*pItem
;
1378 if( bCheckDropCap
&&
1379 SFX_ITEM_SET
== rItemSet
.GetItemState( RES_PARATR_DROP
, sal_True
,
1382 const SwFmtDrop
*pDrop
= (const SwFmtDrop
*)pItem
;
1383 const SwCharFmt
*pDCCharFmt
= pDrop
->GetCharFmt();
1386 SfxItemSet
aTstItemSet( *pDCCharFmt
->GetAttrSet().GetPool(),
1387 RES_CHRATR_FONT
, RES_CHRATR_FONT
,
1388 RES_CHRATR_POSTURE
, RES_CHRATR_POSTURE
,
1389 RES_CHRATR_WEIGHT
, RES_CHRATR_WEIGHT
,
1390 RES_CHRATR_CJK_FONT
, RES_CHRATR_CJK_FONT
,
1391 RES_CHRATR_CJK_POSTURE
, RES_CHRATR_CJK_WEIGHT
,
1392 RES_CHRATR_CTL_FONT
, RES_CHRATR_CTL_FONT
,
1393 RES_CHRATR_CTL_POSTURE
, RES_CHRATR_CTL_WEIGHT
,
1395 aTstItemSet
.Set( pDCCharFmt
->GetAttrSet(), sal_True
);
1396 return HasScriptDependentItems( aTstItemSet
, sal_False
);
1403 static sal_Bool
OutCSS1Rule( SwHTMLWriter
& rHTMLWrt
, const String
& rSelector
,
1404 const SfxItemSet
& rItemSet
, sal_Bool bHasClass
,
1405 sal_Bool bCheckForPseudo
)
1407 sal_Bool bScriptDependent
= sal_False
;
1408 if( SwHTMLWriter::HasScriptDependentItems( rItemSet
,
1409 rHTMLWrt
.IsHTMLMode(HTMLMODE_DROPCAPS
) && bHasClass
) )
1411 bScriptDependent
= sal_True
;
1412 String
aSelector( rSelector
);
1415 if( bCheckForPseudo
)
1417 xub_StrLen nPos
= aSelector
.SearchBackward( ':' );
1418 if( STRING_NOTFOUND
!= nPos
)
1420 aPseudo
= aSelector
.Copy( nPos
);
1421 aSelector
.Erase( nPos
);
1427 // If we are exporting styles for a tag we have to export a tag
1428 // rule for all properties that aren't style dependent and
1429 // some class rule for the additional style dependen properties
1431 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_NO_SCRIPT
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_TEMPLATE
,
1433 rHTMLWrt
.OutCSS1_SfxItemSet( rItemSet
, FALSE
);
1436 SfxItemSet
aScriptItemSet( *rItemSet
.GetPool(),
1437 RES_CHRATR_FONT
, RES_CHRATR_FONTSIZE
,
1438 RES_CHRATR_LANGUAGE
, RES_CHRATR_POSTURE
,
1439 RES_CHRATR_WEIGHT
, RES_CHRATR_WEIGHT
,
1440 RES_CHRATR_CJK_FONT
, RES_CHRATR_CTL_WEIGHT
,
1442 aScriptItemSet
.Put( rItemSet
);
1444 String
aNewSelector( aSelector
);
1445 aNewSelector
.AppendAscii( RTL_CONSTASCII_STRINGPARAM(".western") );
1446 aNewSelector
.Append( aPseudo
);
1448 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_WESTERN
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_TEMPLATE
,
1449 TRUE
, &aNewSelector
);
1450 rHTMLWrt
.OutCSS1_SfxItemSet( aScriptItemSet
, FALSE
);
1453 aNewSelector
= aSelector
;
1454 aNewSelector
.AppendAscii( RTL_CONSTASCII_STRINGPARAM(".cjk") );
1455 aNewSelector
.Append( aPseudo
);
1457 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_CJK
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_TEMPLATE
,
1458 TRUE
, &aNewSelector
);
1459 rHTMLWrt
.OutCSS1_SfxItemSet( aScriptItemSet
, FALSE
);
1462 aNewSelector
= aSelector
;
1463 aNewSelector
.AppendAscii( RTL_CONSTASCII_STRINGPARAM(".ctl") );
1464 aNewSelector
.Append( aPseudo
);
1466 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_CTL
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_TEMPLATE
,
1467 TRUE
, &aNewSelector
);
1468 rHTMLWrt
.OutCSS1_SfxItemSet( aScriptItemSet
, FALSE
);
1473 // If ther are script dependencies and we are derived from a tag,
1474 // when we have to export a style dependent class for all
1476 String
aNewSelector( aSelector
);
1477 aNewSelector
.AppendAscii( RTL_CONSTASCII_STRINGPARAM("-western") );
1478 aNewSelector
.Append( aPseudo
);
1480 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_WESTERN
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_TEMPLATE
,
1481 TRUE
, &aNewSelector
);
1482 rHTMLWrt
.OutCSS1_SfxItemSet( rItemSet
, FALSE
);
1485 aNewSelector
= aSelector
;
1486 aNewSelector
.AppendAscii( RTL_CONSTASCII_STRINGPARAM("-cjk") );
1487 aNewSelector
.Append( aPseudo
);
1489 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_CJK
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_TEMPLATE
,
1490 TRUE
, &aNewSelector
);
1491 rHTMLWrt
.OutCSS1_SfxItemSet( rItemSet
, FALSE
);
1494 aNewSelector
= aSelector
;
1495 aNewSelector
.AppendAscii( RTL_CONSTASCII_STRINGPARAM("-ctl") );
1496 aNewSelector
.Append( aPseudo
);
1498 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_CTL
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_TEMPLATE
,
1499 TRUE
, &aNewSelector
);
1500 rHTMLWrt
.OutCSS1_SfxItemSet( rItemSet
, FALSE
);
1506 // If there are no script dependencies, when all items are
1507 // exported in one step. For hyperlinks only, a script information
1508 // must be there, because these two chr formats don't support
1509 // script dependencies by now.
1510 SwCSS1OutMode
aMode( rHTMLWrt
,
1511 rHTMLWrt
.nCSS1Script
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_TEMPLATE
,
1513 rHTMLWrt
.OutCSS1_SfxItemSet( rItemSet
, FALSE
);
1516 return bScriptDependent
;
1519 static void OutCSS1DropCapRule(
1520 SwHTMLWriter
& rHTMLWrt
, const String
& rSelector
,
1521 const SwFmtDrop
& rDrop
, sal_Bool bHasClass
,
1522 sal_Bool bHasScriptDependencies
)
1524 const SwCharFmt
*pDCCharFmt
= rDrop
.GetCharFmt();
1525 if( (bHasScriptDependencies
&& bHasClass
) ||
1526 (pDCCharFmt
&& SwHTMLWriter::HasScriptDependentItems( pDCCharFmt
->GetAttrSet(), sal_False
) ) )
1528 String
aSelector( rSelector
);
1531 xub_StrLen nPos
= aSelector
.SearchBackward( ':' );
1532 if( STRING_NOTFOUND
!= nPos
)
1534 aPseudo
= aSelector
.Copy( nPos
);
1535 aSelector
.Erase( nPos
);
1540 // If we are exporting styles for a tag we have to export a tag
1541 // rule for all properties that aren't style dependent and
1542 // some class rule for the additional style dependen properties
1544 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_NO_SCRIPT
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_DROPCAP
,
1546 OutCSS1_SwFmtDropAttrs( rHTMLWrt
, rDrop
);
1549 SfxItemSet
aScriptItemSet( rHTMLWrt
.pDoc
->GetAttrPool(),
1550 RES_CHRATR_FONT
, RES_CHRATR_FONTSIZE
,
1551 RES_CHRATR_LANGUAGE
, RES_CHRATR_POSTURE
,
1552 RES_CHRATR_WEIGHT
, RES_CHRATR_WEIGHT
,
1553 RES_CHRATR_CJK_FONT
, RES_CHRATR_CTL_WEIGHT
,
1556 aScriptItemSet
.Set( pDCCharFmt
->GetAttrSet(), sal_True
);
1558 String
aNewSelector( aSelector
);
1559 aNewSelector
.AppendAscii( RTL_CONSTASCII_STRINGPARAM(".western") );
1560 aNewSelector
.Append( aPseudo
);
1562 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_WESTERN
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_DROPCAP
,
1563 TRUE
, &aNewSelector
);
1564 OutCSS1_SwFmtDropAttrs( rHTMLWrt
, rDrop
, &aScriptItemSet
);
1567 aNewSelector
= aSelector
;
1568 aNewSelector
.AppendAscii( RTL_CONSTASCII_STRINGPARAM(".cjk") );
1569 aNewSelector
.Append( aPseudo
);
1571 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_CJK
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_DROPCAP
,
1572 TRUE
, &aNewSelector
);
1573 OutCSS1_SwFmtDropAttrs( rHTMLWrt
, rDrop
, &aScriptItemSet
);
1576 aNewSelector
= aSelector
;
1577 aNewSelector
.AppendAscii( RTL_CONSTASCII_STRINGPARAM(".ctl") );
1578 aNewSelector
.Append( aPseudo
);
1580 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_CTL
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_DROPCAP
,
1581 TRUE
, &aNewSelector
);
1582 OutCSS1_SwFmtDropAttrs( rHTMLWrt
, rDrop
, &aScriptItemSet
);
1587 // If ther are script dependencies and we are derived from a tag,
1588 // when we have to export a style dependent class for all
1590 String
aNewSelector( aSelector
);
1591 aNewSelector
.AppendAscii( RTL_CONSTASCII_STRINGPARAM("-western") );
1592 aNewSelector
.Append( aPseudo
);
1594 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_WESTERN
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_DROPCAP
,
1595 TRUE
, &aNewSelector
);
1596 OutCSS1_SwFmtDropAttrs( rHTMLWrt
, rDrop
);
1599 aNewSelector
= aSelector
;
1600 aNewSelector
.AppendAscii( RTL_CONSTASCII_STRINGPARAM("-cjk") );
1601 aNewSelector
.Append( aPseudo
);
1603 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_CJK
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_DROPCAP
,
1604 TRUE
, &aNewSelector
);
1605 OutCSS1_SwFmtDropAttrs( rHTMLWrt
, rDrop
);
1608 aNewSelector
= aSelector
;
1609 aNewSelector
.AppendAscii( RTL_CONSTASCII_STRINGPARAM("-ctl") );
1610 aNewSelector
.Append( aPseudo
);
1612 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_CTL
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_DROPCAP
,
1613 TRUE
, &aNewSelector
);
1614 OutCSS1_SwFmtDropAttrs( rHTMLWrt
, rDrop
);
1620 // If there are no script dependencies, when all items are
1621 // exported in one step. For hyperlinks only, a script information
1622 // must be there, because these two chr formats don't support
1623 // script dependencies by now.
1624 SwCSS1OutMode
aMode( rHTMLWrt
,
1625 rHTMLWrt
.nCSS1Script
|CSS1_OUTMODE_RULE
|CSS1_OUTMODE_DROPCAP
,
1627 OutCSS1_SwFmtDropAttrs( rHTMLWrt
, rDrop
);
1631 static Writer
& OutCSS1_SwFmt( Writer
& rWrt
, const SwFmt
& rFmt
,
1632 IDocumentStylePoolAccess
/*SwDoc*/ *pDoc
, SwDoc
*pTemplate
)
1634 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
1636 BOOL bCharFmt
= FALSE
;
1637 switch( rFmt
.Which() )
1643 case RES_TXTFMTCOLL
:
1644 case RES_CONDTXTFMTCOLL
:
1645 // diese Vorlagen-Typen koennen exportiert werden
1653 // den Selector und die auszugebende Attr-Set-Tiefe ermitteln
1655 USHORT nRefPoolId
= 0;
1656 USHORT nDeep
= GetCSS1Selector( &rFmt
, aSelector
, nRefPoolId
);
1658 return rWrt
; // von keiner HTML-Vorlage abgeleitet
1660 USHORT nPoolFmtId
= rFmt
.GetPoolFmtId();
1662 // Den auszugebenden Attr-Set bestimmen. Hier muessen 3 Faelle
1663 // unterschieden werden:
1664 // - HTML-Tag-Vorlagen (nDeep==USHRT_MAX):
1665 // Es werden die Attrs ausgegeben
1666 // - die in der Vorlage gesetzt sind, aber nicht im Original aus
1668 // - die Default-Attrs fuer die Attrs, die im Original aus der
1669 // HTML-Vorlage gesetzt sind, aber nicht in der vorliegeden Vorlage.
1670 // - direkt von HTML-Vorlagen abgeleitete Vorlagen (nDeep==1):
1671 // Es weren nur die Attribute des Vorlagen-Item-Set ohne seine
1672 // Parents ausgegeben.
1673 // - indirekt von HTML-Tag-Vorlagen abgeleitete Vorlagen (nDeep>1)
1674 // Es werden die Attribute des Vorlagen-Item-Sets inkl. seiner Parents,
1675 // aber ohne die Attribute, die in der HTML-Tag-Vorlage gesetzt sind,
1678 // einen Item-Set mit allen Attributen aus der Vorlage anlegen
1679 // (ausser fuer nDeep==1)
1680 const SfxItemSet
& rFmtItemSet
= rFmt
.GetAttrSet();
1681 SfxItemSet
aItemSet( *rFmtItemSet
.GetPool(), rFmtItemSet
.GetRanges() );
1682 aItemSet
.Set( rFmtItemSet
, TRUE
); // Was nDeep!=1 that is not working
1683 // for script dependent items buts should
1684 // not make a deifference for any other
1686 BOOL bSetDefaults
= TRUE
, bClearSame
= TRUE
;
1687 const SwFmt
*pRefFmt
= 0;
1688 const SwFmt
*pRefFmtScript
= 0;
1691 case CSS1_FMT_ISTAG
:
1692 pRefFmt
= SwHTMLWriter::GetTemplateFmt( nRefPoolId
, pTemplate
);
1694 case CSS1_FMT_CMPREF
:
1695 pRefFmt
= SwHTMLWriter::GetTemplateFmt( nRefPoolId
, pDoc
);
1696 pRefFmtScript
= SwHTMLWriter::GetTemplateFmt( nRefPoolId
, pTemplate
);
1700 pRefFmt
= SwHTMLWriter::GetParentFmt( rFmt
, nDeep
);
1701 pRefFmtScript
= SwHTMLWriter::GetTemplateFmt( nRefPoolId
, pTemplate
);
1702 bSetDefaults
= FALSE
;
1708 // Den Item-Set der Referenz-Vorlage (inkl. seiner Parents) vom
1710 SwHTMLWriter::SubtractItemSet( aItemSet
, pRefFmt
->GetAttrSet(),
1711 bSetDefaults
, bClearSame
,
1713 ? &pRefFmtScript
->GetAttrSet()
1718 const SvxULSpaceItem
& rULItem
= pRefFmt
->GetULSpace();
1719 rHTMLWrt
.nDfltTopMargin
= rULItem
.GetUpper();
1720 rHTMLWrt
.nDfltBottomMargin
= rULItem
.GetLower();
1723 else if( CSS1_FMT_ISTAG
==nDeep
&& !bCharFmt
)
1725 // die Default-Abstaende nach oben und unten setzen (fuer den
1726 // Fall, dass es keine Vorlage als Referenz gibt)
1727 rHTMLWrt
.nDfltTopMargin
= 0;
1728 rHTMLWrt
.nDfltBottomMargin
= HTML_PARSPACE
;
1729 if( USER_FMT
& nPoolFmtId
)
1731 // Benutzer-Vorlagen
1732 const String
& rNm
= rFmt
.GetName();
1733 switch( rNm
.GetChar(0) )
1735 case 'D': if( rNm
.EqualsAscii("DD 1") || rNm
.EqualsAscii("DT 1") )
1736 rHTMLWrt
.nDfltBottomMargin
= 0;
1738 case 'L': if(rNm
.EqualsAscii(OOO_STRING_SVTOOLS_HTML_listing
) )
1739 rHTMLWrt
.nDfltBottomMargin
= 0;
1741 case 'P': if( rNm
.EqualsAscii(OOO_STRING_SVTOOLS_HTML_preformtxt
) )
1742 rHTMLWrt
.nDfltBottomMargin
= 0;
1744 case 'X': if( rNm
.EqualsAscii(OOO_STRING_SVTOOLS_HTML_xmp
) )
1745 rHTMLWrt
.nDfltBottomMargin
= 0;
1752 switch( nPoolFmtId
)
1754 case RES_POOLCOLL_HEADLINE1
:
1755 case RES_POOLCOLL_HEADLINE2
:
1756 case RES_POOLCOLL_HEADLINE3
:
1757 case RES_POOLCOLL_HEADLINE4
:
1758 case RES_POOLCOLL_HEADLINE5
:
1759 case RES_POOLCOLL_HEADLINE6
:
1760 rHTMLWrt
.nDfltTopMargin
= HTML_HEADSPACE
;
1762 case RES_POOLCOLL_SENDADRESS
:
1763 case RES_POOLCOLL_HTML_DT
:
1764 case RES_POOLCOLL_HTML_DD
:
1765 case RES_POOLCOLL_HTML_PRE
:
1766 rHTMLWrt
.nDfltBottomMargin
= 0;
1772 // wo nicht auszugeben ist ...
1773 if( !aItemSet
.Count() )
1776 // There is no support for script dependent hyperlinks by now.
1777 sal_Bool bCheckForPseudo
= sal_False
;
1779 (RES_POOLCHR_INET_NORMAL
==nRefPoolId
||
1780 RES_POOLCHR_INET_VISIT
==nRefPoolId
) )
1781 bCheckForPseudo
= sal_True
;
1784 // jetzt die Attribute (inkl. Selektor) ausgeben
1785 sal_Bool bHasScriptDependencies
= sal_False
;
1786 if( OutCSS1Rule( rHTMLWrt
, aSelector
, aItemSet
, CSS1_FMT_ISTAG
!= nDeep
,
1790 rHTMLWrt
.aScriptTextStyles
.Insert( new String( rFmt
.GetName() ) );
1793 if( nPoolFmtId
==RES_POOLCOLL_TEXT
)
1794 rHTMLWrt
.aScriptParaStyles
.Insert
1795 (new String( pDoc
->GetTxtCollFromPool
1796 ( RES_POOLCOLL_STANDARD
, false )->GetName()
1798 rHTMLWrt
.aScriptParaStyles
.Insert( new String( rFmt
.GetName() ) );
1800 bHasScriptDependencies
= sal_True
;
1803 if( nPoolFmtId
==RES_POOLCOLL_TEXT
&& !rHTMLWrt
.bFirstCSS1Property
)
1804 rHTMLWrt
.bPoolCollTextModified
= TRUE
;
1806 // Drop-Caps ausgeben
1807 const SfxPoolItem
*pItem
;
1808 if( rHTMLWrt
.IsHTMLMode(HTMLMODE_DROPCAPS
) &&
1809 SFX_ITEM_SET
==aItemSet
.GetItemState( RES_PARATR_DROP
, FALSE
, &pItem
))
1811 String
sOut( aSelector
);
1813 sOut
.AppendAscii( sCSS1_first_letter
);
1814 const SwFmtDrop
*pDrop
= (const SwFmtDrop
*)pItem
;
1815 OutCSS1DropCapRule( rHTMLWrt
, sOut
, *pDrop
, CSS1_FMT_ISTAG
!= nDeep
, bHasScriptDependencies
);
1821 static Writer
& OutCSS1_SwPageDesc( Writer
& rWrt
, const SwPageDesc
& rPageDesc
,
1822 IDocumentStylePoolAccess
/*SwDoc*/ *pDoc
, SwDoc
*pTemplate
,
1823 USHORT nRefPoolId
, BOOL bExtRef
,
1826 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
1828 const SwPageDesc
* pRefPageDesc
= 0;
1830 pRefPageDesc
= pDoc
->GetPageDescFromPool( nRefPoolId
, false );
1831 else if( pTemplate
)
1832 pRefPageDesc
= pTemplate
->GetPageDescFromPool( nRefPoolId
, false );
1834 String
aSelector( '@' );
1835 aSelector
.AppendAscii( sCSS1_page
);
1839 const sal_Char
*pPseudo
= 0;
1840 switch( rPageDesc
.GetPoolFmtId() )
1842 case RES_POOLPAGE_FIRST
: pPseudo
= sCSS1_first
; break;
1843 case RES_POOLPAGE_LEFT
: pPseudo
= sCSS1_left
; break;
1844 case RES_POOLPAGE_RIGHT
: pPseudo
= sCSS1_right
; break;
1848 aSelector
.Append( ':' );
1849 aSelector
.AppendAscii( pPseudo
);
1853 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_RULE_ON
|CSS1_OUTMODE_TEMPLATE
,
1856 // Die Groesse: Wenn sie sich nur durch das Landscape-Flag unterscheidet,
1857 // wird nur Portrait oder Landscape exportiert. Sonst wird die Groesse
1859 BOOL bRefLandscape
= pRefPageDesc
? pRefPageDesc
->GetLandscape() : FALSE
;
1861 const Size
& rSz
= rPageDesc
.GetMaster().GetFrmSize().GetSize();
1864 aRefSz
= pRefPageDesc
->GetMaster().GetFrmSize().GetSize();
1865 if( bRefLandscape
!= rPageDesc
.GetLandscape() )
1867 long nTmp
= aRefSz
.Height();
1868 aRefSz
.Height() = aRefSz
.Width();
1869 aRefSz
.Width() = nTmp
;
1873 // Boeser uebler Hack: Auf der Seiten-Tabpage gibt es leichte
1874 // Rundungsfehler bei der Seitengroesse. Unter anderem wegen bug
1875 // 25535 wird dummerweise auch noch immer Size-Item vom Dialog geputtet,
1876 // auch wenn man gar nichts geaendert hat. Folge: Sobald man einmal im
1877 // Seiten-Dialog war und ihn mit OK verlassen hat, bekommt man eine
1878 // neue Seitengroesse, die dann hier exportiert wuerde. Um das
1879 // vermeiden erlauben wir hier kleine Abweichungen.
1880 if( Abs( rSz
.Width() - aRefSz
.Width() ) <= 2 &&
1881 Abs( rSz
.Height() - aRefSz
.Height() ) <= 2 )
1883 if( bRefLandscape
!= rPageDesc
.GetLandscape() )
1885 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_size
,
1886 rPageDesc
.GetLandscape() ? sCSS1_PV_landscape
1887 : sCSS1_PV_portrait
);
1893 AddUnitPropertyValue( rSz
.Width(), rHTMLWrt
.GetCSS1Unit(), sVal
);
1895 AddUnitPropertyValue( rSz
.Height(), rHTMLWrt
.GetCSS1Unit(), sVal
);
1896 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_size
, sVal
);
1899 // Die Abstand-Attribute koennen auf gwohnte Weise exportiert werden
1900 const SwFrmFmt
&rMaster
= rPageDesc
.GetMaster();
1901 SfxItemSet
aItemSet( *rMaster
.GetAttrSet().GetPool(),
1902 RES_LR_SPACE
, RES_UL_SPACE
);
1903 aItemSet
.Set( rMaster
.GetAttrSet(), TRUE
);
1907 SwHTMLWriter::SubtractItemSet( aItemSet
,
1908 pRefPageDesc
->GetMaster().GetAttrSet(),
1912 OutCSS1_SvxULSpace_SvxLRSpace( rWrt
, aItemSet
, FALSE
);
1914 // Wenn fuer einen Pseudo-Selektor keine Property ausgegeben wurde, muessen
1915 // wir trotzdem etwas ausgeben, damit beim Import die entsprechende
1916 // Vorlage angelegt wird.
1917 if( rHTMLWrt
.bFirstCSS1Property
&& bPseudo
)
1919 rHTMLWrt
.OutNewLine();
1920 ByteString
sTmp( aSelector
, rHTMLWrt
.eDestEnc
);
1921 rWrt
.Strm() << sTmp
.GetBuffer() << " {";
1922 rHTMLWrt
.bFirstCSS1Property
= FALSE
;
1925 if( !rHTMLWrt
.bFirstCSS1Property
)
1926 rWrt
.Strm() << sCSS1_rule_end
;
1931 static Writer
& OutCSS1_SwFtnInfo( Writer
& rWrt
, const SwEndNoteInfo
& rInfo
,
1932 SwDoc
*pDoc
, USHORT nNotes
, BOOL bEndNote
)
1934 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
1940 aSelector
.AssignAscii( OOO_STRING_SVTOOLS_HTML_anchor
);
1941 aSelector
.Append( '.');
1942 aSelector
.AppendAscii( bEndNote
? OOO_STRING_SVTOOLS_HTML_sdendnote_anc
1943 : OOO_STRING_SVTOOLS_HTML_sdfootnote_anc
);
1944 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_RULE
|CSS1_OUTMODE_TEMPLATE
,
1946 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_font_size
,
1947 sHTML_FTN_fontheight
);
1948 rHTMLWrt
.Strm() << sCSS1_rule_end
;
1951 const SwCharFmt
*pSymCharFmt
= rInfo
.GetCharFmt( *pDoc
);
1954 const SfxItemSet
& rFmtItemSet
= pSymCharFmt
->GetAttrSet();
1955 SfxItemSet
aItemSet( *rFmtItemSet
.GetPool(), rFmtItemSet
.GetRanges() );
1956 aItemSet
.Set( rFmtItemSet
, TRUE
);
1958 // Wenn es Fuss- bzw. Endnoten gibt, dann muessen alles Attribute
1959 // ausgegeben werden, damit Netscape das Dokument richtig anzeigt.
1960 // Anderenfalls genuegt es, die Unterschiede zur Fuss-/Endnoten
1961 // Vorlage rauszuschreiben.
1962 if( nNotes
== 0 && rHTMLWrt
.pTemplate
)
1964 SwFmt
*pRefFmt
= rHTMLWrt
.pTemplate
->GetCharFmtFromPool(
1965 static_cast< sal_uInt16
>(bEndNote
? RES_POOLCHR_ENDNOTE
: RES_POOLCHR_FOOTNOTE
) );
1967 SwHTMLWriter::SubtractItemSet( aItemSet
, pRefFmt
->GetAttrSet(),
1970 if( aItemSet
.Count() )
1972 aSelector
.AssignAscii( OOO_STRING_SVTOOLS_HTML_anchor
);
1973 aSelector
.Append( '.');
1974 aSelector
.AppendAscii( bEndNote
? OOO_STRING_SVTOOLS_HTML_sdendnote_sym
1975 : OOO_STRING_SVTOOLS_HTML_sdfootnote_sym
);
1976 if( OutCSS1Rule( rHTMLWrt
, aSelector
, aItemSet
, sal_True
, sal_False
))
1977 rHTMLWrt
.aScriptTextStyles
.Insert( new String( pSymCharFmt
->GetName() ) );
1984 Writer
& OutCSS1_BodyTagStyleOpt( Writer
& rWrt
, const SfxItemSet
& rItemSet
,
1985 String aEmbBGGrfName
)
1987 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
1989 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_STYLE_OPT_ON
|
1990 CSS1_OUTMODE_ENCODE
|CSS1_OUTMODE_BODY
);
1993 // Es werden nur die Attribute der Seiten-Vorlage ausgegeben.
1994 // Die Attribute der Standard-Absatz-Vorlage werden schon beim
1995 // Export der Absatz-Vorlagen beruecksichtigt.
1997 const SfxPoolItem
*pItem
;
1998 if( SFX_ITEM_SET
== rItemSet
.GetItemState( RES_BACKGROUND
, FALSE
,
2001 OutCSS1_SvxBrush( rWrt
, *pItem
, CSS1_BACKGROUND_PAGE
,
2005 if( SFX_ITEM_SET
== rItemSet
.GetItemState( RES_BOX
, FALSE
,
2008 OutCSS1_SvxBox( rWrt
, *pItem
);
2011 if( !rHTMLWrt
.bFirstCSS1Property
)
2013 // wenn eine Property als Bestandteil einer Style-Option
2014 // ausgegeben wurde, muss die Optiomn noch beendet werden
2015 rWrt
.Strm() << '\"';
2021 Writer
& OutCSS1_ParaTagStyleOpt( Writer
& rWrt
, const SfxItemSet
& rItemSet
)
2023 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2025 SwCSS1OutMode
aMode( rHTMLWrt
, rHTMLWrt
.nCSS1Script
|CSS1_OUTMODE_STYLE_OPT
|
2026 CSS1_OUTMODE_ENCODE
|CSS1_OUTMODE_PARA
);
2027 rHTMLWrt
.OutCSS1_SfxItemSet( rItemSet
, FALSE
);
2032 Writer
& OutCSS1_HintSpanTag( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2034 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2036 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_SPAN_TAG
|
2037 CSS1_OUTMODE_ENCODE
|CSS1_OUTMODE_HINT
);
2039 Out( aCSS1AttrFnTab
, rHt
, rWrt
);
2041 if( !rHTMLWrt
.bFirstCSS1Property
&& rHTMLWrt
.bTagOn
)
2042 rWrt
.Strm() << sCSS1_span_tag_end
;
2047 Writer
& OutCSS1_HintStyleOpt( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2049 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2051 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_STYLE_OPT_ON
|
2052 CSS1_OUTMODE_ENCODE
|
2053 CSS1_OUTMODE_HINT
);
2055 Out( aCSS1AttrFnTab
, rHt
, rWrt
);
2057 if( !rHTMLWrt
.bFirstCSS1Property
)
2058 rWrt
.Strm() << '\"';
2063 // Wrapper fuer die Ausgabe von Tabellen-Hintergruenden
2064 Writer
& OutCSS1_TableBGStyleOpt( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2066 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2068 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_STYLE_OPT_ON
|
2069 CSS1_OUTMODE_ENCODE
|
2070 CSS1_OUTMODE_TABLEBOX
);
2071 OutCSS1_SvxBrush( rWrt
, rHt
, CSS1_BACKGROUND_TABLE
, 0 );
2073 if( !rHTMLWrt
.bFirstCSS1Property
)
2074 rWrt
.Strm() << '\"';
2080 Writer
& OutCSS1_NumBulListStyleOpt( Writer
& rWrt
, const SwNumRule
& rNumRule
,
2083 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2085 SwCSS1OutMode
aMode( rHTMLWrt
, CSS1_OUTMODE_STYLE_OPT
|
2086 CSS1_OUTMODE_ENCODE
|CSS1_OUTMODE_PARA
);
2088 const SwNumFmt
& rNumFmt
= rNumRule
.Get( nLevel
);
2090 long nLSpace
= rNumFmt
.GetAbsLSpace();
2091 long nFirstLineOffset
= rNumFmt
.GetFirstLineOffset();
2092 long nDfltFirstLineOffset
= HTML_NUMBUL_INDENT
;
2095 const SwNumFmt
& rPrevNumFmt
= rNumRule
.Get( nLevel
-1 );
2096 nLSpace
-= rPrevNumFmt
.GetAbsLSpace();
2097 nDfltFirstLineOffset
= rPrevNumFmt
.GetFirstLineOffset();
2100 if( rHTMLWrt
.IsHTMLMode(HTMLMODE_LSPACE_IN_NUMBUL
) &&
2101 nLSpace
!= HTML_NUMBUL_MARGINLEFT
)
2102 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_margin_left
, nLSpace
);
2104 if( rHTMLWrt
.IsHTMLMode(HTMLMODE_FRSTLINE_IN_NUMBUL
) &&
2105 nFirstLineOffset
!= nDfltFirstLineOffset
)
2106 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_text_indent
, nFirstLineOffset
);
2108 if( !rHTMLWrt
.bFirstCSS1Property
)
2109 rWrt
.Strm() << '\"';
2114 //-----------------------------------------------------------------------
2116 void SwHTMLWriter::OutCSS1_FrmFmtOptions( const SwFrmFmt
& rFrmFmt
,
2117 sal_uInt32 nFrmOpts
,
2118 const SdrObject
*pSdrObj
,
2119 const SfxItemSet
*pItemSet
)
2121 SwCSS1OutMode
aMode( *this, CSS1_OUTMODE_STYLE_OPT_ON
|
2122 CSS1_OUTMODE_ENCODE
|
2123 CSS1_OUTMODE_FRAME
);
2125 const SwFmtHoriOrient
& rHoriOri
= rFrmFmt
.GetHoriOrient();
2126 SvxLRSpaceItem
aLRItem( rFrmFmt
.GetLRSpace() );
2127 SvxULSpaceItem
aULItem( rFrmFmt
.GetULSpace() );
2128 if( nFrmOpts
& HTML_FRMOPT_S_ALIGN
)
2130 const SwFmtAnchor
& rAnchor
= rFrmFmt
.GetAnchor();
2131 switch( rAnchor
.GetAnchorId() )
2134 case FLY_AUTO_CNTNT
:
2135 if( text::RelOrientation::FRAME
== rHoriOri
.GetRelationOrient() ||
2136 text::RelOrientation::PRINT_AREA
== rHoriOri
.GetRelationOrient() )
2138 if( !(nFrmOpts
& HTML_FRMOPT_ALIGN
) )
2141 const sal_Char
*pStr
= text::HoriOrientation::RIGHT
==rHoriOri
.GetHoriOrient()
2144 OutCSS1_PropertyAscii( sCSS1_P_float
, pStr
);
2153 OutCSS1_PropertyAscii( sCSS1_P_position
, sCSS1_PV_absolute
);
2155 // Fuer top/left muessen die Abstaende des Rahmens von
2156 // der Position abgezogen werden, da sie in CSS1 noch
2157 // zur Position addiert werden.
2158 // Das funktioniert auch fuer automatisch ausgerichtete
2159 // Rahmen, obwohl der Abstand da ja auch im Writer noch
2160 // addiert wird. Denn auch in diesem Fall enthalten
2161 // die Orient-Attribute die korrekte Position
2164 long nXPos
=0, nYPos
=0;
2165 BOOL bOutXPos
= FALSE
, bOutYPos
= FALSE
;
2166 if( RES_DRAWFRMFMT
== rFrmFmt
.Which() )
2168 ASSERT( pSdrObj
, "Kein SdrObject uebergeben. Ineffizient" );
2170 pSdrObj
= rFrmFmt
.FindSdrObject();
2171 ASSERT( pSdrObj
, "Wo ist das SdrObject" );
2174 Point
aPos( pSdrObj
->GetRelativePos() );
2178 bOutXPos
= bOutYPos
= TRUE
;
2182 bOutXPos
= text::RelOrientation::CHAR
!= rHoriOri
.GetRelationOrient();
2183 nXPos
= text::HoriOrientation::NONE
== rHoriOri
.GetHoriOrient()
2184 ? rHoriOri
.GetPos() : 0;
2186 const SwFmtVertOrient
& rVertOri
= rFrmFmt
.GetVertOrient();
2187 bOutYPos
= text::RelOrientation::CHAR
!= rVertOri
.GetRelationOrient();
2188 nYPos
= text::VertOrientation::NONE
== rVertOri
.GetVertOrient()
2189 ? rVertOri
.GetPos() : 0;
2194 if( IsHTMLMode( HTMLMODE_FLY_MARGINS
) )
2196 nYPos
-= aULItem
.GetUpper();
2199 aULItem
.SetUpper( (USHORT
)(aULItem
.GetUpper() + nYPos
) );
2204 OutCSS1_UnitProperty( sCSS1_P_top
, nYPos
);
2210 if( IsHTMLMode( HTMLMODE_FLY_MARGINS
) )
2212 nXPos
-= aLRItem
.GetLeft();
2215 aLRItem
.SetLeft( (USHORT
)(aLRItem
.GetLeft() + nXPos
) );
2220 OutCSS1_UnitProperty( sCSS1_P_left
, nXPos
);
2231 if( nFrmOpts
& HTML_FRMOPT_S_SIZE
)
2233 if( RES_DRAWFRMFMT
== rFrmFmt
.Which() )
2235 ASSERT( pSdrObj
, "Kein SdrObject uebergeben. Ineffizient" );
2237 pSdrObj
= rFrmFmt
.FindSdrObject();
2238 ASSERT( pSdrObj
, "Wo ist das SdrObject" );
2241 Size
aTwipSz( pSdrObj
->GetLogicRect().GetSize() );
2242 if( nFrmOpts
& HTML_FRMOPT_S_WIDTH
)
2244 if( nFrmOpts
& HTML_FRMOPT_S_PIXSIZE
)
2245 OutCSS1_PixelProperty( sCSS1_P_width
, aTwipSz
.Width(),
2248 OutCSS1_UnitProperty( sCSS1_P_width
, aTwipSz
.Width() );
2250 if( nFrmOpts
& HTML_FRMOPT_S_HEIGHT
)
2252 if( nFrmOpts
& HTML_FRMOPT_S_PIXSIZE
)
2253 OutCSS1_PixelProperty( sCSS1_P_height
, aTwipSz
.Height(),
2256 OutCSS1_UnitProperty( sCSS1_P_height
, aTwipSz
.Height() );
2262 ASSERT( HTML_FRMOPT_ABSSIZE
& nFrmOpts
,
2263 "Absolute Groesse wird exportiert" );
2264 ASSERT( HTML_FRMOPT_ANYSIZE
& nFrmOpts
,
2265 "Jede Groesse wird exportiert" );
2267 if( nFrmOpts
& HTML_FRMOPT_S_WIDTH
)
2268 nMode
|= CSS1_FRMSIZE_WIDTH
;
2269 if( nFrmOpts
& HTML_FRMOPT_S_HEIGHT
)
2270 nMode
|= (CSS1_FRMSIZE_MINHEIGHT
|CSS1_FRMSIZE_FIXHEIGHT
);
2271 if( nFrmOpts
& HTML_FRMOPT_S_PIXSIZE
)
2272 nMode
|= CSS1_FRMSIZE_PIXEL
;
2274 OutCSS1_SwFmtFrmSize( *this, rFrmFmt
.GetFrmSize(), nMode
);
2278 const SfxItemSet
& rItemSet
= rFrmFmt
.GetAttrSet();
2280 if( (nFrmOpts
& HTML_FRMOPT_S_SPACE
) &&
2281 IsHTMLMode( HTMLMODE_FLY_MARGINS
) )
2283 const SvxLRSpaceItem
*pLRItem
= 0;
2284 const SvxULSpaceItem
*pULItem
= 0;
2285 if( SFX_ITEM_SET
== rItemSet
.GetItemState( RES_LR_SPACE
, TRUE
) )
2287 if( SFX_ITEM_SET
== rItemSet
.GetItemState( RES_UL_SPACE
, TRUE
) )
2289 if( pLRItem
|| pULItem
)
2290 OutCSS1_SvxULSpace_SvxLRSpace( *this, pULItem
, pLRItem
);
2294 if( nFrmOpts
& HTML_FRMOPT_S_BORDER
)
2296 const SfxPoolItem
* pItem
;
2297 if( nFrmOpts
& HTML_FRMOPT_S_NOBORDER
)
2298 OutCSS1_SvxBox( *this, rFrmFmt
.GetBox() );
2299 else if( SFX_ITEM_SET
==rItemSet
.GetItemState( RES_BOX
, TRUE
, &pItem
) )
2300 OutCSS1_SvxBox( *this, *pItem
);
2303 // background (wenn, dann muss auch eine Farbe ausgegeben werden)
2304 if( nFrmOpts
& HTML_FRMOPT_S_BACKGROUND
)
2305 OutCSS1_FrmFmtBackground( rFrmFmt
);
2308 OutCSS1_SfxItemSet( *pItemSet
, FALSE
);
2310 if( !bFirstCSS1Property
)
2314 void SwHTMLWriter::OutCSS1_TableFrmFmtOptions( const SwFrmFmt
& rFrmFmt
)
2316 SwCSS1OutMode
aMode( *this, CSS1_OUTMODE_STYLE_OPT_ON
|
2317 CSS1_OUTMODE_ENCODE
|
2318 CSS1_OUTMODE_TABLE
);
2320 const SfxPoolItem
*pItem
;
2321 const SfxItemSet
& rItemSet
= rFrmFmt
.GetAttrSet();
2322 if( SFX_ITEM_SET
==rItemSet
.GetItemState( RES_BACKGROUND
, FALSE
, &pItem
) )
2323 OutCSS1_SvxBrush( *this, *pItem
, CSS1_BACKGROUND_TABLE
, 0 );
2325 if( IsHTMLMode( HTMLMODE_PRINT_EXT
) )
2326 OutCSS1_SvxFmtBreak_SwFmtPDesc_SvxFmtKeep( *this, rItemSet
, FALSE
);
2328 if( SFX_ITEM_SET
==rItemSet
.GetItemState( RES_LAYOUT_SPLIT
, FALSE
, &pItem
) )
2329 OutCSS1_SwFmtLayoutSplit( *this, *pItem
);
2331 if( !bFirstCSS1Property
)
2335 void SwHTMLWriter::OutCSS1_SectionFmtOptions( const SwFrmFmt
& rFrmFmt
)
2337 SwCSS1OutMode
aMode( *this, CSS1_OUTMODE_STYLE_OPT_ON
|
2338 CSS1_OUTMODE_ENCODE
|
2339 CSS1_OUTMODE_SECTION
);
2341 const SfxPoolItem
*pItem
;
2342 const SfxItemSet
& rItemSet
= rFrmFmt
.GetAttrSet();
2343 if( SFX_ITEM_SET
==rItemSet
.GetItemState( RES_BACKGROUND
, FALSE
, &pItem
) )
2344 OutCSS1_SvxBrush( *this, *pItem
, CSS1_BACKGROUND_SECTION
, 0 );
2346 if( !bFirstCSS1Property
)
2350 static BOOL
OutCSS1_FrmFmtBrush( SwHTMLWriter
& rWrt
,
2351 const SvxBrushItem
& rBrushItem
)
2353 BOOL bWritten
= FALSE
;
2354 /// OD 02.09.2002 #99657#
2355 /// output brush of frame format, if its background color is not "no fill"/"auto fill"
2356 /// or it has a background graphic.
2357 if( rBrushItem
.GetColor() != COL_TRANSPARENT
||
2358 0 != rBrushItem
.GetGraphicLink() ||
2359 0 != rBrushItem
.GetGraphicPos() )
2361 OutCSS1_SvxBrush( rWrt
, rBrushItem
, CSS1_BACKGROUND_FLY
, 0 );
2367 void SwHTMLWriter::OutCSS1_FrmFmtBackground( const SwFrmFmt
& rFrmFmt
)
2369 // Wenn der Rahmen selbst einen Hintergrund hat, wird der ausgegeben.
2370 if( OutCSS1_FrmFmtBrush( *this, rFrmFmt
.GetBackground() ) )
2373 // Wenn der Rahmen nicht seitengebunden ist, wird sonst muss der
2374 // Hintergrund vom Anker betrachtet
2375 const SwFmtAnchor
& rAnchor
= rFrmFmt
.GetAnchor();
2376 RndStdIds eAnchorId
= rAnchor
.GetAnchorId();
2377 const SwPosition
*pAnchorPos
= rAnchor
.GetCntntAnchor();
2378 if( FLY_PAGE
!= eAnchorId
&& pAnchorPos
)
2380 const SwNode
& rNode
= pAnchorPos
->nNode
.GetNode();
2381 if( rNode
.IsCntntNode() )
2383 // Wenn der Rahmen in einem Content-Node verankert ist,
2384 // wird der Hintergrund von Content-Node ausgegeben, wenn
2386 if( OutCSS1_FrmFmtBrush( *this,
2387 rNode
.GetCntntNode()->GetSwAttrSet().GetBackground()) )
2390 // Sonst koennen wir evtl. auch in einer Tabelle stehen
2391 const SwTableNode
*pTableNd
= rNode
.FindTableNode();
2394 const SwStartNode
*pBoxSttNd
= rNode
.FindTableBoxStartNode();
2395 const SwTableBox
*pBox
=
2396 pTableNd
->GetTable().GetTblBox( pBoxSttNd
->GetIndex() );
2398 // Wenn die Box einen Hintergrund hat, nehmen wir den.
2399 if( OutCSS1_FrmFmtBrush( *this,
2400 pBox
->GetFrmFmt()->GetBackground() ) )
2403 // Sonst betrachten wir den der Lines
2404 const SwTableLine
*pLine
= pBox
->GetUpper();
2407 if( OutCSS1_FrmFmtBrush( *this,
2408 pLine
->GetFrmFmt()->GetBackground() ) )
2410 pBox
= pLine
->GetUpper();
2411 pLine
= pBox
? pBox
->GetUpper() : 0;
2414 // Wenn da auch nichts war den der Tabelle.
2415 if( OutCSS1_FrmFmtBrush( *this,
2416 pTableNd
->GetTable().GetFrmFmt()->GetBackground() ) )
2422 // Wenn der Anker wieder in einem Fly-Frame steht, dann
2423 // wird der Hintergrund des Fly-Frames ausgegeben.
2424 const SwFrmFmt
*pFrmFmt
= rNode
.GetFlyFmt();
2427 OutCSS1_FrmFmtBackground( *pFrmFmt
);
2432 // Schliesslich bleibt noch der Hintergrund der Seite uebrig und als
2433 // letzte Rettung das Item der Config.
2434 ASSERT( pCurrPageDesc
, "Keine Seiten-Vorlage gemerkt" );
2435 if( !OutCSS1_FrmFmtBrush( *this,
2436 pCurrPageDesc
->GetMaster().GetBackground() ) )
2438 Color
aColor( COL_WHITE
);
2440 // Die Hintergrund-Farbe wird normalerweise nur in Browse-Mode
2441 // benutzt. Wir benutzen si bei einem HTML-Dokument immer und
2442 // bei einem Text-Dokument nur, wenn es im Browse-Mode angezeigt
2444 if( pDoc
->get(IDocumentSettingAccess::HTML_MODE
) ||
2445 pDoc
->get(IDocumentSettingAccess::BROWSE_MODE
))
2447 ViewShell
*pVSh
= 0;
2448 pDoc
->GetEditShell( &pVSh
);
2450 COL_TRANSPARENT
!= pVSh
->GetViewOptions()->GetRetoucheColor().GetColor())
2451 aColor
= pVSh
->GetViewOptions()->GetRetoucheColor().GetColor();
2455 GetCSS1Color( aColor
, sOut
);
2456 OutCSS1_PropertyAscii( sCSS1_P_background
, sOut
);
2460 //-----------------------------------------------------------------------
2462 static Writer
& OutCSS1_SvxTxtLn_SvxCrOut_SvxBlink( Writer
& rWrt
,
2463 const SvxUnderlineItem
*pUItem
,
2464 const SvxOverlineItem
*pOItem
,
2465 const SvxCrossedOutItem
*pCOItem
,
2466 const SvxBlinkItem
*pBItem
)
2468 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2471 const sal_Char
*pUStr
= 0;
2474 switch( pUItem
->GetLineStyle() )
2476 case UNDERLINE_NONE
:
2479 case UNDERLINE_DONTKNOW
:
2482 if( !rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) )
2484 // das geht auch in HTML und muss nicht als STYLE-Option
2485 // und darf nicht als Hint geschrieben werden
2486 ASSERT( !rHTMLWrt
.IsCSS1Source(CSS1_OUTMODE_HINT
),
2487 "Underline als Hint schreiben?" );
2488 pUStr
= sCSS1_PV_underline
;
2494 const sal_Char
*pOStr
= 0;
2497 switch( pOItem
->GetLineStyle() )
2499 case UNDERLINE_NONE
:
2502 case UNDERLINE_DONTKNOW
:
2505 if( !rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) )
2507 // das geht auch in HTML und muss nicht als STYLE-Option
2508 // und darf nicht als Hint geschrieben werden
2509 ASSERT( !rHTMLWrt
.IsCSS1Source(CSS1_OUTMODE_HINT
),
2510 "Overline als Hint schreiben?" );
2511 pOStr
= sCSS1_PV_overline
;
2517 const sal_Char
*pCOStr
= 0;
2520 switch( pCOItem
->GetStrikeout() )
2522 case STRIKEOUT_NONE
:
2525 case STRIKEOUT_DONTKNOW
:
2528 if( !rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) )
2530 // das geht auch in HTML und muss nicht als STYLE-Option
2531 // und darf nicht als Hint geschrieben werden
2532 ASSERT( !rHTMLWrt
.IsCSS1Source(CSS1_OUTMODE_HINT
),
2533 "CrossedOut als Hint schreiben?" );
2534 pCOStr
= sCSS1_PV_line_through
;
2540 const sal_Char
*pBStr
= 0;
2541 if( pBItem
&& rHTMLWrt
.IsHTMLMode(HTMLMODE_BLINK
) )
2543 if( !pBItem
->GetValue() )
2547 else if( !rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) )
2549 // das geht auch in HTML und muss nicht als STYLE-Option
2550 // und darf nicht als Hint geschrieben werden
2551 ASSERT( !rHTMLWrt
.IsCSS1Source(CSS1_OUTMODE_HINT
),
2552 "Blink als Hint schreiben?" );
2553 pBStr
= sCSS1_PV_blink
;
2559 sOut
.Append( pUStr
);
2566 sOut
.Append( pOStr
);
2574 sOut
.Append( pCOStr
);
2582 sOut
.Append( pBStr
);
2586 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_text_decoration
, sOut
);
2588 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_text_decoration
, sCSS1_PV_none
);
2594 static Writer
& OutCSS1_SvxCaseMap( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2596 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2598 if( !rHTMLWrt
.IsHTMLMode(HTMLMODE_SMALL_CAPS
) )
2601 const sal_Char
*pStr
= 0;
2602 switch( ((const SvxCaseMapItem
&)rHt
).GetCaseMap() )
2604 case SVX_CASEMAP_NOT_MAPPED
: pStr
= sCSS1_PV_normal
; break;
2605 case SVX_CASEMAP_KAPITAELCHEN
: pStr
= sCSS1_PV_small_caps
; break;
2611 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_font_variant
, pStr
);
2617 static Writer
& OutCSS1_SvxColor( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2619 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2621 // Farben muessen nicht in der Style-Option ausgegeben werden.
2622 if( rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) &&
2623 !rHTMLWrt
.bCfgPreferStyles
)
2625 ASSERT( !rHTMLWrt
.IsCSS1Source(CSS1_OUTMODE_HINT
),
2626 "Farbe wirklich als Hint ausgeben?" );
2628 Color
aColor( ((const SvxColorItem
&)rHt
).GetValue() );
2629 if( COL_AUTO
== aColor
.GetColor() )
2630 aColor
.SetColor( COL_BLACK
);
2633 GetCSS1Color( aColor
, sOut
);
2635 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_color
, sOut
);
2641 static Writer
& OutCSS1_SvxCrossedOut( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2643 // Mit dieser Methode werden nur Hints ausgegeben!
2644 // Sonst wird OutCSS1_SvxTxtLn_SvxCrOut_SvxBlink() direkt aufgerufen.
2646 if( ((SwHTMLWriter
&)rWrt
).IsCSS1Source(CSS1_OUTMODE_HINT
) )
2647 OutCSS1_SvxTxtLn_SvxCrOut_SvxBlink( rWrt
,
2648 0, 0, (const SvxCrossedOutItem
*)&rHt
, 0 );
2653 static Writer
& OutCSS1_SvxFont( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2655 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2657 // Fonts muessen nicht in der Style-Option ausgegeben werden.
2658 if( rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) )
2661 sal_uInt16 nScript
= CSS1_OUTMODE_WESTERN
;
2662 switch( rHt
.Which() )
2664 case RES_CHRATR_CJK_FONT
: nScript
= CSS1_OUTMODE_CJK
; break;
2665 case RES_CHRATR_CTL_FONT
: nScript
= CSS1_OUTMODE_CTL
; break;
2667 if( !rHTMLWrt
.IsCSS1Script( nScript
) )
2670 ASSERT( !rHTMLWrt
.IsCSS1Source(CSS1_OUTMODE_HINT
),
2671 "Font wirklich als Hint ausgeben?" );
2674 // MS IE3b1 hat mit einfachen Haekchen Probleme
2675 USHORT nMode
= rHTMLWrt
.nCSS1OutMode
& CSS1_OUTMODE_ANY_ON
;
2676 sal_Unicode cQuote
= nMode
== CSS1_OUTMODE_RULE_ON
? '\"' : '\'';
2677 SwHTMLWriter::PrepareFontList( ((const SvxFontItem
&)rHt
), sOut
, cQuote
,
2680 rHTMLWrt
.OutCSS1_Property( sCSS1_P_font_family
, sOut
);
2685 static Writer
& OutCSS1_SvxFontHeight( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2687 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2689 // Font-Hoehen muessen nicht in der Style-Option ausgegeben werden.
2690 // Fuer Drop-Caps wird ein andewres font-size ausgegeben
2691 if( rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) ||
2692 rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_DROPCAP
) )
2695 sal_uInt16 nScript
= CSS1_OUTMODE_WESTERN
;
2696 switch( rHt
.Which() )
2698 case RES_CHRATR_CJK_FONTSIZE
: nScript
= CSS1_OUTMODE_CJK
; break;
2699 case RES_CHRATR_CTL_FONTSIZE
: nScript
= CSS1_OUTMODE_CTL
; break;
2701 if( !rHTMLWrt
.IsCSS1Script( nScript
) )
2704 UINT32 nHeight
= ((const SvxFontHeightItem
&)rHt
).GetHeight();
2705 if( rHTMLWrt
.IsCSS1Source(CSS1_OUTMODE_HINT
) )
2707 // einen Hint nur dann ausgeben wenn es auch was bringt
2708 USHORT nSize
= rHTMLWrt
.GetHTMLFontSize( nHeight
);
2709 if( rHTMLWrt
.aFontHeights
[nSize
-1] == nHeight
)
2712 ByteString
sHeight( ByteString::CreateFromInt32(
2713 (sal_Int32
)(nHeight
/20) ) );
2714 sHeight
.Append( sCSS1_UNIT_pt
);
2716 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_font_size
, sHeight
);
2721 static Writer
& OutCSS1_SvxPosture( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2723 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2725 sal_uInt16 nScript
= CSS1_OUTMODE_WESTERN
;
2726 switch( rHt
.Which() )
2728 case RES_CHRATR_CJK_POSTURE
: nScript
= CSS1_OUTMODE_CJK
; break;
2729 case RES_CHRATR_CTL_POSTURE
: nScript
= CSS1_OUTMODE_CTL
; break;
2731 if( !rHTMLWrt
.IsCSS1Script( nScript
) )
2734 const sal_Char
*pStr
= 0;
2735 switch( ((const SvxPostureItem
&)rHt
).GetPosture() )
2737 case ITALIC_NONE
: pStr
= sCSS1_PV_normal
; break;
2738 case ITALIC_OBLIQUE
: pStr
= sCSS1_PV_oblique
; break;
2740 if( !rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) )
2742 // das geht auch in HTML und muss nicht als STYLE-Option
2743 // und darf nicht als Hint geschrieben werden
2744 ASSERT( !rHTMLWrt
.IsCSS1Source(CSS1_OUTMODE_HINT
),
2745 "Italic als Hint schreiben?" );
2746 pStr
= sCSS1_PV_italic
;
2754 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_font_style
, pStr
);
2759 static Writer
& OutCSS1_SvxKerning( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2761 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2763 // Kerning-Item nur ausgeben, wenn volle Style-Unterst?tzung da ist
2764 if( !rHTMLWrt
.IsHTMLMode(HTMLMODE_FULL_STYLES
) )
2767 INT16 nValue
= ((const SvxKerningItem
&)rHt
).GetValue();
2777 // Breite als n.n pt
2778 nValue
= (nValue
+ 1) / 2; // 1/10pt
2779 sOut
.Append( ByteString::CreateFromInt32( (sal_Int32
)(nValue
/ 10) ) );
2781 sOut
.Append( ByteString::CreateFromInt32( (sal_Int32
)(nValue
% 10) ) );
2782 sOut
.Append( sCSS1_UNIT_pt
);
2784 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_letter_spacing
, sOut
);
2788 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_letter_spacing
,
2795 static Writer
& OutCSS1_SvxLanguage( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2797 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2799 // Language will be exported rules only
2800 if( rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) )
2803 sal_uInt16 nScript
= CSS1_OUTMODE_WESTERN
;
2804 switch( rHt
.Which() )
2806 case RES_CHRATR_CJK_LANGUAGE
: nScript
= CSS1_OUTMODE_CJK
; break;
2807 case RES_CHRATR_CTL_LANGUAGE
: nScript
= CSS1_OUTMODE_CTL
; break;
2809 if( !rHTMLWrt
.IsCSS1Script( nScript
) )
2812 ASSERT( !rHTMLWrt
.IsCSS1Source(CSS1_OUTMODE_HINT
),
2813 "Language wirklich als Hint ausgeben?" );
2815 LanguageType eLang
= ((const SvxLanguageItem
&)rHt
).GetLanguage();
2816 if( LANGUAGE_DONTKNOW
== eLang
)
2819 String sOut
= MsLangId::convertLanguageToIsoString( eLang
);
2821 rHTMLWrt
.OutCSS1_Property( sCSS1_P_so_language
, sOut
);
2826 static Writer
& OutCSS1_SvxUnderline( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2828 // Mit dieser Methode werden nur Hints ausgegeben!
2829 // Sonst wird OutCSS1_SvxTxtLn_SvxCrOut_SvxBlink() direkt aufgerufen.
2831 if( ((SwHTMLWriter
&)rWrt
).IsCSS1Source(CSS1_OUTMODE_HINT
) )
2832 OutCSS1_SvxTxtLn_SvxCrOut_SvxBlink( rWrt
,
2833 (const SvxUnderlineItem
*)&rHt
, 0, 0, 0 );
2839 static Writer
& OutCSS1_SvxOverline( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2841 // Mit dieser Methode werden nur Hints ausgegeben!
2842 // Sonst wird OutCSS1_SvxTxtLn_SvxCrOut_SvxBlink() direkt aufgerufen.
2844 if( ((SwHTMLWriter
&)rWrt
).IsCSS1Source(CSS1_OUTMODE_HINT
) )
2845 OutCSS1_SvxTxtLn_SvxCrOut_SvxBlink( rWrt
,
2846 0, (const SvxOverlineItem
*)&rHt
, 0, 0 );
2852 static Writer
& OutCSS1_SvxFontWeight( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2854 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2856 sal_uInt16 nScript
= CSS1_OUTMODE_WESTERN
;
2857 switch( rHt
.Which() )
2859 case RES_CHRATR_CJK_WEIGHT
: nScript
= CSS1_OUTMODE_CJK
; break;
2860 case RES_CHRATR_CTL_WEIGHT
: nScript
= CSS1_OUTMODE_CTL
; break;
2862 if( !rHTMLWrt
.IsCSS1Script( nScript
) )
2865 const sal_Char
*pStr
= 0;
2866 switch( ((const SvxWeightItem
&)rHt
).GetWeight() )
2868 case WEIGHT_ULTRALIGHT
: pStr
= sCSS1_PV_extra_light
; break;
2869 case WEIGHT_LIGHT
: pStr
= sCSS1_PV_light
; break;
2870 case WEIGHT_SEMILIGHT
: pStr
= sCSS1_PV_demi_light
; break;
2871 case WEIGHT_NORMAL
: pStr
= sCSS1_PV_normal
; break;
2872 case WEIGHT_SEMIBOLD
: pStr
= sCSS1_PV_demi_bold
; break;
2874 if( !rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) )
2876 // das geht auch in HTML und muss nicht als STYLE-Option
2877 // und darf nicht als Hint geschrieben werden
2878 ASSERT( !rHTMLWrt
.IsCSS1Source(CSS1_OUTMODE_HINT
),
2879 "Fett als Hint schreiben?" );
2880 pStr
= sCSS1_PV_bold
;
2883 case WEIGHT_ULTRABOLD
: pStr
= sCSS1_PV_extra_bold
; break;
2885 pStr
= sCSS1_PV_normal
;;
2889 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_font_weight
, pStr
);
2894 static Writer
& OutCSS1_SvxBlink( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2896 // Mit dieser Methode werden nur Hints ausgegeben!
2897 // Sonst wird OutCSS1_SvxTxtLn_SvxCrOut_SvxBlink() direkt aufgerufen.
2899 if( ((SwHTMLWriter
&)rWrt
).IsCSS1Source(CSS1_OUTMODE_HINT
) )
2900 OutCSS1_SvxTxtLn_SvxCrOut_SvxBlink( rWrt
,
2901 0, 0, 0, (const SvxBlinkItem
*)&rHt
);
2906 static Writer
& OutCSS1_SvxLineSpacing( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2908 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2910 // #60393#: Netscape4 hat massive Probleme mit den Zellenhoehen
2911 // wenn der Zeilenabstand innerhalb einer Tabelle geaendert wird
2912 // und die Breite der Tabelle nicht automatisch berechnet wird
2913 // (also wenn eine WIDTH-Option vorhanden ist).
2914 if( rHTMLWrt
.bOutTable
&& rHTMLWrt
.bCfgNetscape4
)
2917 const SvxLineSpacingItem
& rLSItem
= (const SvxLineSpacingItem
&)rHt
;
2920 USHORT nPrcHeight
= 0;
2921 SvxLineSpace eLineSpace
= rLSItem
.GetLineSpaceRule();
2922 switch( rLSItem
.GetInterLineSpaceRule() )
2924 case SVX_INTER_LINE_SPACE_OFF
:
2925 case SVX_INTER_LINE_SPACE_FIX
:
2927 switch( eLineSpace
)
2929 case SVX_LINE_SPACE_MIN
:
2930 case SVX_LINE_SPACE_FIX
:
2931 nHeight
= rLSItem
.GetLineHeight();
2933 case SVX_LINE_SPACE_AUTO
:
2941 case SVX_INTER_LINE_SPACE_PROP
:
2942 nPrcHeight
= rLSItem
.GetPropLineSpace();
2950 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_line_height
, (long)nHeight
);
2951 else if( nPrcHeight
)
2954 ByteString::CreateFromInt32( (sal_Int32
)nPrcHeight
) );
2956 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_line_height
, sHeight
);
2963 static Writer
& OutCSS1_SvxAdjust( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2965 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2967 // Alignment in Style-Option nur ausgeben, wenn das Tag kein
2968 // ALIGN=xxx zulaesst
2969 if( rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) &&
2973 const sal_Char
* pStr
= 0;
2974 switch( ((const SvxAdjustItem
&)rHt
).GetAdjust() )
2976 case SVX_ADJUST_LEFT
: pStr
= sCSS1_PV_left
; break;
2977 case SVX_ADJUST_RIGHT
: pStr
= sCSS1_PV_right
; break;
2978 case SVX_ADJUST_BLOCK
: pStr
= sCSS1_PV_justify
; break;
2979 case SVX_ADJUST_CENTER
: pStr
= sCSS1_PV_center
; break;
2985 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_text_align
, pStr
);
2990 static Writer
& OutCSS1_SvxFmtSplit( Writer
& rWrt
, const SfxPoolItem
& rHt
)
2992 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
2994 const sal_Char
*pStr
= ((const SvxFmtSplitItem
&)rHt
).GetValue()
2997 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_page_break_inside
, pStr
);
3002 static Writer
& OutCSS1_SwFmtLayoutSplit( Writer
& rWrt
, const SfxPoolItem
& rHt
)
3004 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
3006 const sal_Char
*pStr
= ((const SwFmtLayoutSplit
&)rHt
).GetValue()
3009 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_page_break_inside
, pStr
);
3014 static Writer
& OutCSS1_SvxWidows( Writer
& rWrt
, const SfxPoolItem
& rHt
)
3016 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
3019 ByteString::CreateFromInt32( ((const SvxWidowsItem
&)rHt
).GetValue() ) );
3020 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_widows
, aStr
);
3025 static Writer
& OutCSS1_SvxOrphans( Writer
& rWrt
, const SfxPoolItem
& rHt
)
3027 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
3030 ByteString::CreateFromInt32( ((const SvxOrphansItem
&)rHt
).GetValue() ) );
3031 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_orphans
, aStr
);
3036 static void OutCSS1_SwFmtDropAttrs( SwHTMLWriter
& rHWrt
,
3037 const SwFmtDrop
& rDrop
,
3038 const SfxItemSet
*pCharFmtItemSet
)
3040 // Text fliesst rechts drumrum
3041 rHWrt
.OutCSS1_PropertyAscii( sCSS1_P_float
, sCSS1_PV_left
);
3043 // Anzahl der Zeilen -> %-Angabe fuer Font-Hoehe!
3044 ByteString
sOut( ByteString::CreateFromInt32( rDrop
.GetLines()*100 ) );
3046 rHWrt
.OutCSS1_PropertyAscii( sCSS1_P_font_size
, sOut
);
3048 // Abstand zum Text = rechter Rand
3049 USHORT nDistance
= rDrop
.GetDistance();
3051 rHWrt
.OutCSS1_UnitProperty( sCSS1_P_margin_right
, nDistance
);
3053 const SwCharFmt
*pDCCharFmt
= rDrop
.GetCharFmt();
3054 if( pCharFmtItemSet
)
3055 rHWrt
.OutCSS1_SfxItemSet( *pCharFmtItemSet
);
3056 else if( pDCCharFmt
)
3057 rHWrt
.OutCSS1_SfxItemSet( pDCCharFmt
->GetAttrSet() );
3058 else if( (rHWrt
.nCSS1OutMode
& CSS1_OUTMODE_ANY_OFF
) == CSS1_OUTMODE_RULE_OFF
)
3059 rHWrt
.Strm() << sCSS1_rule_end
;
3063 static Writer
& OutCSS1_SwFmtDrop( Writer
& rWrt
, const SfxPoolItem
& rHt
)
3065 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
3067 // nie als Option eines Absatzes ausgeben, sondern nur als Hints
3068 if( !rHTMLWrt
.IsCSS1Source(CSS1_OUTMODE_HINT
) )
3071 if( rHTMLWrt
.bTagOn
)
3073 SwCSS1OutMode
aMode( rHTMLWrt
,
3074 rHTMLWrt
.nCSS1Script
|CSS1_OUTMODE_SPAN_TAG1_ON
|CSS1_OUTMODE_ENCODE
|
3075 CSS1_OUTMODE_DROPCAP
);
3077 OutCSS1_SwFmtDropAttrs( rHTMLWrt
, (const SwFmtDrop
&)rHt
);
3078 // Ein "> wird schon vom aufrufenden OutCSS1_HintAsSpanTag geschrieben.
3082 HTMLOutFuncs::Out_AsciiTag( rWrt
.Strm(), OOO_STRING_SVTOOLS_HTML_span
, FALSE
);
3088 static Writer
& OutCSS1_SwFmtFrmSize( Writer
& rWrt
, const SfxPoolItem
& rHt
,
3091 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
3094 const SwFmtFrmSize
& rFSItem
= (const SwFmtFrmSize
&)rHt
;
3096 if( nMode
& CSS1_FRMSIZE_WIDTH
)
3098 BYTE nPrcWidth
= rFSItem
.GetWidthPercent();
3101 (sOut
= ByteString::CreateFromInt32( nPrcWidth
) ) += '%';
3102 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_width
, sOut
);
3104 else if( nMode
& CSS1_FRMSIZE_PIXEL
)
3106 rHTMLWrt
.OutCSS1_PixelProperty( sCSS1_P_width
,
3107 rFSItem
.GetSize().Width(), FALSE
);
3111 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_width
,
3112 rFSItem
.GetSize().Width() );
3116 if( nMode
& CSS1_FRMSIZE_ANYHEIGHT
)
3118 BOOL bOutHeight
= FALSE
;
3119 switch( rFSItem
.GetHeightSizeType() )
3122 bOutHeight
= (nMode
& CSS1_FRMSIZE_FIXHEIGHT
) != 0;
3125 bOutHeight
= (nMode
& CSS1_FRMSIZE_MINHEIGHT
) != 0;
3128 bOutHeight
= (nMode
& CSS1_FRMSIZE_VARHEIGHT
) != 0;
3131 ASSERT( bOutHeight
, "Hoehe wird nicht exportiert" );
3137 BYTE nPrcHeight
= rFSItem
.GetHeightPercent();
3140 (sOut
= ByteString::CreateFromInt32( nPrcHeight
) ) += '%';
3141 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_height
, sOut
);
3143 else if( nMode
& CSS1_FRMSIZE_PIXEL
)
3145 rHTMLWrt
.OutCSS1_PixelProperty( sCSS1_P_height
,
3146 rFSItem
.GetSize().Width(),
3151 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_height
,
3152 rFSItem
.GetSize().Height() );
3160 static Writer
& OutCSS1_SvxLRSpace( Writer
& rWrt
, const SfxPoolItem
& rHt
)
3162 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
3164 const SvxLRSpaceItem
& rLRItem
= (const SvxLRSpaceItem
&)rHt
;
3166 // Der Export der harten Attributierung ist unnoetig, wenn die
3167 // neuen Werte denen der aktuellen Vorlage entsprechen
3169 // Einen linken Rand kann es durch eine Liste bereits in der
3171 long nLeftMargin
= (long)rLRItem
.GetTxtLeft() - rHTMLWrt
.nLeftMargin
;
3172 if( rHTMLWrt
.nDfltLeftMargin
!= nLeftMargin
)
3174 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_margin_left
, nLeftMargin
);
3177 if( rHTMLWrt
.nDfltRightMargin
!= rLRItem
.GetRight() )
3179 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_margin_right
,
3180 (long)rLRItem
.GetRight() );
3183 // Der Erstzeilen-Einzug kann den Platz fuer eine Numerierung
3185 long nFirstLineIndent
= (long)rLRItem
.GetTxtFirstLineOfst() -
3186 rHTMLWrt
.nFirstLineIndent
;
3187 if( rHTMLWrt
.nDfltFirstLineIndent
!= nFirstLineIndent
)
3189 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_text_indent
,
3196 static Writer
& OutCSS1_SvxULSpace( Writer
& rWrt
, const SfxPoolItem
& rHt
)
3198 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
3200 const SvxULSpaceItem
& rULItem
= (const SvxULSpaceItem
&)rHt
;
3202 if( rHTMLWrt
.nDfltTopMargin
!= rULItem
.GetUpper() )
3204 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_margin_top
,
3205 (long)rULItem
.GetUpper() );
3208 if( rHTMLWrt
.nDfltBottomMargin
!= rULItem
.GetLower() )
3210 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_margin_bottom
,
3211 (long)rULItem
.GetLower() );
3217 static Writer
& OutCSS1_SvxULSpace_SvxLRSpace( Writer
& rWrt
,
3218 const SvxULSpaceItem
*pULItem
,
3219 const SvxLRSpaceItem
*pLRItem
)
3221 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
3223 if( pLRItem
&& pULItem
&&
3224 pLRItem
->GetLeft() == pLRItem
->GetRight() &&
3225 pLRItem
->GetLeft() == pULItem
->GetUpper() &&
3226 pLRItem
->GetLeft() == pULItem
->GetLower() &&
3227 pLRItem
->GetLeft() != rHTMLWrt
.nDfltLeftMargin
&&
3228 pLRItem
->GetRight() != rHTMLWrt
.nDfltRightMargin
&&
3229 pULItem
->GetUpper() != rHTMLWrt
.nDfltTopMargin
&&
3230 pULItem
->GetLower() != rHTMLWrt
.nDfltBottomMargin
)
3232 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_margin
, (long)pLRItem
->GetLeft() );
3237 OutCSS1_SvxLRSpace( rWrt
, *pLRItem
);
3239 OutCSS1_SvxULSpace( rWrt
, *pULItem
);
3245 static Writer
& OutCSS1_SvxULSpace_SvxLRSpace( Writer
& rWrt
,
3246 const SfxItemSet
& rItemSet
,
3249 const SvxULSpaceItem
*pULSpace
= 0;
3250 const SvxLRSpaceItem
*pLRSpace
= 0;
3251 const SfxPoolItem
*pItem
;
3252 if( SFX_ITEM_SET
== rItemSet
.GetItemState( RES_LR_SPACE
, bDeep
, &pItem
) )
3253 pLRSpace
= (const SvxLRSpaceItem
*)pItem
;
3255 if( SFX_ITEM_SET
== rItemSet
.GetItemState( RES_UL_SPACE
, bDeep
, &pItem
) )
3256 pULSpace
= (const SvxULSpaceItem
*)pItem
;
3258 if( pLRSpace
|| pULSpace
)
3259 OutCSS1_SvxULSpace_SvxLRSpace( rWrt
, pULSpace
, pLRSpace
);
3264 static Writer
& OutCSS1_SvxFmtBreak_SwFmtPDesc_SvxFmtKeep( Writer
& rWrt
,
3265 const SvxFmtBreakItem
*pBreakItem
,
3266 const SwFmtPageDesc
*pPDescItem
,
3267 const SvxFmtKeepItem
*pKeepItem
)
3269 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
3271 if( !rHTMLWrt
.IsHTMLMode(HTMLMODE_PRINT_EXT
) )
3274 const sal_Char
*pBreakBefore
= 0;
3275 const sal_Char
*pBreakAfter
= 0;
3279 pBreakAfter
= pKeepItem
->GetValue() ? sCSS1_PV_avoid
: sCSS1_PV_auto
;
3283 switch( pBreakItem
->GetBreak() )
3285 case SVX_BREAK_NONE
:
3286 pBreakBefore
= sCSS1_PV_auto
;
3288 pBreakAfter
= sCSS1_PV_auto
;
3291 case SVX_BREAK_PAGE_BEFORE
:
3292 pBreakBefore
= sCSS1_PV_always
;
3295 case SVX_BREAK_PAGE_AFTER
:
3296 pBreakAfter
= sCSS1_PV_always
;
3305 const SwPageDesc
*pPDesc
= pPDescItem
->GetPageDesc();
3308 switch( pPDesc
->GetPoolFmtId() )
3310 case RES_POOLPAGE_LEFT
: pBreakBefore
= sCSS1_PV_left
; break;
3311 case RES_POOLPAGE_RIGHT
: pBreakBefore
= sCSS1_PV_right
; break;
3312 default: pBreakBefore
= sCSS1_PV_always
; break;
3315 else if( !pBreakBefore
)
3317 pBreakBefore
= sCSS1_PV_auto
;
3322 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_page_break_before
,
3325 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_page_break_after
,
3331 static Writer
& OutCSS1_SvxFmtBreak_SwFmtPDesc_SvxFmtKeep( Writer
& rWrt
,
3332 const SfxItemSet
& rItemSet
,
3335 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
3336 const SfxPoolItem
*pItem
;
3337 const SvxFmtBreakItem
*pBreakItem
= 0;
3338 if( SFX_ITEM_SET
==rItemSet
.GetItemState( RES_BREAK
, bDeep
, &pItem
))
3339 pBreakItem
= (const SvxFmtBreakItem
*)pItem
;
3341 const SwFmtPageDesc
*pPDescItem
= 0;
3342 if( ( !rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) ||
3343 !rHTMLWrt
.bCSS1IgnoreFirstPageDesc
||
3344 rHTMLWrt
.pStartNdIdx
->GetIndex() !=
3345 rHTMLWrt
.pCurPam
->GetPoint()->nNode
.GetIndex() ) &&
3346 SFX_ITEM_SET
==rItemSet
.GetItemState( RES_PAGEDESC
, bDeep
, &pItem
))
3347 pPDescItem
= (const SwFmtPageDesc
*)pItem
;
3349 const SvxFmtKeepItem
*pKeepItem
= 0;
3350 if( SFX_ITEM_SET
==rItemSet
.GetItemState( RES_KEEP
, bDeep
, &pItem
))
3351 pKeepItem
= (const SvxFmtKeepItem
*)pItem
;
3353 if( pBreakItem
|| pPDescItem
|| pKeepItem
)
3354 OutCSS1_SvxFmtBreak_SwFmtPDesc_SvxFmtKeep( rWrt
, pBreakItem
,
3355 pPDescItem
, pKeepItem
);
3360 // Wrapper fuer OutCSS1_SfxItemSet etc.
3361 static Writer
& OutCSS1_SvxBrush( Writer
& rWrt
, const SfxPoolItem
& rHt
)
3363 OutCSS1_SvxBrush( rWrt
, rHt
, CSS1_BACKGROUND_ATTR
, 0 );
3368 static Writer
& OutCSS1_SvxBrush( Writer
& rWrt
, const SfxPoolItem
& rHt
,
3369 USHORT nMode
, const String
*pGrfName
)
3371 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
3373 // Das Zeichen-Attribut wird nicht ausgegeben, wenn gerade
3374 // Optionen ausgegeben werden
3375 if( rHt
.Which() < RES_CHRATR_END
&&
3376 rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_PARA
) )
3379 // Erstmal ein par Werte holen
3380 // const Brush &rBrush = ((const SvxBrushItem &)rHt).GetBrush();
3381 const Color
& rColor
= ((const SvxBrushItem
&)rHt
).GetColor();
3382 const String
*pLink
= pGrfName
? pGrfName
3383 : ((const SvxBrushItem
&)rHt
).GetGraphicLink();
3384 SvxGraphicPosition ePos
= ((const SvxBrushItem
&)rHt
).GetGraphicPos();
3386 if( CSS1_BACKGROUND_PAGE
==nMode
)
3388 // Fuer Seitenvorlagen wurde der Grafik-Name uebergeben. Es wird
3389 // nur ein Attribut ausgegeben, wenn die Grafik nicht gekachelt ist.
3390 ASSERT( pLink
, "Wo ist der Grafik-Name der Seitenvorlage?" );
3391 if( !pLink
|| !pLink
->Len() || GPOS_TILED
==ePos
)
3395 // Erstmal die Farbe holen
3396 BOOL bColor
= FALSE
;
3397 /// OD 02.09.2002 #99657#
3398 /// set <bTransparent> to TRUE, if color is "no fill"/"auto fill"
3399 BOOL bTransparent
= (rColor
.GetColor() == COL_TRANSPARENT
);
3407 // und jetzt eine Grafik
3412 // embeddete Grafik -> WriteEmbedded schreiben
3413 const Graphic
* pGrf
= ((const SvxBrushItem
&)rHt
).GetGraphic();
3416 // Grafik als (JPG-)File speichern
3417 const String
* pTempFileName
= rHTMLWrt
.GetOrigFileName();
3419 sGrfNm
= *pTempFileName
;
3420 USHORT nErr
= XOutBitmap::WriteGraphic( *pGrf
, sGrfNm
,
3421 String::CreateFromAscii("JPG"),
3422 XOUTBMP_USE_NATIVE_IF_POSSIBLE
);
3423 if( !nErr
) // fehlerhaft, da ist nichts auszugeben
3425 sGrfNm
= URIHelper::SmartRel2Abs(
3426 INetURLObject(rWrt
.GetBaseURL()), sGrfNm
,
3427 URIHelper::GetMaybeFileHdl() );
3432 rHTMLWrt
.nWarn
= WARN_SWG_POOR_LOAD
| WARN_SW_WRITE_BASE
;
3436 else if( !pGrfName
&& rHTMLWrt
.bCfgCpyLinkedGrfs
)
3439 rWrt
.CopyLocalFileToINet( sGrfNm
);
3443 // In Tabellen wird nur dann etwas exportiert, wenn eine Grafik
3445 if( CSS1_BACKGROUND_TABLE
==nMode
&& !pLink
)
3448 // ggf. noch die Ausrichtung der Grafik
3449 const sal_Char
*pRepeat
= 0, *pHori
= 0, *pVert
= 0;
3452 if( GPOS_TILED
==ePos
)
3454 pRepeat
= sCSS1_PV_repeat
;
3463 pHori
= sCSS1_PV_top
;
3469 pHori
= sCSS1_PV_middle
;
3475 pHori
= sCSS1_PV_bottom
;
3487 pVert
= sCSS1_PV_left
;
3493 pVert
= sCSS1_PV_center
;
3499 pVert
= sCSS1_PV_right
;
3506 if( pHori
|| pVert
)
3507 pRepeat
= sCSS1_PV_no_repeat
;
3511 // jetzt den String zusammen bauen
3513 if( !pLink
&& !bColor
)
3515 // keine Farbe und kein Link, aber ein transparenter Brush
3516 if( bTransparent
&& CSS1_BACKGROUND_FLY
!= nMode
)
3517 sOut
.AssignAscii( sCSS1_PV_transparent
);
3524 GetCSS1Color( aColor
, sTmp
);
3525 sOut
+= String( sTmp
, RTL_TEXTENCODING_ASCII_US
);
3533 sOut
.AppendAscii( sCSS1_url
);
3535 sOut
.Append( String(URIHelper::simpleNormalizedMakeRelative(rWrt
.GetBaseURL(),
3543 sOut
.AppendAscii( pRepeat
);
3549 sOut
.AppendAscii( pHori
);
3554 sOut
.AppendAscii( pVert
);
3558 sOut
.AppendAscii( sCSS1_PV_scroll
);
3563 rHTMLWrt
.OutCSS1_Property( sCSS1_P_background
, sOut
);
3568 static void OutCSS1_SvxBorderLine( SwHTMLWriter
& rHTMLWrt
,
3569 const sal_Char
*pProperty
,
3570 const SvxBorderLine
*pLine
)
3574 rHTMLWrt
.OutCSS1_PropertyAscii( pProperty
, sCSS1_PV_none
);
3578 BOOL bDouble
= FALSE
;
3579 INT32 nWidth
= pLine
->GetOutWidth();
3580 if( pLine
->GetInWidth() )
3582 nWidth
+= pLine
->GetDistance();
3583 nWidth
+= pLine
->GetInWidth();
3588 if( Application::GetDefaultDevice() &&
3589 nWidth
<= Application::GetDefaultDevice()->PixelToLogic(
3590 Size( 1, 1 ), MapMode( MAP_TWIP
) ).Width() )
3592 // Wenn die Breite kleiner ist als ein Pixel, dann als 1px
3593 // ausgeben, damit Netscape und IE die Linie auch darstellen.
3598 nWidth
*= 5; // 1/100pt
3600 // Breite als n.nn pt
3601 sOut
+= ByteString::CreateFromInt32( nWidth
/ 100 );
3603 += ByteString::CreateFromInt32((nWidth
/10) % 10))
3604 += ByteString::CreateFromInt32(nWidth
% 10)) += sCSS1_UNIT_pt
;
3607 // Linien-Stil: solid oder double
3609 += (bDouble
? sCSS1_PV_double
: sCSS1_PV_solid
)) += ' ';
3611 // und noch die Farbe
3612 GetCSS1Color( pLine
->GetColor(), sOut
);
3614 rHTMLWrt
.OutCSS1_PropertyAscii( pProperty
, sOut
);
3617 static Writer
& OutCSS1_SvxBox( Writer
& rWrt
, const SfxPoolItem
& rHt
)
3619 SwHTMLWriter
& rHTMLWrt
= (SwHTMLWriter
&)rWrt
;
3621 // Das Zeichen-Attribut wird nicht ausgegeben, wenn gerade
3622 // Optionen ausgegeben werden
3623 if( !rHTMLWrt
.IsHTMLMode(HTMLMODE_PARA_BORDER
))
3626 const SvxBoxItem
& rBoxItem
= (const SvxBoxItem
&)rHt
;
3627 const SvxBorderLine
*pTop
= rBoxItem
.GetTop();
3628 const SvxBorderLine
*pBottom
= rBoxItem
.GetBottom();
3629 const SvxBorderLine
*pLeft
= rBoxItem
.GetLeft();
3630 const SvxBorderLine
*pRight
= rBoxItem
.GetRight();
3632 if( (pTop
&& pBottom
&& pLeft
&& pRight
&&
3633 *pTop
== *pBottom
&& *pTop
== *pLeft
&& *pTop
== *pRight
) ||
3634 (!pTop
&& !pBottom
&& !pLeft
&& !pRight
) )
3636 // alle Linien gesetzt und gleich oder alle Linien nicht gesetzt
3638 OutCSS1_SvxBorderLine( rHTMLWrt
, sCSS1_P_border
, pTop
);
3642 // sonst alle Linien individuell ausgeben
3643 OutCSS1_SvxBorderLine( rHTMLWrt
, sCSS1_P_border_top
, pTop
);
3644 OutCSS1_SvxBorderLine( rHTMLWrt
, sCSS1_P_border_bottom
, pBottom
);
3645 OutCSS1_SvxBorderLine( rHTMLWrt
, sCSS1_P_border_left
, pLeft
);
3646 OutCSS1_SvxBorderLine( rHTMLWrt
, sCSS1_P_border_right
, pRight
);
3649 long nTopDist
= pTop
? rBoxItem
.GetDistance( BOX_LINE_TOP
) : 0;
3650 long nBottomDist
= pBottom
? rBoxItem
.GetDistance( BOX_LINE_BOTTOM
) : 0;
3651 long nLeftDist
= pLeft
? rBoxItem
.GetDistance( BOX_LINE_LEFT
) : 0;
3652 long nRightDist
= pRight
? rBoxItem
.GetDistance( BOX_LINE_RIGHT
) : 0;
3654 if( nTopDist
== nBottomDist
&& nLeftDist
== nRightDist
)
3657 AddUnitPropertyValue( nTopDist
, rHTMLWrt
.GetCSS1Unit(), sVal
);
3658 if( nTopDist
!= nLeftDist
)
3661 AddUnitPropertyValue( nLeftDist
, rHTMLWrt
.GetCSS1Unit(), sVal
);
3663 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_padding
, sVal
);
3667 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_padding_top
, nTopDist
);
3668 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_padding_bottom
, nBottomDist
);
3669 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_padding_left
, nLeftDist
);
3670 rHTMLWrt
.OutCSS1_UnitProperty( sCSS1_P_padding_right
, nRightDist
);
3676 static Writer
& OutCSS1_SvxFrameDirection( Writer
& rWrt
, const SfxPoolItem
& rHt
)
3678 SwHTMLWriter
& rHTMLWrt
= static_cast< SwHTMLWriter
& >( rWrt
);
3680 // Language will be exported rules only
3681 if( !rHTMLWrt
.IsCSS1Source( CSS1_OUTMODE_TEMPLATE
) )
3685 static_cast< const SvxFrameDirectionItem
& >( rHt
).GetValue();
3689 case FRMDIR_HORI_LEFT_TOP
:
3690 case FRMDIR_VERT_TOP_LEFT
:
3691 pStr
= sCSS1_PV_ltr
;
3693 case FRMDIR_HORI_RIGHT_TOP
:
3694 case FRMDIR_VERT_TOP_RIGHT
:
3695 pStr
= sCSS1_PV_rtl
;
3697 case FRMDIR_ENVIRONMENT
:
3698 pStr
= sCSS1_PV_inherit
;
3703 rHTMLWrt
.OutCSS1_PropertyAscii( sCSS1_P_direction
, pStr
);
3709 * lege hier die Tabellen fuer die HTML-Funktions-Pointer auf
3710 * die Ausgabe-Funktionen an.
3711 * Es sind lokale Strukturen, die nur innerhalb der HTML-DLL
3712 * bekannt sein muessen.
3716 SwAttrFnTab aCSS1AttrFnTab
= {
3717 /* RES_CHRATR_CASEMAP */ OutCSS1_SvxCaseMap
,
3718 /* RES_CHRATR_CHARSETCOLOR */ 0,
3719 /* RES_CHRATR_COLOR */ OutCSS1_SvxColor
,
3720 /* RES_CHRATR_CONTOUR */ 0,
3721 /* RES_CHRATR_CROSSEDOUT */ OutCSS1_SvxCrossedOut
,
3722 /* RES_CHRATR_ESCAPEMENT */ 0,
3723 /* RES_CHRATR_FONT */ OutCSS1_SvxFont
,
3724 /* RES_CHRATR_FONTSIZE */ OutCSS1_SvxFontHeight
,
3725 /* RES_CHRATR_KERNING */ OutCSS1_SvxKerning
,
3726 /* RES_CHRATR_LANGUAGE */ OutCSS1_SvxLanguage
,
3727 /* RES_CHRATR_POSTURE */ OutCSS1_SvxPosture
,
3728 /* RES_CHRATR_PROPORTIONALFONTSIZE*/0,
3729 /* RES_CHRATR_SHADOWED */ 0,
3730 /* RES_CHRATR_UNDERLINE */ OutCSS1_SvxUnderline
,
3731 /* RES_CHRATR_WEIGHT */ OutCSS1_SvxFontWeight
,
3732 /* RES_CHRATR_WORDLINEMODE */ 0,
3733 /* RES_CHRATR_AUTOKERN */ 0,
3734 /* RES_CHRATR_BLINK */ OutCSS1_SvxBlink
,
3735 /* RES_CHRATR_NOHYPHEN */ 0, // Neu: nicht trennen
3736 /* RES_CHRATR_NOLINEBREAK */ 0, // Neu: nicht umbrechen
3737 /* RES_CHRATR_BACKGROUND */ OutCSS1_SvxBrush
, // Neu: Zeichenhintergrund
3738 /* RES_CHRATR_CJK_FONT */ OutCSS1_SvxFont
,
3739 /* RES_CHRATR_CJK_FONTSIZE */ OutCSS1_SvxFontHeight
,
3740 /* RES_CHRATR_CJK_LANGUAGE */ OutCSS1_SvxLanguage
,
3741 /* RES_CHRATR_CJK_POSTURE */ OutCSS1_SvxPosture
,
3742 /* RES_CHRATR_CJK_WEIGHT */ OutCSS1_SvxFontWeight
,
3743 /* RES_CHRATR_CTL_FONT */ OutCSS1_SvxFont
,
3744 /* RES_CHRATR_CTL_FONTSIZE */ OutCSS1_SvxFontHeight
,
3745 /* RES_CHRATR_CTL_LANGUAGE */ OutCSS1_SvxLanguage
,
3746 /* RES_CHRATR_CTL_POSTURE */ OutCSS1_SvxPosture
,
3747 /* RES_CHRATR_CTL_WEIGHT */ OutCSS1_SvxFontWeight
,
3748 /* RES_CHRATR_ROTATE */ 0,
3749 /* RES_CHRATR_EMPHASIS_MARK */ 0,
3750 /* RES_CHRATR_TWO_LINES */ 0,
3751 /* RES_CHRATR_SCALEW */ 0,
3752 /* RES_CHRATR_RELIEF */ 0,
3753 /* RES_CHRATR_HIDDEN */ 0,
3754 /* RES_CHRATR_OVERLINE */ OutCSS1_SvxOverline
,
3755 /* RES_CHRATR_DUMMY1 */ 0,
3756 /* RES_CHRATR_DUMMY2 */ 0,
3758 /* RES_TXTATR_NOLINEBREAK */ 0,
3759 /* RES_TXTATR_NOHYPHEN */ 0,
3760 /* RES_TXTATR_REFMARK*/ 0,
3761 /* RES_TXTATR_TOXMARK */ 0,
3762 /* RES_TXTATR_CHARFMT */ 0,
3763 /* RES_TXTATR_TWO_LINES */ 0,
3764 /* RES_TXTATR_CJK_RUBY */ 0,
3765 /* RES_TXTATR_UNKNOWN_CONTAINER */ 0,
3766 /* RES_TXTATR_DUMMY5 */ 0,
3767 /* RES_TXTATR_DUMMY6 */ 0,
3769 /* RES_TXTATR_FIELD */ 0,
3770 /* RES_TXTATR_FLYCNT */ 0,
3771 /* RES_TXTATR_FTN */ 0,
3772 /* RES_TXTATR_SOFTHYPH */ 0,
3773 /* RES_TXTATR_HARDBLANK*/ 0,
3774 /* RES_TXTATR_DUMMY1 */ 0, // Dummy:
3775 /* RES_TXTATR_DUMMY2 */ 0, // Dummy:
3777 /* RES_PARATR_LINESPACING */ OutCSS1_SvxLineSpacing
,
3778 /* RES_PARATR_ADJUST */ OutCSS1_SvxAdjust
,
3779 /* RES_PARATR_SPLIT */ OutCSS1_SvxFmtSplit
,
3780 /* RES_PARATR_WIDOWS */ OutCSS1_SvxWidows
,
3781 /* RES_PARATR_ORPHANS */ OutCSS1_SvxOrphans
,
3782 /* RES_PARATR_TABSTOP */ 0,
3783 /* RES_PARATR_HYPHENZONE*/ 0,
3784 /* RES_PARATR_DROP */ OutCSS1_SwFmtDrop
,
3785 /* RES_PARATR_REGISTER */ 0, // neu: Registerhaltigkeit
3786 /* RES_PARATR_NUMRULE */ 0, // Dummy:
3787 /* RES_PARATR_SCRIPTSPACE */ 0, // Dummy:
3788 /* RES_PARATR_HANGINGPUNCTUATION */ 0, // Dummy:
3789 /* RES_PARATR_FORBIDDEN_RULES */ 0, // new
3790 /* RES_PARATR_VERTALIGN */ 0, // new
3791 /* RES_PARATR_SNAPTOGRID*/ 0, // new
3792 /* RES_PARATR_CONNECT_TO_BORDER */ 0, // new
3793 /* RES_PARATR_OUTLINELEVEL */ 0, // new since cws outlinelevel
3795 /* RES_PARATR_LIST_ID */ 0, // new
3796 /* RES_PARATR_LIST_LEVEL */ 0, // new
3797 /* RES_PARATR_LIST_ISRESTART */ 0, // new
3798 /* RES_PARATR_LIST_RESTARTVALUE */ 0, // new
3799 /* RES_PARATR_LIST_ISCOUNTED */ 0, // new
3801 /* RES_FILL_ORDER */ 0,
3802 /* RES_FRM_SIZE */ 0,
3803 /* RES_PAPER_BIN */ 0,
3804 /* RES_LR_SPACE */ OutCSS1_SvxLRSpace
,
3805 /* RES_UL_SPACE */ OutCSS1_SvxULSpace
,
3806 /* RES_PAGEDESC */ 0,
3813 /* RES_PROTECT */ 0,
3814 /* RES_SURROUND */ 0,
3815 /* RES_VERT_ORIENT */ 0,
3816 /* RES_HORI_ORIENT */ 0,
3818 /* RES_BACKGROUND */ OutCSS1_SvxBrush
,
3819 /* RES_BOX */ OutCSS1_SvxBox
,
3821 /* RES_FRMMACRO */ 0,
3825 /* RES_EDIT_IN_READONLY */ 0,
3826 /* RES_LAYOUT_SPLIT */ 0,
3828 /* RES_TEXTGRID */ 0,
3829 /* RES_LINENUMBER */ 0,
3830 /* RES_FTN_AT_TXTEND */ 0,
3831 /* RES_END_AT_TXTEND */ 0,
3832 /* RES_COLUMNBALANCE */ 0,
3833 /* RES_FRAMEDIR */ OutCSS1_SvxFrameDirection
,
3834 /* RES_HEADER_FOOTER_EAT_SPACING */ 0,
3835 /* RES_FRMATR_DUMMY9 */ 0, // Dummy:
3836 /* RES_FOLLOW_TEXT_FLOW */ 0,
3837 /* RES_WRAP_INFLUENCE_ON_OBJPOS */ 0,
3838 /* RES_FRMATR_DUMMY2 */ 0, // Dummy:
3839 /* RES_AUTO_STYLE */ 0, // Dummy:
3840 /* RES_FRMATR_DUMMY4 */ 0, // Dummy:
3841 /* RES_FRMATR_DUMMY5 */ 0, // Dummy:
3843 /* RES_GRFATR_MIRRORGRF */ 0,
3844 /* RES_GRFATR_CROPGRF */ 0,
3845 /* RES_GRFATR_ROTATION */ 0,
3846 /* RES_GRFATR_LUMINANCE */ 0,
3847 /* RES_GRFATR_CONTRAST */ 0,
3848 /* RES_GRFATR_CHANNELR */ 0,
3849 /* RES_GRFATR_CHANNELG */ 0,
3850 /* RES_GRFATR_CHANNELB */ 0,
3851 /* RES_GRFATR_GAMMA */ 0,
3852 /* RES_GRFATR_INVERT */ 0,
3853 /* RES_GRFATR_TRANSPARENCY */ 0,
3854 /* RES_GRFATR_DRWAMODE */ 0,
3855 /* RES_GRFATR_DUMMY1 */ 0,
3856 /* RES_GRFATR_DUMMY2 */ 0,
3857 /* RES_GRFATR_DUMMY3 */ 0,
3858 /* RES_GRFATR_DUMMY4 */ 0,
3859 /* RES_GRFATR_DUMMY5 */ 0,
3861 /* RES_BOXATR_FORMAT */ 0,
3862 /* RES_BOXATR_FORMULA */ 0,
3863 /* RES_BOXATR_VALUE */ 0