diff options
author | Andras Timar <atimar@suse.com> | 2013-07-11 16:54:36 +0200 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2013-07-11 21:44:59 +0200 |
commit | 562c39d73fb473f0eaec227ed0f607de4b7d8322 (patch) | |
tree | e4c2e0f64c481a4ce6f015c614122503da678750 /sw | |
parent | 5e75084ca252ae9d90e18df0c50a92f48dfa7ece (diff) |
fix HTML export of linked image bullets
Change-Id: I14ade42adfff9beb0e40eb0d7e5569cbef0ced06
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/html/htmlatr.cxx | 1 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfly.cxx | 115 | ||||
-rw-r--r-- | sw/source/filter/html/htmlnum.cxx | 1 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.hxx | 2 |
4 files changed, 51 insertions, 68 deletions
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 57f9be726dfd..9032d028e387 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 d0426c3c4a82..7889ebf38822 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 be594f2cb6e7..dbb24ce8c3eb 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 a3fbb09bb795..a49c81b50de6 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 ); |