Kaydet (Commit) d9e335ea authored tarafından Jochen Nitschke's avatar Jochen Nitschke

fix wrong usages of setProperty vs setAnyProperty...

and remove some useless casts.

setAnyProperty takes an Any for property value.
setProperty takes any value and creates an Any.

Change-Id: Ida0a80bd679775c08925309bfbc695630af2225f
Reviewed-on: https://gerrit.libreoffice.org/29917Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJochen Nitschke <j.nitschke+logerrit@ok.de>
üst 9bcae1a1
......@@ -174,7 +174,7 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
OUString presetTextWarp;
if ( aGeoPropSeq[ i ].Value >>= presetTextWarp )
{
aPropertyMap.setProperty( PROP_PresetTextWarp, Any( presetTextWarp ) );
aPropertyMap.setProperty( PROP_PresetTextWarp, presetTextWarp );
}
}
}
......
......@@ -805,19 +805,19 @@ Reference< XShape > const & Shape::createAndInsert(
// TextFrames have BackColor, not FillColor
if (aShapeProps.hasProperty(PROP_FillColor))
{
aShapeProps.setProperty(PROP_BackColor, aShapeProps.getProperty(PROP_FillColor));
aShapeProps.setAnyProperty(PROP_BackColor, aShapeProps.getProperty(PROP_FillColor));
aShapeProps.erase(PROP_FillColor);
}
// TextFrames have BackColorTransparency, not FillTransparence
if (aShapeProps.hasProperty(PROP_FillTransparence))
{
aShapeProps.setProperty(PROP_BackColorTransparency, aShapeProps.getProperty(PROP_FillTransparence));
aShapeProps.setAnyProperty(PROP_BackColorTransparency, aShapeProps.getProperty(PROP_FillTransparence));
aShapeProps.erase(PROP_FillTransparence);
}
// TextFrames have BackGrahicURL, not FillBitmapURL
if (aShapeProps.hasProperty(PROP_FillBitmapURL))
{
aShapeProps.setProperty(PROP_BackGraphicURL, aShapeProps.getProperty(PROP_FillBitmapURL));
aShapeProps.setAnyProperty(PROP_BackGraphicURL, aShapeProps.getProperty(PROP_FillBitmapURL));
aShapeProps.erase(PROP_FillBitmapURL);
}
if (aShapeProps.hasProperty(PROP_FillBitmapName))
......@@ -840,7 +840,7 @@ Reference< XShape > const & Shape::createAndInsert(
aBorderLine.Color = aShapeProps.getProperty(PROP_LineColor).get<sal_Int32>();
if (aLineProperties.moLineWidth.has())
aBorderLine.LineWidth = convertEmuToHmm(aLineProperties.moLineWidth.get());
aShapeProps.setProperty(nBorder, uno::makeAny(aBorderLine));
aShapeProps.setProperty(nBorder, aBorderLine);
}
aShapeProps.erase(PROP_LineColor);
}
......@@ -913,12 +913,12 @@ Reference< XShape > const & Shape::createAndInsert(
aFormat.Location = nLocation;
}
aFormat.ShadowWidth = *oShadowDistance;
aShapeProps.setProperty(PROP_ShadowFormat, uno::makeAny(aFormat));
aShapeProps.setProperty(PROP_ShadowFormat, aFormat);
}
}
else if (mbTextBox)
{
aShapeProps.setProperty(PROP_TextBox, uno::makeAny(true));
aShapeProps.setProperty(PROP_TextBox, true);
}
if (aServiceName != "com.sun.star.text.TextFrame" && isLinkedTxbx())
......
......@@ -288,15 +288,15 @@ void BulletList::apply( const BulletList& rSource )
void BulletList::pushToPropMap( const ::oox::core::XmlFilterBase* pFilterBase, PropertyMap& rPropMap ) const
{
if( msNumberingPrefix.hasValue() )
rPropMap.setProperty( PROP_Prefix, msNumberingPrefix);
rPropMap.setAnyProperty( PROP_Prefix, msNumberingPrefix);
if( msNumberingSuffix.hasValue() )
rPropMap.setProperty( PROP_Suffix, msNumberingSuffix);
rPropMap.setAnyProperty( PROP_Suffix, msNumberingSuffix);
if( mnStartAt.hasValue() )
rPropMap.setProperty( PROP_StartWith, mnStartAt);
rPropMap.setAnyProperty( PROP_StartWith, mnStartAt);
rPropMap.setProperty( PROP_Adjust, HoriOrientation::LEFT);
if( mnNumberingType.hasValue() )
rPropMap.setProperty( PROP_NumberingType, mnNumberingType);
rPropMap.setAnyProperty( PROP_NumberingType, mnNumberingType);
OUString aBulletFontName;
sal_Int16 nBulletFontPitch = 0;
......@@ -352,9 +352,9 @@ void BulletList::pushToPropMap( const ::oox::core::XmlFilterBase* pFilterBase, P
rPropMap.setProperty( PROP_Graphic, xBitmap);
}
if( mnSize.hasValue() )
rPropMap.setProperty( PROP_BulletRelSize, mnSize);
rPropMap.setAnyProperty( PROP_BulletRelSize, mnSize);
if ( maStyleName.hasValue() )
rPropMap.setProperty( PROP_CharStyleName, maStyleName);
rPropMap.setAnyProperty( PROP_CharStyleName, maStyleName);
if (pFilterBase ) {
if ( maBulletColorPtr->isUsed() )
rPropMap.setProperty( PROP_BulletColor, maBulletColorPtr->getColor( pFilterBase->getGraphicHelper() ));
......@@ -426,20 +426,20 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p
{
if ( noParaLeftMargin )
{
aPropSet.setProperty( PROP_ParaLeftMargin, static_cast< sal_Int32 >(0));
rioBulletMap.setProperty( PROP_LeftMargin, static_cast< sal_Int32 >( *noParaLeftMargin ));
aPropSet.setProperty<sal_Int32>( PROP_ParaLeftMargin, 0);
rioBulletMap.setProperty( PROP_LeftMargin, *noParaLeftMargin);
noParaLeftMargin = boost::none;
}
if ( noFirstLineIndentation )
{
// Force Paragraph property as zero - impress seems to use the value from previous
// (non) bullet line if not set to zero explicitly :(
aPropSet.setProperty( PROP_ParaFirstLineIndent, static_cast< sal_Int32 >(0) );
rioBulletMap.setProperty( PROP_FirstLineOffset, static_cast< sal_Int32 >( *noFirstLineIndentation ));
aPropSet.setProperty<sal_Int32>( PROP_ParaFirstLineIndent, 0);
rioBulletMap.setProperty( PROP_FirstLineOffset, *noFirstLineIndentation);
noFirstLineIndentation = boost::none;
}
if ( nNumberingType != NumberingType::BITMAP && !rioBulletMap.hasProperty( PROP_BulletColor ) && pFilterBase )
rioBulletMap.setProperty( PROP_BulletColor, static_cast< sal_Int32 >( maTextCharacterProperties.maFillProperties.getBestSolidColor().getColor( pFilterBase->getGraphicHelper())));
rioBulletMap.setProperty( PROP_BulletColor, maTextCharacterProperties.maFillProperties.getBestSolidColor().getColor( pFilterBase->getGraphicHelper()));
}
if ( bApplyBulletMap )
......@@ -456,7 +456,7 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p
{
// fix default bullet size to be 100%
if( !rioBulletMap.hasProperty( PROP_BulletRelSize ) )
rioBulletMap.setProperty( PROP_BulletRelSize, static_cast< sal_Int16 >( 100 ));
rioBulletMap.setProperty<sal_Int16>( PROP_BulletRelSize, 100);
Sequence< PropertyValue > aBulletPropSeq = rioBulletMap.makePropertyValueSequence();
xNumRule->replaceByIndex( getLevel(), makeAny( aBulletPropSeq ) );
}
......@@ -470,7 +470,7 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p
}
}
if ( noParaLeftMargin )
aPropSet.setProperty( PROP_ParaLeftMargin, sal_Int32( *noParaLeftMargin ) );
aPropSet.setProperty( PROP_ParaLeftMargin, *noParaLeftMargin);
if ( noFirstLineIndentation )
{
aPropSet.setProperty( PROP_ParaFirstLineIndent, *noFirstLineIndentation );
......
......@@ -830,7 +830,7 @@ void ShadowModel::pushToPropMap(ShapePropertyMap& rPropMap, const GraphicHelper&
aFormat.Location = table::ShadowLocation_BOTTOM_RIGHT;
// The width of the shadow is the average of the x and y values, see SwWW8ImplReader::MatchSdrItemsIntoFlySet().
aFormat.ShadowWidth = ((nOffsetX + nOffsetY) / 2);
rPropMap.setProperty(PROP_ShadowFormat, uno::makeAny(aFormat));
rPropMap.setProperty(PROP_ShadowFormat, aFormat);
}
TextpathModel::TextpathModel()
......
......@@ -511,7 +511,7 @@ void ShapeBase::convertShapeProperties( const Reference< XShape >& rxShape ) con
aBorderLine.Color = aPropMap.getProperty(PROP_LineColor).get<sal_Int32>();
if (oLineWidth)
aBorderLine.LineWidth = *oLineWidth;
aPropMap.setProperty(nBorder, uno::makeAny(aBorderLine));
aPropMap.setProperty(nBorder, aBorderLine);
}
aPropMap.erase(PROP_LineColor);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment