diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-08-25 17:50:29 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-08-25 18:00:38 +0200 |
commit | c64945bcb9a69a2c4f69c673fa1935d91f70b238 (patch) | |
tree | 2cb6c6d5985898a9f754ca0b3489f3cad0a865f8 | |
parent | 1ee98159f7749b2c1ad47de60a9b3057b9e9720e (diff) |
sc HTML export: indent conditional block
Change-Id: Ia96d201ce10fcb58b213b709506a54760c053643
-rw-r--r-- | sc/source/filter/html/htmlexp.cxx | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index f9facfc95e7e..3b1cf12359a4 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -313,11 +313,11 @@ sal_uLong ScHTMLExport::Write() { if (!mbSkipHeaderFooter) { - rStrm.WriteChar( '<' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_doctype ).WriteChar( ' ' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_doctype40 ).WriteChar( '>' ) - .WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( SAL_NEWLINE_STRING ); - TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_html ); - WriteHeader(); - OUT_LF(); + rStrm.WriteChar( '<' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_doctype ).WriteChar( ' ' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_doctype40 ).WriteChar( '>' ) + .WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( SAL_NEWLINE_STRING ); + TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_html ); + WriteHeader(); + OUT_LF(); } WriteBody(); OUT_LF(); @@ -555,70 +555,70 @@ void ScHTMLExport::WriteBody() // default text color black if (!mbSkipHeaderFooter) { - rStrm.WriteChar( '<' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_body ); + rStrm.WriteChar( '<' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_body ); - if (!mbSkipImages) - { - 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() ) - { // A transparent background color should always result in default - // background of the browser. Also, HTMLOutFuncs::Out_Color() writes - // black #000000 for COL_AUTO which is the same as white #ffffff with - // transparency set to 0xff, our default background. - OUT_SP_CSTR_ASS( OOO_STRING_SVTOOLS_HTML_O_bgcolor ); - HTMLOutFuncs::Out_Color( rStrm, aHTMLStyle.aBackgroundColor ); - } + if ( !aHTMLStyle.aBackgroundColor.GetTransparency() ) + { // A transparent background color should always result in default + // background of the browser. Also, HTMLOutFuncs::Out_Color() writes + // black #000000 for COL_AUTO which is the same as white #ffffff with + // transparency set to 0xff, our default background. + OUT_SP_CSTR_ASS( OOO_STRING_SVTOOLS_HTML_O_bgcolor ); + HTMLOutFuncs::Out_Color( rStrm, aHTMLStyle.aBackgroundColor ); + } - rStrm.WriteChar( '>' ); OUT_LF(); + rStrm.WriteChar( '>' ); OUT_LF(); } if ( bAll ) |