Kaydet (Commit) 03fe839d authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

html export: rework image output to use HTML writer

Change-Id: Iead3f0f49b93453bd45f07f047978cb92d279d21
üst 3aa99295
......@@ -1171,32 +1171,32 @@ void SwHTMLWriter::OutImplicitMark( const OUString& rMark,
}
}
void SwHTMLWriter::OutHyperlinkHRefValue( const OUString& rURL )
OUString SwHTMLWriter::convertHyperlinkHRefValue(const OUString& rURL)
{
OUString sURL( rURL );
sal_Int32 nPos = sURL.lastIndexOf( cMarkSeparator );
if( nPos != -1 )
OUString sURL(rURL);
sal_Int32 nPos = sURL.lastIndexOf(cMarkSeparator);
if (nPos != -1)
{
OUString sCmp(comphelper::string::remove(sURL.copy(nPos+1), ' '));
if( !sCmp.isEmpty() )
OUString sCompare(comphelper::string::remove(sURL.copy(nPos + 1), ' '));
if (!sCompare.isEmpty())
{
sCmp = sCmp.toAsciiLowerCase();
if( sCmp == "region" ||
sCmp == "frame" ||
sCmp == "graphic" ||
sCmp == "ole" ||
sCmp == "table" ||
sCmp == "outline" ||
sCmp == "text" )
sCompare = sCompare.toAsciiLowerCase();
if( sCompare == "region" || sCompare == "frame" ||
sCompare == "graphic" || sCompare == "ole" ||
sCompare == "table" || sCompare == "outline" ||
sCompare == "text" )
{
sURL = sURL.replace( '?', '_' ); // '?' causes problems in IE/Netscape 5
}
}
}
return URIHelper::simpleNormalizedMakeRelative(GetBaseURL(), sURL);
}
sURL = URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), sURL);
HTMLOutFuncs::Out_String( Strm(), sURL, eDestEnc,
&aNonConvertableCharacters );
void SwHTMLWriter::OutHyperlinkHRefValue( const OUString& rURL )
{
OUString sURL = convertHyperlinkHRefValue(rURL);
HTMLOutFuncs::Out_String( Strm(), sURL, eDestEnc, &aNonConvertableCharacters );
}
void SwHTMLWriter::OutBackground( const SvxBrushItem *pBrushItem, bool bGraphic )
......@@ -1297,25 +1297,31 @@ sal_uInt16 SwHTMLWriter::GetHTMLDirection( sal_uInt16 nDir ) const
void SwHTMLWriter::OutDirection( sal_uInt16 nDir )
{
const sal_Char *pValue = 0;
switch( nDir )
OString sConverted = convertDirection(nDir);
if (!sConverted.isEmpty())
{
OStringBuffer sOut;
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_dir)
.append("=\"").append(sConverted).append('\"');
Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() );
}
}
OString SwHTMLWriter::convertDirection(sal_uInt16 nDirection)
{
OString sConverted;
switch (nDirection)
{
case FRMDIR_HORI_LEFT_TOP:
case FRMDIR_VERT_TOP_LEFT:
pValue = "ltr";
sConverted = "ltr";
break;
case FRMDIR_HORI_RIGHT_TOP:
case FRMDIR_VERT_TOP_RIGHT:
pValue = "rtl";
sConverted = "rtl";
break;
}
if( pValue != 0 )
{
OStringBuffer sOut;
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_dir)
.append("=\"").append(pValue).append('\"');
Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() );
}
return sConverted;
}
OString SwHTMLWriter::GetIndentString(sal_uInt16 nIncLvl)
......
......@@ -414,6 +414,9 @@ public:
void OutBookmarks();
void OutPointFieldmarks( const SwPosition& rPos );
void OutImplicitMark( const OUString& rMark, const sal_Char *pMarkType );
OUString convertHyperlinkHRefValue(const OUString& rURL);
void OutHyperlinkHRefValue( const OUString& rURL );
// gebe die evt. an der akt. Position stehenden FlyFrame aus.
......@@ -465,12 +468,16 @@ public:
sal_uInt16 GetHTMLDirection( sal_uInt16 nDir ) const;
sal_uInt16 GetHTMLDirection( const SfxItemSet& rItemSet ) const;
void OutDirection( sal_uInt16 nDir );
OString convertDirection(sal_uInt16 nDirection);
// ALT/ALIGN/WIDTH/HEIGHT/HSPACE/VSPACE-Optionen des aktuellen
// Frame-Formats ausgeben und ggf. ein <BR CLEAR=...> vorne an
// rEndTags anhaengen
OString OutFrmFmtOptions( const SwFrmFmt& rFrmFmt, const OUString& rAltTxt,
sal_uInt32 nFrmOpts, const OString& rEndTags = OString() );
void writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrmFmt& rFrmFmt, const OUString& rAltTxt, sal_uInt32 nFrmOpts);
void OutCSS1_TableFrmFmtOptions( const SwFrmFmt& rFrmFmt );
void OutCSS1_TableCellBorderHack(const SwFrmFmt& rFrmFmt);
void OutCSS1_SectionFmtOptions( const SwFrmFmt& rFrmFmt, const SwFmtCol *pCol );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment