summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-01 13:18:59 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-11-01 12:34:51 +0000
commit39414827352e58e8be76abaa9a5a1ac9518d927f (patch)
tree7b856026bae224c678cab020ce00f97574d2bbba
parentd5c4823555e6f5c4e3bd9258c819bb2a763227c4 (diff)
loplugin:oncevar in sal..scripting
Change-Id: Id9ab12f3a61eb83a2288b2fd4d99ab77f5833e1b Reviewed-on: https://gerrit.libreoffice.org/30461 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sal/qa/osl/process/osl_Thread.cxx3
-rw-r--r--sal/qa/osl/process/osl_process.cxx13
-rw-r--r--sc/source/filter/excel/xltoolbar.cxx3
-rw-r--r--sc/source/filter/html/htmlexp.cxx19
-rw-r--r--sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx3
-rw-r--r--sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx4
-rw-r--r--sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx4
-rw-r--r--sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx7
-rw-r--r--sc/source/ui/docshell/docsh.cxx8
-rw-r--r--sc/source/ui/docshell/impex.cxx11
-rw-r--r--sc/source/ui/unoobj/scdetect.cxx16
-rw-r--r--sc/source/ui/vba/vbaformatconditions.cxx16
-rw-r--r--sc/source/ui/vba/vbarange.cxx20
-rw-r--r--sc/source/ui/vba/vbawindow.cxx3
-rw-r--r--sc/source/ui/vba/vbaworkbooks.cxx3
-rw-r--r--scripting/source/dlgprov/dlgevtatt.cxx4
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx8
-rw-r--r--scripting/source/provider/URIHelper.cxx19
-rw-r--r--scripting/source/stringresource/stringresource.cxx7
19 files changed, 58 insertions, 113 deletions
diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
index 8f42ae4080e5..32840a69c80c 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 475b09750826..d97b25190403 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 753e660ba888..59b9243cbbc1 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 d30ed4f0b7b8..4177226146fc 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 abcc1cd7355a..17aabcca2bc3 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 e82c580c300e..74b097602e6f 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 6dea71fc1fdd..4443b6142035 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 24854e3d9c91..a8c3939991d2 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 ba3d5de7f0e2..9d1e8fe8d1c2 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 5ec7b7294f77..9cfe424225fa 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 bb2c407c3f9a..6e3318bdddc8 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 c01b1863b426..6cfebf709b2b 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 60f48d1d5685..f68d5495a9d8 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 29f9206ac586..de36e6daff9e 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 57215fd78bbd..535e554636b3 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 4e94a6f8f53a..633ec641ad88 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 4adfd13e6c2f..c47a84959277 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 56a78bc8d1af..1bf4cf958021 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 9d71b74f9311..f29dbfbf56f4 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 );
}