loplugin:reducevarscope in xmloff

Change-Id: Ib67311f84a6a7a490afb392e642d74693fde3113
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103747
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel 2020-10-01 11:00:51 +02:00 committed by Noel Grandin
parent cc2b7c1f93
commit 7bd7ff5a8d
31 changed files with 43 additions and 60 deletions

View File

@ -403,7 +403,6 @@ void XMLChartExportPropertyMapper::handleSpecialItem(
OUString sAttrName = getPropertySetMapper()->GetEntryXMLName( rProperty.mnIndex );
sal_uInt16 nNameSpace = getPropertySetMapper()->GetEntryNameSpace( rProperty.mnIndex );
OUStringBuffer sValueBuffer;
OUString sValue;
sal_Int32 nValue = 0;
bool bValue = false;
@ -519,7 +518,7 @@ void XMLChartExportPropertyMapper::handleSpecialItem(
if( !sValueBuffer.isEmpty())
{
sValue = sValueBuffer.makeStringAndClear();
OUString sValue = sValueBuffer.makeStringAndClear();
sAttrName = rNamespaceMap.GetQNameByKey( nNameSpace, sAttrName );
rAttrList.AddAttribute( sAttrName, sValue );
}

View File

@ -2659,7 +2659,6 @@ void SchXMLExportHelper_Impl::exportSeries(
xSource->getDataSequences());
sal_Int32 nMainSequenceIndex = -1;
sal_Int32 nSeriesLength = 0;
sal_Int32 nAttachedAxis = chart::ChartAxisAssign::PRIMARY_Y;
bool bHasMeanValueLine = false;
Reference< beans::XPropertySet > xPropSet;
tLabelValuesDataPair aSeriesLabelValuesPair;
@ -2671,10 +2670,10 @@ void SchXMLExportHelper_Impl::exportSeries(
sal_Int32 nSeqIdx=0;
for( ; nSeqIdx<aSeqCnt.getLength(); ++nSeqIdx )
{
OUString aRole;
Reference< chart2::data::XDataSequence > xTempValueSeq( aSeqCnt[nSeqIdx]->getValues() );
if( nMainSequenceIndex==-1 )
{
OUString aRole;
Reference< beans::XPropertySet > xSeqProp( xTempValueSeq, uno::UNO_QUERY );
if( xSeqProp.is())
xSeqProp->getPropertyValue("Role") >>= aRole;
@ -2694,6 +2693,7 @@ void SchXMLExportHelper_Impl::exportSeries(
// have found the main sequence, then xValuesSeq and
// xLabelSeq contain those. Otherwise both are empty
{
sal_Int32 nAttachedAxis = chart::ChartAxisAssign::PRIMARY_Y;
// get property states for autostyles
try
{
@ -3351,7 +3351,6 @@ void SchXMLExportHelper_Impl::exportDataPoints(
const sal_Int32 * pPoints = aDataPointSeq.getConstArray();
sal_Int32 nElement;
sal_Int32 nRepeat;
Reference< chart2::XColorScheme > xColorScheme;
if( xDiagram.is())
xColorScheme.set( xDiagram->getDefaultColorScheme());
@ -3539,7 +3538,7 @@ void SchXMLExportHelper_Impl::exportDataPoints(
nLastIndex = nCurrIndex;
}
// final empty elements
nRepeat = nSeriesLength - nLastIndex - 1;
sal_Int32 nRepeat = nSeriesLength - nLastIndex - 1;
if( nRepeat > 0 )
{
SchXMLDataPointStruct aPoint;

View File

@ -724,7 +724,6 @@ void SchXMLDataPointContext::StartElement( const uno::Reference< xml::sax::XAttr
{
OUString sAttrName = xAttrList->getNameByIndex( i );
OUString aLocalName;
bool bHideLegend = false;
sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
if( nPrefix == XML_NAMESPACE_CHART )
@ -753,7 +752,7 @@ void SchXMLDataPointContext::StartElement( const uno::Reference< xml::sax::XAttr
}
else if (IsXMLToken(aLocalName, XML_HIDE_LEGEND))
{
bHideLegend = xAttrList->getValueByIndex(i).toBoolean();
bool bHideLegend = xAttrList->getValueByIndex(i).toBoolean();
if (bHideLegend)
{
uno::Sequence<sal_Int32> deletedLegendEntriesSeq;

View File

@ -81,7 +81,6 @@ bool XMLErrorIndicatorPropertyHdl::importXML( const OUString& rStrImpValue,
bool XMLErrorIndicatorPropertyHdl::exportXML( OUString& rStrExpValue,
const uno::Any& rValue, const SvXMLUnitConverter& /*rUnitConverter*/ ) const
{
OUStringBuffer aBuffer;
chart::ChartErrorIndicatorType eType;
rValue >>= eType;
@ -92,6 +91,7 @@ bool XMLErrorIndicatorPropertyHdl::exportXML( OUString& rStrExpValue,
if( bValue )
{
OUStringBuffer aBuffer;
::sax::Converter::convertBool( aBuffer, bValue );
rStrExpValue = aBuffer.makeStringAndClear();
}

View File

@ -68,7 +68,6 @@ SignatureLineContext::SignatureLineContext(SvXMLImport& rImport, sal_uInt16 nPrf
xPropSet->setPropertyValue("SignatureLineUnsignedImage", Any(xUnsignedGraphic));
Reference<XGraphic> xGraphic;
bool bIsSigned(false);
try
{
// Get the document signatures
@ -97,6 +96,7 @@ SignatureLineContext::SignatureLineContext(SvXMLImport& rImport, sal_uInt16 nPrf
[&xAttrList](const DocumentSignatureInformation& rSignatureInfo) {
return rSignatureInfo.SignatureLineId == xAttrList->getValueByName("loext:id");
});
bool bIsSigned(false);
if (pSignatureInfo != xSignatureInfo.end())
{
bIsSigned = true;

View File

@ -299,7 +299,6 @@ void XMLAnimationsExporter::collect( const Reference< XShape >& xShape, SvXMLExp
Reference< XPropertySet > xProps( xShape, UNO_QUERY );
if( xProps.is() )
{
AnimationEffect eEffect;
XMLEffectHint aEffect;
if( any2bool( xProps->getPropertyValue( AnimExpImpl::gsSoundOn ) ) )
@ -328,7 +327,7 @@ void XMLAnimationsExporter::collect( const Reference< XShape >& xShape, SvXMLExp
}
{
AnimationEffect eEffect;
xProps->getPropertyValue( AnimExpImpl::gsEffect ) >>= eEffect;
if( eEffect != AnimationEffect_NONE )
{

View File

@ -878,11 +878,11 @@ bool XMLSdHeaderFooterVisibilityTypeHdl::exportXML(
const SvXMLUnitConverter& ) const
{
bool bRet = false;
OUStringBuffer aOut;
bool bValue;
if (rValue >>= bValue)
{
OUStringBuffer aOut;
::sax::Converter::convertBool( aOut, bValue );
rStrExpValue = aOut.makeStringAndClear();

View File

@ -2264,12 +2264,11 @@ void SdXMLExport::ExportMasterStyles_()
if(xMasterPage.is())
{
// prepare masterpage attributes
OUString sMasterPageName;
Reference < container::XNamed > xNamed(xMasterPage, UNO_QUERY);
if(xNamed.is())
{
bool bEncoded = false;
sMasterPageName = xNamed->getName();
OUString sMasterPageName = xNamed->getName();
AddAttribute(XML_NAMESPACE_STYLE, XML_NAME,
EncodeStyleName( sMasterPageName, &bEncoded ));
if( bEncoded )

View File

@ -4756,7 +4756,6 @@ void XMLShapeExport::ImpExportCustomShape(
if ( !xPropSet.is() )
return;
OUString aStr;
uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
// Transformation
@ -4764,6 +4763,7 @@ void XMLShapeExport::ImpExportCustomShape(
if ( xPropSetInfo.is() )
{
OUString aStr;
if ( xPropSetInfo->hasPropertyByName( "CustomShapeEngine" ) )
{
uno::Any aEngine( xPropSet->getPropertyValue( "CustomShapeEngine" ) );

View File

@ -117,7 +117,6 @@ namespace xmloff
bool OControlTextEmphasisHandler::exportXML( OUString& _rStrExpValue, const Any& _rValue, const SvXMLUnitConverter& ) const
{
OUStringBuffer aReturn;
bool bSuccess = false;
sal_Int16 nFontEmphasis = sal_Int16();
if (_rValue >>= nFontEmphasis)
@ -128,6 +127,7 @@ namespace xmloff
bool bBelow = 0 != (nFontEmphasis & awt::FontEmphasisMark::BELOW);
// convert
OUStringBuffer aReturn;
bSuccess = SvXMLUnitConverter::convertEnum(aReturn, nType, aFontEmphasisMap, XML_NONE);
if (bSuccess)
{

View File

@ -45,15 +45,12 @@ bool DrawAspectHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, c
bool DrawAspectHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
{
bool bRet = false;
OUStringBuffer aOut;
sal_Int64 nAspect = 0;
if( ( rValue >>= nAspect ) && nAspect > 0 )
{
// store the aspect as an integer value
aOut.append( nAspect );
rStrExpValue = aOut.makeStringAndClear();
rStrExpValue = OUString::number(nAspect);
bRet = true;
}

View File

@ -76,11 +76,10 @@ bool XMLBitmapRepeatOffsetPropertyHandler::exportXML(
const Any& rValue,
const SvXMLUnitConverter& ) const
{
OUStringBuffer aOut;
sal_Int32 nValue = 0;
if( rValue >>= nValue )
{
OUStringBuffer aOut;
::sax::Converter::convertPercent( aOut, nValue );
aOut.append( ' ' );
aOut.append( mbX ? msHorizontal : msVertical );

View File

@ -49,8 +49,6 @@ bool XMLConstantsPropertyHandler::exportXML(
const Any& rValue,
const SvXMLUnitConverter& ) const
{
OUStringBuffer aOut;
bool bRet = false;
sal_Int32 nEnum = 0;
@ -70,6 +68,7 @@ bool XMLConstantsPropertyHandler::exportXML(
if( (nEnum >= 0) && (nEnum <= 0xffff) )
{
sal_uInt16 nConst = static_cast<sal_uInt16>( nEnum );
OUStringBuffer aOut;
bRet = SvXMLUnitConverter::convertEnum(
aOut, nConst, pMap, eDefault );

View File

@ -65,11 +65,10 @@ bool XMLFillBitmapSizePropertyHandler::exportXML(
const Any& rValue,
const SvXMLUnitConverter& rUnitConverter ) const
{
OUStringBuffer aOut;
sal_Int32 nValue = 0;
if( rValue >>= nValue )
{
OUStringBuffer aOut;
if( nValue < 0 )
{
::sax::Converter::convertPercent( aOut, -nValue );

View File

@ -134,10 +134,10 @@ bool XMLCrossedOutTypePropHdl::exportXML( OUString& rStrExpValue, const uno::Any
{
bool bRet = false;
sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if (rValue >>= nValue)
{
OUStringBuffer aOut;
bRet = SvXMLUnitConverter::convertEnum(
aOut, nValue, pXML_CrossedoutType_Enum );
if( bRet )
@ -181,10 +181,10 @@ bool XMLCrossedOutStylePropHdl::exportXML( OUString& rStrExpValue, const uno::An
{
bool bRet = false;
sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if( rValue >>= nValue )
{
OUStringBuffer aOut;
bRet = SvXMLUnitConverter::convertEnum(
aOut, nValue, pXML_CrossedoutStyle_Enum );
if( bRet )
@ -250,10 +250,10 @@ bool XMLCrossedOutWidthPropHdl::exportXML( OUString& rStrExpValue, const uno::An
{
bool bRet = false;
sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if( (rValue >>= nValue) && (awt::FontStrikeout::BOLD == nValue) )
{
OUStringBuffer aOut;
bRet = SvXMLUnitConverter::convertEnum(
aOut, nValue, pXML_CrossedoutWidth_Enum );
if( bRet )

View File

@ -135,11 +135,10 @@ bool XMLCharHeightDiffHdl::importXML( const OUString& rStrImpValue, uno::Any& rV
bool XMLCharHeightDiffHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
{
OUStringBuffer aOut;
float nRel = 0;
if( (rValue >>= nRel) && (nRel != 0) )
{
OUStringBuffer aOut;
::sax::Converter::convertMeasure( aOut, static_cast<sal_Int32>(nRel),
util::MeasureUnit::POINT, util::MeasureUnit::POINT );
rStrExpValue = aOut.makeStringAndClear();

View File

@ -58,10 +58,10 @@ bool XMLCaseMapPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValu
{
bool bRet = false;
sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if( rValue >>= nValue )
{
OUStringBuffer aOut;
bRet = SvXMLUnitConverter::convertEnum(
aOut, nValue, pXML_Casemap_Enum );
if( bRet )

View File

@ -239,15 +239,13 @@ bool XMLFontEncodingPropHdl::importXML( const OUString& rStrImpValue, uno::Any&
bool XMLFontEncodingPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
{
bool bRet = false;
OUStringBuffer aOut;
sal_Int16 nSet = sal_Int16();
if( rValue >>= nSet )
{
if( static_cast<rtl_TextEncoding>(nSet) == RTL_TEXTENCODING_SYMBOL )
{
aOut.append( GetXMLToken(XML_X_SYMBOL) );
rStrExpValue = aOut.makeStringAndClear();
rStrExpValue = GetXMLToken(XML_X_SYMBOL);
bRet = true;
}
}
@ -275,7 +273,6 @@ bool XMLFontPitchPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rVa
{
bool bRet = false;
sal_Int16 nPitch = sal_Int16();
OUStringBuffer aOut;
FontPitch ePitch = PITCH_DONTKNOW;
if( rValue >>= nPitch )
@ -283,6 +280,7 @@ bool XMLFontPitchPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rVa
if( PITCH_DONTKNOW != ePitch )
{
OUStringBuffer aOut;
bRet = SvXMLUnitConverter::convertEnum( aOut, ePitch, aFontPitchMapping, XML_FIXED );
rStrExpValue = aOut.makeStringAndClear();
}

View File

@ -120,7 +120,6 @@ bool XMLShadowPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue
bool XMLShadowPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
{
bool bRet = false;
OUStringBuffer aOut;
table::ShadowFormat aShadow;
if( rValue >>= aShadow )
@ -150,8 +149,8 @@ bool XMLShadowPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue
nX *= aShadow.ShadowWidth;
nY *= aShadow.ShadowWidth;
OUStringBuffer aOut;
::sax::Converter::convertColor( aOut, aShadow.Color );
aOut.append( ' ' );
rUnitConverter.convertMeasureToXML( aOut, nX );
aOut.append( ' ' );

View File

@ -281,7 +281,6 @@ bool XMLStyleExport::exportStyle(
Reference< XChapterNumberingSupplier > xCNSupplier
(GetExport().GetModel(), UNO_QUERY);
OUString sOutlineName;
if (xCNSupplier.is())
{
Reference< XIndexReplace > xNumRule
@ -290,6 +289,7 @@ bool XMLStyleExport::exportStyle(
Reference< XPropertySet > xNumRulePropSet
(xNumRule, UNO_QUERY);
OUString sOutlineName;
xNumRulePropSet->getPropertyValue("Name")
>>= sOutlineName;
bSuppressListStyle = sListName == sOutlineName;

View File

@ -168,12 +168,12 @@ bool XMLUnderlineTypePropHdl::exportXML( OUString& rStrExpValue, const uno::Any&
{
bool bRet = false;
sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if( (rValue >>= nValue) &&
(awt::FontUnderline::DOUBLE == nValue ||
awt::FontUnderline::DOUBLEWAVE == nValue) )
{
OUStringBuffer aOut;
bRet = SvXMLUnitConverter::convertEnum(
aOut, nValue, pXML_UnderlineType_Enum );
if( bRet )
@ -259,10 +259,10 @@ bool XMLUnderlineStylePropHdl::exportXML( OUString& rStrExpValue, const uno::Any
{
bool bRet = false;
sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if( rValue >>= nValue )
{
OUStringBuffer aOut;
bRet = SvXMLUnitConverter::convertEnum(
aOut, nValue, pXML_UnderlineStyle_Enum );
if( bRet )
@ -349,10 +349,10 @@ bool XMLUnderlineWidthPropHdl::exportXML( OUString& rStrExpValue, const uno::Any
{
bool bRet = false;
sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if( (rValue >>= nValue) && (awt::FontUnderline::NONE != nValue) )
{
OUStringBuffer aOut;
bRet = SvXMLUnitConverter::convertEnum(
aOut, nValue, pXML_UnderlineWidth_Enum );
if( bRet )

View File

@ -192,10 +192,10 @@ bool XMLMeasurePropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, co
{
bool bRet = false;
sal_Int32 nValue;
OUStringBuffer aOut;
if( lcl_xmloff_getAny( rValue, nValue, nBytes ) )
{
OUStringBuffer aOut;
rUnitConverter.convertMeasureToXML( aOut, nValue );
rStrExpValue = aOut.makeStringAndClear();
@ -304,10 +304,10 @@ bool XMLPercentPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, co
{
bool bRet = false;
sal_Int32 nValue;
OUStringBuffer aOut;
if( lcl_xmloff_getAny( rValue, nValue, nBytes ) )
{
OUStringBuffer aOut;
::sax::Converter::convertPercent( aOut, nValue );
rStrExpValue = aOut.makeStringAndClear();
@ -382,10 +382,10 @@ bool XMLNegPercentPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue,
{
bool bRet = false;
sal_Int32 nValue;
OUStringBuffer aOut;
if( lcl_xmloff_getAny( rValue, nValue, nBytes ) )
{
OUStringBuffer aOut;
::sax::Converter::convertPercent( aOut, 100-nValue );
rStrExpValue = aOut.makeStringAndClear();
@ -412,10 +412,10 @@ bool XMLMeasurePxPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue,
{
bool bRet = false;
sal_Int32 nValue;
OUStringBuffer aOut;
if( lcl_xmloff_getAny( rValue, nValue, nBytes ) )
{
OUStringBuffer aOut;
::sax::Converter::convertMeasurePx( aOut, nValue );
rStrExpValue = aOut.makeStringAndClear();
@ -514,9 +514,9 @@ bool XMLHexPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const
bool bRet = false;
sal_uInt32 nRsid = 0;
OUStringBuffer aOut;
if( rValue >>= nRsid )
{
OUStringBuffer aOut;
SvXMLUnitConverter::convertHex( aOut, nRsid );
rStrExpValue = aOut.makeStringAndClear();

View File

@ -142,12 +142,11 @@ void SvXMLImportPropertyMapper::importXML(
const css::uno::Sequence< css::xml::Attribute > unknownAttribs = xAttrList->getUnknownAttributes();
for (const css::xml::Attribute& rAttribute : unknownAttribs)
{
OUString aPrefix;
int nSepIndex = rAttribute.Name.indexOf(SvXMLImport::aNamespaceSeparator);
if (nSepIndex != -1)
{
// If it's an unknown attribute in a known namespace, ignore it.
aPrefix = rAttribute.Name.copy(0, nSepIndex);
OUString aPrefix = rAttribute.Name.copy(0, nSepIndex);
if (rNamespaceMap.GetKeyByPrefix(aPrefix) != USHRT_MAX)
continue;
}

View File

@ -1935,7 +1935,6 @@ sal_uInt32 SvXMLNumFmtExport::ForceSystemLanguage( sal_uInt32 nKey )
{
SAL_WARN_IF( pFormatter == nullptr, "xmloff.style", "format without formatter?" );
sal_Int32 nErrorPos;
SvNumFormatType nType = pFormat->GetType();
sal_uInt32 nNewKey = pFormatter->GetFormatForLanguageIfBuiltIn(
@ -1948,6 +1947,7 @@ sal_uInt32 SvXMLNumFmtExport::ForceSystemLanguage( sal_uInt32 nKey )
else
{
OUString aFormatString( pFormat->GetFormatstring() );
sal_Int32 nErrorPos;
pFormatter->PutandConvertEntry(
aFormatString,
nErrorPos, nType, nNewKey,

View File

@ -613,14 +613,13 @@ Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( XmlStyleFamily
if( XmlStyleFamily::TEXT_TEXT == nFamily || XmlStyleFamily::TEXT_PARAGRAPH == nFamily)
{
bool bPara = XmlStyleFamily::TEXT_PARAGRAPH == nFamily;
OUString sName;
if( !bPara && mxTextAutoStyles.is() )
xAutoStyles = mxTextAutoStyles;
else if( bPara && mxParaAutoStyles.is() )
xAutoStyles = mxParaAutoStyles;
else
{
sName = bPara ? OUStringLiteral( u"ParagraphStyles" ): OUStringLiteral( u"CharacterStyles" );
OUStringLiteral sName = bPara ? OUStringLiteral( u"ParagraphStyles" ): OUStringLiteral( u"CharacterStyles" );
Reference< XAutoStylesSupplier > xAutoStylesSupp( GetImport().GetModel(), UNO_QUERY );
Reference< XAutoStyles > xAutoStyleFamilies = xAutoStylesSupp->getAutoStyles();
if (xAutoStyleFamilies->hasByName(sName))

View File

@ -131,7 +131,6 @@ void XMLSectionFootnoteConfigExport::exportXML(
GetXMLToken( bEndnote ? XML_ENDNOTE
: XML_FOOTNOTE ) );
// start numbering
OUStringBuffer sBuf;
if (bNumRestart)
{
// restart number is stored as 0.., but interpreted as 1..
@ -154,6 +153,7 @@ void XMLSectionFootnoteConfigExport::exportXML(
}
// number type: num format
OUStringBuffer sBuf;
rExport.GetMM100UnitConverter().convertNumFormat( sBuf,
nNumberingType );
rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_FORMAT,

View File

@ -46,7 +46,6 @@ XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport,
bLeft( bLft ),
bFirst( bFrst )
{
const OUString sShareContentFirst( "FirstIsShared" );
// NOTE: if this ever handles XML_DISPLAY attr then beware of fdo#72850 !
if( !(bLeft || bFirst) )
return;
@ -70,6 +69,7 @@ XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport,
}
if (bFirst)
{
const OUString sShareContentFirst( "FirstIsShared" );
aAny = xPropSet->getPropertyValue( sShareContentFirst );
bool bSharedFirst = bool();
if (!(aAny >>= bSharedFirst))

View File

@ -47,8 +47,6 @@ void XMLTextDropCapExport::exportXML( const Any& rAny,
{
DropCapFormat aFormat;
rAny >>= aFormat;
OUString sValue;
OUStringBuffer sBuffer;
if( aFormat.Lines > 1 )
{
SvXMLUnitConverter& rUnitConv = rExport.GetMM100UnitConverter();
@ -58,6 +56,7 @@ void XMLTextDropCapExport::exportXML( const Any& rAny,
OUString::number( aFormat.Lines ) );
// style:length
OUString sValue;
if( bWholeWord )
{
sValue = GetXMLToken(XML_WORD);
@ -72,6 +71,7 @@ void XMLTextDropCapExport::exportXML( const Any& rAny,
// style:distance
if( aFormat.Distance > 0 )
{
OUStringBuffer sBuffer;
rUnitConv.convertMeasureToXML( sBuffer, aFormat.Distance );
rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_DISTANCE,
sBuffer.makeStringAndClear() );

View File

@ -2261,7 +2261,6 @@ void XMLTextFieldExport::ExportMacro(
{
// some strings we'll need
OUString sEventType( "EventType" );
OUString sScript( "Script" );
OUString sPropertyScriptURL( "ScriptURL" );
@ -2285,6 +2284,7 @@ void XMLTextFieldExport::ExportMacro(
// Framework URL, otherwise treat it as a Basic Macro
if (!sName.isEmpty())
{
OUString sScript( "Script" );
aSeq = Sequence<PropertyValue> (2);
PropertyValue* pArr = aSeq.getArray();
pArr[0].Name = sEventType;

View File

@ -2001,7 +2001,6 @@ void XMLTextParagraphExport::exportParagraph(
{
Reference< XChapterNumberingSupplier > xCNSupplier( GetExport().GetModel(), UNO_QUERY );
OUString sOutlineName;
if (xCNSupplier.is())
{
Reference< XIndexReplace > xNumRule ( xCNSupplier->getChapterNumberingRules() );
@ -2010,6 +2009,7 @@ void XMLTextParagraphExport::exportParagraph(
if (xNumRule.is())
{
Reference< XPropertySet > xNumRulePropSet( xNumRule, UNO_QUERY );
OUString sOutlineName;
xNumRulePropSet->getPropertyValue(
"Name" ) >>= sOutlineName;
bAssignedtoOutlineStyle = ( sListStyleName == sOutlineName );

View File

@ -49,7 +49,6 @@ using namespace ::xmloff::token;
void XMLTextParagraphExport::exportStyleAttributes(
const css::uno::Reference< css::style::XStyle > & rStyle )
{
OUString sName;
Reference< XPropertySet > xPropSet( rStyle, UNO_QUERY );
Reference< XPropertySetInfo > xPropSetInfo(
xPropSet->getPropertySetInfo());
@ -91,6 +90,7 @@ void XMLTextParagraphExport::exportStyleAttributes(
if( PropertyState_DIRECT_VALUE ==
xPropState->getPropertyState( gsPageDescName ) )
{
OUString sName;
xPropSet->getPropertyValue( gsPageDescName ) >>= sName;
// fix for #i5551# if( sName.getLength() > 0 )
GetExport().AddAttribute( XML_NAMESPACE_STYLE,