diff options
author | Chr. Rossmanith <ChrRossmanith@gmx.de> | 2015-04-10 21:58:43 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2015-04-11 13:29:02 +0200 |
commit | f8976c41dc847cc47abf127bed4e0dc58aa7f1b5 (patch) | |
tree | 7a56a636c72596c5dfc1d1e1bb2e6136921b4a2d /filter | |
parent | 1e9bbd1bf0eda05c8474c49581fdaeace6689ae1 (diff) |
tdf#37650: further improvement of svg export
continues work of 0a4e9138281bd0a4be59031357c1bf52134d007a
when opening a <tspan> element check if <text> element has been
opened already; if not open <text> element and close it immediately
after writing the text
Change-Id: I6e4cfdf9ba107ec9e65a99e7866f4a1075737d82
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/svg/svgwriter.cxx | 68 |
1 files changed, 64 insertions, 4 deletions
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 01d218b5c227..5774dfda9f04 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -3435,14 +3435,29 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, if( mrExport.IsUsePositionedCharacters() ) { vcl::Font aFont = ImplSetCorrectFontHeight(); + bool bTextShapeStarted=false; + if( !maTextWriter.isTextShapeStarted() ) + { + bTextShapeStarted=true; + maTextWriter.startTextShape(); + } mpContext->SetFontAttr( aFont ); ImplWriteText( pA->GetPoint(), aText, NULL, 0 ); + if( bTextShapeStarted ) + maTextWriter.endTextShape(); } else { + bool bTextShapeStarted=false; + if( !maTextWriter.isTextShapeStarted() ) + { + bTextShapeStarted=true; + maTextWriter.startTextShape(); + } maTextWriter.writeTextPortion( pA->GetPoint(), aText ); + if( bTextShapeStarted ) + maTextWriter.endTextShape(); } - } } } @@ -3459,12 +3474,27 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, if( mrExport.IsUsePositionedCharacters() ) { vcl::Font aFont = ImplSetCorrectFontHeight(); + bool bTextShapeStarted=false; + if( !maTextWriter.isTextShapeStarted() ) + { + bTextShapeStarted=true; + maTextWriter.startTextShape(); + } mpContext->SetFontAttr( aFont ); ImplWriteText( pA->GetRect().TopLeft(), pA->GetText(), NULL, 0 ); + if( bTextShapeStarted ) + maTextWriter.endTextShape(); } + + bool bTextShapeStarted=false; + if( !maTextWriter.isTextShapeStarted() ) { - maTextWriter.writeTextPortion( pA->GetRect().TopLeft(), pA->GetText() ); + bTextShapeStarted=true; + maTextWriter.startTextShape(); } + maTextWriter.writeTextPortion( pA->GetRect().TopLeft(), pA->GetText() ); + if( bTextShapeStarted ) + maTextWriter.endTextShape(); } } } @@ -3483,12 +3513,28 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, if( mrExport.IsUsePositionedCharacters() ) { vcl::Font aFont = ImplSetCorrectFontHeight(); + bool bTextShapeStarted=false; + if( !maTextWriter.isTextShapeStarted() ) + { + bTextShapeStarted=true; + maTextWriter.startTextShape(); + } mpContext->SetFontAttr( aFont ); ImplWriteText( pA->GetPoint(), aText, pA->GetDXArray(), 0 ); + if( bTextShapeStarted ) + maTextWriter.endTextShape(); } else { + bool bTextShapeStarted=false; + if( !maTextWriter.isTextShapeStarted() ) + { + bTextShapeStarted=true; + maTextWriter.startTextShape(); + } maTextWriter.writeTextPortion( pA->GetPoint(), aText ); + if( bTextShapeStarted ) + maTextWriter.endTextShape(); } } } @@ -3508,14 +3554,28 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, if( mrExport.IsUsePositionedCharacters() ) { vcl::Font aFont = ImplSetCorrectFontHeight(); + bool bTextShapeStarted=false; + if( !maTextWriter.isTextShapeStarted() ) + { + bTextShapeStarted=true; + maTextWriter.startTextShape(); + } mpContext->SetFontAttr( aFont ); ImplWriteText( pA->GetPoint(), aText, NULL, pA->GetWidth() ); + if( bTextShapeStarted ) + maTextWriter.endTextShape(); } else { - maTextWriter.startTextShape(); + bool bTextShapeStarted=false; + if( !maTextWriter.isTextShapeStarted() ) + { + bTextShapeStarted=true; + maTextWriter.startTextShape(); + } maTextWriter.writeTextPortion( pA->GetPoint(), aText ); - maTextWriter.endTextShape(); + if( bTextShapeStarted ) + maTextWriter.endTextShape(); } } } |