[Libreoffice-commits] core.git: sal/qa scripting/source sc/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Nov 1 12:35:17 UTC 2016


 sal/qa/osl/process/osl_Thread.cxx                              |    3 -
 sal/qa/osl/process/osl_process.cxx                             |   13 +++---
 sc/source/filter/excel/xltoolbar.cxx                           |    3 -
 sc/source/filter/html/htmlexp.cxx                              |   19 +++------
 sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx    |    3 -
 sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx           |    4 --
 sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx            |    4 --
 sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx |    7 +--
 sc/source/ui/docshell/docsh.cxx                                |    8 ++--
 sc/source/ui/docshell/impex.cxx                                |   11 ++---
 sc/source/ui/unoobj/scdetect.cxx                               |   16 ++------
 sc/source/ui/vba/vbaformatconditions.cxx                       |   16 ++------
 sc/source/ui/vba/vbarange.cxx                                  |   20 +++-------
 sc/source/ui/vba/vbawindow.cxx                                 |    3 -
 sc/source/ui/vba/vbaworkbooks.cxx                              |    3 -
 scripting/source/dlgprov/dlgevtatt.cxx                         |    4 --
 scripting/source/dlgprov/dlgprov.cxx                           |    8 +---
 scripting/source/provider/URIHelper.cxx                        |   19 +++------
 scripting/source/stringresource/stringresource.cxx             |    7 +--
 19 files changed, 58 insertions(+), 113 deletions(-)

New commits:
commit 39414827352e58e8be76abaa9a5a1ac9518d927f
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Nov 1 13:18:59 2016 +0200

    loplugin:oncevar in sal..scripting
    
    Change-Id: Id9ab12f3a61eb83a2288b2fd4d99ab77f5833e1b
    Reviewed-on: https://gerrit.libreoffice.org/30461
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
index 8f42ae4..32840a6 100644
--- a/sal/qa/osl/process/osl_Thread.cxx
+++ b/sal/qa/osl/process/osl_Thread.cxx
@@ -1843,8 +1843,7 @@ namespace osl_ThreadData
         void getData_001()
             {
                 char* pc = new char[2];
-                char nData[] = "i";
-                strcpy(pc, nData);
+                strcpy(pc, "i");
                 myThreadData.setData(pc);
 
                 myKeyThread aThread1('c');
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx
index 475b097..d97b251 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -66,12 +66,6 @@
 # endif
 #endif
 
-#if defined(_WIN32)
-    const rtl::OUStringLiteral EXECUTABLE_NAME ("osl_process_child.exe");
-#else
-    const rtl::OUStringLiteral EXECUTABLE_NAME ("osl_process_child");
-#endif
-
 using namespace osl;
 
 using ::rtl::OUString;
@@ -184,7 +178,12 @@ public:
     {
         parameters_[0] = env_param_.pData;
         suCWD = getExecutablePath();
-        suExecutableFileURL = suCWD + "/" + EXECUTABLE_NAME;
+
+#if defined(_WIN32)
+        suExecutableFileURL = suCWD + "/" "osl_process_child.exe";
+#else
+        suExecutableFileURL = suCWD + "/" "osl_process_child";
+#endif
     }
 
     virtual void setUp() override
diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx
index 753e660..59b9243 100644
--- a/sc/source/filter/excel/xltoolbar.cxx
+++ b/sc/source/filter/excel/xltoolbar.cxx
@@ -148,7 +148,6 @@ bool ScCTB::ImportMenuTB( ScCTBWrapper& rWrapper, const css::uno::Reference< css
 bool ScCTB::ImportCustomToolBar( ScCTBWrapper& rWrapper, CustomToolBarImportHelper& helper )
 {
 
-    static const char sToolbarPrefix[] = "private:resource/toolbar/custom_";
     bool bRes = false;
     try
     {
@@ -163,7 +162,7 @@ bool ScCTB::ImportCustomToolBar( ScCTBWrapper& rWrapper, CustomToolBarImportHelp
         // set UI name for toolbar
         xProps->setPropertyValue("UIName", uno::makeAny( name.getString() ) );
 
-        OUString sToolBarName = sToolbarPrefix + name.getString();
+        OUString sToolBarName = "private:resource/toolbar/custom_" + name.getString();
         for ( std::vector< ScTBC >::iterator it =  rTBC.begin(); it != rTBC.end(); ++it )
         {
             if ( !it->ImportToolBarControl( rWrapper, xIndexContainer, helper, IsMenuToolbar() ) )
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index d30ed4f..4177226 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -87,15 +87,9 @@ using namespace ::com::sun::star;
 
 const static sal_Char sMyBegComment[]   = "<!-- ";
 const static sal_Char sMyEndComment[]   = " -->";
-const static sal_Char sFontFamily[]     = "font-family:";
-const static sal_Char sFontSize[]       = "font-size:";
 const static sal_Char sDisplay[]        = "display:";
 const static sal_Char sBorder[]         = "border:";
-const static sal_Char sPadding[]        = "padding:";
-const static sal_Char sPosition[]       = "position:";
 const static sal_Char sBackground[]     = "background:";
-const static sal_Char sWidth[]          = "width:";
-const static sal_Char sHeight[]         = "height:";
 
 const sal_uInt16 ScHTMLExport::nDefaultFontSize[SC_HTML_FONTSIZES] =
 {
@@ -359,7 +353,8 @@ void ScHTMLExport::WriteHeader()
     rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_HTML_body ).WriteCharPtr( "," ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_division ).WriteCharPtr( "," ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_table ).WriteCharPtr( "," )
        .WriteCharPtr( OOO_STRING_SVTOOLS_HTML_thead ).WriteCharPtr( "," ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_tbody ).WriteCharPtr( "," ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_tfoot ).WriteCharPtr( "," )
        .WriteCharPtr( OOO_STRING_SVTOOLS_HTML_tablerow ).WriteCharPtr( "," ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_tableheader ).WriteCharPtr( "," )
-       .WriteCharPtr( OOO_STRING_SVTOOLS_HTML_tabledata ).WriteCharPtr( "," ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_parabreak ).WriteCharPtr( " { " ).WriteCharPtr( sFontFamily );
+       .WriteCharPtr( OOO_STRING_SVTOOLS_HTML_tabledata ).WriteCharPtr( "," ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_parabreak )
+       .WriteCharPtr( " { " ).WriteCharPtr( "font-family:" );
     sal_Int32 nFonts = comphelper::string::getTokenCount(aHTMLStyle.aFontFamilyName, ';');
     if ( nFonts == 1 )
     {
@@ -380,7 +375,7 @@ void ScHTMLExport::WriteHeader()
                 rStrm.WriteCharPtr( ", " );
         }
     }
-    rStrm.WriteCharPtr( "; " ).WriteCharPtr( sFontSize )
+    rStrm.WriteCharPtr( "; " ).WriteCharPtr( "font-size:" )
        .WriteCharPtr( GetFontSizeCss( ( sal_uInt16 ) aHTMLStyle.nFontHeight ) ).WriteCharPtr( " }" );
 
     OUT_LF();
@@ -390,10 +385,10 @@ void ScHTMLExport::WriteHeader()
     rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_HTML_anchor ).WriteCharPtr(".comment-indicator:hover")
        .WriteCharPtr(" + ").WriteCharPtr( OOO_STRING_SVTOOLS_HTML_comment2 ).WriteCharPtr(" { ")
        .WriteCharPtr(sBackground).WriteCharPtr("#ffd").WriteCharPtr("; ")
-       .WriteCharPtr(sPosition).WriteCharPtr("absolute").WriteCharPtr("; ")
+       .WriteCharPtr("position:").WriteCharPtr("absolute").WriteCharPtr("; ")
        .WriteCharPtr(sDisplay).WriteCharPtr("block").WriteCharPtr("; ")
        .WriteCharPtr(sBorder).WriteCharPtr("1px solid black").WriteCharPtr("; ")
-       .WriteCharPtr(sPadding).WriteCharPtr("0.5em").WriteCharPtr("; ")
+       .WriteCharPtr("padding:").WriteCharPtr("0.5em").WriteCharPtr("; ")
        .WriteCharPtr(" } ");
 
     OUT_LF();
@@ -403,8 +398,8 @@ void ScHTMLExport::WriteHeader()
         .WriteCharPtr(sBackground).WriteCharPtr("red").WriteCharPtr("; ")
         .WriteCharPtr(sDisplay).WriteCharPtr("inline-block").WriteCharPtr("; ")
         .WriteCharPtr(sBorder).WriteCharPtr("1px solid black").WriteCharPtr("; ")
-        .WriteCharPtr(sWidth).WriteCharPtr("0.5em").WriteCharPtr("; ")
-        .WriteCharPtr(sHeight).WriteCharPtr("0.5em").WriteCharPtr("; ")
+        .WriteCharPtr("width:").WriteCharPtr("0.5em").WriteCharPtr("; ")
+        .WriteCharPtr("height:").WriteCharPtr("0.5em").WriteCharPtr("; ")
         .WriteCharPtr(" } ");
 
     OUT_LF();
diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
index abcc1cd..17aabcc 100644
--- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
@@ -58,7 +58,6 @@ static sal_Int16 lclAnovaLabels[] =
 };
 
 static const char strWildcardRange[] = "%RANGE%";
-static const char strWildcardNumber[] = "%NUMBER%";
 
 OUString lclCreateMultiParameterFormula(
             ScRangeList&        aRangeList, const OUString& aFormulaTemplate,
@@ -189,7 +188,7 @@ void ScAnalysisOfVarianceDialog::RowColumn(ScRangeList& rRangeList, AddressWalke
         for (size_t i = 0; i < rRangeList.size(); i++)
         {
             aTemplate.setTemplate(aLabelTemplate);
-            aTemplate.applyNumber(strWildcardNumber, i + 1);
+            aTemplate.applyNumber("%NUMBER%", i + 1);
             aOutput.writeString(aTemplate.getTemplate());
             if (pResultRange != nullptr)
                 pResultRange->aEnd = aOutput.current();
diff --git a/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx b/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx
index e82c580..74b0976 100644
--- a/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx
@@ -15,8 +15,6 @@
 
 #include "CorrelationDialog.hxx"
 
-static const char strCorrelationTemplate[] = "=CORREL(%VAR1%; %VAR2%)";
-
 ScCorrelationDialog::ScCorrelationDialog(
                         SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
                         vcl::Window* pParent, ScViewData* pViewData ) :
@@ -37,7 +35,7 @@ const OUString ScCorrelationDialog::getLabel()
 
 const OUString ScCorrelationDialog::getTemplate()
 {
-    return OUString(strCorrelationTemplate);
+    return OUString("=CORREL(%VAR1%; %VAR2%)");
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx
index 6dea71f..4443b61 100644
--- a/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx
@@ -15,8 +15,6 @@
 
 #include "CovarianceDialog.hxx"
 
-static const char strCovarianceTemplate[] = "=COVAR(%VAR1%; %VAR2%)";
-
 ScCovarianceDialog::ScCovarianceDialog(
                         SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
                         vcl::Window* pParent, ScViewData* pViewData ) :
@@ -42,7 +40,7 @@ const OUString ScCovarianceDialog::getLabel()
 
 const OUString ScCovarianceDialog::getTemplate()
 {
-    return OUString(strCovarianceTemplate);
+    return OUString("=COVAR(%VAR1%; %VAR2%)");
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx
index 24854e3..a8c3939 100644
--- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx
@@ -54,9 +54,6 @@ static const StatisticCalculation lclCalcDefinitions[] =
     { 0,                         nullptr }
 };
 
-static const char strWildcardRange[] = "%RANGE%";
-static const char strWildcardNumber[] = "%NUMBER%";
-
 }
 
 ScDescriptiveStatisticsDialog::ScDescriptiveStatisticsDialog(
@@ -105,7 +102,7 @@ ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell)
         else
             aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ROW_LABEL_TEMPLATE));
 
-        aTemplate.applyNumber(strWildcardNumber, pIterator->index() + 1);
+        aTemplate.applyNumber("%NUMBER%", pIterator->index() + 1);
         aOutput.writeBoldString(aTemplate.getTemplate());
         aOutput.nextColumn();
     }
@@ -131,7 +128,7 @@ ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell)
         for(sal_Int32 i = 0; lclCalcDefinitions[i].aFormula != nullptr; i++)
         {
             aTemplate.setTemplate(lclCalcDefinitions[i].aFormula);
-            aTemplate.applyRange(strWildcardRange, pIterator->get(), b3DAddress);
+            aTemplate.applyRange("%RANGE%", pIterator->get(), b3DAddress);
             aOutput.writeFormula(aTemplate.getTemplate());
             aOutput.nextRow();
         }
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index ba3d5de..9d1e8fe 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -150,9 +150,9 @@ using ::std::vector;
 
 static const sal_Char pFilterSc50[]     = "StarCalc 5.0";
 static const sal_Char pFilterXML[]      = "StarOffice XML (Calc)";
-static const sal_Char pFilterAscii[]        = "Text - txt - csv (StarCalc)";
-static const sal_Char pFilterLotus[]        = "Lotus";
-static const sal_Char pFilterQPro6[]        = "Quattro Pro 6.0";
+static const sal_Char pFilterAscii[]    = "Text - txt - csv (StarCalc)";
+static const sal_Char pFilterLotus[]    = "Lotus";
+static const sal_Char pFilterQPro6[]    = "Quattro Pro 6.0";
 static const sal_Char pFilterExcel4[]   = "MS Excel 4.0";
 static const sal_Char pFilterEx4Temp[]  = "MS Excel 4.0 Vorlage/Template";
 static const sal_Char pFilterExcel5[]   = "MS Excel 5.0/95";
@@ -161,7 +161,7 @@ static const sal_Char pFilterExcel95[]  = "MS Excel 95";
 static const sal_Char pFilterEx95Temp[] = "MS Excel 95 Vorlage/Template";
 static const sal_Char pFilterExcel97[]  = "MS Excel 97";
 static const sal_Char pFilterEx97Temp[] = "MS Excel 97 Vorlage/Template";
-static const sal_Char pFilterDBase[]        = "dBase";
+static const sal_Char pFilterDBase[]    = "dBase";
 static const sal_Char pFilterDif[]      = "DIF";
 static const sal_Char pFilterSylk[]     = "SYLK";
 static const sal_Char pFilterHtml[]     = "HTML (StarCalc)";
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 5ec7b72..9cfe424 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -68,8 +68,6 @@ static const sal_Int32 nArbitraryLineLengthLimit = 2 * MAXCOLCOUNT * 65536;
 namespace
 {
     const char SYLK_LF[]  = "\x1b :";
-    const char DOUBLE_SEMICOLON[] = ";;";
-    const char DOUBLE_DOUBLEQUOTE[] = "\"\"";
 
     inline bool lcl_IsEndianSwap( const SvStream& rStrm )
     {
@@ -715,9 +713,9 @@ static void lcl_UnescapeSylk( OUString & rString, SylkVersion eVersion )
     // Older versions quoted the string and doubled embedded quotes, but not
     // the semicolons, which was plain wrong.
     if (eVersion >= SYLK_OOO32)
-        rString = rString.replaceAll(DOUBLE_SEMICOLON, ";");
+        rString = rString.replaceAll(";;", ";");
     else
-        rString = rString.replaceAll(DOUBLE_DOUBLEQUOTE, "\"");
+        rString = rString.replaceAll("\"\"", "\"");
 
     rString = rString.replaceAll(SYLK_LF, "\n");
 }
@@ -1099,8 +1097,7 @@ static bool lcl_PutString(
             sal_Int16 nMonth = (sal_Int16) aMStr.toInt32();
             if (!nMonth)
             {
-                static const char aSeptCorrect[] =  "SEPT";
-                static const char aSepShortened[] =  "SEP";
+                static const char aSepShortened[] = "SEP";
                 uno::Sequence< i18n::CalendarItem2 > xMonths;
                 sal_Int32 i, nMonthCount;
                 //  first test all month names from local international
@@ -1111,7 +1108,7 @@ static bool lcl_PutString(
                     if ( rTransliteration.isEqual( aMStr, xMonths[i].FullName ) ||
                          rTransliteration.isEqual( aMStr, xMonths[i].AbbrevName ) )
                         nMonth = sal::static_int_cast<sal_Int16>( i+1 );
-                    else if ( i == 8 && rTransliteration.isEqual( aSeptCorrect,
+                    else if ( i == 8 && rTransliteration.isEqual( "SEPT",
                                 xMonths[i].AbbrevName ) &&
                             rTransliteration.isEqual( aMStr, aSepShortened ) )
                     {   // correct English abbreviation is SEPT,
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index bb2c407..6e3318b 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -35,12 +35,6 @@ using utl::MediaDescriptor;
 
 namespace {
 
-const sal_Char pFilterLotus[]        = "Lotus";
-const sal_Char pFilterQPro6[]        = "Quattro Pro 6.0";
-const sal_Char pFilterDBase[]        = "dBase";
-const sal_Char pFilterDif[]      = "DIF";
-const sal_Char pFilterSylk[]     = "SYLK";
-
 // Tabelle mit Suchmustern
 // Bedeutung der Sequenzen
 // 0x00??: genau Byte 0x?? muss an dieser Stelle stehen
@@ -290,35 +284,35 @@ OUString SAL_CALL ScFilterDetect::detect( uno::Sequence<beans::PropertyValue>& l
         if (!detectThisFormat(*pStream, pLotus) && !detectThisFormat(*pStream, pLotusNew) && !detectThisFormat(*pStream, pLotus2))
             return OUString();
 
-        pSearchFilterName = pFilterLotus;
+        pSearchFilterName = "Lotus";
     }
     else if (aTypeName == "calc_QPro")
     {
         if (!detectThisFormat(*pStream, pQPro))
             return OUString();
 
-        pSearchFilterName = pFilterQPro6;
+        pSearchFilterName = "Quattro Pro 6.0";
     }
     else if (aTypeName == "calc_SYLK")
     {
         if (!detectThisFormat(*pStream, pSylk))
             return OUString();
 
-        pSearchFilterName = pFilterSylk;
+        pSearchFilterName = "SYLK";
     }
     else if (aTypeName == "calc_DIF")
     {
         if (!detectThisFormat(*pStream, pDIF1) && !detectThisFormat(*pStream, pDIF2))
             return OUString();
 
-        pSearchFilterName = pFilterDif;
+        pSearchFilterName = "DIF";
     }
     else if (aTypeName == "calc_dBase")
     {
         if (!lcl_MayBeDBase(*pStream))
             return OUString();
 
-        pSearchFilterName = pFilterDBase;
+        pSearchFilterName = "dBase";
     }
     else
         return OUString();
diff --git a/sc/source/ui/vba/vbaformatconditions.cxx b/sc/source/ui/vba/vbaformatconditions.cxx
index c01b186..6cfebf7 100644
--- a/sc/source/ui/vba/vbaformatconditions.cxx
+++ b/sc/source/ui/vba/vbaformatconditions.cxx
@@ -34,12 +34,6 @@
 using namespace ::ooo::vba;
 using namespace ::com::sun::star;
 
-static const char OPERATOR[] = "Operator";
-static const char FORMULA1[] = "Formula1";
-static const char FORMULA2[] = "Formula2";
-static const char STYLENAME[] = "StyleName";
-static const char sStyleNamePrefix[] = "Excel_CondFormat";
-
 void SAL_CALL
 ScVbaFormatConditions::Delete(  ) throw (script::BasicErrorException, uno::RuntimeException, std::exception)
 {
@@ -176,20 +170,20 @@ ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, cons
         else
             aValue = uno::makeAny( ScVbaFormatCondition::retrieveAPIOperator(_aOperator) );
 
-        beans::PropertyValue aProperty( OPERATOR, 0, aValue, beans::PropertyState_DIRECT_VALUE );
+        beans::PropertyValue aProperty( "Operator", 0, aValue, beans::PropertyState_DIRECT_VALUE );
         aPropertyValueVector.push_back( aProperty );
 
         if ( _aFormula1.hasValue() )
         {
-            beans::PropertyValue aProp( FORMULA1, 0, uno::makeAny( getA1Formula( _aFormula1 ) ), beans::PropertyState_DIRECT_VALUE );
+            beans::PropertyValue aProp( "Formula1", 0, uno::makeAny( getA1Formula( _aFormula1 ) ), beans::PropertyState_DIRECT_VALUE );
             aPropertyValueVector.push_back( aProp );
         }
         if ( _aFormula2.hasValue() )
         {
-            beans::PropertyValue aProp( FORMULA2, 0, uno::makeAny( getA1Formula( _aFormula2 ) ), beans::PropertyState_DIRECT_VALUE );
+            beans::PropertyValue aProp( "Formula2", 0, uno::makeAny( getA1Formula( _aFormula2 ) ), beans::PropertyState_DIRECT_VALUE );
             aPropertyValueVector.push_back( aProp );
         }
-        aProperty.Name = STYLENAME;
+        aProperty.Name = "StyleName";
         aProperty.Value = uno::makeAny( sStyleName );
 
         mxSheetConditionalEntries->addNew(comphelper::containerToSequence(aPropertyValueVector));
@@ -247,7 +241,7 @@ ScVbaFormatConditions::getStyleName()
     if ( !pStyles )
         DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
     uno::Sequence< OUString > sCellStyleNames = pStyles->getStyleNames();
-    return ContainerUtilities::getUniqueName(sCellStyleNames, sStyleNamePrefix, "_");
+    return ContainerUtilities::getUniqueName(sCellStyleNames, "Excel_CondFormat", "_");
 }
 
 void
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 60f48d1..f68d549 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -686,17 +686,13 @@ public:
 };
 
 static const char ISVISIBLE[] = "IsVisible";
-static const char POSITION[] = "Position";
 static const char EQUALS[] = "=";
 static const char NOTEQUALS[] = "<>";
 static const char GREATERTHAN[] = ">";
 static const char GREATERTHANEQUALS[] = ">=";
 static const char LESSTHAN[] = "<";
 static const char LESSTHANEQUALS[] = "<=";
-static const char CONTS_HEADER[] = "ContainsHeader";
-static const char INSERTPAGEBREAKS[] = "InsertPageBreaks";
 static const char STR_ERRORMESSAGE_APPLIESTOSINGLERANGEONLY[] = "The command you chose cannot be performed with multiple selections.\nSelect a single range and click the command again";
-static const char STR_ERRORMESSAGE_NOCELLSWEREFOUND[] = "No cells were found";
 static const char CELLSTYLE[] = "CellStyle";
 
 class CellValueSetter : public ValueSetter
@@ -3517,7 +3513,7 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
     sal_Int32 nIndex =  findSortPropertyIndex( sortDescriptor,  "IsSortColumns" );
     sortDescriptor[ nIndex ].Value <<= bIsSortColumns;
 
-    nIndex =    findSortPropertyIndex( sortDescriptor, CONTS_HEADER );
+    nIndex =    findSortPropertyIndex( sortDescriptor, "ContainsHeader" );
     sortDescriptor[ nIndex ].Value <<= bContainsHeader;
 
     rDoc.SetSortParam( aSortParam, nTab );
@@ -4070,13 +4066,13 @@ ScVbaRange::getHeight() throw (uno::RuntimeException, std::exception)
 awt::Point
 ScVbaRange::getPosition() throw ( uno::RuntimeException )
 {
-        awt::Point aPoint;
+    awt::Point aPoint;
     uno::Reference< beans::XPropertySet > xProps;
     if ( mxRange.is() )
         xProps.set( mxRange, uno::UNO_QUERY_THROW );
     else
         xProps.set( mxRanges, uno::UNO_QUERY_THROW );
-    xProps->getPropertyValue( POSITION ) >>= aPoint;
+    xProps->getPropertyValue( "Position" ) >>= aPoint;
     return aPoint;
 }
 uno::Any SAL_CALL
@@ -4196,10 +4192,9 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC
     Cell1 >>= sRangeName;
     if ( Cell1.hasValue() && !Cell2.hasValue() && !sRangeName.isEmpty() )
     {
-        static const char sNamedRanges[] = "NamedRanges";
         uno::Reference< beans::XPropertySet > xPropSet( getCurrentExcelDoc(xContext), uno::UNO_QUERY_THROW );
 
-        uno::Reference< container::XNameAccess > xNamed( xPropSet->getPropertyValue( sNamedRanges ), uno::UNO_QUERY_THROW );
+        uno::Reference< container::XNameAccess > xNamed( xPropSet->getPropertyValue( "NamedRanges" ), uno::UNO_QUERY_THROW );
         uno::Reference< sheet::XCellRangeReferrer > xReferrer;
         try
         {
@@ -5478,7 +5473,7 @@ ScVbaRange::SpecialCellsImpl( sal_Int32 nType, const uno::Any& _oValue) throw (
     }
     catch (uno::Exception& )
     {
-        DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, STR_ERRORMESSAGE_NOCELLSWEREFOUND);
+        DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, "No cells were found");
     }
     return xRange;
 }
@@ -5503,7 +5498,7 @@ ScVbaRange::Subtotal( ::sal_Int32 _nGroupBy, ::sal_Int32 _nFunction, const uno::
         uno::Reference< sheet::XSubTotalCalculatable> xSub(mxRange, uno::UNO_QUERY_THROW );
         uno::Reference< sheet::XSubTotalDescriptor > xSubDesc = xSub->createSubTotalDescriptor(true);
         uno::Reference< beans::XPropertySet > xSubDescPropertySet( xSubDesc, uno::UNO_QUERY_THROW );
-        xSubDescPropertySet->setPropertyValue(INSERTPAGEBREAKS, uno::makeAny( bAddPageBreaks));
+        xSubDescPropertySet->setPropertyValue("InsertPageBreaks", uno::makeAny( bAddPageBreaks));
         sal_Int32 nLen = _nTotalList.getLength();
         uno::Sequence< sheet::SubTotalColumn > aColumns( nLen );
         for (int i = 0; i < nLen; i++)
@@ -5586,13 +5581,12 @@ ScVbaRange::hasError() throw (uno::RuntimeException, std::exception)
     uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW );
     uno::Reference< script::XInvocation > xInvoc( xApplication->WorksheetFunction(), uno::UNO_QUERY_THROW );
 
-    static const char FunctionName[] = "IsError";
     uno::Sequence< uno::Any > Params(1);
     uno::Reference< excel::XRange > aRange( this );
     Params[0] = uno::makeAny( aRange );
     uno::Sequence< sal_Int16 > OutParamIndex;
     uno::Sequence< uno::Any > OutParam;
-    xInvoc->invoke( FunctionName, Params, OutParamIndex, OutParam ) >>= dResult;
+    xInvoc->invoke( "IsError", Params, OutParamIndex, OutParam ) >>= dResult;
     return dResult > 0.0;
 }
 
diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index 29f9206..de36e6d 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -319,11 +319,10 @@ ScVbaWindow::getCaption() throw (uno::RuntimeException, std::exception)
 
             if ( !sTitle.equals( sName ) )
             {
-                static const char sDot[] = ".";
                 // starts with title
                 if ( sName.startsWith( sTitle ) )
                     // extension starts immediately after
-                    if ( sName.match( sDot, sTitle.getLength() ) )
+                    if ( sName.match( ".", sTitle.getLength() ) )
                         sTitle = sName;
             }
         }
diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx
index 57215fd..535e554 100644
--- a/sc/source/ui/vba/vbaworkbooks.cxx
+++ b/sc/source/ui/vba/vbaworkbooks.cxx
@@ -230,7 +230,6 @@ ScVbaWorkbooks::Open( const OUString& rFileName, const uno::Any& /*UpdateLinks*/
         sProps.realloc( 3 );
         sProps[ nIndex ].Name = "FilterOptions";
         sal_Int16 delims[] = { 0 /*default not used*/, 9/*tab*/, 44/*comma*/, 32/*space*/, 59/*semicolon*/ };
-        static const char sRestOfFormat[] = ",34,0,1";
 
         OUString sFormat;
         sal_Int16 nFormat = 0; // default indicator
@@ -264,7 +263,7 @@ ScVbaWorkbooks::Open( const OUString& rFileName, const uno::Any& /*UpdateLinks*/
 
         getCurrentDelim() = nDelim; //set new current
 
-        sFormat = OUString::number( nDelim ) + sRestOfFormat;
+        sFormat = OUString::number( nDelim ) + ",34,0,1";
         sProps[ nIndex++ ].Value <<= sFormat;
         sProps[ nIndex ].Name = "FilterName";
         sProps[ nIndex++ ].Value <<= OUString( "Text - txt - csv (StarCalc)" );
diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
index 4e94a6f..633ec64 100644
--- a/scripting/source/dlgprov/dlgevtatt.cxx
+++ b/scripting/source/dlgprov/dlgevtatt.cxx
@@ -536,9 +536,7 @@ namespace dlgprov
 
     void DialogUnoScriptListenerImpl::firing_impl( const ScriptEvent& aScriptEvent, Any* pRet )
     {
-        static const char sUnoURLScheme[] = "vnd.sun.star.UNO:";
-
-        OUString aMethodName = aScriptEvent.ScriptCode.copy( strlen(sUnoURLScheme) );
+        OUString aMethodName = aScriptEvent.ScriptCode.copy( strlen("vnd.sun.star.UNO:") );
 
         const Any* pArguments = aScriptEvent.Arguments.getConstArray();
         Any aEventObject = pArguments[0];
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 4adfd13..c47a849 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -86,9 +86,6 @@ namespace comp_DialogModelProvider
 namespace dlgprov
 {
 
-
-static const char aResourceResolverPropName[] = "ResourceResolver";
-
     Reference< resource::XStringResourceManager > lcl_getStringResourceManager(const Reference< XComponentContext >& i_xContext,const OUString& i_sURL)
     {
         INetURLObject aInetObj( i_sURL );
@@ -153,7 +150,7 @@ static const char aResourceResolverPropName[] = "ResourceResolver";
             Reference< beans::XPropertySet > xDlgPSet( xDialogModel, UNO_QUERY );
             Any aStringResourceManagerAny;
             aStringResourceManagerAny <<= xStringResourceManager;
-            xDlgPSet->setPropertyValue( aResourceResolverPropName, aStringResourceManagerAny );
+            xDlgPSet->setPropertyValue( "ResourceResolver", aStringResourceManagerAny );
         }
 
         return xDialogModel;
@@ -614,7 +611,6 @@ static const char aResourceResolverPropName[] = "ResourceResolver";
 
 
     static const char aDecorationPropName[] = "Decoration";
-    static const char aTitlePropName[] = "Title";
 
     Reference < XControl > DialogProviderImpl::createDialogImpl(
         const OUString& URL, const Reference< XInterface >& xHandler,
@@ -664,7 +660,7 @@ static const char aResourceResolverPropName[] = "ResourceResolver";
                         if( !bDecoration )
                         {
                             xDlgModPropSet->setPropertyValue( aDecorationPropName, makeAny( true ) );
-                            xDlgModPropSet->setPropertyValue( aTitlePropName, makeAny( OUString() ) );
+                            xDlgModPropSet->setPropertyValue( "Title", makeAny( OUString() ) );
                         }
                     }
                     catch( UnknownPropertyException& )
diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx
index 56a78bc..1bf4cf9 100644
--- a/scripting/source/provider/URIHelper.cxx
+++ b/scripting/source/provider/URIHelper.cxx
@@ -35,9 +35,7 @@ namespace lang = ::com::sun::star::lang;
 namespace uri = ::com::sun::star::uri;
 
 static const char SHARE[] = "share";
-static const char SHARE_URI[] = "vnd.sun.star.expand:$BRAND_BASE_DIR";
 
-static const char SHARE_UNO_PACKAGES[] = "share:uno_packages";
 static const char SHARE_UNO_PACKAGES_URI[] =
     "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE";
 
@@ -45,12 +43,7 @@ static const char USER[] = "user";
 static const char USER_URI[] =
     "vnd.sun.star.expand:${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE( "bootstrap") "::UserInstallation}";
 
-static const char USER_UNO_PACKAGES[] = "user:uno_packages";
-static const char USER_UNO_PACKAGES_DIR[] =
-    "/user/uno_packages/cache";
 
-static const char DOCUMENT[] = "document";
-static const char TDOC_SCHEME[] = "vnd.sun.star.tdoc";
 
 ScriptingFrameworkURIHelper::ScriptingFrameworkURIHelper(
     const uno::Reference< uno::XComponentContext >& xContext)
@@ -118,26 +111,26 @@ ScriptingFrameworkURIHelper::initBaseURI()
         uri = USER_URI;
         bAppendScriptsPart = true;
     }
-    else if ( m_sLocation == USER_UNO_PACKAGES )
+    else if ( m_sLocation == "user:uno_packages" )
     {
         test = "uno_packages";
-        uri = OUStringLiteral(USER_URI) + USER_UNO_PACKAGES_DIR;
+        uri = OUStringLiteral(USER_URI) + "/user/uno_packages/cache";
     }
     else if (m_sLocation == SHARE)
     {
         test = SHARE;
-        uri = SHARE_URI;
+        uri = "vnd.sun.star.expand:$BRAND_BASE_DIR";
         bAppendScriptsPart = true;
     }
-    else if (m_sLocation == SHARE_UNO_PACKAGES)
+    else if (m_sLocation == "share:uno_packages")
     {
         test = "uno_packages";
         uri = SHARE_UNO_PACKAGES_URI;
     }
-    else if (m_sLocation.startsWith(TDOC_SCHEME))
+    else if (m_sLocation.startsWith("vnd.sun.star.tdoc"))
     {
         m_sBaseURI = m_sLocation.concat( SCRIPTS_PART );
-        m_sLocation = DOCUMENT;
+        m_sLocation = "document";
         return true;
     }
     else
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 9d71b74..f29dbfb 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -2130,9 +2130,6 @@ void implWriteStringWithEncoding( const OUString& aStr,
 bool StringResourcePersistenceImpl::implWritePropertiesFile( LocaleItem* pLocaleItem,
     const Reference< io::XOutputStream >& xOutputStream, const OUString& aComment )
 {
-    static const char aAssignmentStr[] = "=";
-    static const char aLineFeedStr[] = "\n";
-
     if( !xOutputStream.is() || pLocaleItem == nullptr )
         return false;
 
@@ -2146,7 +2143,7 @@ bool StringResourcePersistenceImpl::implWritePropertiesFile( LocaleItem* pLocale
     xTextOutputStream->setEncoding( aEncodingStr );
 
     xTextOutputStream->writeString( aComment );
-    xTextOutputStream->writeString( aLineFeedStr );
+    xTextOutputStream->writeString( "\n" );
 
     const IdToStringMap& rHashMap = pLocaleItem->m_aIdToStringMap;
     if( !rHashMap.empty() )
@@ -2189,7 +2186,7 @@ bool StringResourcePersistenceImpl::implWritePropertiesFile( LocaleItem* pLocale
                 if( !( it == rHashMap.end() ) )
                 {
                     implWriteStringWithEncoding( aResourceID, xTextOutputStream, true );
-                    xTextOutputStream->writeString( aAssignmentStr );
+                    xTextOutputStream->writeString( "=" );
                     OUString aValStr = (*it).second;
                     implWriteStringWithEncoding( aValStr, xTextOutputStream, false );
                 }


More information about the Libreoffice-commits mailing list