[Libreoffice-commits] core.git: xmloff/source

Joren De Cuyper jorendc at libreoffice.org
Tue Jul 29 05:44:51 PDT 2014


 xmloff/source/chart/SchXMLExport.cxx           |   93 +++++++++----------------
 xmloff/source/core/DocumentSettingsContext.cxx |   45 ++++--------
 xmloff/source/draw/shapeexport.cxx             |   64 ++++++-----------
 xmloff/source/draw/ximpshap.cxx                |   26 ++----
 xmloff/source/text/txtparae.cxx                |   58 ++++++---------
 5 files changed, 105 insertions(+), 181 deletions(-)

New commits:
commit ccdd9a2c549d32f1c53437f17510af1ac9de5efe
Author: Joren De Cuyper <jorendc at libreoffice.org>
Date:   Mon Jul 28 19:30:00 2014 +0200

    Further OUString cleanup in xmloff/
    
    Change-Id: Ic749119931db569bf26c8d8a58da7d468811f927
    Reviewed-on: https://gerrit.libreoffice.org/10598
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 9652641..ede6793 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -296,8 +296,7 @@ public:
         OUString aRole;
 
         return ( xProp.is() &&
-                 (xProp->getPropertyValue(
-                     OUString(  "Role" ) ) >>= aRole ) &&
+                 (xProp->getPropertyValue( "Role" ) >>= aRole ) &&
                  m_aRole.equals( aRole ));
     }
 
@@ -1186,16 +1185,15 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >&
             aAny >>= bHasLegend;
             if ( bIncludeTable )
             {
-                OUString sNullDate("NullDate");
-                aAny = xDocPropSet->getPropertyValue(sNullDate);
+                aAny = xDocPropSet->getPropertyValue("NullDate");
                 if ( !aAny.hasValue() )
                 {
                     Reference<container::XChild> xChild(rChartDoc, uno::UNO_QUERY );
                     if ( xChild.is() )
                     {
                         Reference< beans::XPropertySet > xParentDoc( xChild->getParent(),uno::UNO_QUERY);
-                        if ( xParentDoc.is() && xParentDoc->getPropertySetInfo()->hasPropertyByName(sNullDate) )
-                            aAny = xParentDoc->getPropertyValue(sNullDate);
+                        if ( xParentDoc.is() && xParentDoc->getPropertySetInfo()->hasPropertyByName("NullDate") )
+                            aAny = xParentDoc->getPropertyValue("NullDate");
                     }
                 }
 
@@ -2313,14 +2311,13 @@ void SchXMLExportHelper_Impl::exportAxis(
     bool bHasTitle, bool bHasMajorGrid, bool bHasMinorGrid,
     bool bExportContent )
 {
-    static const OUString sNumFormat( "NumberFormat" );
     std::vector< XMLPropertyState > aPropertyStates;
     SvXMLElementExport* pAxis = NULL;
 
     // get property states for autostyles
     if( xAxisProps.is() && mxExpPropMapper.is() )
     {
-        lcl_exportNumberFormat( sNumFormat, xAxisProps, mrExport );
+        lcl_exportNumberFormat( "NumberFormat", xAxisProps, mrExport );
         aPropertyStates = mxExpPropMapper->Filter( xAxisProps );
 
         if (!maSrcShellID.isEmpty() && !maDestShellID.isEmpty() && maSrcShellID != maDestShellID)
@@ -2417,41 +2414,25 @@ void SchXMLExportHelper_Impl::exportAxes(
     // get multiple properties using XMultiPropertySet
     MultiPropertySetHandler aDiagramProperties (xDiagram);
 
-    aDiagramProperties.Add (
-        OUString("HasXAxis"), bHasXAxis);
-    aDiagramProperties.Add (
-        OUString("HasYAxis"), bHasYAxis);
-    aDiagramProperties.Add (
-        OUString("HasZAxis"), bHasZAxis);
-    aDiagramProperties.Add (
-        OUString("HasSecondaryXAxis"), bHasSecondaryXAxis);
-    aDiagramProperties.Add (
-        OUString("HasSecondaryYAxis"), bHasSecondaryYAxis);
-
-    aDiagramProperties.Add (
-        OUString ("HasXAxisTitle"), bHasXAxisTitle);
-    aDiagramProperties.Add (
-        OUString ("HasYAxisTitle"), bHasYAxisTitle);
-    aDiagramProperties.Add (
-        OUString ("HasZAxisTitle"), bHasZAxisTitle);
-    aDiagramProperties.Add (
-        OUString ("HasSecondaryXAxisTitle"), bHasSecondaryXAxisTitle);
-    aDiagramProperties.Add (
-        OUString ("HasSecondaryYAxisTitle"), bHasSecondaryYAxisTitle);
-
-    aDiagramProperties.Add (
-        OUString ("HasXAxisGrid"), bHasXAxisMajorGrid);
-    aDiagramProperties.Add (
-        OUString ("HasYAxisGrid"), bHasYAxisMajorGrid);
-    aDiagramProperties.Add (
-        OUString ("HasZAxisGrid"), bHasZAxisMajorGrid);
-
-    aDiagramProperties.Add (
-        OUString ("HasXAxisHelpGrid"), bHasXAxisMinorGrid);
-    aDiagramProperties.Add (
-        OUString ("HasYAxisHelpGrid"), bHasYAxisMinorGrid);
-    aDiagramProperties.Add (
-        OUString ("HasZAxisHelpGrid"), bHasZAxisMinorGrid);
+    aDiagramProperties.Add ("HasXAxis", bHasXAxis);
+    aDiagramProperties.Add ("HasYAxis", bHasYAxis);
+    aDiagramProperties.Add ("HasZAxis", bHasZAxis);
+    aDiagramProperties.Add ("HasSecondaryXAxis", bHasSecondaryXAxis);
+    aDiagramProperties.Add ("HasSecondaryYAxis", bHasSecondaryYAxis);
+
+    aDiagramProperties.Add ("HasXAxisTitle", bHasXAxisTitle);
+    aDiagramProperties.Add ("HasYAxisTitle", bHasYAxisTitle);
+    aDiagramProperties.Add ("HasZAxisTitle", bHasZAxisTitle);
+    aDiagramProperties.Add ("HasSecondaryXAxisTitle", bHasSecondaryXAxisTitle);
+    aDiagramProperties.Add ("HasSecondaryYAxisTitle", bHasSecondaryYAxisTitle);
+
+    aDiagramProperties.Add ("HasXAxisGrid", bHasXAxisMajorGrid);
+    aDiagramProperties.Add ("HasYAxisGrid", bHasYAxisMajorGrid);
+    aDiagramProperties.Add ("HasZAxisGrid", bHasZAxisMajorGrid);
+
+    aDiagramProperties.Add ("HasXAxisHelpGrid", bHasXAxisMinorGrid);
+    aDiagramProperties.Add ("HasYAxisHelpGrid", bHasYAxisMinorGrid);
+    aDiagramProperties.Add ("HasZAxisHelpGrid", bHasZAxisMinorGrid);
 
     if ( ! aDiagramProperties.GetProperties ())
     {
@@ -2604,9 +2585,6 @@ void SchXMLExportHelper_Impl::exportSeries(
 
     std::vector< XMLPropertyState > aPropertyStates;
 
-    const OUString sNumFormat("NumberFormat");
-    const OUString sPercentageNumFormat( "PercentageNumberFormat");
-
     Sequence< Reference< chart2::XCoordinateSystem > >
         aCooSysSeq( xBCooSysCnt->getCoordinateSystems());
     for( sal_Int32 nCSIdx=0; nCSIdx<aCooSysSeq.getLength(); ++nCSIdx )
@@ -2716,8 +2694,8 @@ void SchXMLExportHelper_Impl::exportSeries(
                                 const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
                                 if( nCurrentODFVersion >= SvtSaveOptions::ODFVER_012 )
                                 {
-                                    lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport );
-                                    lcl_exportNumberFormat( sPercentageNumFormat, xPropSet, mrExport );
+                                    lcl_exportNumberFormat( "NumberFormat", xPropSet, mrExport );
+                                    lcl_exportNumberFormat( "PercentageNumberFormat", xPropSet, mrExport );
                                 }
 
                                 if( mxExpPropMapper.is())
@@ -3002,8 +2980,8 @@ void SchXMLExportHelper_Impl::exportRegressionCurve(
             xEquationProperties.set( xRegCurve->getEquationProperties() );
             if( xEquationProperties.is())
             {
-                xEquationProperties->getPropertyValue( OUString("ShowEquation")) >>= bShowEquation;
-                xEquationProperties->getPropertyValue( OUString("ShowCorrelationCoefficient")) >>= bShowRSquared;
+                xEquationProperties->getPropertyValue( "ShowEquation") >>= bShowEquation;
+                xEquationProperties->getPropertyValue( "ShowCorrelationCoefficient") >>= bShowRSquared;
 
                 bExportEquation = ( bShowEquation || bShowRSquared );
                 const SvtSaveOptions::ODFDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFDefaultVersion() );
@@ -3015,7 +2993,7 @@ void SchXMLExportHelper_Impl::exportRegressionCurve(
                 {
                     // number format
                     sal_Int32 nNumberFormat = 0;
-                    if( (xEquationProperties->getPropertyValue(OUString("NumberFormat")) >>= nNumberFormat ) &&
+                    if( (xEquationProperties->getPropertyValue("NumberFormat") >>= nNumberFormat ) &&
                         nNumberFormat != -1 )
                     {
                         mrExport.addDataStyle( nNumberFormat );
@@ -3098,7 +3076,7 @@ void SchXMLExportHelper_Impl::exportErrorBar( const Reference<beans::XPropertySe
         {
             Any aAny;
 
-            aAny = xSeriesProp->getPropertyValue( bYError ? OUString("ErrorBarY") : OUString("ErrorBarX") );
+            aAny = xSeriesProp->getPropertyValue( bYError ? "ErrorBarY" : "ErrorBarX" );
             aAny >>= xErrorBarProp;
 
             if ( xErrorBarProp.is() )
@@ -3294,9 +3272,6 @@ void SchXMLExportHelper_Impl::exportDataPoints(
 
     std::vector< XMLPropertyState > aPropertyStates;
 
-    const OUString sNumFormat("NumberFormat");
-    const OUString sPercentageNumFormat( "PercentageNumberFormat");
-
     bool bVaryColorsByPoint = false;
     Sequence< sal_Int32 > aDataPointSeq;
     if( xSeriesProperties.is())
@@ -3357,8 +3332,8 @@ void SchXMLExportHelper_Impl::exportDataPoints(
                 const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
                 if( nCurrentODFVersion >= SvtSaveOptions::ODFVER_012 && bExportNumFmt )
                 {
-                    lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport );
-                    lcl_exportNumberFormat( sPercentageNumFormat, xPropSet, mrExport );
+                    lcl_exportNumberFormat( "NumberFormat", xPropSet, mrExport );
+                    lcl_exportNumberFormat( "PercentageNumberFormat", xPropSet, mrExport );
                 }
 
                 aPropertyStates = mxExpPropMapper->Filter( xPropSet );
@@ -3418,8 +3393,8 @@ void SchXMLExportHelper_Impl::exportDataPoints(
                 const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
                 if( nCurrentODFVersion >= SvtSaveOptions::ODFVER_012 )
                 {
-                    lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport );
-                    lcl_exportNumberFormat( sPercentageNumFormat, xPropSet, mrExport );
+                    lcl_exportNumberFormat( "NumberFormat", xPropSet, mrExport );
+                    lcl_exportNumberFormat( "PercentageNumberFormat", xPropSet, mrExport );
                 }
 
                 aPropertyStates = mxExpPropMapper->Filter( xPropSet );
diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index b65266a..cc3c27f 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -761,37 +761,32 @@ void XMLConfigItemMapIndexedContext::EndElement()
                         beans::PropertyValue *pForChar = aProps.getArray();
                         i18n::ForbiddenCharacters aForbid;
                         lang::Locale aLocale;
-                        const OUString sLanguage  ( "Language" );
-                        const OUString sCountry   ( "Country" );
-                        const OUString sVariant   ( "Variant" );
-                        const OUString sBeginLine ( "BeginLine" );
-                        const OUString sEndLine   ( "EndLine" );
                         bool bHaveLanguage = false, bHaveCountry = false, bHaveVariant = false,
                              bHaveBegin = false, bHaveEnd = false;
 
                         for ( sal_Int32 j = 0 ; j < XML_FORBIDDEN_CHARACTER_MAX ; j++ )
                         {
-                            if (pForChar->Name.equals (sLanguage ) )
+                            if (pForChar->Name.equals ( "Language" ) )
                             {
                                 pForChar->Value >>= aLocale.Language;
                                 bHaveLanguage = true;
                             }
-                            else if (pForChar->Name.equals (sCountry ) )
+                            else if (pForChar->Name.equals ( "Country" ) )
                             {
                                 pForChar->Value >>= aLocale.Country;
                                 bHaveCountry = true;
                             }
-                            else if (pForChar->Name.equals (sVariant ) )
+                            else if (pForChar->Name.equals ( "Variant" ) )
                             {
                                 pForChar->Value >>= aLocale.Variant;
                                 bHaveVariant = true;
                             }
-                            else if (pForChar->Name.equals (sBeginLine ) )
+                            else if (pForChar->Name.equals ( "BeginLine" ) )
                             {
                                 pForChar->Value >>= aForbid.beginLine;
                                 bHaveBegin = true;
                             }
-                            else if (pForChar->Name.equals (sEndLine ) )
+                            else if (pForChar->Name.equals ( "EndLine" ) )
                             {
                                 pForChar->Value >>= aForbid.endLine;
                                 bHaveEnd = true;
@@ -829,16 +824,6 @@ void XMLConfigItemMapIndexedContext::EndElement()
 
             formula::SymbolDescriptor *pDescriptor = aSymbolList.getArray();
 
-            const OUString sName     ( "Name" );
-            const OUString sExportName ( "ExportName" );
-            const OUString sFontName ( "FontName" );
-            const OUString sSymbolSet ( "SymbolSet" );
-            const OUString sCharacter ( "Character" );
-            const OUString sCharSet  ( "CharSet" );
-            const OUString sFamily   ( "Family" );
-            const OUString sPitch    ( "Pitch" );
-            const OUString sWeight   ( "Weight" );
-            const OUString sItalic   ( "Italic" );
             sal_Int16 nNumFullEntries = 0;
 
             for ( sal_Int32 i = 0; i < nCount; i++ )
@@ -853,52 +838,52 @@ void XMLConfigItemMapIndexedContext::EndElement()
 
                     for ( sal_Int32 j = 0 ; j < XML_SYMBOL_DESCRIPTOR_MAX ; j++ )
                     {
-                        if (pSymbol->Name.equals ( sName ) )
+                        if (pSymbol->Name.equals ( "Name" ) )
                         {
                             pSymbol->Value >>= pDescriptor[nNumFullEntries].sName;
                             bHaveName = true;
                         }
-                        else if (pSymbol->Name.equals (sExportName ) )
+                        else if (pSymbol->Name.equals ( "ExportName" ) )
                         {
                             pSymbol->Value >>= pDescriptor[nNumFullEntries].sExportName;
                             bHaveExportName = true;
                         }
-                        else if (pSymbol->Name.equals (sFontName ) )
+                        else if (pSymbol->Name.equals ( "FontName" ) )
                         {
                             pSymbol->Value >>= pDescriptor[nNumFullEntries].sFontName;
                             bHaveFontName = true;
                         }
-                        else if (pSymbol->Name.equals (sCharSet ) )
+                        else if (pSymbol->Name.equals ( "CharSet" ) )
                         {
                             pSymbol->Value >>= pDescriptor[nNumFullEntries].nCharSet;
                             bHaveCharSet = true;
                         }
-                        else if (pSymbol->Name.equals (sFamily ) )
+                        else if (pSymbol->Name.equals ( "Family" ) )
                         {
                             pSymbol->Value >>= pDescriptor[nNumFullEntries].nFamily;
                             bHaveFamily = true;
                         }
-                        else if (pSymbol->Name.equals (sPitch ) )
+                        else if (pSymbol->Name.equals ( "Pitch" ) )
                         {
                             pSymbol->Value >>= pDescriptor[nNumFullEntries].nPitch;
                             bHavePitch = true;
                         }
-                        else if (pSymbol->Name.equals (sWeight ) )
+                        else if (pSymbol->Name.equals ( "Weight" ) )
                         {
                             pSymbol->Value >>= pDescriptor[nNumFullEntries].nWeight;
                             bHaveWeight = true;
                         }
-                        else if (pSymbol->Name.equals (sItalic ) )
+                        else if (pSymbol->Name.equals ( "Italic" ) )
                         {
                             pSymbol->Value >>= pDescriptor[nNumFullEntries].nItalic;
                             bHaveItalic = true;
                         }
-                        else if (pSymbol->Name.equals (sSymbolSet ) )
+                        else if (pSymbol->Name.equals ( "SymbolSet" ) )
                         {
                             pSymbol->Value >>= pDescriptor[nNumFullEntries].sSymbolSet;
                             bHaveSymbolSet = true;
                         }
-                        else if (pSymbol->Name.equals (sCharacter ) )
+                        else if (pSymbol->Name.equals ( "Character" ) )
                         {
                             pSymbol->Value >>= pDescriptor[nNumFullEntries].nCharacter;
                             bHaveCharacter = true;
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index ba8ce16..2d23a8b 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -433,9 +433,8 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap
                     // * defaults for style properties are not written, but we need to write the "left",
                     //   because we need to distiguish this "left" from the case where not align attribute
                     //   is present which means "void"
-                    static const OUString s_sParaAdjustPropertyName(  "ParaAdjust"  );
-                    if  (   xPropSetInfo->hasPropertyByName( s_sParaAdjustPropertyName )
-                        &&  ( beans::PropertyState_DEFAULT_VALUE == xPropState->getPropertyState( s_sParaAdjustPropertyName ) )
+                    if  (   xPropSetInfo->hasPropertyByName( "ParaAdjust" )
+                        &&  ( beans::PropertyState_DEFAULT_VALUE == xPropState->getPropertyState( "ParaAdjust" ) )
                         )
                     {
                         sal_Int32 nIndex = GetExport().GetTextParagraphExport()->GetParagraphPropertyMapper()->getPropertySetMapper()->FindEntryIndex( CTF_SD_SHAPE_PARA_ADJUST );
@@ -443,7 +442,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap
                             //          as member, thus saving time.
                         DBG_ASSERT(-1 != nIndex, "XMLShapeExport::collectShapeAutoStyles: could not obtain the index for the ParaAdjust context id!");
 
-                        uno::Any aParaAdjustValue = xPropSet->getPropertyValue( s_sParaAdjustPropertyName );
+                        uno::Any aParaAdjustValue = xPropSet->getPropertyValue( "ParaAdjust" );
                         XMLPropertyState aAlignDefaultState( nIndex, aParaAdjustValue );
 
                         xPropStates.push_back( aAlignDefaultState );
@@ -1311,8 +1310,7 @@ void XMLShapeExport::ImpExportNewTrans_GetB2DHomMatrix(::basegfx::B2DHomMatrix&
     */
     uno::Any aAny;
     if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 &&
-         xPropSet->getPropertySetInfo()->hasPropertyByName(
-            OUString("TransformationInHoriL2R")) )
+         xPropSet->getPropertySetInfo()->hasPropertyByName("TransformationInHoriL2R") )
     {
         aAny = xPropSet->getPropertyValue("TransformationInHoriL2R");
     }
@@ -2271,7 +2269,7 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
                         sRequestedName = sRequestedName.copy( 0, nLastIndex );
                     if ( !sRequestedName.isEmpty() )
                     {
-                        aResolveURL = aResolveURL.concat( OUString("?requestedName="));
+                        aResolveURL = aResolveURL.concat( "?requestedName=");
                         aResolveURL = aResolveURL.concat( sRequestedName );
                     }
                 }
@@ -2296,7 +2294,7 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
 
                         uno::Any aAny;
                         aAny <<= aStreamURL;
-                        xPropSet->setPropertyValue( OUString("GraphicStreamURL"), aAny );
+                        xPropSet->setPropertyValue( "GraphicStreamURL", aAny );
                     }
 
                     mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
@@ -2470,10 +2468,8 @@ void XMLShapeExport::ImpExportConnectorShape(
        the OASIS Open Office file format to the OpenOffice.org file format. (#i36248#)
     */
     if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 &&
-         xProps->getPropertySetInfo()->hasPropertyByName(
-            OUString("StartPositionInHoriL2R")) &&
-         xProps->getPropertySetInfo()->hasPropertyByName(
-            OUString("EndPositionInHoriL2R")) )
+         xProps->getPropertySetInfo()->hasPropertyByName("StartPositionInHoriL2R") &&
+         xProps->getPropertySetInfo()->hasPropertyByName("EndPositionInHoriL2R") )
     {
         xProps->getPropertyValue("StartPositionInHoriL2R") >>= aStart;
         xProps->getPropertyValue("EndPositionInHoriL2R") >>= aEnd;
@@ -2644,10 +2640,8 @@ void XMLShapeExport::ImpExportMeasureShape(
        the OASIS Open Office file format to the OpenOffice.org file format. (#i36248#)
     */
     if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 &&
-         xProps->getPropertySetInfo()->hasPropertyByName(
-            OUString("StartPositionInHoriL2R")) &&
-         xProps->getPropertySetInfo()->hasPropertyByName(
-            OUString("EndPositionInHoriL2R")) )
+         xProps->getPropertySetInfo()->hasPropertyByName("StartPositionInHoriL2R") &&
+         xProps->getPropertySetInfo()->hasPropertyByName("EndPositionInHoriL2R") )
     {
         xProps->getPropertyValue("StartPositionInHoriL2R") >>= aStart;
         xProps->getPropertyValue("EndPositionInHoriL2R") >>= aEnd;
@@ -3107,17 +3101,15 @@ static void lcl_CopyStream(
     if (!xOutStream.is())
     {
         SAL_WARN("xmloff", "no output stream");
-        throw uno::Exception(
-            OUString("no output stream"),0);
+        throw uno::Exception("no output stream",0);
     }
     uno::Reference< beans::XPropertySet > const xStreamProps(xStream,
         uno::UNO_QUERY);
     if (xStreamProps.is()) { // this is NOT supported in FileSystemStorage
-        xStreamProps->setPropertyValue(
-            OUString("MediaType"),
+        xStreamProps->setPropertyValue("MediaType",
             uno::makeAny(rMimeType));
         xStreamProps->setPropertyValue( // turn off compression
-            OUString("Compressed"),
+            "Compressed",
             uno::makeAny(sal_False));
     }
     ::comphelper::OStorageHelper::CopyInputToOutput(xInStream, xOutStream);
@@ -3138,8 +3130,7 @@ lcl_StoreMediaAndGetURL(SvXMLExport & rExport,
             uno::Reference<embed::XStorage> const xTarget(
                     rExport.GetTargetStorage(), uno::UNO_QUERY_THROW);
             uno::Reference<io::XInputStream> xInStream;
-            xPropSet->getPropertyValue(
-                OUString("PrivateStream"))
+            xPropSet->getPropertyValue("PrivateStream")
                     >>= xInStream;
 
             if (!xInStream.is())
@@ -3252,9 +3243,8 @@ static void lcl_StoreGltfFallback(
             if( xGraphic.is() )
             {
                 // Fallback storage
-                const OUString sFallbackFolder("Fallbacks");
                 const uno::Reference<embed::XStorage> xFallbackTarget(
-                    xModelsTarget->openStorageElement(sFallbackFolder, embed::ElementModes::WRITE));
+                    xModelsTarget->openStorageElement("Fallbacks", embed::ElementModes::WRITE));
 
                 const OUString sModelName = sUrlPath.copy(sUrlPath.lastIndexOf("/")+1);
                 uno::Reference< io::XStream > xPictureStream(
@@ -3274,7 +3264,7 @@ static void lcl_StoreGltfFallback(
                     xFallbackTransaction->commit();
                 }
 
-                const OUString sFallbackURL( sUrlPath.copy(0,sUrlPath.lastIndexOf("/")) + "/" + sFallbackFolder + "/" + sModelName + ".png");
+                const OUString sFallbackURL( sUrlPath.copy(0,sUrlPath.lastIndexOf("/")) + "/" + "Fallbacks" + "/" + sModelName + ".png");
                 rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sFallbackURL );
                 rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
                 rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
@@ -4844,17 +4834,15 @@ void XMLShapeExport::ImpExportCustomShape(
 
         if ( xPropSetInfo.is() )
         {
-            const OUString sCustomShapeEngine( "CustomShapeEngine" );
-            if ( xPropSetInfo->hasPropertyByName( sCustomShapeEngine ) )
+            if ( xPropSetInfo->hasPropertyByName( "CustomShapeEngine" ) )
             {
-                uno::Any aEngine( xPropSet->getPropertyValue( sCustomShapeEngine ) );
+                uno::Any aEngine( xPropSet->getPropertyValue( "CustomShapeEngine" ) );
                 if ( ( aEngine >>= aStr ) && !aStr.isEmpty() )
                     mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ENGINE, aStr );
             }
-            const OUString sCustomShapeData( "CustomShapeData" );
-            if ( xPropSetInfo->hasPropertyByName( sCustomShapeData ) )
+            if ( xPropSetInfo->hasPropertyByName( "CustomShapeData" ) )
             {
-                uno::Any aData( xPropSet->getPropertyValue( sCustomShapeData ) );
+                uno::Any aData( xPropSet->getPropertyValue( "CustomShapeData" ) );
                 if ( ( aData >>= aStr ) && !aStr.isEmpty() )
                     mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DATA, aStr );
             }
@@ -4948,16 +4936,14 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
                 {
                     xStorage.set( GetExport().GetTargetStorage(), uno::UNO_QUERY_THROW );
 
-                    xPictureStorage.set( xStorage->openStorageElement( OUString( "Pictures" ), ::embed::ElementModes::READWRITE ), uno::UNO_QUERY_THROW );
-                    const OUString sPrefix( "TablePreview" );
-                    const OUString sSuffix( ".svm" );
+                    xPictureStorage.set( xStorage->openStorageElement( "Pictures" , ::embed::ElementModes::READWRITE ), uno::UNO_QUERY_THROW );
 
                     sal_Int32 nIndex = 0;
                     do
                     {
-                        sPictureName = sPrefix;
+                        sPictureName = "TablePreview";
                         sPictureName += OUString::number( ++nIndex );
-                        sPictureName += sSuffix;
+                        sPictureName += ".svm";
                     }
                     while( xPictureStorage->hasByName( sPictureName ) );
 
@@ -4983,7 +4969,7 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
                 {
                     OUString sURL( "Pictures/" );
                     sURL += sPictureName;
-                    mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sURL );
+                    mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sURL );
                     mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
                     mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
                     mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD );
@@ -5017,5 +5003,3 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 1f224a1..3a45d57 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -375,43 +375,37 @@ void SdXMLShapeContext::EndElement()
     {
         uno::Reference< beans::XPropertySet > xProp( mxShape, uno::UNO_QUERY );
 
-        OUString sLink(  "Hyperlink"  );
-        if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName( sLink ) )
-            xProp->setPropertyValue( sLink, uno::Any( msHyperlink ) );
+        if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName( "Hyperlink" ) )
+            xProp->setPropertyValue( "Hyperlink", uno::Any( msHyperlink ) );
         Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY );
-        const OUString sBookmark(  "Bookmark"  );
 
         if( xEventsSupplier.is() )
         {
-            const OUString sEventType(  "EventType"  );
-            const OUString sClickAction(  "ClickAction"  );
-
             Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_QUERY_THROW );
 
             uno::Sequence< beans::PropertyValue > aProperties( 3 );
-            aProperties[0].Name = sEventType;
+            aProperties[0].Name = "EventType";
             aProperties[0].Handle = -1;
             aProperties[0].Value <<= OUString( "Presentation" );
             aProperties[0].State = beans::PropertyState_DIRECT_VALUE;
 
-            aProperties[1].Name = sClickAction;
+            aProperties[1].Name = "ClickAction";
             aProperties[1].Handle = -1;
             aProperties[1].Value <<= ::com::sun::star::presentation::ClickAction_DOCUMENT;
             aProperties[1].State = beans::PropertyState_DIRECT_VALUE;
 
-            aProperties[2].Name = sBookmark;
+            aProperties[2].Name = "Bookmark";
             aProperties[2].Handle = -1;
             aProperties[2].Value <<= msHyperlink;
             aProperties[2].State = beans::PropertyState_DIRECT_VALUE;
 
-            const OUString sAPIEventName(  "OnClick"  );
-            xEvents->replaceByName( sAPIEventName, Any( aProperties ) );
+            xEvents->replaceByName( "OnClick", Any( aProperties ) );
         }
         else
         {
             // in draw use the Bookmark property
             Reference< beans::XPropertySet > xSet( mxShape, UNO_QUERY_THROW );
-            xSet->setPropertyValue( sBookmark, Any( msHyperlink ) );
+            xSet->setPropertyValue( "Bookmark", Any( msHyperlink ) );
             xSet->setPropertyValue("OnClick", Any( ::com::sun::star::presentation::ClickAction_DOCUMENT ) );
         }
     }
@@ -788,16 +782,14 @@ void SdXMLShapeContext::SetThumbnail()
         if( !xPropSet.is() )
             return;
 
-        const OUString sProperty("ThumbnailGraphicURL");
-
         uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
-        if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName( sProperty ) )
+        if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName( "ThumbnailGraphicURL" ) )
         {
             // load the thumbnail graphic and export it to a wmf stream so we can set
             // it at the api
 
             const OUString aInternalURL( GetImport().ResolveGraphicObjectURL( maThumbnailURL, false ) );
-            xPropSet->setPropertyValue( sProperty, uno::makeAny( aInternalURL ) );
+            xPropSet->setPropertyValue( "ThumbnailGraphicURL", uno::makeAny( aInternalURL ) );
         }
     }
     catch(const uno::Exception&)
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 6d0b2d8..a542676 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -157,16 +157,13 @@ namespace
 
     static bool lcl_ShapeFilter(const Reference<XTextContent>& xTxtContent)
     {
-        static const OUString sTextFrameService("com.sun.star.text.TextFrame");
-        static const OUString sTextGraphicService("com.sun.star.text.TextGraphicObject");
-        static const OUString sTextEmbeddedService("com.sun.star.text.TextEmbeddedObject");
         Reference<XShape> xShape(xTxtContent, UNO_QUERY);
         if(!xShape.is())
             return false;
         Reference<XServiceInfo> xServiceInfo(xTxtContent, UNO_QUERY);
-        if(xServiceInfo->supportsService(sTextFrameService) ||
-            xServiceInfo->supportsService(sTextGraphicService) ||
-            xServiceInfo->supportsService(sTextEmbeddedService) )
+        if(xServiceInfo->supportsService("com.sun.star.text.TextFrame") ||
+            xServiceInfo->supportsService("com.sun.star.text.TextGraphicObject") ||
+            xServiceInfo->supportsService("com.sun.star.text.TextEmbeddedObject") )
             return false;
         return true;
     };
@@ -397,14 +394,14 @@ void FieldParamExporter::Export()
                 // Save the OLE object
                 Reference< embed::XStorage > xTargetStg = m_pExport->GetTargetStorage();
                 Reference< embed::XStorage > xDstStg = xTargetStg->openStorageElement(
-                        OUString("OLELinks"), embed::ElementModes::WRITE );
+                        "OLELinks", embed::ElementModes::WRITE );
 
                 if ( !xDstStg->hasByName( sValue ) ) {
                     Reference< XStorageBasedDocument > xStgDoc (
                             m_pExport->GetModel( ), UNO_QUERY );
                     Reference< embed::XStorage > xDocStg = xStgDoc->getDocumentStorage();
                     Reference< embed::XStorage > xOleStg = xDocStg->openStorageElement(
-                            OUString("OLELinks"), embed::ElementModes::READ );
+                            "OLELinks", embed::ElementModes::READ );
 
                     xOleStg->copyElementTo( sValue, xDstStg, sValue );
                     Reference< embed::XTransactedObject > xTransact( xDstStg, UNO_QUERY );
@@ -417,7 +414,7 @@ void FieldParamExporter::Export()
         {
             bool bValue = false;
             aValue >>= bValue;
-            ExportParameter(*pCurrent, (bValue ? OUString("true" ) : OUString("false")) );
+            ExportParameter(*pCurrent, OUString::boolean(bValue) );
         }
         else if(aValueType == aSeqType)
         {
@@ -512,19 +509,17 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily,
                     {
                         Reference < XPropertySet > xNumPropSet( xNumRule,
                                                                 UNO_QUERY );
-                        const OUString sIsAutomatic( "IsAutomatic"  );
                         if( xNumPropSet.is() &&
                             xNumPropSet->getPropertySetInfo()
-                                       ->hasPropertyByName( sIsAutomatic ) )
+                                       ->hasPropertyByName( "IsAutomatic" ) )
                         {
-                            bAdd = *(sal_Bool *)xNumPropSet->getPropertyValue( sIsAutomatic ).getValue();
+                            bAdd = *(sal_Bool *)xNumPropSet->getPropertyValue( "IsAutomatic" ).getValue();
                             // Check on outline style (#i73361#)
-                            const OUString sNumberingIsOutline( "NumberingIsOutline"  );
                             if ( bAdd &&
                                  xNumPropSet->getPropertySetInfo()
-                                           ->hasPropertyByName( sNumberingIsOutline ) )
+                                           ->hasPropertyByName( "NumberingIsOutline" ) )
                             {
-                                bAdd = !(*(sal_Bool *)xNumPropSet->getPropertyValue( sNumberingIsOutline ).getValue());
+                                bAdd = !(*(sal_Bool *)xNumPropSet->getPropertyValue( "NumberingIsOutline" ).getValue());
                             }
                         }
                         else
@@ -629,19 +624,17 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily,
             {
                 Reference < XPropertySet > xNumPropSet( xNumRule,
                                                         UNO_QUERY );
-                const OUString sIsAutomatic( "IsAutomatic"  );
                 if( xNumPropSet.is() &&
                     xNumPropSet->getPropertySetInfo()
-                               ->hasPropertyByName( sIsAutomatic ) )
+                               ->hasPropertyByName( "IsAutomatic" ) )
                 {
-                    bAdd = *(sal_Bool *)xNumPropSet->getPropertyValue( sIsAutomatic ).getValue();
+                    bAdd = *(sal_Bool *)xNumPropSet->getPropertyValue( "IsAutomatic" ).getValue();
                     // Check on outline style (#i73361#)
-                    const OUString sNumberingIsOutline( "NumberingIsOutline"  );
                     if ( bAdd &&
                          xNumPropSet->getPropertySetInfo()
-                                   ->hasPropertyByName( sNumberingIsOutline ) )
+                                   ->hasPropertyByName( "NumberingIsOutline" ) )
                     {
-                        bAdd = !(*(sal_Bool *)xNumPropSet->getPropertyValue( sNumberingIsOutline ).getValue());
+                        bAdd = !(*(sal_Bool *)xNumPropSet->getPropertyValue( "NumberingIsOutline" ).getValue());
                     }
                 }
                 else
@@ -1615,7 +1608,6 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress )
         Reference< XIndexAccess > xNumberingRules = xNumberingRulesSupp->getNumberingRules();
         nCount = xNumberingRules->getCount();
         // Custom outline assignment lost after re-importing sxw (#i73361#)
-        const OUString sNumberingIsOutline( "NumberingIsOutline"  );
         for( sal_Int32 i = 0; i < nCount; ++i )
         {
             Reference< XIndexReplace > xNumRule( xNumberingRules->getByIndex( i ), UNO_QUERY );
@@ -1630,18 +1622,17 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress )
                 {
                     Reference < XPropertySet > xNumPropSet( xNumRule,
                                                             UNO_QUERY );
-                    const OUString sIsAutomatic( "IsAutomatic"  );
                     if( xNumPropSet.is() &&
                         xNumPropSet->getPropertySetInfo()
-                                   ->hasPropertyByName( sIsAutomatic ) )
+                                   ->hasPropertyByName( "IsAutomatic" ) )
                     {
-                        bAdd = *(sal_Bool *)xNumPropSet->getPropertyValue( sIsAutomatic ).getValue();
+                        bAdd = *(sal_Bool *)xNumPropSet->getPropertyValue( "IsAutomatic" ).getValue();
                         // Check on outline style (#i73361#)
                         if ( bAdd &&
                              xNumPropSet->getPropertySetInfo()
-                                       ->hasPropertyByName( sNumberingIsOutline ) )
+                                       ->hasPropertyByName( "NumberingIsOutline" ) )
                         {
-                            bAdd = !(*(sal_Bool *)xNumPropSet->getPropertyValue( sNumberingIsOutline ).getValue());
+                            bAdd = !(*(sal_Bool *)xNumPropSet->getPropertyValue( "NumberingIsOutline" ).getValue());
                         }
                     }
                     else
@@ -2057,7 +2048,7 @@ void XMLTextParagraphExport::exportParagraph(
                                 {
                                     Reference< XPropertySet > xNumRulePropSet( xNumRule, UNO_QUERY );
                                     xNumRulePropSet->getPropertyValue(
-                                        OUString("Name") ) >>= sOutlineName;
+                                        "Name" ) >>= sOutlineName;
                                     bAssignedtoOutlineStyle = ( sListStyleName == sOutlineName );
                                 }
                             }
@@ -2070,7 +2061,6 @@ void XMLTextParagraphExport::exportParagraph(
                     }
 
                     {
-                        OUString sParaIsNumberingRestart("ParaIsNumberingRestart");
                         bool bIsRestartNumbering = false;
 
                         Reference< XPropertySetInfo >
@@ -2079,9 +2069,9 @@ void XMLTextParagraphExport::exportParagraph(
                                      xPropSet->getPropertySetInfo());
 
                         if (xPropSetInfo->
-                            hasPropertyByName(sParaIsNumberingRestart))
+                            hasPropertyByName("ParaIsNumberingRestart"))
                         {
-                            xPropSet->getPropertyValue(sParaIsNumberingRestart)
+                            xPropSet->getPropertyValue("ParaIsNumberingRestart")
                                 >>= bIsRestartNumbering;
                         }
 
@@ -2091,14 +2081,12 @@ void XMLTextParagraphExport::exportParagraph(
                                                      XML_RESTART_NUMBERING,
                                                      XML_TRUE);
 
-                            OUString sNumberingStartValue("NumberingStartValue");
-
                             if (xPropSetInfo->
-                                hasPropertyByName(sNumberingStartValue))
+                                hasPropertyByName("NumberingStartValue"))
                             {
                                 sal_Int32 nStartValue = 0;
 
-                                xPropSet->getPropertyValue(sNumberingStartValue)
+                                xPropSet->getPropertyValue("NumberingStartValue")
                                     >>= nStartValue;
 
                                 OUStringBuffer sTmpStartValue;


More information about the Libreoffice-commits mailing list