[Libreoffice-commits] core.git: 18 commits - include/svtools svtools/CppunitTest_svtools_html.mk svtools/Library_svt.mk svtools/Module_svtools.mk svtools/qa svtools/source sw/Library_sw.mk sw/source
Tomaž Vajngerl
tomaz.vajngerl at collabora.com
Sun Apr 6 13:02:55 PDT 2014
include/svtools/HtmlWriter.hxx | 45
include/svtools/htmlout.hxx | 7
svtools/CppunitTest_svtools_html.mk | 33
svtools/Library_svt.mk | 1
svtools/Module_svtools.mk | 4
svtools/qa/unit/testHtmlWriter.cxx | 169 +++
svtools/source/svhtml/HtmlWriter.cxx | 122 ++
svtools/source/svhtml/htmlout.cxx | 38
sw/Library_sw.mk | 6
sw/source/filter/html/css1atr.cxx | 37
sw/source/filter/html/css1kywd.cxx | 328 ++---
sw/source/filter/html/css1kywd.hxx | 327 ++---
sw/source/filter/html/htmlatr.cxx | 203 +--
sw/source/filter/html/htmldraw.cxx | 844 ---------------
sw/source/filter/html/htmldrawreader.cxx | 591 ++++++++++
sw/source/filter/html/htmldrawwriter.cxx | 310 +++++
sw/source/filter/html/htmlfly.cxx | 1671 ------------------------------
sw/source/filter/html/htmlflywriter.cxx | 1705 +++++++++++++++++++++++++++++++
sw/source/filter/html/htmlnum.cxx | 873 ---------------
sw/source/filter/html/htmlnum.hxx | 5
sw/source/filter/html/htmlnumreader.cxx | 618 +++++++++++
sw/source/filter/html/htmlnumwriter.cxx | 315 +++++
sw/source/filter/html/wrthtml.cxx | 62 -
sw/source/filter/html/wrthtml.hxx | 57 -
24 files changed, 4462 insertions(+), 3909 deletions(-)
New commits:
commit 9dc6182766b7d311069da57ce693a64e49612771
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Apr 6 18:56:36 2014 +0200
html: "using namespace css" missing
Change-Id: I06d0b77b374be004bf417480e5cc59c73e21bf60
diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx
index f3bb026..15fcdb9 100644
--- a/sw/source/filter/html/htmlfly.cxx
+++ b/sw/source/filter/html/htmlfly.cxx
@@ -33,6 +33,8 @@
#include "doc.hxx"
#include "frmfmt.hxx"
+using namespace css;
+
SwHTMLPosFlyFrm::SwHTMLPosFlyFrm( const SwPosFlyFrm& rPosFly,
const SdrObject *pSdrObj,
sal_uInt8 nOutMode ) :
commit 566c8c4de38cd21fb0308cc86f87c01d996f51ed
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Mar 16 22:33:54 2014 +0100
sw html: cleanup htmlatr
Change-Id: I502c63995b053be9535886c5565dc9d07e14bc57
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 6d2d794..5f2b3d2 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -1071,14 +1071,14 @@ HTMLSttEndPos::~HTMLSttEndPos()
typedef std::vector<HTMLSttEndPos *> _HTMLEndLst;
-enum HTMLOnOffState { HTML_NOT_SUPPORTED, // nicht unterst. Attribut
- HTML_REAL_VALUE, // Attribut mit Wert
- HTML_ON_VALUE, // Attribut entspricht On-Tag
- HTML_OFF_VALUE, // Attribut entspricht Off-Tag
- HTML_CHRFMT_VALUE, // Attribut fuer Zeichenvorlage
- HTML_COLOR_VALUE, // Attribut fuer Vordergrundfarbe
- HTML_STYLE_VALUE, // Attribut muss als Style exp.
- HTML_DROPCAP_VALUE, // DropCap-Attributs
+enum HTMLOnOffState { HTML_NOT_SUPPORTED, // unsupported Attribute
+ HTML_REAL_VALUE, // Attribute with value
+ HTML_ON_VALUE, // Attribute is On-Tag
+ HTML_OFF_VALUE, // Attribute is Off-Tag
+ HTML_CHRFMT_VALUE, // Attribute for character format
+ HTML_COLOR_VALUE, // Attribute for forground color
+ HTML_STYLE_VALUE, // Attribute must be exported as style
+ HTML_DROPCAP_VALUE, // DropCap-Attribute
HTML_AUTOFMT_VALUE }; // Attribute for automatic character styles
class HTMLEndPosLst
@@ -1426,7 +1426,7 @@ sal_Bool HTMLEndPosLst::ExistsOffTagItem( sal_uInt16 nWhich, sal_Int32 nStartPos
// das Attribut beginnt vor oder an der aktuellen Position
// und endet hinter ihr
const SfxPoolItem *pItem = pTest->GetItem();
- sal_uInt16 nTstWhich = pItem->Which() ;
+ sal_uInt16 nTstWhich = pItem->Which();
if( (nTstWhich == RES_CHRATR_CROSSEDOUT ||
nTstWhich == RES_CHRATR_UNDERLINE ||
nTstWhich == RES_CHRATR_BLINK) &&
@@ -1884,10 +1884,7 @@ void HTMLEndPosLst::Insert( const SfxItemSet& rItemSet,
void HTMLEndPosLst::Insert( const SwDrawFrmFmt& rFmt, sal_Int32 nPos,
SwHTMLFmtInfos& rFmtInfos )
{
- // der Type-Cast ist nur noetig, um nicht seinetwegen
- // svdrwobt.hxx zu includem
- const SdrObject* pTextObj =
- (const SdrObject *)SwHTMLWriter::GetMarqueeTextObj( rFmt );
+ const SdrObject* pTextObj = (const SdrObject*) SwHTMLWriter::GetMarqueeTextObj( rFmt );
if( pTextObj )
{
@@ -1905,8 +1902,7 @@ void HTMLEndPosLst::Insert( const SwDrawFrmFmt& rFmt, sal_Int32 nPos,
}
}
-sal_uInt16 HTMLEndPosLst::GetScriptAtPos( sal_Int32 nPos ,
- sal_uInt16 nWeak )
+sal_uInt16 HTMLEndPosLst::GetScriptAtPos( sal_Int32 nPos, sal_uInt16 nWeak )
{
sal_uInt16 nRet = CSS1_OUTMODE_ANY_SCRIPT;
@@ -2153,12 +2149,12 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
// Bookmarks oder absatzgebundene Grafiken aber schon.
// MIB 21.7.97: Ausserdem auch keine leeren Tabellen-Zellen exportieren.
if( !nEnd && (nPoolId == RES_POOLCOLL_STANDARD ||
- nPoolId == RES_POOLCOLL_TABLE ||
- nPoolId == RES_POOLCOLL_TABLE_HDLN) )
+ nPoolId == RES_POOLCOLL_TABLE ||
+ nPoolId == RES_POOLCOLL_TABLE_HDLN) )
{
// Der aktuelle Node ist leer und enthaelt Standard-Vorlage ...
const SfxPoolItem* pItem;
- const SfxItemSet *pItemSet = pNd->GetpSwAttrSet();
+ const SfxItemSet* pItemSet = pNd->GetpSwAttrSet();
if( pItemSet && pItemSet->Count() &&
SFX_ITEM_SET == pItemSet->GetItemState( RES_CHRATR_FONTSIZE, false, &pItem ) &&
40 == ((const SvxFontHeightItem *)pItem)->GetHeight() )
@@ -2168,12 +2164,11 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
const SwNode *pNextNd = rWrt.pDoc->GetNodes()[nNdPos+1];
const SwNode *pPrevNd = rWrt.pDoc->GetNodes()[nNdPos-1];
sal_Bool bStdColl = nPoolId == RES_POOLCOLL_STANDARD;
- if( ( bStdColl && (pNextNd->IsTableNode() ||
- pNextNd->IsSectionNode()) ) ||
- ( !bStdColl && pNextNd->IsEndNode() &&
- pPrevNd->IsStartNode() &&
- SwTableBoxStartNode==
- pPrevNd->GetStartNode()->GetStartNodeType() ) )
+ if( ( bStdColl && (pNextNd->IsTableNode() || pNextNd->IsSectionNode()) ) ||
+ ( !bStdColl &&
+ pNextNd->IsEndNode() &&
+ pPrevNd->IsStartNode() &&
+ SwTableBoxStartNode == pPrevNd->GetStartNode()->GetStartNodeType() ) )
{
// ... und er steht vor einer Tabelle ohne einem Bereich
rHTMLWrt.OutBookmarks();
@@ -2192,8 +2187,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
sal_Bool bPageBreakBehind = sal_False;
if( rHTMLWrt.bCfgFormFeed &&
!(rHTMLWrt.bOutTable || rHTMLWrt.bOutFlyFrame) &&
- rHTMLWrt.pStartNdIdx->GetIndex() !=
- rHTMLWrt.pCurPam->GetPoint()->nNode.GetIndex() )
+ rHTMLWrt.pStartNdIdx->GetIndex() != rHTMLWrt.pCurPam->GetPoint()->nNode.GetIndex() )
{
sal_Bool bPageBreakBefore = sal_False;
const SfxPoolItem* pItem;
@@ -2201,12 +2195,12 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
if( pItemSet )
{
- if( SFX_ITEM_SET ==
- pItemSet->GetItemState( RES_PAGEDESC, true, &pItem ) &&
+ if( SFX_ITEM_SET == pItemSet->GetItemState( RES_PAGEDESC, true, &pItem ) &&
((SwFmtPageDesc *)pItem)->GetPageDesc() )
+ {
bPageBreakBefore = sal_True;
- else if( SFX_ITEM_SET ==
- pItemSet->GetItemState( RES_BREAK, true, &pItem ) )
+ }
+ else if( SFX_ITEM_SET == pItemSet->GetItemState( RES_BREAK, true, &pItem ) )
{
switch( ((SvxFmtBreakItem *)pItem)->GetBreak() )
{
@@ -2221,7 +2215,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
bPageBreakBehind = sal_True;
break;
default:
- ;
+ break;
}
}
}
@@ -2234,16 +2228,19 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
rHTMLWrt.OutForm();
// An dem Node "verankerte" Seitenegebunde Rahmen ausgeben
- sal_Bool bFlysLeft = rHTMLWrt.OutFlyFrm( rNode.GetIndex(),
- 0, HTML_POS_PREFIX );
+ sal_Bool bFlysLeft = rHTMLWrt.OutFlyFrm( rNode.GetIndex(), 0, HTML_POS_PREFIX );
+
// An dem Node verankerte Rahmen ausgeben, die vor dem
// Absatz-Tag geschrieben werden sollen.
if( bFlysLeft )
- bFlysLeft = rHTMLWrt.OutFlyFrm( rNode.GetIndex(),
- 0, HTML_POS_BEFORE );
+ {
+ bFlysLeft = rHTMLWrt.OutFlyFrm( rNode.GetIndex(), 0, HTML_POS_BEFORE );
+ }
if( rHTMLWrt.pCurPam->GetPoint()->nNode == rHTMLWrt.pCurPam->GetMark()->nNode )
+ {
nEnd = rHTMLWrt.pCurPam->GetMark()->nContent.GetIndex();
+ }
// gibt es harte Attribute, die als Optionen geschrieben werden muessen?
rHTMLWrt.bTagOn = sal_True;
commit af04f766b09151b5f291daa78b37b666fd6b8d37
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Mar 16 22:32:41 2014 +0100
sw html: cleanup wrthtml
Change-Id: I807a2b5338c56d90a27305c113ade25baecb01de
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 56a94a2..bf8dac6 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -131,10 +131,9 @@ SwHTMLWriter::~SwHTMLWriter()
sal_uLong SwHTMLWriter::WriteStream()
{
- // neue Konfiguration setzen
SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
- // die Fontgroessen 1-7
+ // font heights 1-7
aFontHeights[0] = rHtmlOptions.GetFontSize( 0 ) * 20;
aFontHeights[1] = rHtmlOptions.GetFontSize( 1 ) * 20;
aFontHeights[2] = rHtmlOptions.GetFontSize( 2 ) * 20;
@@ -147,24 +146,23 @@ sal_uLong SwHTMLWriter::WriteStream()
// (dann auch obere und untere Absatz-Abstaende)
nExportMode = rHtmlOptions.GetExportMode();
nHTMLMode = GetHtmlMode(0);
- if( HTML_CFG_WRITER==nExportMode ||
- HTML_CFG_NS40==nExportMode )
+
+ if( HTML_CFG_WRITER == nExportMode || HTML_CFG_NS40 == nExportMode )
nHTMLMode |= HTMLMODE_BLOCK_SPACER;
- if( HTML_CFG_WRITER==nExportMode || HTML_CFG_MSIE==nExportMode )
+ if( HTML_CFG_WRITER == nExportMode || HTML_CFG_MSIE == nExportMode )
nHTMLMode |= (HTMLMODE_FLOAT_FRAME | HTMLMODE_LSPACE_IN_NUMBUL);
- if( HTML_CFG_MSIE==nExportMode )
+ if( HTML_CFG_MSIE == nExportMode )
nHTMLMode |= HTMLMODE_NBSP_IN_TABLES;
- if( HTML_CFG_WRITER==nExportMode || HTML_CFG_NS40==nExportMode ||
- HTML_CFG_MSIE==nExportMode )
- nHTMLMode |= HTMLMODE_ABS_POS_FLY|HTMLMODE_ABS_POS_DRAW;
+ if( HTML_CFG_WRITER == nExportMode || HTML_CFG_NS40 == nExportMode || HTML_CFG_MSIE == nExportMode )
+ nHTMLMode |= HTMLMODE_ABS_POS_FLY | HTMLMODE_ABS_POS_DRAW;
- if( HTML_CFG_WRITER==nExportMode )
+ if( HTML_CFG_WRITER == nExportMode )
nHTMLMode |= HTMLMODE_FLY_MARGINS;
- if( HTML_CFG_NS40==nExportMode )
+ if( HTML_CFG_NS40 == nExportMode )
nHTMLMode |= HTMLMODE_BORDER_NONE;
nHTMLMode |= HTMLMODE_FONT_GENERIC;
@@ -172,9 +170,8 @@ sal_uLong SwHTMLWriter::WriteStream()
if( HTML_CFG_NS40==nExportMode )
nHTMLMode |= HTMLMODE_NO_CONTROL_CENTERING;
- bCfgOutStyles = IsHTMLMode(HTMLMODE_SOME_STYLES |
- HTMLMODE_FULL_STYLES);
- bCfgNetscape4 = (HTML_CFG_NS40==nExportMode);
+ bCfgOutStyles = IsHTMLMode(HTMLMODE_SOME_STYLES | HTMLMODE_FULL_STYLES);
+ bCfgNetscape4 = (HTML_CFG_NS40 == nExportMode);
if( IsHTMLMode(HTMLMODE_SOME_STYLES | HTMLMODE_FULL_STYLES) )
nHTMLMode |= HTMLMODE_PRINT_EXT;
@@ -190,14 +187,12 @@ sal_uLong SwHTMLWriter::WriteStream()
eCSS1Unit = (FieldUnit)SW_MOD()->GetMetric( pDoc->get(IDocumentSettingAccess::HTML_MODE) );
sal_Bool bWriteUTF8 = bWriteClipboardDoc;
- eDestEnc = bWriteUTF8 ? RTL_TEXTENCODING_UTF8
- : rHtmlOptions.GetTextEncoding();
- const sal_Char *pCharSet =
- rtl_getBestMimeCharsetFromTextEncoding( eDestEnc );
+ eDestEnc = bWriteUTF8 ? RTL_TEXTENCODING_UTF8 : rHtmlOptions.GetTextEncoding();
+ const sal_Char *pCharSet = rtl_getBestMimeCharsetFromTextEncoding( eDestEnc );
eDestEnc = rtl_getTextEncodingFromMimeCharset( pCharSet );
// Nur noch fuer den MS-IE ziehen wir den Export von Styles vor.
- bCfgPreferStyles = HTML_CFG_MSIE==nExportMode;
+ bCfgPreferStyles = HTML_CFG_MSIE == nExportMode;
bCfgStarBasic = rHtmlOptions.IsStarBasic();
commit c30cf5a3d7902018b0a752fa2060b8f2a2caafc2
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Mar 16 20:59:11 2014 +0100
sw html: use HtmlWriter in htmlatr in some places
Change-Id: I98369729df0298d05a683cdfc1aa1584187206a7
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 9bd329d..6d2d794 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -74,6 +74,8 @@
#include <numrule.hxx>
#include <rtl/strbuf.hxx>
+#include <svtools/HtmlWriter.hxx>
+
#include <boost/scoped_ptr.hpp>
using namespace css;
@@ -784,14 +786,11 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
// ggf ein List-Item aufmachen
if( rInfo.bInNumBulList && bNumbered )
{
- OString sOut = "<" + OString(OOO_STRING_SVTOOLS_HTML_li);
+ HtmlWriter html(rWrt.Strm());
+ html.start(OOO_STRING_SVTOOLS_HTML_li);
if( USHRT_MAX != nNumStart )
- {
- sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_value) + "=\"" +
- OString::number(static_cast<sal_Int32>(nNumStart)) + "=\"";
- }
- sOut += ">";
- rWrt.Strm().WriteOString( sOut );
+ html.attribute(OOO_STRING_SVTOOLS_HTML_O_value, OString::number(nNumStart));
+ html.endAttribute();
}
if( rHWrt.nDefListLvl > 0 && !bForceDL )
@@ -2050,14 +2049,15 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
SwHTMLWriter & rHTMLWrt = (SwHTMLWriter&)rWrt;
const OUString& rStr = pNd->GetTxt();
- sal_Int32 nEnde = rStr.getLength();
+ sal_Int32 nEnd = rStr.getLength();
// Besonderheit: leere Node und HR-Vorlage (horizontaler Strich)
// nur ein <HR> ausgeben
sal_uInt16 nPoolId = pNd->GetAnyFmtColl().GetPoolFmtId();
- if( !nEnde && (RES_POOLCOLL_HTML_HR==nPoolId ||
- pNd->GetAnyFmtColl().GetName() == OOO_STRING_SVTOOLS_HTML_horzrule) )
+ // Handle horizontal rule <hr>
+ if (!nEnd &&
+ (RES_POOLCOLL_HTML_HR==nPoolId || pNd->GetAnyFmtColl().GetName() == OOO_STRING_SVTOOLS_HTML_horzrule))
{
// dann die absatz-gebundenen Grafiken/OLE-Objekte im Absatz
// MIB 8.7.97: Ein <PRE> spannen wir um die Linie auf. Dann stimmen
@@ -2073,12 +2073,13 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
rHTMLWrt.bLFPossible = sal_True;
- OString sOut = "<" + OString(OOO_STRING_SVTOOLS_HTML_horzrule);
+ HtmlWriter aHtml(rWrt.Strm());
+ aHtml.start(OOO_STRING_SVTOOLS_HTML_horzrule);
const SfxItemSet* pItemSet = pNd->GetpSwAttrSet();
if( !pItemSet )
{
- rWrt.Strm().WriteOString( sOut ).WriteChar( '>' );
+ aHtml.endAttribute();
return rHTMLWrt;
}
const SfxPoolItem* pItem;
@@ -2109,25 +2110,18 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
nPageWidth = pBox->GetFrmFmt()->GetFrmSize().GetWidth();
}
- sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_width) + "=\"";
- rWrt.Strm().WriteOString( sOut );
- rWrt.OutULong( rHTMLWrt.ToPixel(nPageWidth-nLeft-nRight,false) ).WriteCharPtr( "\"" );
-
- sOut = " " + OString(OOO_STRING_SVTOOLS_HTML_O_align) + "=\"";
-
- const sal_Char* pStr = 0;
+ OString sWidth = OString::number(rHTMLWrt.ToPixel(nPageWidth - nLeft - nRight, false));
+ aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_width, sWidth);
if( !nLeft )
- pStr = OOO_STRING_SVTOOLS_HTML_AL_left;
+ aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_align, OOO_STRING_SVTOOLS_HTML_AL_left);
else if( !nRight )
- pStr = OOO_STRING_SVTOOLS_HTML_AL_right;
+ aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_align, OOO_STRING_SVTOOLS_HTML_AL_right);
else
- pStr = OOO_STRING_SVTOOLS_HTML_AL_center;
-
- sOut += OString(pStr) + "\"";
+ aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_align, OOO_STRING_SVTOOLS_HTML_AL_center);
}
}
- rWrt.Strm().WriteOString( sOut );
+
if( SFX_ITEM_SET == pItemSet->GetItemState( RES_BOX, false, &pItem ))
{
const SvxBoxItem* pBoxItem = (const SvxBoxItem*)pItem;
@@ -2135,27 +2129,22 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
if( pBorderLine )
{
sal_uInt16 nWidth = pBorderLine->GetScaledWidth();
- sOut = " " + OString(OOO_STRING_SVTOOLS_HTML_O_size) + "=\"";
- rWrt.Strm().WriteOString( sOut );
- rWrt.OutULong( rHTMLWrt.ToPixel(nWidth,false) ).WriteCharPtr( "\"" );
+ OString sWidth = OString::number(rHTMLWrt.ToPixel(nWidth, false));
+ aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_size, sWidth);
const Color& rBorderColor = pBorderLine->GetColor();
if( !rBorderColor.IsRGBEqual( Color(COL_GRAY) ) )
{
- sOut = " " + OString(OOO_STRING_SVTOOLS_HTML_O_color) + "=";
- rWrt.Strm().WriteOString( sOut );
- HTMLOutFuncs::Out_Color( rWrt.Strm(), rBorderColor,
- rHTMLWrt.eDestEnc );
+ HtmlWriterHelper::applyColor(aHtml, OOO_STRING_SVTOOLS_HTML_O_color, rBorderColor);
}
if( !pBorderLine->GetInWidth() )
{
- sOut = " " + OString(OOO_STRING_SVTOOLS_HTML_O_noshade);
- rWrt.Strm().WriteOString( sOut );
+ aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_noshade, OOO_STRING_SVTOOLS_HTML_O_noshade);
}
}
}
- rWrt.Strm().WriteChar( '>' );
+ aHtml.end();
return rHTMLWrt;
}
@@ -2163,7 +2152,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
// vor Tabellen und Bereichen eingefuegt werden, nicht exportieren,
// Bookmarks oder absatzgebundene Grafiken aber schon.
// MIB 21.7.97: Ausserdem auch keine leeren Tabellen-Zellen exportieren.
- if( !nEnde && (nPoolId == RES_POOLCOLL_STANDARD ||
+ if( !nEnd && (nPoolId == RES_POOLCOLL_STANDARD ||
nPoolId == RES_POOLCOLL_TABLE ||
nPoolId == RES_POOLCOLL_TABLE_HDLN) )
{
@@ -2254,7 +2243,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
0, HTML_POS_BEFORE );
if( rHTMLWrt.pCurPam->GetPoint()->nNode == rHTMLWrt.pCurPam->GetMark()->nNode )
- nEnde = rHTMLWrt.pCurPam->GetMark()->nContent.GetIndex();
+ nEnd = rHTMLWrt.pCurPam->GetMark()->nContent.GetIndex();
// gibt es harte Attribute, die als Optionen geschrieben werden muessen?
rHTMLWrt.bTagOn = sal_True;
@@ -2314,7 +2303,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
rHTMLWrt.aScriptTextStyles );
if( aFmtInfo.pItemSet )
{
- aEndPosLst.Insert( *aFmtInfo.pItemSet, 0, nEnde + nOffset,
+ aEndPosLst.Insert( *aFmtInfo.pItemSet, 0, nEnd + nOffset,
rHTMLWrt.aChrFmtInfos, sal_False, sal_True );
}
@@ -2378,7 +2367,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
else
{
sal_Int32 nTmpStt = nHtStt < nStrPos ? nStrPos : nHtStt;
- sal_Int32 nTmpEnd = nHtEnd < nEnde ? nHtEnd : nEnde;
+ sal_Int32 nTmpEnd = nHtEnd < nEnd ? nHtEnd : nEnd;
aEndPosLst.Insert( pHt->GetAttr(), nTmpStt + nOffset,
nTmpEnd + nOffset,
rHTMLWrt.aChrFmtInfos );
@@ -2403,7 +2392,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
HTMLOutContext aContext( rHTMLWrt.eDestEnc );
sal_Int32 nPreSplitPos = 0;
- for( ; nStrPos < nEnde; nStrPos++ )
+ for( ; nStrPos < nEnd; nStrPos++ )
{
// Die an der aktuellen Position verankerten Rahmen ausgeben
if( bFlysLeft )
@@ -2417,7 +2406,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
sal_Bool bOutChar = sal_True;
const SwTxtAttr * pTxtHt = 0;
if( nAttrPos < nCntAttr && *pHt->GetStart() == nStrPos
- && nStrPos != nEnde )
+ && nStrPos != nEnd )
{
do {
if ( pHt->End() && !pHt->HasDummyChar() )
@@ -2489,7 +2478,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
{
// #i120442#: get the UTF-32 codepoint by converting an eventual UTF-16 unicode surrogate pair
sal_uInt64 c = rStr[nStrPos];
- if( nStrPos < nEnde - 1 )
+ if( nStrPos < nEnd - 1 )
{
const sal_Unicode d = rStr[nStrPos + 1];
if( (c >= 0xd800 && c <= 0xdbff) && (d >= 0xdc00 && d <= 0xdfff) )
@@ -2513,7 +2502,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
sal_Int32 nWordLen = rStr.indexOf( ' ', nStrPos+1 );
if( nWordLen == -1 )
- nWordLen = nEnde;
+ nWordLen = nEnd;
nWordLen -= nStrPos;
if( nLineLen >= rHTMLWrt.nWhishLineLen ||
@@ -2561,7 +2550,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
// Die an der letzten Position verankerten Rahmen ausgeben
if( bFlysLeft )
bFlysLeft = rHTMLWrt.OutFlyFrm( rNode.GetIndex(),
- nEnde, HTML_POS_INSIDE );
+ nEnd, HTML_POS_INSIDE );
OSL_ENSURE( !bFlysLeft, "Es wurden nicht alle Rahmen gespeichert!" );
rHTMLWrt.bTxtAttr = sal_False;
@@ -2572,7 +2561,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
rWrt.pCurPam->GetPoint()->nNode.GetIndex() ==
rWrt.pCurPam->GetMark()->nNode.GetIndex();
- if( bEndOfCell && !nEnde &&
+ if( bEndOfCell && !nEnd &&
rHTMLWrt.IsHTMLMode(HTMLMODE_NBSP_IN_TABLES) )
{
// Wenn der letzte Absatz einer Tabellezelle leer ist und
@@ -2582,32 +2571,38 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
}
else
{
- HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_linebreak );
- const SvxULSpaceItem& rULSpace =
- (const SvxULSpaceItem &)pNd->GetSwAttrSet().Get(RES_UL_SPACE);
- if( rULSpace.GetLower() > 0 && !bEndOfCell &&
+ HtmlWriter aHtml(rHTMLWrt.Strm());
+ aHtml.single(OOO_STRING_SVTOOLS_HTML_linebreak);
+ const SvxULSpaceItem& rULSpace = (const SvxULSpaceItem&) pNd->GetSwAttrSet().Get(RES_UL_SPACE);
+ if (rULSpace.GetLower() > 0 &&
+ !bEndOfCell &&
!rHTMLWrt.IsHTMLMode(HTMLMODE_NO_BR_AT_PAREND) )
- HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_linebreak );
+ {
+ aHtml.single(OOO_STRING_SVTOOLS_HTML_linebreak);
+ }
rHTMLWrt.bLFPossible = sal_True;
}
}
if( rHTMLWrt.bClearLeft || rHTMLWrt.bClearRight )
{
- const sal_Char *pStr;
+ const sal_Char* pString;
if( rHTMLWrt.bClearLeft )
{
if( rHTMLWrt.bClearRight )
- pStr = OOO_STRING_SVTOOLS_HTML_AL_all;
+ pString = OOO_STRING_SVTOOLS_HTML_AL_all;
else
- pStr = OOO_STRING_SVTOOLS_HTML_AL_left;
+ pString = OOO_STRING_SVTOOLS_HTML_AL_left;
}
else
- pStr = OOO_STRING_SVTOOLS_HTML_AL_right;
+ {
+ pString = OOO_STRING_SVTOOLS_HTML_AL_right;
+ }
- OString sOut = OString(OOO_STRING_SVTOOLS_HTML_linebreak) + " " +
- OString(OOO_STRING_SVTOOLS_HTML_O_clear) + "=" + OString(pStr) + "\"";
- HTMLOutFuncs::Out_AsciiTag( rHTMLWrt.Strm(), sOut.getStr() );
+ HtmlWriter aHtml(rHTMLWrt.Strm());
+ aHtml.start(OOO_STRING_SVTOOLS_HTML_linebreak);
+ aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_clear, pString);
+ aHtml.end();
rHTMLWrt.bClearLeft = sal_False;
rHTMLWrt.bClearRight = sal_False;
@@ -2618,7 +2613,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
// wenn ein LF nicht schon erlaubt ist wird es erlaubt, wenn der
// Absatz mit einem ' ' endet
if( !rHTMLWrt.bLFPossible && !rHTMLWrt.nLastParaToken &&
- nEnde > 0 && ' ' == rStr[nEnde-1] )
+ nEnd > 0 && ' ' == rStr[nEnd-1] )
rHTMLWrt.bLFPossible = sal_True;
rHTMLWrt.bTagOn = sal_False;
commit 58f8e286e9a7411ab852d74b9cba9cd2b693f2e8
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Mar 16 20:57:51 2014 +0100
Add HtmlWriterHelper to svtools.
Change-Id: I4d96402cc0fa86d83fe0ade314b84bff86d7db97
diff --git a/include/svtools/htmlout.hxx b/include/svtools/htmlout.hxx
index 9ae7f19..dd3b245 100644
--- a/include/svtools/htmlout.hxx
+++ b/include/svtools/htmlout.hxx
@@ -26,6 +26,8 @@
#include <rtl/string.hxx>
#include <svl/macitem.hxx>
+#include "HtmlWriter.hxx"
+
class Color;
class ImageMap;
class SvStream;
@@ -104,6 +106,11 @@ struct HTMLOutFuncs
OUString *pNonConvertableChars = 0);
};
+struct HtmlWriterHelper
+{
+ SVT_DLLPUBLIC static void applyColor( HtmlWriter& rHtmlWriter, OString aAttributeName, const Color& rColor);
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index 00b7b52..1a675cf 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -32,6 +32,8 @@
#include <svtools/imappoly.hxx>
#include "svl/urihelper.hxx"
+#include <sstream>
+
#define TXTCONV_BUFFER_SIZE 20
HTMLOutContext::HTMLOutContext( rtl_TextEncoding eDestEnc )
@@ -975,4 +977,28 @@ OString HTMLOutFuncs::CreateTableDataOptionsValNum(
return aStrTD.makeStringAndClear();
}
+void HtmlWriterHelper::applyColor(HtmlWriter& rHtmlWriter, OString aAttributeName, const Color& rColor)
+{
+ OStringBuffer sBuffer;
+
+ if( rColor.GetColor() == COL_AUTO )
+ {
+ sBuffer.append("#000000");
+ }
+ else
+ {
+ sBuffer.append('#');
+ std::ostringstream sStringStream;
+ sStringStream
+ << std::right
+ << std::setfill('0')
+ << std::setw(6)
+ << std::hex
+ << rColor.GetRGBColor();
+ sBuffer.append(sStringStream.str().c_str());
+ }
+
+ rHtmlWriter.attribute(aAttributeName, sBuffer.makeStringAndClear());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit c7b69624eec1329113630e308170346fce2be823
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Mar 16 20:53:44 2014 +0100
Introduce HtmlWriter unit tests.
Change-Id: Icb39dde433124d444c48761e074f6b839a043d4e
diff --git a/svtools/CppunitTest_svtools_html.mk b/svtools/CppunitTest_svtools_html.mk
new file mode 100644
index 0000000..e436b6d
--- /dev/null
+++ b/svtools/CppunitTest_svtools_html.mk
@@ -0,0 +1,33 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,svtools_html))
+
+$(eval $(call gb_CppunitTest_use_external,svtools_html,boost_headers))
+
+$(eval $(call gb_CppunitTest_use_api,svtools_html, \
+ offapi \
+ udkapi \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,svtools_html, \
+ svtools/qa/unit/testHtmlWriter \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,svtools_html, \
+ comphelper \
+ cppu \
+ cppuhelper \
+ tl \
+ sal \
+ svt \
+ $(gb_UWINAPI) \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/svtools/Module_svtools.mk b/svtools/Module_svtools.mk
index 1e0f72c..3a2784c 100644
--- a/svtools/Module_svtools.mk
+++ b/svtools/Module_svtools.mk
@@ -28,6 +28,10 @@ $(eval $(call gb_Module_add_l10n_targets,svtools,\
UIConfig_svt \
))
+$(eval $(call gb_Module_add_check_targets,svtools,\
+ CppunitTest_svtools_html \
+))
+
ifeq ($(CROSS_COMPILING),)
ifneq ($(OS),WNT)
diff --git a/svtools/qa/unit/testHtmlWriter.cxx b/svtools/qa/unit/testHtmlWriter.cxx
new file mode 100644
index 0000000..78548b3
--- /dev/null
+++ b/svtools/qa/unit/testHtmlWriter.cxx
@@ -0,0 +1,169 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include "cppunit/TestCase.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/TestSuite.h"
+#include "cppunit/extensions/HelperMacros.h"
+#include "cppunit/plugin/TestPlugIn.h"
+
+#include <tools/stream.hxx>
+#include <svtools/HtmlWriter.hxx>
+
+namespace
+{
+
+OString extractFromStream(SvMemoryStream& rStream)
+{
+ rStream.WriteChar('\0');
+ rStream.Flush();
+ rStream.Seek(STREAM_SEEK_TO_BEGIN);
+ return OString((const sal_Char*)rStream.GetBuffer());
+}
+
+}
+
+class Test: public CppUnit::TestFixture
+{
+
+public:
+ virtual void setUp();
+ void testSingleElement();
+ void testSingleElementWithAttributes();
+ void testSingleElementWithContent();
+ void testSingleElementWithContentAndAttributes();
+ void testNested();
+
+ CPPUNIT_TEST_SUITE(Test);
+ CPPUNIT_TEST(testSingleElement);
+ CPPUNIT_TEST(testSingleElementWithAttributes);
+ CPPUNIT_TEST(testSingleElementWithContent);
+ CPPUNIT_TEST(testSingleElementWithContentAndAttributes);
+ CPPUNIT_TEST(testNested);
+
+ CPPUNIT_TEST_SUITE_END();
+};
+
+void Test::setUp()
+{}
+
+void Test::testSingleElement()
+{
+ {
+ SvMemoryStream aStream;
+
+ HtmlWriter aHtml(aStream);
+ aHtml.prettyPrint(false);
+ aHtml.start("abc");
+ aHtml.end();
+
+ OString aString = extractFromStream(aStream);
+ CPPUNIT_ASSERT_EQUAL(aString, OString("<abc/>"));
+ }
+
+ {
+ SvMemoryStream aStream;
+
+ HtmlWriter aHtml(aStream);
+ aHtml.prettyPrint(false);
+ aHtml.single("abc");
+
+ OString aString = extractFromStream(aStream);
+
+ CPPUNIT_ASSERT_EQUAL(aString, OString("<abc/>"));
+ }
+}
+
+void Test::testSingleElementWithAttributes()
+{
+ {
+ SvMemoryStream aStream;
+
+ HtmlWriter aHtml(aStream);
+ aHtml.prettyPrint(false);
+ aHtml.start("abc");
+ aHtml.attribute("x", "y");
+ aHtml.end();
+
+ OString aString = extractFromStream(aStream);
+
+ CPPUNIT_ASSERT_EQUAL(aString, OString("<abc x=\"y\"/>"));
+ }
+
+ {
+ SvMemoryStream aStream;
+
+ HtmlWriter aHtml(aStream);
+ aHtml.prettyPrint(false);
+ aHtml.start("abc");
+ aHtml.attribute("x", "y");
+ aHtml.attribute("q", "w");
+ aHtml.end();
+
+ OString aString = extractFromStream(aStream);
+
+ CPPUNIT_ASSERT_EQUAL(aString, OString("<abc x=\"y\" q=\"w\"/>"));
+ }
+}
+
+void Test::testSingleElementWithContent()
+{
+ SvMemoryStream aStream;
+
+ HtmlWriter aHtml(aStream);
+ aHtml.prettyPrint(false);
+ aHtml.start("abc");
+ aHtml.write("xxxx");
+ aHtml.end();
+
+ OString aString = extractFromStream(aStream);
+
+ CPPUNIT_ASSERT_EQUAL(aString, OString("<abc>xxxx</abc>"));
+}
+
+void Test::testSingleElementWithContentAndAttributes()
+{
+ SvMemoryStream aStream;
+
+ HtmlWriter aHtml(aStream);
+ aHtml.prettyPrint(false);
+ aHtml.start("abc");
+ aHtml.attribute("x", "y");
+ aHtml.attribute("q", "w");
+ aHtml.write("xxxx");
+ aHtml.end();
+
+ OString aString = extractFromStream(aStream);
+
+ CPPUNIT_ASSERT_EQUAL(aString, OString("<abc x=\"y\" q=\"w\">xxxx</abc>"));
+}
+
+void Test::testNested()
+{
+ SvMemoryStream aStream;
+
+ HtmlWriter aHtml(aStream);
+ aHtml.prettyPrint(false);
+ aHtml.start("abc");
+ aHtml.start("xyz");
+ aHtml.write("xxx");
+ aHtml.end();
+ aHtml.end();
+
+ OString aString = extractFromStream(aStream);
+
+ CPPUNIT_ASSERT_EQUAL(OString("<abc><xyz>xxx</xyz></abc>"), aString);
+}
+
+
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 2480ded80ed3b6e75d4cfb92dbe003000a685820
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Mar 16 20:50:27 2014 +0100
HtmlWriter: add prettyPrint option, instance variables
Change-Id: I6a29e91cc2f328ccbd01b617b39dc9275332d1f0
diff --git a/include/svtools/HtmlWriter.hxx b/include/svtools/HtmlWriter.hxx
index 7bcb238..acfeb65 100644
--- a/include/svtools/HtmlWriter.hxx
+++ b/include/svtools/HtmlWriter.hxx
@@ -19,20 +19,24 @@
class SVT_DLLPUBLIC HtmlWriter
{
private:
- std::vector<OString> mElementStack;
- SvStream& mStream;
+ std::vector<OString> maElementStack;
+ SvStream& mrStream;
- bool mElementOpen;
- bool mContentWritten;
+ bool mbElementOpen;
+ bool mbContentWritten;
+ bool mbPrettyPrint;
public:
HtmlWriter(SvStream& rStream);
virtual ~HtmlWriter();
+ void prettyPrint(bool bChoice);
+
void start(OString aElement);
void end();
void write(OString aContent);
void attribute(OString aAttribute, OString aValue);
+ void single(OString aContent);
void endAttribute();
};
diff --git a/svtools/source/svhtml/HtmlWriter.cxx b/svtools/source/svhtml/HtmlWriter.cxx
index 36a3a4f..e107bee 100644
--- a/svtools/source/svhtml/HtmlWriter.cxx
+++ b/svtools/source/svhtml/HtmlWriter.cxx
@@ -11,89 +11,110 @@
#include <svtools/HtmlWriter.hxx>
HtmlWriter::HtmlWriter(SvStream& rStream) :
- mStream(rStream),
- mElementOpen(false),
- mContentWritten(false)
+ mrStream(rStream),
+ mbElementOpen(false),
+ mbContentWritten(false),
+ mbPrettyPrint(true)
{}
HtmlWriter::~HtmlWriter()
{}
+void HtmlWriter::prettyPrint(bool bChoice)
+{
+ mbPrettyPrint = bChoice;
+}
+
void HtmlWriter::start(OString aElement)
{
- if (mElementOpen)
+ if (mbElementOpen)
+ {
+ mrStream.WriteChar('>');
+ if (!mbContentWritten && mbPrettyPrint)
+ mrStream.WriteChar('\n');
+ mbContentWritten = false;
+ }
+ maElementStack.push_back(aElement);
+
+ if (mbPrettyPrint)
{
- mStream.WriteChar('>');
- if (!mContentWritten)
- mStream.WriteChar('\n');
- mContentWritten = false;
+ for(size_t i = 0; i < maElementStack.size() - 1; i++)
+ {
+ mrStream.WriteCharPtr(" ");
+ }
}
- mElementStack.push_back(aElement);
- for(size_t i = 0; i < mElementStack.size() - 1; i++)
- mStream.WriteCharPtr(" ");
+ mrStream.WriteChar('<');
+ mrStream.WriteOString(aElement);
+ mbElementOpen = true;
+}
- mStream.WriteChar('<');
- mStream.WriteOString(aElement);
- mElementOpen = true;
+void HtmlWriter::single(OString aContent)
+{
+ start(aContent);
+ end();
}
void HtmlWriter::endAttribute()
{
- if (mElementOpen)
+ if (mbElementOpen)
{
- mStream.WriteCharPtr(" />");
- mStream.WriteCharPtr("\n");
- mElementOpen = false;
+ mrStream.WriteCharPtr("/>");
+ if (mbPrettyPrint)
+ mrStream.WriteCharPtr("\n");
+ mbElementOpen = false;
}
}
void HtmlWriter::end()
{
- if (mElementOpen)
+ if (mbElementOpen)
{
- mStream.WriteCharPtr(" />");
- mStream.WriteCharPtr("\n");
+ mrStream.WriteCharPtr("/>");
+ if (mbPrettyPrint)
+ mrStream.WriteCharPtr("\n");
}
else
{
- if (!mContentWritten)
+ if (!mbContentWritten && mbPrettyPrint)
{
- for(size_t i = 0; i < mElementStack.size() - 1; i++)
+ for(size_t i = 0; i < maElementStack.size() - 1; i++)
{
- mStream.WriteCharPtr(" ");
+ mrStream.WriteCharPtr(" ");
}
}
- mStream.WriteCharPtr("</");
- mStream.WriteOString(mElementStack.back());
- mStream.WriteCharPtr(">\n");
+ mrStream.WriteCharPtr("</");
+ mrStream.WriteOString(maElementStack.back());
+ mrStream.WriteCharPtr(">");
+ if (mbPrettyPrint)
+ mrStream.WriteCharPtr("\n");
}
- mElementStack.pop_back();
- mElementOpen = false;
- mContentWritten = false;
+ maElementStack.pop_back();
+ mbElementOpen = false;
+ mbContentWritten = false;
}
void HtmlWriter::write(OString aContent)
{
- if (mElementOpen)
+ if (mbElementOpen)
{
- mStream.WriteChar('>');
- mElementOpen = false;
+ mrStream.WriteChar('>');
+ mbElementOpen = false;
}
- mContentWritten = true;
- mStream.WriteOString(aContent);
+ mbContentWritten = true;
+ mrStream.WriteOString(aContent);
}
void HtmlWriter::attribute(OString aAttribute, OString aValue)
{
- if (mElementOpen && !aAttribute.isEmpty() && !aValue.isEmpty())
+ if (mbElementOpen && !aAttribute.isEmpty() && !aValue.isEmpty())
{
- mStream.WriteChar(' ');
- mStream.WriteOString(aAttribute);
- mStream.WriteChar('=');
- mStream.WriteChar('"');
- mStream.WriteOString(aValue);
- mStream.WriteChar('"');
+ mrStream.WriteChar(' ');
+ mrStream.WriteOString(aAttribute);
+ mrStream.WriteChar('=');
+ mrStream.WriteChar('"');
+ mrStream.WriteOString(aValue);
+ mrStream.WriteChar('"');
}
}
commit ee0b9f8df684c743d17880c5b7e1e69504c27cc1
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sat Mar 15 23:15:46 2014 +0100
svtools: make HTMLOutFuncs::Out_AsciiTag clearer.
Change-Id: I89d72383a50707aa8cb958eaea916e8070cfcd82
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index c5e2a50..00b7b52 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -512,10 +512,14 @@ OString HTMLOutFuncs::ConvertStringToHTML( const OUString& rSrc,
SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, const sal_Char *pStr,
bool bOn, rtl_TextEncoding )
{
- sal_Char sStt[3] = "</";
- if( bOn )
- sStt[1] = 0;
- return (rStream.WriteCharPtr( sStt ).WriteCharPtr( pStr ).WriteChar( '>' ));
+ if(bOn)
+ rStream.WriteCharPtr("<");
+ else
+ rStream.WriteCharPtr("</");
+
+ rStream.WriteCharPtr(pStr).WriteChar('>');
+
+ return rStream;
}
SvStream& HTMLOutFuncs::Out_Char( SvStream& rStream, sal_Unicode c,
commit 96c548a7c6700cbc5206e5ea80c1eb87d349f3a3
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sat Mar 15 23:09:09 2014 +0100
svtools: HtmlWriter - for writing HTML structure to a stream
HtmlWriter is used to write the structure of a HTML document to
a stream. The goal is to abstract the messy construction of
strings when writing attributes of a html element and other
HTML specifics needed when structuring a HTML document.
Change-Id: Ibdf42914e43ef02f16a43e4230575ed7340e68d8
diff --git a/include/svtools/HtmlWriter.hxx b/include/svtools/HtmlWriter.hxx
new file mode 100644
index 0000000..7bcb238
--- /dev/null
+++ b/include/svtools/HtmlWriter.hxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#ifndef INCLUDED_HTML_HXX
+#define INCLUDED_HTML_HXX
+
+#include <rtl/string.hxx>
+#include <tools/stream.hxx>
+#include <vector>
+#include <svtools/svtdllapi.h>
+
+class SVT_DLLPUBLIC HtmlWriter
+{
+private:
+ std::vector<OString> mElementStack;
+ SvStream& mStream;
+
+ bool mElementOpen;
+ bool mContentWritten;
+
+public:
+ HtmlWriter(SvStream& rStream);
+ virtual ~HtmlWriter();
+
+ void start(OString aElement);
+ void end();
+ void write(OString aContent);
+ void attribute(OString aAttribute, OString aValue);
+ void endAttribute();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index 4762808..192f14a 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -197,6 +197,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/svhtml/htmlkywd \
svtools/source/svhtml/htmlout \
svtools/source/svhtml/htmlsupp \
+ svtools/source/svhtml/HtmlWriter \
svtools/source/svhtml/parhtml \
svtools/source/svrtf/parrtf \
svtools/source/svrtf/rtfkeywd \
diff --git a/svtools/source/svhtml/HtmlWriter.cxx b/svtools/source/svhtml/HtmlWriter.cxx
new file mode 100644
index 0000000..36a3a4f
--- /dev/null
+++ b/svtools/source/svhtml/HtmlWriter.cxx
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <svtools/HtmlWriter.hxx>
+
+HtmlWriter::HtmlWriter(SvStream& rStream) :
+ mStream(rStream),
+ mElementOpen(false),
+ mContentWritten(false)
+{}
+
+HtmlWriter::~HtmlWriter()
+{}
+
+void HtmlWriter::start(OString aElement)
+{
+ if (mElementOpen)
+ {
+ mStream.WriteChar('>');
+ if (!mContentWritten)
+ mStream.WriteChar('\n');
+ mContentWritten = false;
+ }
+ mElementStack.push_back(aElement);
+
+ for(size_t i = 0; i < mElementStack.size() - 1; i++)
+ mStream.WriteCharPtr(" ");
+
+ mStream.WriteChar('<');
+ mStream.WriteOString(aElement);
+ mElementOpen = true;
+}
+
+void HtmlWriter::endAttribute()
+{
+ if (mElementOpen)
+ {
+ mStream.WriteCharPtr(" />");
+ mStream.WriteCharPtr("\n");
+ mElementOpen = false;
+ }
+}
+
+void HtmlWriter::end()
+{
+ if (mElementOpen)
+ {
+ mStream.WriteCharPtr(" />");
+ mStream.WriteCharPtr("\n");
+ }
+ else
+ {
+ if (!mContentWritten)
+ {
+ for(size_t i = 0; i < mElementStack.size() - 1; i++)
+ {
+ mStream.WriteCharPtr(" ");
+ }
+ }
+ mStream.WriteCharPtr("</");
+ mStream.WriteOString(mElementStack.back());
+ mStream.WriteCharPtr(">\n");
+ }
+ mElementStack.pop_back();
+ mElementOpen = false;
+ mContentWritten = false;
+}
+
+void HtmlWriter::write(OString aContent)
+{
+ if (mElementOpen)
+ {
+ mStream.WriteChar('>');
+ mElementOpen = false;
+ }
+ mContentWritten = true;
+ mStream.WriteOString(aContent);
+}
+
+void HtmlWriter::attribute(OString aAttribute, OString aValue)
+{
+ if (mElementOpen && !aAttribute.isEmpty() && !aValue.isEmpty())
+ {
+ mStream.WriteChar(' ');
+ mStream.WriteOString(aAttribute);
+ mStream.WriteChar('=');
+ mStream.WriteChar('"');
+ mStream.WriteOString(aValue);
+ mStream.WriteChar('"');
+ }
+}
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 82a3eb625a846207839de7abc65ee14d3045c143
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sat Mar 15 21:29:15 2014 +0100
sw html: convert stringbuffer chaining (append) to use + operator
Change-Id: Ie828b7c290ad4b61c23bd74676c43cdff0afd257
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index e231243..56a94a2 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -521,8 +521,7 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt,
const OUString& rName = rSection.GetSectionName();
if( !rName.isEmpty() && !bContinued )
{
- sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_id).
- append("=\"");
+ sOut.append(" " + OString(OOO_STRING_SVTOOLS_HTML_O_id) + "=\"");
rHTMLWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() );
HTMLOutFuncs::Out_String( rHTMLWrt.Strm(), rName, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters );
sOut.append('\"');
@@ -534,8 +533,7 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt,
if( FILE_LINK_SECTION == rSection.GetType() )
{
- sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_href).
- append("=\"");
+ sOut.append(" " + OString(OOO_STRING_SVTOOLS_HTML_O_href) + "=\"");
rHTMLWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() );
const OUString& aFName = rSection.GetLinkFileName();
@@ -550,12 +548,11 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt,
HTMLOutFuncs::Out_String( rHTMLWrt.Strm(), aEncURL,
rHTMLWrt.eDestEnc,
&rHTMLWrt.aNonConvertableCharacters );
- const sal_Char *pDelim = "ÿ";
+ const sal_Char* pDelim = "ÿ";
if( !aFilter.isEmpty() || !aSection.isEmpty() || bURLContainsDelim )
rHTMLWrt.Strm().WriteCharPtr( pDelim );
if( !aFilter.isEmpty() )
- HTMLOutFuncs::Out_String( rHTMLWrt.Strm(), aFilter,
- rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters );
+ HTMLOutFuncs::Out_String( rHTMLWrt.Strm(), aFilter, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters );
if( !aSection.isEmpty() || bURLContainsDelim )
rHTMLWrt.Strm().WriteCharPtr( pDelim );
if( !aSection.isEmpty() )
@@ -586,11 +583,9 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt,
if( nGutter && Application::GetDefaultDevice() )
{
nGutter = (sal_uInt16)Application::GetDefaultDevice()
- ->LogicToPixel( Size(nGutter,0),
- MapMode(MAP_TWIP) ).Width();
+ ->LogicToPixel( Size(nGutter, 0), MapMode(MAP_TWIP) ).Width();
}
- sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_gutter).
- append("=\"").append(static_cast<sal_Int32>(nGutter)).append("\"");
+ sOut.append(" " + OString(OOO_STRING_SVTOOLS_HTML_O_gutter) + "=\"" + OString::number(nGutter) + "\"");
}
}
@@ -777,7 +772,7 @@ void SwHTMLWriter::Out_SwDoc( SwPaM* pPam )
}
// schreibe die StyleTabelle, algemeine Angaben,Header/Footer/Footnotes
-static void OutBodyColor( const sal_Char *pTag, const SwFmt *pFmt,
+static void OutBodyColor( const sal_Char* pTag, const SwFmt *pFmt,
SwHTMLWriter& rHWrt )
{
const SwFmt *pRefFmt = 0;
@@ -831,7 +826,7 @@ static void OutBodyColor( const sal_Char *pTag, const SwFmt *pFmt,
if( pColorItem )
{
OStringBuffer sOut;
- sOut.append(' ').append(pTag).append("=");
+ sOut.append(" " + OString(pTag) + "=");
rHWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() );
Color aColor( pColorItem->GetValue() );
if( COL_AUTO == aColor.GetColor() )
@@ -889,8 +884,7 @@ sal_uInt16 SwHTMLWriter::OutHeaderAttrs()
const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 &rHeaderAttrs )
{
OStringBuffer sOut;
- sOut.append(OOO_STRING_SVTOOLS_HTML_doctype).append(' ')
- .append(OOO_STRING_SVTOOLS_HTML_doctype40);
+ sOut.append(OString(OOO_STRING_SVTOOLS_HTML_doctype) + " " + OString(OOO_STRING_SVTOOLS_HTML_doctype40));
HTMLOutFuncs::Out_AsciiTag( Strm(), sOut.makeStringAndClear().getStr() );
// baue den Vorspann
@@ -968,7 +962,7 @@ const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 &rHeaderAttrs )
// der Body wird nicht eingerueckt, weil sonst alles eingerueckt waere!
OutNewLine();
- sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_body);
+ sOut.append("<" + OString(OOO_STRING_SVTOOLS_HTML_body));
Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() );
// language
@@ -1010,8 +1004,7 @@ const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 &rHeaderAttrs )
void SwHTMLWriter::OutAnchor( const OUString& rName )
{
OStringBuffer sOut;
- sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_anchor).append(' ')
- .append(OOO_STRING_SVTOOLS_HTML_O_name).append("=\"");
+ sOut.append("<" + OString(OOO_STRING_SVTOOLS_HTML_anchor) + " " + OString(OOO_STRING_SVTOOLS_HTML_O_name) + "=\"");
Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() );
HTMLOutFuncs::Out_String( Strm(), rName, eDestEnc, &aNonConvertableCharacters ).WriteCharPtr( "\">" );
HTMLOutFuncs::Out_AsciiTag( Strm(), OOO_STRING_SVTOOLS_HTML_anchor, false );
commit 4b22b7fbba14fdbbac7bf7552e81dfc2bdcd06c5
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sat Mar 15 18:02:04 2014 +0100
sw html: also change commented constants in css1kywd + translate
Change-Id: Ief05af37729929bb51a72ee17b941a7370c52728
diff --git a/sw/source/filter/html/css1kywd.cxx b/sw/source/filter/html/css1kywd.cxx
index e5bc4c5..cd10449 100644
--- a/sw/source/filter/html/css1kywd.cxx
+++ b/sw/source/filter/html/css1kywd.cxx
@@ -21,14 +21,10 @@
const sal_Char* sCSS_mimetype = "text/css";
-// ein par allgemeine Strings
-
const sal_Char* sCSS1_import = "import";
-// Feature: PrintExt
const sal_Char* sCSS1_page = "page";
//const sal_Char* sCSS1_media = "media";
-// /Feature: PrintExt
const sal_Char* sCSS1_important = "important";
@@ -36,11 +32,9 @@ const sal_Char* sCSS1_link = "link";
const sal_Char* sCSS1_visited = "visited";
const sal_Char* sCSS1_first_letter = "first-letter";
-// Feature: PrintExt
const sal_Char* sCSS1_left = "left";
const sal_Char* sCSS1_right = "right";
const sal_Char* sCSS1_first = "first";
-// /Feature: PrintExt
const sal_Char* sCSS1_url = "url";
const sal_Char* sCSS1_rgb = "rgb";
@@ -54,7 +48,7 @@ const sal_Char* sCSS1_UNIT_px = "px";
const sal_Char* sCSS1_UNIT_em = "em";
const sal_Char* sCSS1_UNIT_ex = "ex";
-// Strings fuer Font-Properties
+// Strings for font properties
const sal_Char* sCSS1_P_font_family = "font-family";
@@ -108,7 +102,7 @@ const sal_Char* sCSS1_PV_smaller = "smaller";
const sal_Char* sCSS1_P_font = "font";
-// Strings fuer Farb- und Hintergrund-Properties
+// Strings for color and background properties
const sal_Char* sCSS1_P_color = "color";
@@ -128,7 +122,7 @@ const sal_Char* sCSS1_PV_bottom = "bottom";
const sal_Char* sCSS1_PV_scroll = "scroll";
-// Strings fuer Text-Properties
+// Strings for text properties
const sal_Char* sCSS1_P_letter_spacing = "letter-spacing";
@@ -151,7 +145,7 @@ const sal_Char* sCSS1_P_text_indent = "text-indent";
const sal_Char* sCSS1_P_line_height = "line-height";
-// Strings fuer Box-Properties
+// Strings for box properties
const sal_Char* sCSS1_P_margin_left = "margin-left";
const sal_Char* sCSS1_P_margin_right = "margin-right";
@@ -202,7 +196,7 @@ const sal_Char* sCSS1_P_float = "float";
const sal_Char* sCSS1_P_column_count = "column-count";
-// Strings fuer Positioning
+// Strings for positioning
const sal_Char* sCSS1_P_position = "position";
@@ -214,9 +208,7 @@ const sal_Char* sCSS1_P_left = "left";
const sal_Char* sCSS1_P_top = "top";
-// Feature: PrintExt
-
-// Strings fuer Printing Extensions
+// Strings for printing extensions
const sal_Char* sCSS1_P_page_break_before = "page-break-before";
const sal_Char* sCSS1_P_page_break_after = "page-break-after";
@@ -235,8 +227,6 @@ const sal_Char* sCSS1_PV_landscape = "landscape";
//const sal_Char* sCSS1_PV_crop = "crop";
//const sal_Char* sCSS1_PV_cross = "cross";
-// /Feature: PrintExt
-
const sal_Char* sCSS1_class_abs_pos = "sd-abs-pos";
const sal_Char* sCSS1_P_so_language = "so-language";
diff --git a/sw/source/filter/html/css1kywd.hxx b/sw/source/filter/html/css1kywd.hxx
index aed4b38..38a96fc 100644
--- a/sw/source/filter/html/css1kywd.hxx
+++ b/sw/source/filter/html/css1kywd.hxx
@@ -24,8 +24,6 @@
extern const sal_Char* sCSS_mimetype;
-// ein par allgemeine Strings
-
extern const sal_Char* sCSS1_import;
extern const sal_Char* sCSS1_page;
@@ -52,7 +50,7 @@ extern const sal_Char* sCSS1_UNIT_px;
extern const sal_Char* sCSS1_UNIT_em;
extern const sal_Char* sCSS1_UNIT_ex;
-// Strings fuer Font-Properties
+// Strings for font properties
extern const sal_Char* sCSS1_P_font_family;
@@ -70,7 +68,7 @@ extern const sal_Char* sCSS1_PV_oblique;
extern const sal_Char* sCSS1_P_font_variant;
-//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_normal, "normal" );
+//extern const sal_Char* sCSS1_PV_normal;
extern const sal_Char* sCSS1_PV_small_caps;
extern const sal_Char* sCSS1_P_text_transform;
@@ -84,7 +82,7 @@ extern const sal_Char* sCSS1_P_font_weight;
extern const sal_Char* sCSS1_PV_extra_light;
extern const sal_Char* sCSS1_PV_light;
extern const sal_Char* sCSS1_PV_demi_light;
-//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_medium, "medium" );
+//extern const sal_Char* sCSS1_PV_medium;
extern const sal_Char* sCSS1_PV_demi_bold;
extern const sal_Char* sCSS1_PV_bold;
extern const sal_Char* sCSS1_PV_extra_bold;
@@ -106,7 +104,7 @@ extern const sal_Char* sCSS1_PV_smaller;
extern const sal_Char* sCSS1_P_font;
-// Strings fuer Farb- und Hintergrund-Properties
+// Strings for color and background properties
extern const sal_Char* sCSS1_P_color;
@@ -126,7 +124,7 @@ extern const sal_Char* sCSS1_PV_bottom;
extern const sal_Char* sCSS1_PV_scroll;
-// Strings fuer Text-Properties
+// Strings for text properties
extern const sal_Char* sCSS1_P_letter_spacing;
@@ -149,7 +147,7 @@ extern const sal_Char* sCSS1_P_text_indent;
extern const sal_Char* sCSS1_P_line_height;
-// Strings fuer Box-Properties
+// Strings for box properties
extern const sal_Char* sCSS1_P_margin_left;
extern const sal_Char* sCSS1_P_margin_right;
@@ -179,10 +177,10 @@ extern const sal_Char* sCSS1_P_border_bottom;
extern const sal_Char* sCSS1_P_border;
extern const sal_Char* sCSS1_PV_thin;
-//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_medium, "medium" );
+//extern const sal_Char* sCSS1_PV_medium;
extern const sal_Char* sCSS1_PV_thick;
-//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_none, "none" );
+//extern const sal_Char* sCSS1_PV_none;
extern const sal_Char* sCSS1_PV_dotted;
extern const sal_Char* sCSS1_PV_dashed;
extern const sal_Char* sCSS1_PV_solid;
@@ -200,7 +198,7 @@ extern const sal_Char* sCSS1_P_float;
extern const sal_Char* sCSS1_P_column_count;
-// Strings fuer Positioning
+// Strings for positioning
extern const sal_Char* sCSS1_P_position;
@@ -212,9 +210,7 @@ extern const sal_Char* sCSS1_P_left;
extern const sal_Char* sCSS1_P_top;
-// Feature: PrintExt
-
-// Strings fuer Printing Extensions
+// Strings for printing extensions
extern const sal_Char* sCSS1_P_page_break_before;
extern const sal_Char* sCSS1_P_page_break_after;
@@ -222,7 +218,7 @@ extern const sal_Char* sCSS1_P_page_break_inside;
extern const sal_Char* sCSS1_P_size;
extern const sal_Char* sCSS1_P_widows;
extern const sal_Char* sCSS1_P_orphans;
-//sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_marks, "marks" );
+//extern const sal_Char* sCSS1_P_marks;
extern const sal_Char* sCSS1_PV_always;
extern const sal_Char* sCSS1_PV_avoid;
@@ -230,10 +226,9 @@ extern const sal_Char* sCSS1_PV_avoid;
extern const sal_Char* sCSS1_PV_portrait;
extern const sal_Char* sCSS1_PV_landscape;
-//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_crop, "crop" );
-//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_cross, "cross" );
+//extern const sal_Char* sCSS1_PV_crop;
+//extern const sal_Char* sCSS1_PV_cross;
-// /Feature: PrintExt
extern const sal_Char* sCSS1_class_abs_pos;
commit 4487e268ffac149cdd28d90a848813bf0bb04e4a
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sat Mar 15 17:00:26 2014 +0100
sw html: css1atr - put local stuff in anonymous namespace
Change-Id: Iea0e0a82ce8726f5a51de37d1c20e9cfa2f751d9
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 8cf1287..fa65155 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -92,8 +92,8 @@
#include <rtl/strbuf.hxx>
-using namespace ::com::sun::star;
-using ::editeng::SvxBorderLine;
+using namespace css;
+using editeng::SvxBorderLine;
#define HTML_HEADSPACE (12*20)
@@ -110,12 +110,6 @@ using ::editeng::SvxBorderLine;
#define CSS1_FRMSIZE_ANYHEIGHT 0x0e
#define CSS1_FRMSIZE_PIXEL 0x10
-const sal_Char* sCSS1_rule_end = " }";
-const sal_Char* sCSS1_span_tag_end = "\">";
-const sal_Char cCSS1_style_opt_end = '\"';
-
-const sal_Char* sHTML_FTN_fontheight = "57%";
-
extern SwAttrFnTab aCSS1AttrFnTab;
static Writer& OutCSS1_SwFmt( Writer& rWrt, const SwFmt& rFmt,
@@ -154,7 +148,16 @@ static Writer& OutCSS1_SvxFmtBreak_SwFmtPDesc_SvxFmtKeep( Writer& rWrt,
sal_Bool bDeep );
static Writer& OutCSS1_SwFmtLayoutSplit( Writer& rWrt, const SfxPoolItem& rHt );
-static OString ConvToHex(sal_uInt16 nHex)
+namespace
+{
+
+const sal_Char* sCSS1_rule_end = " }";
+const sal_Char* sCSS1_span_tag_end = "\">";
+const sal_Char cCSS1_style_opt_end = '\"';
+
+const sal_Char* sHTML_FTN_fontheight = "57%";
+
+OString lclConvToHex(sal_uInt16 nHex)
{
sal_Char aNToABuf[] = "00";
@@ -171,9 +174,11 @@ static OString ConvToHex(sal_uInt16 nHex)
return OString(aNToABuf, 2);
}
-static OString GetCSS1Color(const Color& rColor)
+static OString lclGetCSS1Color(const Color& rColor)
{
- return "#" + ConvToHex(rColor.GetRed()) + ConvToHex(rColor.GetGreen()) + ConvToHex(rColor.GetBlue());
+ return "#" + lclConvToHex(rColor.GetRed()) + lclConvToHex(rColor.GetGreen()) + lclConvToHex(rColor.GetBlue());
+}
+
}
class SwCSS1OutMode
@@ -2280,7 +2285,7 @@ void SwHTMLWriter::OutCSS1_FrmFmtBackground( const SwFrmFmt& rFrmFmt )
aColor = pVSh->GetViewOptions()->GetRetoucheColor().GetColor();
}
- OutCSS1_PropertyAscii(sCSS1_P_background, GetCSS1Color(aColor));
+ OutCSS1_PropertyAscii(sCSS1_P_background, lclGetCSS1Color(aColor));
}
}
@@ -2455,7 +2460,7 @@ static Writer& OutCSS1_SvxColor( Writer& rWrt, const SfxPoolItem& rHt )
if( COL_AUTO == aColor.GetColor() )
aColor.SetColor( COL_BLACK );
- rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_color, GetCSS1Color(aColor));
+ rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_color, lclGetCSS1Color(aColor));
return rWrt;
}
@@ -3292,7 +3297,7 @@ static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt,
{
if( bColor )
{
- OString sTmp(GetCSS1Color(aColor));
+ OString sTmp(lclGetCSS1Color(aColor));
sOut += OStringToOUString(sTmp, RTL_TEXTENCODING_ASCII_US);
}
@@ -3398,7 +3403,7 @@ static void OutCSS1_SvxBorderLine( SwHTMLWriter& rHTMLWrt,
sOut.append(' ');
// and also the color
- sOut.append(GetCSS1Color(pLine->GetColor()));
+ sOut.append(lclGetCSS1Color(pLine->GetColor()));
rHTMLWrt.OutCSS1_PropertyAscii(pProperty, sOut.makeStringAndClear());
}
commit 3841e3a13f15df950f1e5eef23cc0c273401b8c1
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sat Mar 15 16:53:16 2014 +0100
sw html: get rid of macro - use const sal_Char* constant instead
Change-Id: I2b3b264d40cd61507e0b3a1957f89f4f681c6f61
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 22b38d0..8cf1287 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -110,11 +110,11 @@ using ::editeng::SvxBorderLine;
#define CSS1_FRMSIZE_ANYHEIGHT 0x0e
#define CSS1_FRMSIZE_PIXEL 0x10
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_rule_end, " }" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_span_tag_end, "\">" );
-const sal_Char cCSS1_style_opt_end = '\"';
+const sal_Char* sCSS1_rule_end = " }";
+const sal_Char* sCSS1_span_tag_end = "\">";
+const sal_Char cCSS1_style_opt_end = '\"';
-sal_Char CSS1_CONSTASCII_DEF( sHTML_FTN_fontheight, "57%" );
+const sal_Char* sHTML_FTN_fontheight = "57%";
extern SwAttrFnTab aCSS1AttrFnTab;
@@ -3486,7 +3486,7 @@ static Writer& OutCSS1_SvxFrameDirection( Writer& rWrt, const SfxPoolItem& rHt )
sal_uInt16 nDir =
static_cast< const SvxFrameDirectionItem& >( rHt ).GetValue();
- sal_Char *pStr = 0;
+ const sal_Char* pStr = NULL;
switch( nDir )
{
case FRMDIR_HORI_LEFT_TOP:
diff --git a/sw/source/filter/html/css1kywd.cxx b/sw/source/filter/html/css1kywd.cxx
index 0ac6b28..e5bc4c5 100644
--- a/sw/source/filter/html/css1kywd.cxx
+++ b/sw/source/filter/html/css1kywd.cxx
@@ -3,8 +3,8 @@
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ * License = v. 2.0. If a copy of the MPL was not distributed with this
+ * file = You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
@@ -12,240 +12,240 @@
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
+ * License = Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "css1kywd.hxx"
-sal_Char CSS1_CONSTASCII_DEF( sCSS_mimetype, "text/css" );
+const sal_Char* sCSS_mimetype = "text/css";
// ein par allgemeine Strings
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_import, "import" );
+const sal_Char* sCSS1_import = "import";
// Feature: PrintExt
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_page, "page" );
-//sal_Char CSS1_CONSTASCII_DEF( sCSS1_media, "media" );
+const sal_Char* sCSS1_page = "page";
+//const sal_Char* sCSS1_media = "media";
// /Feature: PrintExt
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_important, "important" );
+const sal_Char* sCSS1_important = "important";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_link, "link" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_visited, "visited" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_first_letter, "first-letter" );
+const sal_Char* sCSS1_link = "link";
+const sal_Char* sCSS1_visited = "visited";
+const sal_Char* sCSS1_first_letter = "first-letter";
// Feature: PrintExt
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_left, "left" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_right, "right" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_first, "first" );
+const sal_Char* sCSS1_left = "left";
+const sal_Char* sCSS1_right = "right";
+const sal_Char* sCSS1_first = "first";
// /Feature: PrintExt
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_url, "url" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_rgb, "rgb" );
+const sal_Char* sCSS1_url = "url";
+const sal_Char* sCSS1_rgb = "rgb";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_UNIT_pt, "pt" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_UNIT_mm, "mm" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_UNIT_cm, "cm" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_UNIT_pc, "pc" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_UNIT_inch, "in" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_UNIT_px, "px" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_UNIT_em, "em" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_UNIT_ex, "ex" );
+const sal_Char* sCSS1_UNIT_pt = "pt";
+const sal_Char* sCSS1_UNIT_mm = "mm";
+const sal_Char* sCSS1_UNIT_cm = "cm";
+const sal_Char* sCSS1_UNIT_pc = "pc";
+const sal_Char* sCSS1_UNIT_inch = "in";
+const sal_Char* sCSS1_UNIT_px = "px";
+const sal_Char* sCSS1_UNIT_em = "em";
+const sal_Char* sCSS1_UNIT_ex = "ex";
// Strings fuer Font-Properties
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_font_family, "font-family" );
+const sal_Char* sCSS1_P_font_family = "font-family";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_serif, "serif" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_sans_serif, "sans-serif" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_cursive, "cursive" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_fantasy, "fantasy" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_monospace, "monospace" );
+const sal_Char* sCSS1_PV_serif = "serif";
+const sal_Char* sCSS1_PV_sans_serif = "sans-serif";
+const sal_Char* sCSS1_PV_cursive = "cursive";
+const sal_Char* sCSS1_PV_fantasy = "fantasy";
+const sal_Char* sCSS1_PV_monospace = "monospace";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_font_style, "font-style" );
+const sal_Char* sCSS1_P_font_style = "font-style";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_normal, "normal" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_italic, "italic" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_oblique, "oblique" );
+const sal_Char* sCSS1_PV_normal = "normal";
+const sal_Char* sCSS1_PV_italic = "italic";
+const sal_Char* sCSS1_PV_oblique = "oblique";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_font_variant, "font-variant" );
+const sal_Char* sCSS1_P_font_variant = "font-variant";
-//sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_normal, "normal" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_small_caps, "small-caps" );
+//const sal_Char* sCSS1_PV_normal = "normal";
+const sal_Char* sCSS1_PV_small_caps = "small-caps";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_font_weight, "font-weight" );
+const sal_Char* sCSS1_P_font_weight = "font-weight";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_extra_light, "extra-light" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_light, "light" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_demi_light, "demi-light" );
-//sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_medium, "medium" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_demi_bold, "demi-bold" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_bold, "bold" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_extra_bold, "extra-bold" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_lighter, "lighter" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_bolder, "bolder" );
+const sal_Char* sCSS1_PV_extra_light = "extra-light";
+const sal_Char* sCSS1_PV_light = "light";
+const sal_Char* sCSS1_PV_demi_light = "demi-light";
+//const sal_Char* sCSS1_PV_medium = "medium";
+const sal_Char* sCSS1_PV_demi_bold = "demi-bold";
+const sal_Char* sCSS1_PV_bold = "bold";
+const sal_Char* sCSS1_PV_extra_bold = "extra-bold";
+const sal_Char* sCSS1_PV_lighter = "lighter";
+const sal_Char* sCSS1_PV_bolder = "bolder";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_text_transform, "text-transform" );
+const sal_Char* sCSS1_P_text_transform = "text-transform";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_capitalize, "capitalize" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_uppercase, "uppercase" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_lowercase, "lowercase" );
+const sal_Char* sCSS1_PV_capitalize = "capitalize";
+const sal_Char* sCSS1_PV_uppercase = "uppercase";
+const sal_Char* sCSS1_PV_lowercase = "lowercase";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_font_size, "font-size" );
+const sal_Char* sCSS1_P_font_size = "font-size";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_xx_small, "xx-small" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_x_small, "x-small" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_small, "small" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_medium, "medium" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_large, "large" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_x_large, "x-large" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_xx_large, "xx-large" );
+const sal_Char* sCSS1_PV_xx_small = "xx-small";
+const sal_Char* sCSS1_PV_x_small = "x-small";
+const sal_Char* sCSS1_PV_small = "small";
+const sal_Char* sCSS1_PV_medium = "medium";
+const sal_Char* sCSS1_PV_large = "large";
+const sal_Char* sCSS1_PV_x_large = "x-large";
+const sal_Char* sCSS1_PV_xx_large = "xx-large";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_larger, "larger" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_smaller, "smaller" );
+const sal_Char* sCSS1_PV_larger = "larger";
+const sal_Char* sCSS1_PV_smaller = "smaller";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_font, "font" );
+const sal_Char* sCSS1_P_font = "font";
// Strings fuer Farb- und Hintergrund-Properties
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_color, "color" );
+const sal_Char* sCSS1_P_color = "color";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_background, "background" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_background_color, "background-color" );
+const sal_Char* sCSS1_P_background = "background";
+const sal_Char* sCSS1_P_background_color = "background-color";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_transparent, "transparent" );
+const sal_Char* sCSS1_PV_transparent = "transparent";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_repeat, "repeat" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_repeat_x, "repeat-x" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_repeat_y, "repeat-y" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_no_repeat, "no-repeat" );
+const sal_Char* sCSS1_PV_repeat = "repeat";
+const sal_Char* sCSS1_PV_repeat_x = "repeat-x";
+const sal_Char* sCSS1_PV_repeat_y = "repeat-y";
+const sal_Char* sCSS1_PV_no_repeat = "no-repeat";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_top, "top" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_middle, "middle" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_bottom, "bottom" );
+const sal_Char* sCSS1_PV_top = "top";
+const sal_Char* sCSS1_PV_middle = "middle";
+const sal_Char* sCSS1_PV_bottom = "bottom";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_scroll, "scroll" );
+const sal_Char* sCSS1_PV_scroll = "scroll";
// Strings fuer Text-Properties
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_letter_spacing, "letter-spacing" );
+const sal_Char* sCSS1_P_letter_spacing = "letter-spacing";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_text_decoration, "text-decoration" );
+const sal_Char* sCSS1_P_text_decoration = "text-decoration";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_none, "none" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_underline, "underline" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_overline, "overline" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_line_through, "line-through" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_blink, "blink" );
+const sal_Char* sCSS1_PV_none = "none";
+const sal_Char* sCSS1_PV_underline = "underline";
+const sal_Char* sCSS1_PV_overline = "overline";
+const sal_Char* sCSS1_PV_line_through = "line-through";
+const sal_Char* sCSS1_PV_blink = "blink";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_text_align, "text-align" );
+const sal_Char* sCSS1_P_text_align = "text-align";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_left, "left" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_center, "center" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_right, "right" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_justify, "justify" );
+const sal_Char* sCSS1_PV_left = "left";
+const sal_Char* sCSS1_PV_center = "center";
+const sal_Char* sCSS1_PV_right = "right";
+const sal_Char* sCSS1_PV_justify = "justify";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_text_indent, "text-indent" );
+const sal_Char* sCSS1_P_text_indent = "text-indent";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_line_height, "line-height" );
+const sal_Char* sCSS1_P_line_height = "line-height";
// Strings fuer Box-Properties
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_margin_left, "margin-left" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_margin_right, "margin-right" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_margin_top, "margin-top" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_margin_bottom, "margin-bottom" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_margin, "margin" );
-
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_padding_top, "padding-top" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_padding_bottom, "padding-bottom" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_padding_left, "padding-left" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_padding_right, "padding-right" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_padding, "padding" );
-
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_auto, "auto" );
-
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_border_left_width, "border-left-width" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_border_right_width, "border-right-width" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_border_top_width, "border-top-width" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_border_bottom_width, "border-bottom-width" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_border_width, "border-width" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_border_color, "border-color" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_border_style, "border-style" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_border_left, "border-left" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_border_right, "border-right" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_border_top, "border-top" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_border_bottom, "border-bottom" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_border, "border" );
-
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_thin, "thin" );
-//sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_medium, "medium" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_thick, "thick" );
-
-//sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_none, "none" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_dotted, "dotted" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_dashed, "dashed" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_solid, "solid" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_double, "double" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_groove, "groove" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_ridge, "ridge" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_inset, "inset" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_outset, "outset" );
-
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_width, "width" );
-
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_height, "height" );
-
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_float, "float" );
-
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_column_count, "column-count" );
+const sal_Char* sCSS1_P_margin_left = "margin-left";
+const sal_Char* sCSS1_P_margin_right = "margin-right";
+const sal_Char* sCSS1_P_margin_top = "margin-top";
+const sal_Char* sCSS1_P_margin_bottom = "margin-bottom";
+const sal_Char* sCSS1_P_margin = "margin";
+
+const sal_Char* sCSS1_P_padding_top = "padding-top";
+const sal_Char* sCSS1_P_padding_bottom = "padding-bottom";
+const sal_Char* sCSS1_P_padding_left = "padding-left";
+const sal_Char* sCSS1_P_padding_right = "padding-right";
+const sal_Char* sCSS1_P_padding = "padding";
+
+const sal_Char* sCSS1_PV_auto = "auto";
+
+const sal_Char* sCSS1_P_border_left_width = "border-left-width";
+const sal_Char* sCSS1_P_border_right_width = "border-right-width";
+const sal_Char* sCSS1_P_border_top_width = "border-top-width";
+const sal_Char* sCSS1_P_border_bottom_width = "border-bottom-width";
+const sal_Char* sCSS1_P_border_width = "border-width";
+const sal_Char* sCSS1_P_border_color = "border-color";
+const sal_Char* sCSS1_P_border_style = "border-style";
+const sal_Char* sCSS1_P_border_left = "border-left";
+const sal_Char* sCSS1_P_border_right = "border-right";
+const sal_Char* sCSS1_P_border_top = "border-top";
+const sal_Char* sCSS1_P_border_bottom = "border-bottom";
+const sal_Char* sCSS1_P_border = "border";
+
+const sal_Char* sCSS1_PV_thin = "thin";
+//const sal_Char* sCSS1_PV_medium = "medium";
+const sal_Char* sCSS1_PV_thick = "thick";
+
+//const sal_Char* sCSS1_PV_none = "none";
+const sal_Char* sCSS1_PV_dotted = "dotted";
+const sal_Char* sCSS1_PV_dashed = "dashed";
+const sal_Char* sCSS1_PV_solid = "solid";
+const sal_Char* sCSS1_PV_double = "double";
+const sal_Char* sCSS1_PV_groove = "groove";
+const sal_Char* sCSS1_PV_ridge = "ridge";
+const sal_Char* sCSS1_PV_inset = "inset";
+const sal_Char* sCSS1_PV_outset = "outset";
+
+const sal_Char* sCSS1_P_width = "width";
+
+const sal_Char* sCSS1_P_height = "height";
+
+const sal_Char* sCSS1_P_float = "float";
+
+const sal_Char* sCSS1_P_column_count = "column-count";
// Strings fuer Positioning
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_position, "position" );
+const sal_Char* sCSS1_P_position = "position";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_absolute, "absolute" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_relative, "relative" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_static, "static" );
+const sal_Char* sCSS1_PV_absolute = "absolute";
+const sal_Char* sCSS1_PV_relative = "relative";
+const sal_Char* sCSS1_PV_static = "static";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_left, "left" );
+const sal_Char* sCSS1_P_left = "left";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_top, "top" );
+const sal_Char* sCSS1_P_top = "top";
// Feature: PrintExt
// Strings fuer Printing Extensions
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_page_break_before, "page-break-before" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_page_break_after, "page-break-after" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_page_break_inside, "page-break-inside" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_size, "size" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_widows, "widows" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_orphans, "orphans" );
-//sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_marks, "marks" );
+const sal_Char* sCSS1_P_page_break_before = "page-break-before";
+const sal_Char* sCSS1_P_page_break_after = "page-break-after";
+const sal_Char* sCSS1_P_page_break_inside = "page-break-inside";
+const sal_Char* sCSS1_P_size = "size";
+const sal_Char* sCSS1_P_widows = "widows";
+const sal_Char* sCSS1_P_orphans = "orphans";
+//const sal_Char* sCSS1_P_marks = "marks";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_always, "always" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_avoid, "avoid" );
+const sal_Char* sCSS1_PV_always = "always";
+const sal_Char* sCSS1_PV_avoid = "avoid";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_portrait, "portrait" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_landscape, "landscape" );
+const sal_Char* sCSS1_PV_portrait = "portrait";
+const sal_Char* sCSS1_PV_landscape = "landscape";
-//sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_crop, "crop" );
-//sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_cross, "cross" );
+//const sal_Char* sCSS1_PV_crop = "crop";
+//const sal_Char* sCSS1_PV_cross = "cross";
// /Feature: PrintExt
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_class_abs_pos, "sd-abs-pos" );
+const sal_Char* sCSS1_class_abs_pos = "sd-abs-pos";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_so_language, "so-language" );
+const sal_Char* sCSS1_P_so_language = "so-language";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_direction, "direction" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_ltr, "ltr" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_rtl, "rtl" );
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_inherit, "inherit" );
+const sal_Char* sCSS1_P_direction = "direction";
+const sal_Char* sCSS1_PV_ltr = "ltr";
+const sal_Char* sCSS1_PV_rtl = "rtl";
+const sal_Char* sCSS1_PV_inherit = "inherit";
-sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_display, "display" );
+const sal_Char* sCSS1_P_display = "display";
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/css1kywd.hxx b/sw/source/filter/html/css1kywd.hxx
index 755d0de..aed4b38 100644
--- a/sw/source/filter/html/css1kywd.hxx
+++ b/sw/source/filter/html/css1kywd.hxx
@@ -22,240 +22,228 @@
#include <sal/types.h>
-#ifndef CSS1_CONSTASCII_DECL
-#define CSS1_CONSTASCII_DECL( n, s ) n[sizeof(s)]
-#endif
-#ifndef CSS1_CONSTASCII_DEF
-#define CSS1_CONSTASCII_DEF( n, s ) n[sizeof(s)] = s
-#endif
-
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS_mimetype, "text/css" );
+extern const sal_Char* sCSS_mimetype;
// ein par allgemeine Strings
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_import, "import" );
+extern const sal_Char* sCSS1_import;
-// Feature: PrintExt
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_page, "page" );
-//sal_Char CSS1_CONSTASCII_DECL( sCSS1_media, "media" );
-// /Feature: PrintExt
+extern const sal_Char* sCSS1_page;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_important, "important" );
+extern const sal_Char* sCSS1_important;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_link, "link" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_visited, "visited" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_first_letter, "first-letter" );
+extern const sal_Char* sCSS1_link;
+extern const sal_Char* sCSS1_visited;
+extern const sal_Char* sCSS1_first_letter;
-// Feature: PrintExt
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_left, "left" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_right, "right" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_first, "first" );
-// /Feature: PrintExt
+extern const sal_Char* sCSS1_left;
+extern const sal_Char* sCSS1_right;
+extern const sal_Char* sCSS1_first;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_url, "url" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_rgb, "rgb" );
+extern const sal_Char* sCSS1_url;
+extern const sal_Char* sCSS1_rgb;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_UNIT_pt, "pt" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_UNIT_mm, "mm" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_UNIT_cm, "cm" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_UNIT_pc, "pc" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_UNIT_inch, "in" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_UNIT_px, "px" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_UNIT_em, "em" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_UNIT_ex, "ex" );
+extern const sal_Char* sCSS1_UNIT_pt;
+extern const sal_Char* sCSS1_UNIT_mm;
+extern const sal_Char* sCSS1_UNIT_cm;
+extern const sal_Char* sCSS1_UNIT_pc;
+extern const sal_Char* sCSS1_UNIT_inch;
+extern const sal_Char* sCSS1_UNIT_px;
+extern const sal_Char* sCSS1_UNIT_em;
+extern const sal_Char* sCSS1_UNIT_ex;
// Strings fuer Font-Properties
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_font_family, "font-family" );
+extern const sal_Char* sCSS1_P_font_family;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_serif, "serif" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_sans_serif, "sans-serif" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_cursive, "cursive" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_fantasy, "fantasy" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_monospace, "monospace" );
+extern const sal_Char* sCSS1_PV_serif;
+extern const sal_Char* sCSS1_PV_sans_serif;
+extern const sal_Char* sCSS1_PV_cursive;
+extern const sal_Char* sCSS1_PV_fantasy;
+extern const sal_Char* sCSS1_PV_monospace;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_font_style, "font-style" );
+extern const sal_Char* sCSS1_P_font_style;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_normal, "normal" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_italic, "italic" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_oblique, "oblique" );
+extern const sal_Char* sCSS1_PV_normal;
+extern const sal_Char* sCSS1_PV_italic;
+extern const sal_Char* sCSS1_PV_oblique;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_font_variant, "font-variant" );
+extern const sal_Char* sCSS1_P_font_variant;
//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_normal, "normal" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_small_caps, "small-caps" );
+extern const sal_Char* sCSS1_PV_small_caps;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_text_transform, "text-transform" );
+extern const sal_Char* sCSS1_P_text_transform;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_capitalize, "capitalize" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_uppercase, "uppercase" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_lowercase, "lowercase" );
+extern const sal_Char* sCSS1_PV_capitalize;
+extern const sal_Char* sCSS1_PV_uppercase;
+extern const sal_Char* sCSS1_PV_lowercase;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_font_weight, "font-weight" );
+extern const sal_Char* sCSS1_P_font_weight;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_extra_light, "extra-light" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_light, "light" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_demi_light, "demi-light" );
+extern const sal_Char* sCSS1_PV_extra_light;
+extern const sal_Char* sCSS1_PV_light;
+extern const sal_Char* sCSS1_PV_demi_light;
//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_medium, "medium" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_demi_bold, "demi-bold" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_bold, "bold" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_extra_bold, "extra-bold" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_lighter, "lighter" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_bolder, "bolder" );
+extern const sal_Char* sCSS1_PV_demi_bold;
+extern const sal_Char* sCSS1_PV_bold;
+extern const sal_Char* sCSS1_PV_extra_bold;
+extern const sal_Char* sCSS1_PV_lighter;
+extern const sal_Char* sCSS1_PV_bolder;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_font_size, "font-size" );
+extern const sal_Char* sCSS1_P_font_size;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_xx_small, "xx-small" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_x_small, "x-small" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_small, "small" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_medium, "medium" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_large, "large" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_x_large, "x-large" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_xx_large, "xx-large" );
+extern const sal_Char* sCSS1_PV_xx_small;
+extern const sal_Char* sCSS1_PV_x_small;
+extern const sal_Char* sCSS1_PV_small;
+extern const sal_Char* sCSS1_PV_medium;
+extern const sal_Char* sCSS1_PV_large;
+extern const sal_Char* sCSS1_PV_x_large;
+extern const sal_Char* sCSS1_PV_xx_large;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_larger, "larger" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_smaller, "smaller" );
+extern const sal_Char* sCSS1_PV_larger;
+extern const sal_Char* sCSS1_PV_smaller;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_font, "font" );
+extern const sal_Char* sCSS1_P_font;
// Strings fuer Farb- und Hintergrund-Properties
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_color, "color" );
+extern const sal_Char* sCSS1_P_color;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_background, "background" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_background_color, "background-color" );
+extern const sal_Char* sCSS1_P_background;
+extern const sal_Char* sCSS1_P_background_color;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_transparent, "transparent" );
+extern const sal_Char* sCSS1_PV_transparent;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_repeat, "repeat" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_repeat_x, "repeat-x" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_repeat_y, "repeat-y" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_no_repeat, "no-repeat" );
+extern const sal_Char* sCSS1_PV_repeat;
+extern const sal_Char* sCSS1_PV_repeat_x;
+extern const sal_Char* sCSS1_PV_repeat_y;
+extern const sal_Char* sCSS1_PV_no_repeat;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_top, "top" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_middle, "middle" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_bottom, "bottom" );
+extern const sal_Char* sCSS1_PV_top;
+extern const sal_Char* sCSS1_PV_middle;
+extern const sal_Char* sCSS1_PV_bottom;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_scroll, "scroll" );
+extern const sal_Char* sCSS1_PV_scroll;
// Strings fuer Text-Properties
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_letter_spacing, "letter-spacing" );
+extern const sal_Char* sCSS1_P_letter_spacing;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_text_decoration, "text-decoration" );
+extern const sal_Char* sCSS1_P_text_decoration;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_none, "none" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_underline, "underline" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_overline, "overline" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_line_through, "line-through" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_blink, "blink" );
+extern const sal_Char* sCSS1_PV_none;
+extern const sal_Char* sCSS1_PV_underline;
+extern const sal_Char* sCSS1_PV_overline;
+extern const sal_Char* sCSS1_PV_line_through;
+extern const sal_Char* sCSS1_PV_blink;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_text_align, "text-align" );
+extern const sal_Char* sCSS1_P_text_align;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_left, "left" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_center, "center" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_right, "right" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_justify, "justify" );
+extern const sal_Char* sCSS1_PV_left;
+extern const sal_Char* sCSS1_PV_center;
+extern const sal_Char* sCSS1_PV_right;
+extern const sal_Char* sCSS1_PV_justify;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_text_indent, "text-indent" );
+extern const sal_Char* sCSS1_P_text_indent;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_line_height, "line-height" );
+extern const sal_Char* sCSS1_P_line_height;
// Strings fuer Box-Properties
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_margin_left, "margin-left" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_margin_right, "margin-right" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_margin_top, "margin-top" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_margin_bottom, "margin-bottom" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_margin, "margin" );
-
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_padding_top, "padding-top" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_padding_bottom, "padding-bottom" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_padding_left, "padding-left" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_padding_right, "padding-right" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_padding, "padding" );
-
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_auto, "auto" );
-
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_border_left_width, "border-left-width" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_border_right_width, "border-right-width" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_border_top_width, "border-top-width" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_border_bottom_width, "border-bottom-width" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_border_width, "border-width" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_border_color, "border-color" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_border_style, "border-style" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_border_left, "border-left" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_border_right, "border-right" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_border_top, "border-top" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_border_bottom, "border-bottom" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_border, "border" );
-
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_thin, "thin" );
+extern const sal_Char* sCSS1_P_margin_left;
+extern const sal_Char* sCSS1_P_margin_right;
+extern const sal_Char* sCSS1_P_margin_top;
+extern const sal_Char* sCSS1_P_margin_bottom;
+extern const sal_Char* sCSS1_P_margin;
+
+extern const sal_Char* sCSS1_P_padding_top;
+extern const sal_Char* sCSS1_P_padding_bottom;
+extern const sal_Char* sCSS1_P_padding_left;
+extern const sal_Char* sCSS1_P_padding_right;
+extern const sal_Char* sCSS1_P_padding;
+
+extern const sal_Char* sCSS1_PV_auto;
+
+extern const sal_Char* sCSS1_P_border_left_width;
+extern const sal_Char* sCSS1_P_border_right_width;
+extern const sal_Char* sCSS1_P_border_top_width;
+extern const sal_Char* sCSS1_P_border_bottom_width;
+extern const sal_Char* sCSS1_P_border_width;
+extern const sal_Char* sCSS1_P_border_color;
+extern const sal_Char* sCSS1_P_border_style;
+extern const sal_Char* sCSS1_P_border_left;
+extern const sal_Char* sCSS1_P_border_right;
+extern const sal_Char* sCSS1_P_border_top;
+extern const sal_Char* sCSS1_P_border_bottom;
+extern const sal_Char* sCSS1_P_border;
+
+extern const sal_Char* sCSS1_PV_thin;
//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_medium, "medium" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_thick, "thick" );
+extern const sal_Char* sCSS1_PV_thick;
//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_none, "none" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_dotted, "dotted" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_dashed, "dashed" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_solid, "solid" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_double, "double" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_groove, "groove" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_ridge, "ridge" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_inset, "inset" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_outset, "outset" );
+extern const sal_Char* sCSS1_PV_dotted;
+extern const sal_Char* sCSS1_PV_dashed;
+extern const sal_Char* sCSS1_PV_solid;
+extern const sal_Char* sCSS1_PV_double;
+extern const sal_Char* sCSS1_PV_groove;
+extern const sal_Char* sCSS1_PV_ridge;
+extern const sal_Char* sCSS1_PV_inset;
+extern const sal_Char* sCSS1_PV_outset;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_width, "width" );
+extern const sal_Char* sCSS1_P_width;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_height, "height" );
+extern const sal_Char* sCSS1_P_height;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_float, "float" );
+extern const sal_Char* sCSS1_P_float;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_column_count, "column-count" );
+extern const sal_Char* sCSS1_P_column_count;
// Strings fuer Positioning
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_position, "position" );
+extern const sal_Char* sCSS1_P_position;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_absolute, "absolute" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_relative, "relative" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_static, "static" );
+extern const sal_Char* sCSS1_PV_absolute;
+extern const sal_Char* sCSS1_PV_relative;
+extern const sal_Char* sCSS1_PV_static;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_left, "left" );
+extern const sal_Char* sCSS1_P_left;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_top, "top" );
+extern const sal_Char* sCSS1_P_top;
// Feature: PrintExt
// Strings fuer Printing Extensions
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_page_break_before, "page-break-before" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_page_break_after, "page-break-after" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_page_break_inside, "page-break-inside" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_size, "size" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_widows, "widows" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_orphans, "orphans" );
+extern const sal_Char* sCSS1_P_page_break_before;
+extern const sal_Char* sCSS1_P_page_break_after;
+extern const sal_Char* sCSS1_P_page_break_inside;
+extern const sal_Char* sCSS1_P_size;
+extern const sal_Char* sCSS1_P_widows;
+extern const sal_Char* sCSS1_P_orphans;
//sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_marks, "marks" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_always, "always" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_avoid, "avoid" );
+extern const sal_Char* sCSS1_PV_always;
+extern const sal_Char* sCSS1_PV_avoid;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_portrait, "portrait" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_landscape, "landscape" );
+extern const sal_Char* sCSS1_PV_portrait;
+extern const sal_Char* sCSS1_PV_landscape;
//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_crop, "crop" );
//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_cross, "cross" );
// /Feature: PrintExt
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_class_abs_pos, "sd-abs-pos" );
+extern const sal_Char* sCSS1_class_abs_pos;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_so_language, "so-language" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_direction, "direction" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_ltr, "ltr" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_rtl, "rtl" );
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_inherit, "inherit" );
+extern const sal_Char* sCSS1_P_so_language;
+extern const sal_Char* sCSS1_P_direction;
+extern const sal_Char* sCSS1_PV_ltr;
+extern const sal_Char* sCSS1_PV_rtl;
+extern const sal_Char* sCSS1_PV_inherit;
-extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_display, "display" );
+extern const sal_Char* sCSS1_P_display;
#endif
commit 7f36ef95c02803954c333617ad8ebb4c84d52a71
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sat Mar 15 16:45:46 2014 +0100
sw html: split htmldraw.cxx to reader and writer parts
Change-Id: Id9c9f1098a88bc31282863a5713c38850d03e62b
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index a21028d..6f91e28 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -485,7 +485,8 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/filter/html/htmlbas \
sw/source/filter/html/htmlcss1 \
sw/source/filter/html/htmlctxt \
- sw/source/filter/html/htmldraw \
+ sw/source/filter/html/htmldrawreader \
+ sw/source/filter/html/htmldrawwriter \
sw/source/filter/html/htmlfld \
sw/source/filter/html/htmlfldw \
sw/source/filter/html/htmlfly \
diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldrawreader.cxx
similarity index 67%
rename from sw/source/filter/html/htmldraw.cxx
rename to sw/source/filter/html/htmldrawreader.cxx
index 265acba..912d94a 100644
--- a/sw/source/filter/html/htmldraw.cxx
+++ b/sw/source/filter/html/htmldrawreader.cxx
@@ -48,32 +48,24 @@
#include "poolfmt.hxx"
#include "swcss1.hxx"
#include "swhtml.hxx"
-#include "wrthtml.hxx"
+#include <shellio.hxx>
#include <rtl/strbuf.hxx>
-using namespace ::com::sun::star;
-
-const sal_uInt32 HTML_FRMOPTS_MARQUEE =
- HTML_FRMOPT_ALIGN |
- HTML_FRMOPT_SPACE;
-
-const sal_uInt32 HTML_FRMOPTS_MARQUEE_CSS1 =
- HTML_FRMOPT_S_ALIGN |
- HTML_FRMOPT_S_SPACE;
+using namespace css;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list