[Libreoffice-commits] core.git: sw/source
Andras Timar
atimar at suse.com
Thu Jul 11 13:40:51 PDT 2013
sw/source/filter/html/htmlatr.cxx | 1
sw/source/filter/html/htmlfly.cxx | 115 ++++++++++++++++----------------------
sw/source/filter/html/htmlnum.cxx | 1
sw/source/filter/html/wrthtml.hxx | 2
4 files changed, 51 insertions(+), 68 deletions(-)
New commits:
commit 562c39d73fb473f0eaec227ed0f607de4b7d8322
Author: Andras Timar <atimar at suse.com>
Date: Thu Jul 11 16:54:36 2013 +0200
fix HTML export of linked image bullets
Change-Id: I14ade42adfff9beb0e40eb0d7e5569cbef0ced06
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 57f9be7..9032d02 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -978,7 +978,6 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
OSL_ENSURE( nBulletGrfLvl < MAXLEVEL, "So viele Ebenen gibt's nicht" );
const SwNumFmt& rNumFmt = aNumInfo.GetNumRule()->Get(nBulletGrfLvl);
OutHTML_BulletImage( rWrt, OOO_STRING_SVTOOLS_HTML_image, rNumFmt.GetBrush(),
- rHWrt.aBulletGrfs[nBulletGrfLvl],
rNumFmt.GetGraphicSize(), rNumFmt.GetGraphicOrientation() );
}
diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx
index d0426c3..7889ebf 100644
--- a/sw/source/filter/html/htmlfly.cxx
+++ b/sw/source/filter/html/htmlfly.cxx
@@ -1199,33 +1199,21 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt,
Writer& OutHTML_BulletImage( Writer& rWrt,
const sal_Char *pTag,
const SvxBrushItem* pBrush,
- String &rGrfName,
const Size &rSize,
const SwFmtVertOrient* pVertOrient )
{
SwHTMLWriter & rHTMLWrt = (SwHTMLWriter&)rWrt;
- //Wenn es ein BrushItem gibt, muss die Grafiknoch exportiert werden
- const String *pLink = 0;
OUString aGraphicInBase64;
if( pBrush )
{
- pLink = pBrush->GetGraphicLink();
-
- //embeddete Grafik -> WriteEmbedded schreiben
- if( !pLink )
+ const Graphic* pGrf = pBrush->GetGraphic();
+ if( pGrf )
{
- const Graphic* pGrf = pBrush->GetGraphic();
- if( pGrf )
+ sal_uLong nErr = XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64);
+ if( nErr )
{
- sal_uLong nErr = XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64);
- if( nErr )
- {
- rHTMLWrt.nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE;
- }
- if( rHTMLWrt.GetOrigFileName() )
- rGrfName = *rHTMLWrt.GetOrigFileName();
- pLink = &rGrfName;
+ rHTMLWrt.nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE;
}
}
}
@@ -1234,61 +1222,58 @@ Writer& OutHTML_BulletImage( Writer& rWrt,
if( pTag )
sOut.append('<').append(pTag);
- if( pLink )
+ sOut.append(' ');
+ sOut.append(OOO_STRING_SVTOOLS_HTML_O_src).append("=\"").
+ append(OOO_STRING_SVTOOLS_HTML_O_data).append(":");
+ rWrt.Strm() << sOut.makeStringAndClear().getStr();
+ HTMLOutFuncs::Out_String( rWrt.Strm(), aGraphicInBase64, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters );
+ sOut.append('\"');
+
+ // Groesse des Objekts Twips ohne Raender
+ Size aPixelSz( 0, 0 );
+ if( (rSize.Width() || rSize.Height()) && Application::GetDefaultDevice() )
{
- sOut.append(' ');
- sOut.append(OOO_STRING_SVTOOLS_HTML_O_src).append("=\"").
- append(OOO_STRING_SVTOOLS_HTML_O_data).append(":");
- rWrt.Strm() << sOut.makeStringAndClear().getStr();
- HTMLOutFuncs::Out_String( rWrt.Strm(), aGraphicInBase64, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters );
- sOut.append('\"');
+ aPixelSz =
+ Application::GetDefaultDevice()->LogicToPixel( rSize,
+ MapMode(MAP_TWIP) );
+ if( !aPixelSz.Width() && rSize.Width() )
+ aPixelSz.Width() = 1;
+ if( !aPixelSz.Height() && rSize.Height() )
+ aPixelSz.Height() = 1;
+ }
- // Groesse des Objekts Twips ohne Raender
- Size aPixelSz( 0, 0 );
- if( (rSize.Width() || rSize.Height()) && Application::GetDefaultDevice() )
- {
- aPixelSz =
- Application::GetDefaultDevice()->LogicToPixel( rSize,
- MapMode(MAP_TWIP) );
- if( !aPixelSz.Width() && rSize.Width() )
- aPixelSz.Width() = 1;
- if( !aPixelSz.Height() && rSize.Height() )
- aPixelSz.Height() = 1;
- }
+ if( aPixelSz.Width() )
+ {
+ sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width).
+ append('=').append(static_cast<sal_Int32>(aPixelSz.Width()));
+ }
- if( aPixelSz.Width() )
- {
- sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width).
- append('=').append(static_cast<sal_Int32>(aPixelSz.Width()));
- }
+ if( aPixelSz.Height() )
+ {
+ sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height).
+ append('=').append(static_cast<sal_Int32>(aPixelSz.Height()));
+ }
- if( aPixelSz.Height() )
+ if( pVertOrient )
+ {
+ const sal_Char *pStr = 0;
+ switch( pVertOrient->GetVertOrient() )
{
- sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height).
- append('=').append(static_cast<sal_Int32>(aPixelSz.Height()));
+ case text::VertOrientation::LINE_TOP: pStr = OOO_STRING_SVTOOLS_HTML_VA_top; break;
+ case text::VertOrientation::CHAR_TOP:
+ case text::VertOrientation::BOTTOM: pStr = OOO_STRING_SVTOOLS_HTML_VA_texttop; break; // geht nicht
+ case text::VertOrientation::LINE_CENTER:
+ case text::VertOrientation::CHAR_CENTER: pStr = OOO_STRING_SVTOOLS_HTML_VA_absmiddle; break; // geht nicht
+ case text::VertOrientation::CENTER: pStr = OOO_STRING_SVTOOLS_HTML_VA_middle; break;
+ case text::VertOrientation::LINE_BOTTOM:
+ case text::VertOrientation::CHAR_BOTTOM: pStr = OOO_STRING_SVTOOLS_HTML_VA_absbottom; break; // geht nicht
+ case text::VertOrientation::TOP: pStr = OOO_STRING_SVTOOLS_HTML_VA_bottom; break;
+ case text::VertOrientation::NONE: break;
}
-
- if( pVertOrient )
+ if( pStr )
{
- const sal_Char *pStr = 0;
- switch( pVertOrient->GetVertOrient() )
- {
- case text::VertOrientation::LINE_TOP: pStr = OOO_STRING_SVTOOLS_HTML_VA_top; break;
- case text::VertOrientation::CHAR_TOP:
- case text::VertOrientation::BOTTOM: pStr = OOO_STRING_SVTOOLS_HTML_VA_texttop; break; // geht nicht
- case text::VertOrientation::LINE_CENTER:
- case text::VertOrientation::CHAR_CENTER: pStr = OOO_STRING_SVTOOLS_HTML_VA_absmiddle; break; // geht nicht
- case text::VertOrientation::CENTER: pStr = OOO_STRING_SVTOOLS_HTML_VA_middle; break;
- case text::VertOrientation::LINE_BOTTOM:
- case text::VertOrientation::CHAR_BOTTOM: pStr = OOO_STRING_SVTOOLS_HTML_VA_absbottom; break; // geht nicht
- case text::VertOrientation::TOP: pStr = OOO_STRING_SVTOOLS_HTML_VA_bottom; break;
- case text::VertOrientation::NONE: break;
- }
- if( pStr )
- {
- sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).
- append('=').append(pStr);
- }
+ sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).
+ append('=').append(pStr);
}
}
diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx
index be594f2..dbb24ce 100644
--- a/sw/source/filter/html/htmlnum.cxx
+++ b/sw/source/filter/html/htmlnum.cxx
@@ -827,7 +827,6 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt,
OutHTML_BulletImage( rWrt,
0,
rNumFmt.GetBrush(),
- rWrt.aBulletGrfs[i],
rNumFmt.GetGraphicSize(),
rNumFmt.GetGraphicOrientation() );
}
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index a3fbb09..a49c81b 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -636,7 +636,7 @@ Writer& OutHTML_Image( Writer&, const SwFrmFmt& rFmt,
const ImageMap *pGenImgMap = 0 );
Writer& OutHTML_BulletImage( Writer& rWrt, const sal_Char *pTag,
- const SvxBrushItem* pBrush, String &rGrfName,
+ const SvxBrushItem* pBrush,
const Size &rSize,
const SwFmtVertOrient* pVertOrient );
More information about the Libreoffice-commits
mailing list