summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-28 15:23:12 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-28 17:39:12 +0200
commit2c72660137baf08e1b4611e30750970a688cbacb (patch)
tree6075f047e2746d50dff6c9f91bf385f0f2b965a6
parenta9020e461803964a206d5551884b70717eed165c (diff)
sc html export: some more places to skip images
Change-Id: I1d3deb96688ea29e674b7be2fda034a75d5b92a3
-rw-r--r--sc/source/filter/html/htmlexp.cxx81
1 files changed, 42 insertions, 39 deletions
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index eb93bc60932c..db086107dc89 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -564,53 +564,56 @@ void ScHTMLExport::WriteBody()
// default text color black
rStrm.WriteChar( '<' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_body );
- if ( bAll && GPOS_NONE != pBrushItem->GetGraphicPos() )
+ if (!mbSkipImages)
{
- OUString aLink = pBrushItem->GetGraphicLink();
- OUString aGrfNm;
-
- // Embedded graphic -> write using WriteGraphic
- if( aLink.isEmpty() )
+ if ( bAll && GPOS_NONE != pBrushItem->GetGraphicPos() )
{
- const Graphic* pGrf = pBrushItem->GetGraphic();
- if( pGrf )
+ OUString aLink = pBrushItem->GetGraphicLink();
+ OUString aGrfNm;
+
+ // Embedded graphic -> write using WriteGraphic
+ if( aLink.isEmpty() )
{
- // Save graphic as (JPG) file
- aGrfNm = aStreamPath;
- sal_uInt16 nErr = XOutBitmap::WriteGraphic( *pGrf, aGrfNm,
- "JPG", XOUTBMP_USE_NATIVE_IF_POSSIBLE );
- if( !nErr ) // Contains errors, as we have nothing to output
+ const Graphic* pGrf = pBrushItem->GetGraphic();
+ if( pGrf )
{
- aGrfNm = URIHelper::SmartRel2Abs(
- INetURLObject(aBaseURL),
- aGrfNm, URIHelper::GetMaybeFileHdl(), true, false);
+ // Save graphic as (JPG) file
+ aGrfNm = aStreamPath;
+ sal_uInt16 nErr = XOutBitmap::WriteGraphic( *pGrf, aGrfNm,
+ "JPG", XOUTBMP_USE_NATIVE_IF_POSSIBLE );
+ if( !nErr ) // Contains errors, as we have nothing to output
+ {
+ aGrfNm = URIHelper::SmartRel2Abs(
+ INetURLObject(aBaseURL),
+ aGrfNm, URIHelper::GetMaybeFileHdl(), true, false);
+ if ( HasCId() )
+ MakeCIdURL( aGrfNm );
+ aLink = aGrfNm;
+ }
+ }
+ }
+ else
+ {
+ aGrfNm = aLink;
+ if( bCopyLocalFileToINet || HasCId() )
+ {
+ CopyLocalFileToINet( aGrfNm, aStreamPath );
if ( HasCId() )
MakeCIdURL( aGrfNm );
- aLink = aGrfNm;
}
+ else
+ aGrfNm = URIHelper::SmartRel2Abs(
+ INetURLObject(aBaseURL),
+ aGrfNm, URIHelper::GetMaybeFileHdl(), true, false);
+ aLink = aGrfNm;
}
- }
- else
- {
- aGrfNm = aLink;
- if( bCopyLocalFileToINet || HasCId() )
+ if( !aLink.isEmpty() )
{
- CopyLocalFileToINet( aGrfNm, aStreamPath );
- if ( HasCId() )
- MakeCIdURL( aGrfNm );
+ rStrm.WriteChar( ' ' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_O_background ).WriteCharPtr( "=\"" );
+ OUT_STR( URIHelper::simpleNormalizedMakeRelative(
+ aBaseURL,
+ aLink ) ).WriteChar( '\"' );
}
- else
- aGrfNm = URIHelper::SmartRel2Abs(
- INetURLObject(aBaseURL),
- aGrfNm, URIHelper::GetMaybeFileHdl(), true, false);
- aLink = aGrfNm;
- }
- if( !aLink.isEmpty() )
- {
- rStrm.WriteChar( ' ' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_O_background ).WriteCharPtr( "=\"" );
- OUT_STR( URIHelper::simpleNormalizedMakeRelative(
- aBaseURL,
- aLink ) ).WriteChar( '\"' );
}
}
if ( !aHTMLStyle.aBackgroundColor.GetTransparency() )
@@ -805,7 +808,7 @@ void ScHTMLExport::WriteTables()
IncIndent(-1); TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_table );
- if ( bTabHasGraphics && mbSkipImages )
+ if ( bTabHasGraphics && !mbSkipImages )
{
// the rest that is not in a cell
size_t ListSize = aGraphList.size();
@@ -844,7 +847,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
ScAddress aPos( nCol, nRow, nTab );
ScHTMLGraphEntry* pGraphEntry = NULL;
- if ( bTabHasGraphics )
+ if ( bTabHasGraphics && !mbSkipImages )
{
size_t ListSize = aGraphList.size();
for ( size_t i = 0; i < ListSize; ++i )