diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-04-18 13:19:06 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-04-18 13:19:06 +0000 |
commit | f1f72d908bf74602296b669e2af0b378a9e5e836 (patch) | |
tree | 8aae0dcd85cb5de50a2cc523cf526eaa35f899b8 /oox/source/drawingml/textrun.cxx | |
parent | 9b5fbf83137e056039af454e6bcbfdd7d31eb7f6 (diff) |
INTEGRATION: CWS xmlfilter04 (1.2.12); FILE MERGED
2008/03/11 09:50:33 dr 1.2.12.2: import manual chart title text
2008/02/21 12:42:01 hbrinkm 1.2.12.1: joined changes from xmlfilter03
Diffstat (limited to 'oox/source/drawingml/textrun.cxx')
-rw-r--r-- | oox/source/drawingml/textrun.cxx | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx index 6565d6082dc8..c3d1d8a817fa 100644 --- a/oox/source/drawingml/textrun.cxx +++ b/oox/source/drawingml/textrun.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: textrun.cxx,v $ - * $Revision: 1.4 $ + * $Revision: 1.5 $ * * This file is part of OpenOffice.org. * @@ -48,71 +48,71 @@ using namespace ::com::sun::star::lang; namespace oox { namespace drawingml { - TextRun::TextRun() - : mbIsLineBreak( false ) - , maTextCharacterPropertiesPtr( new TextCharacterProperties() ) - { - } +TextRun::TextRun() + : mbIsLineBreak( false ) + , maTextCharacterPropertiesPtr( new TextCharacterProperties() ) +{ +} - TextRun::~TextRun() - { - } +TextRun::~TextRun() +{ +} - void TextRun::insertAt( - const ::oox::core::XmlFilterBase& rFilterBase, - const Reference < XText > & xText, - const Reference < XTextCursor > &xAt, - const TextCharacterPropertiesPtr& rTextCharacterStyle ) - { - try { - Reference< XTextRange > xStart( xAt, UNO_QUERY ); +void TextRun::insertAt( + const ::oox::core::XmlFilterBase& rFilterBase, + const Reference < XText > & xText, + const Reference < XTextCursor > &xAt, + const TextCharacterPropertiesPtr& rTextCharacterStyle ) +{ + try { + Reference< XTextRange > xStart( xAt, UNO_QUERY ); - Reference< XPropertySet > xProps( xStart, UNO_QUERY); - if ( rTextCharacterStyle.get() ) - rTextCharacterStyle->pushToPropSet( rFilterBase, xProps ); + Reference< XPropertySet > xProps( xStart, UNO_QUERY); + if ( rTextCharacterStyle.get() ) + rTextCharacterStyle->pushToPropSet( rFilterBase, xProps ); - maTextCharacterPropertiesPtr->pushToPropSet( rFilterBase, xProps ); + maTextCharacterPropertiesPtr->pushToPropSet( rFilterBase, xProps ); - if( maTextCharacterPropertiesPtr->getHyperlinkPropertyMap().empty() ) + if( maTextCharacterPropertiesPtr->getHyperlinkPropertyMap().empty() ) + { + if( mbIsLineBreak ) { - if( mbIsLineBreak ) - { - OSL_TRACE( "OOX: TextRun::insertAt() insert line break" ); - xText->insertControlCharacter( xStart, ControlCharacter::LINE_BREAK, sal_False ); - } - else - { - xText->insertString( xStart, text(), sal_False ); - } + OSL_TRACE( "OOX: TextRun::insertAt() insert line break" ); + xText->insertControlCharacter( xStart, ControlCharacter::LINE_BREAK, sal_False ); } else { - OSL_TRACE( "OOX: URL field" ); - Reference< XMultiServiceFactory > xFactory( rFilterBase.getModel(), UNO_QUERY ); - Reference< XTextField > xField( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.text.TextField.URL" ) ), UNO_QUERY ); - if( xField.is() ) - { - const rtl::OUString sRepresentation( OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Representation" ) ) ); - maTextCharacterPropertiesPtr->getHyperlinkPropertyMap()[ sRepresentation ] <<= text(); - - Reference< XPropertySet > xFieldProps( xField, UNO_QUERY); - maTextCharacterPropertiesPtr->pushToUrlFieldPropSet( xFieldProps ); - Reference< XTextContent > xContent( xField, UNO_QUERY); - xText->insertTextContent( xStart, xContent, sal_False ); - } - else - { - OSL_TRACE( "OOX: URL field couldn't be created" ); - xText->insertString( xStart, text(), sal_False ); - } + xText->insertString( xStart, getText(), sal_False ); } } - catch( const Exception& ) + else { - OSL_TRACE("OOX: TextRun::insertAt() exception"); + OSL_TRACE( "OOX: URL field" ); + Reference< XMultiServiceFactory > xFactory( rFilterBase.getModel(), UNO_QUERY ); + Reference< XTextField > xField( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.text.TextField.URL" ) ), UNO_QUERY ); + if( xField.is() ) + { + const rtl::OUString sRepresentation( OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Representation" ) ) ); + maTextCharacterPropertiesPtr->getHyperlinkPropertyMap()[ sRepresentation ] <<= getText(); + + Reference< XPropertySet > xFieldProps( xField, UNO_QUERY); + maTextCharacterPropertiesPtr->pushToUrlFieldPropSet( xFieldProps ); + Reference< XTextContent > xContent( xField, UNO_QUERY); + xText->insertTextContent( xStart, xContent, sal_False ); + } + else + { + OSL_TRACE( "OOX: URL field couldn't be created" ); + xText->insertString( xStart, getText(), sal_False ); + } } } + catch( const Exception& ) + { + OSL_TRACE("OOX: TextRun::insertAt() exception"); + } +} } } |