diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-02 10:36:43 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2013-05-22 10:44:29 +0000 |
commit | 6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 (patch) | |
tree | 2746468845d6f1159e3759ee2cf7a620fca15b6e /oox/source/drawingml/textrun.cxx | |
parent | 697a007c61b9cabceb9767fad87cd5822b300452 (diff) |
Use the new type-checking Reference constructor to reduce code noise
Also create a Clang compiler plugin to detect such cases.
Change-Id: I61ad1a1d6b1c017eeb51f226d2dde0e9bb7f1752
Reviewed-on: https://gerrit.libreoffice.org/4001
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'oox/source/drawingml/textrun.cxx')
-rw-r--r-- | oox/source/drawingml/textrun.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx index 6193cf0c244b..c4648c205d8d 100644 --- a/oox/source/drawingml/textrun.cxx +++ b/oox/source/drawingml/textrun.cxx @@ -116,7 +116,7 @@ sal_Int32 TextRun::insertAt( if ( nIndex >= getText().getLength() ) break; - xStart = Reference< XTextRange >( xAt, UNO_QUERY ); + xStart = xAt; aPropSet = PropertySet( xStart ); aTextCharacterProps.pushToPropSet( aPropSet, rFilterBase ); } @@ -136,8 +136,7 @@ sal_Int32 TextRun::insertAt( PropertySet aFieldProps( xField ); aFieldProps.setProperties( maTextCharacterProperties.maHyperlinkPropertyMap ); aFieldProps.setProperty( PROP_Representation, getText() ); - Reference< XTextContent > xContent( xField, UNO_QUERY); - xText->insertTextContent( xStart, xContent, sal_False ); + xText->insertTextContent( xStart, xField, sal_False ); xTextFieldCursor->gotoEnd( sal_True ); @@ -146,8 +145,7 @@ sal_Int32 TextRun::insertAt( if ( !maTextCharacterProperties.moUnderline.has() ) aTextCharacterProps.moUnderline.set( XML_sng ); - Reference< XTextRange > xFieldRange( xTextFieldCursor, UNO_QUERY ); - PropertySet aFieldTextPropSet( xFieldRange ); + PropertySet aFieldTextPropSet( xTextFieldCursor ); aTextCharacterProps.pushToPropSet( aFieldTextPropSet, rFilterBase ); oox::core::TextField aTextField; |