From 705c48d32eec0aa5180e60ca157daca4b154e4a3 Mon Sep 17 00:00:00 2001
From: Noel Grandin <noel@peralex.com>
Date: Mon, 3 Nov 2014 14:03:54 +0200
Subject: fdo#38835 strip out OUString globals

they are largely unnecessary these days, since our OUString infrastructure
gained optimised handling for static char constants.

Change-Id: I07f73484f82d0582252cb4324d4107c998432c37
---
 sc/source/core/tool/compiler.cxx                   |  2 +-
 sc/source/filter/excel/xltoolbar.cxx               |  4 +-
 .../StatisticsDialogs/AnalysisOfVarianceDialog.cxx |  4 +-
 .../ui/StatisticsDialogs/CorrelationDialog.cxx     |  7 +--
 .../ui/StatisticsDialogs/CovarianceDialog.cxx      |  7 +--
 .../DescriptiveStatisticsDialog.cxx                |  4 +-
 sc/source/ui/StatisticsDialogs/FTestDialog.cxx     |  9 +---
 sc/source/ui/StatisticsDialogs/TTestDialog.cxx     |  9 +---
 sc/source/ui/docshell/impex.cxx                    |  4 +-
 sc/source/ui/vba/vbaapplication.cxx                |  3 +-
 sc/source/ui/vba/vbaborders.cxx                    |  2 +-
 sc/source/ui/vba/vbaformatconditions.cxx           | 10 ++--
 sc/source/ui/vba/vbainterior.cxx                   |  6 +--
 sc/source/ui/vba/vbarange.cxx                      | 55 +++++++++++-----------
 sc/source/ui/vba/vbastyle.cxx                      |  2 +-
 sc/source/ui/vba/vbawindow.cxx                     |  8 ++--
 sc/source/ui/vba/vbaworkbooks.cxx                  |  2 +-
 sc/source/ui/vba/vbaworksheet.cxx                  |  2 +-
 18 files changed, 61 insertions(+), 79 deletions(-)

(limited to 'sc')

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index f76b17a8632b..cfe4d18e9ae6 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -697,7 +697,7 @@ struct Convention_A1 : public ScCompiler::Convention
             KParseTokens::ASC_UNDERSCORE | KParseTokens::ASC_DOLLAR;
         static const sal_Int32 nContFlags = nStartFlags | KParseTokens::ASC_DOT;
         // '?' allowed in range names because of Xcl :-/
-        static const OUString aAddAllowed("?#");
+        static const char aAddAllowed[] = "?#";
         return pCharClass->parseAnyToken( rFormula,
                 nSrcPos, nStartFlags, aAddAllowed, nContFlags, aAddAllowed );
     }
diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx
index 6d307f41706f..0276a0de6591 100644
--- a/sc/source/filter/excel/xltoolbar.cxx
+++ b/sc/source/filter/excel/xltoolbar.cxx
@@ -145,7 +145,7 @@ bool ScCTB::ImportMenuTB( ScCTBWrapper& rWrapper, const css::uno::Reference< css
 bool ScCTB::ImportCustomToolBar( ScCTBWrapper& rWrapper, CustomToolBarImportHelper& helper )
 {
 
-    static OUString sToolbarPrefix( "private:resource/toolbar/custom_" );
+    static const char sToolbarPrefix[] = "private:resource/toolbar/custom_";
     bool bRes = false;
     try
     {
@@ -160,7 +160,7 @@ bool ScCTB::ImportCustomToolBar( ScCTBWrapper& rWrapper, CustomToolBarImportHelp
         // set UI name for toolbar
         xProps->setPropertyValue("UIName", uno::makeAny( name.getString() ) );
 
-        OUString sToolBarName = sToolbarPrefix.concat( name.getString() );
+        OUString sToolBarName = sToolbarPrefix + 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/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
index efb130e1a97b..03a71ad43dd2 100644
--- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
@@ -57,8 +57,8 @@ static sal_Int16 lclAnovaLabels[] =
     0
 };
 
-static const OUString strWildcardRange("%RANGE%");
-static const OUString strWildcardNumber("%NUMBER%");
+static const char strWildcardRange[] = "%RANGE%";
+static const char strWildcardNumber[] = "%NUMBER%";
 
 OUString lclCreateMultiParameterFormula(
             ScRangeList&        aRangeList, const OUString& aFormulaTemplate,
diff --git a/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx b/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx
index 3184b2281e0c..e82c580c300e 100644
--- a/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx
@@ -15,10 +15,7 @@
 
 #include "CorrelationDialog.hxx"
 
-namespace
-{
-    static const OUString strCorrelationTemplate("=CORREL(%VAR1%; %VAR2%)");
-}
+static const char strCorrelationTemplate[] = "=CORREL(%VAR1%; %VAR2%)";
 
 ScCorrelationDialog::ScCorrelationDialog(
                         SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
@@ -40,7 +37,7 @@ const OUString ScCorrelationDialog::getLabel()
 
 const OUString ScCorrelationDialog::getTemplate()
 {
-    return strCorrelationTemplate;
+    return OUString(strCorrelationTemplate);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx
index e26c650f5566..6dea71fc1fdd 100644
--- a/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx
@@ -15,10 +15,7 @@
 
 #include "CovarianceDialog.hxx"
 
-namespace
-{
-    static const OUString strCovarianceTemplate("=COVAR(%VAR1%; %VAR2%)");
-}
+static const char strCovarianceTemplate[] = "=COVAR(%VAR1%; %VAR2%)";
 
 ScCovarianceDialog::ScCovarianceDialog(
                         SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
@@ -45,7 +42,7 @@ const OUString ScCovarianceDialog::getLabel()
 
 const OUString ScCovarianceDialog::getTemplate()
 {
-    return strCovarianceTemplate;
+    return OUString(strCovarianceTemplate);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx
index 157e974fadae..485c04398589 100644
--- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx
@@ -54,8 +54,8 @@ static const StatisticCalculation lclCalcDefinitions[] =
     { 0,                         NULL }
 };
 
-static const OUString strWildcardRange("%RANGE%");
-static const OUString strWildcardNumber("%NUMBER%");
+static const char strWildcardRange[] = "%RANGE%";
+static const char strWildcardNumber[] = "%NUMBER%";
 
 }
 
diff --git a/sc/source/ui/StatisticsDialogs/FTestDialog.cxx b/sc/source/ui/StatisticsDialogs/FTestDialog.cxx
index 2b3eb52944be..1fa3a6eed40f 100644
--- a/sc/source/ui/StatisticsDialogs/FTestDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/FTestDialog.cxx
@@ -28,13 +28,8 @@
 
 #include "FTestDialog.hxx"
 
-namespace
-{
-
-static const OUString strWildcardVariable1Range("%VAR1_RANGE%");
-static const OUString strWildcardVariable2Range("%VAR2_RANGE%");
-
-}
+static const char strWildcardVariable1Range[] = "%VAR1_RANGE%";
+static const char strWildcardVariable2Range[] = "%VAR2_RANGE%";
 
 ScFTestDialog::ScFTestDialog(
                     SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
diff --git a/sc/source/ui/StatisticsDialogs/TTestDialog.cxx b/sc/source/ui/StatisticsDialogs/TTestDialog.cxx
index 684b40f9a2b1..b8f7e1a005d2 100644
--- a/sc/source/ui/StatisticsDialogs/TTestDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/TTestDialog.cxx
@@ -28,13 +28,8 @@
 
 #include "TTestDialog.hxx"
 
-namespace
-{
-
-static const OUString strWildcardVariable1Range("%VAR1_RANGE%");
-static const OUString strWildcardVariable2Range("%VAR2_RANGE%");
-
-}
+static const char strWildcardVariable1Range[] = "%VAR1_RANGE%";
+static const char strWildcardVariable2Range[] = "%VAR2_RANGE%";
 
 ScTTestDialog::ScTTestDialog(
                     SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 0395d403f688..f136d1a3147b 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1065,8 +1065,8 @@ static bool lcl_PutString(
             sal_Int16 nMonth = (sal_Int16) aMStr.toInt32();
             if (!nMonth)
             {
-                static const OUString aSeptCorrect( "SEPT" );
-                static const OUString aSepShortened( "SEP" );
+                static const char aSeptCorrect[] =  "SEPT";
+                static const char aSepShortened[] =  "SEP";
                 uno::Sequence< i18n::CalendarItem2 > xMonths;
                 sal_Int32 i, nMonthCount;
                 //  first test all month names from local international
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 3cc6dd764da6..3e2aa7e0f30a 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -698,8 +698,7 @@ ScVbaApplication::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException, s
 OUString SAL_CALL
 ScVbaApplication::getName() throw (uno::RuntimeException, std::exception)
 {
-    static OUString appName("Microsoft Excel" );
-    return appName;
+    return OUString("Microsoft Excel" );
 }
 
 // #TODO #FIXME get/setDisplayAlerts are just stub impl
diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx
index 8d76d3915b55..1bd506dabdd0 100644
--- a/sc/source/ui/vba/vbaborders.cxx
+++ b/sc/source/ui/vba/vbaborders.cxx
@@ -41,7 +41,7 @@ typedef InheritedHelperInterfaceImpl1<excel::XBorder > ScVbaBorder_Base;
 // borders, the enumeration will match the order in this list
 static const sal_Int16 supportedIndexTable[] = {  XlBordersIndex::xlEdgeLeft, XlBordersIndex::xlEdgeTop, XlBordersIndex::xlEdgeBottom, XlBordersIndex::xlEdgeRight, XlBordersIndex::xlDiagonalDown, XlBordersIndex::xlDiagonalUp, XlBordersIndex::xlInsideVertical, XlBordersIndex::xlInsideHorizontal };
 
-const static OUString sTableBorder("TableBorder");
+static const char sTableBorder[] = "TableBorder";
 
 //  Equiv widths in in 1/100 mm
 const static sal_Int32 OOLineThin = 35;
diff --git a/sc/source/ui/vba/vbaformatconditions.cxx b/sc/source/ui/vba/vbaformatconditions.cxx
index 78df56657493..b8b74e070abe 100644
--- a/sc/source/ui/vba/vbaformatconditions.cxx
+++ b/sc/source/ui/vba/vbaformatconditions.cxx
@@ -32,11 +32,11 @@ using namespace ::com::sun::star;
 
 typedef std::vector< beans::PropertyValue > VecPropValues;
 
-static OUString OPERATOR("Operator");
-static OUString FORMULA1("Formula1");
-static OUString FORMULA2("Formula2");
-static OUString STYLENAME("StyleName");
-static OUString sStyleNamePrefix("Excel_CondFormat");
+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)
diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx
index d75d3fce5945..fa839cc57890 100644
--- a/sc/source/ui/vba/vbainterior.cxx
+++ b/sc/source/ui/vba/vbainterior.cxx
@@ -47,9 +47,9 @@ typedef std::pair< sal_Int32, sal_Int32 > PatternPair;
 using namespace ::com::sun::star;
 using namespace ::ooo::vba;
 using namespace ::ooo::vba::excel::XlPattern;
-static const OUString BACKCOLOR( "CellBackColor" );
-static const OUString PATTERN( "Pattern" );
-static const OUString PATTERNCOLOR( "PatternColor" );
+static const char BACKCOLOR[] = "CellBackColor";
+static const char PATTERN[] = "Pattern";
+static const char PATTERNCOLOR[] = "PatternColor";
 
 static PatternMap lcl_getPatternMap()
 {
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index ebfad21db197..a06ca8e24423 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -689,19 +689,19 @@ public:
     }
 };
 
-const static OUString ISVISIBLE(   "IsVisible");
-const static OUString POSITION(   "Position");
-const static OUString EQUALS( "=" );
-const static OUString NOTEQUALS( "<>" );
-const static OUString GREATERTHAN( ">" );
-const static OUString GREATERTHANEQUALS( ">=" );
-const static OUString LESSTHAN( "<" );
-const static OUString LESSTHANEQUALS( "<=" );
-const static OUString CONTS_HEADER( "ContainsHeader" );
-const static OUString INSERTPAGEBREAKS( "InsertPageBreaks" );
-const static OUString STR_ERRORMESSAGE_APPLIESTOSINGLERANGEONLY( "The command you chose cannot be performed with multiple selections.\nSelect a single range and click the command again" );
-const static OUString STR_ERRORMESSAGE_NOCELLSWEREFOUND( "No cells were found" );
-const static OUString CELLSTYLE( "CellStyle" );
+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
 {
@@ -980,7 +980,7 @@ public:
 
 };
 
-const static OUString sNA("#N/A");
+static const char sNA[] = "#N/A";
 
 class Dim1ArrayValueSetter : public ArrayVisitor
 {
@@ -998,7 +998,7 @@ public:
         if ( y < nColCount )
             mCellValueSetter.processValue( aMatrix[ y ], xCell );
         else
-            mCellValueSetter.processValue( uno::makeAny( sNA ), xCell );
+            mCellValueSetter.processValue( uno::makeAny( OUString(sNA) ), xCell );
     }
 };
 
@@ -1021,7 +1021,7 @@ public:
         if ( x < nRowCount && y < nColCount )
             mCellValueSetter.processValue( aMatrix[ x ][ y ], xCell );
         else
-            mCellValueSetter.processValue( uno::makeAny( sNA ), xCell );
+            mCellValueSetter.processValue( uno::makeAny( OUString(sNA) ), xCell );
 
     }
 };
@@ -3725,8 +3725,7 @@ ScVbaRange::createEnumeration() throw (uno::RuntimeException, std::exception)
 OUString SAL_CALL
 ScVbaRange::getDefaultMethodName(  ) throw (uno::RuntimeException, std::exception)
 {
-    const static OUString sName( "Item" );
-    return sName;
+    return OUString( "Item" );
 }
 
 // returns calc internal col. width ( in points )
@@ -4210,7 +4209,7 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC
     Cell1 >>= sRangeName;
     if ( Cell1.hasValue() && !Cell2.hasValue() && !sRangeName.isEmpty() )
     {
-        const static OUString sNamedRanges( "NamedRanges");
+        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 );
@@ -4302,12 +4301,12 @@ static void lcl_setTableFieldsFromCriteria( OUString& sCriteria1, uno::Reference
     bool bIsNumeric = false;
     if ( sCriteria1.startsWith( EQUALS ) )
     {
-        if ( sCriteria1.getLength() == EQUALS.getLength() )
+        if ( sCriteria1.getLength() == (sal_Int32)strlen(EQUALS) )
             rFilterField.Operator = sheet::FilterOperator2::EMPTY;
         else
         {
             rFilterField.Operator = sheet::FilterOperator2::EQUAL;
-            sCriteria1 = sCriteria1.copy( EQUALS.getLength() );
+            sCriteria1 = sCriteria1.copy( strlen(EQUALS) );
             sCriteria1 = VBAToRegexp( sCriteria1 );
             // UseRegularExpressions
             if ( xDescProps.is() )
@@ -4317,12 +4316,12 @@ static void lcl_setTableFieldsFromCriteria( OUString& sCriteria1, uno::Reference
     }
     else if ( sCriteria1.startsWith( NOTEQUALS ) )
     {
-        if ( sCriteria1.getLength() == NOTEQUALS.getLength() )
+        if ( sCriteria1.getLength() == (sal_Int32)strlen(NOTEQUALS) )
             rFilterField.Operator = sheet::FilterOperator2::NOT_EMPTY;
         else
         {
             rFilterField.Operator = sheet::FilterOperator2::NOT_EQUAL;
-            sCriteria1 = sCriteria1.copy( NOTEQUALS.getLength() );
+            sCriteria1 = sCriteria1.copy( strlen(NOTEQUALS) );
             sCriteria1 = VBAToRegexp( sCriteria1 );
             // UseRegularExpressions
             if ( xDescProps.is() )
@@ -4334,12 +4333,12 @@ static void lcl_setTableFieldsFromCriteria( OUString& sCriteria1, uno::Reference
         bIsNumeric = true;
         if ( sCriteria1.startsWith( GREATERTHANEQUALS ) )
         {
-            sCriteria1 = sCriteria1.copy( GREATERTHANEQUALS.getLength() );
+            sCriteria1 = sCriteria1.copy( strlen(GREATERTHANEQUALS) );
             rFilterField.Operator = sheet::FilterOperator2::GREATER_EQUAL;
         }
         else
         {
-            sCriteria1 = sCriteria1.copy( GREATERTHAN.getLength() );
+            sCriteria1 = sCriteria1.copy( strlen(GREATERTHAN) );
             rFilterField.Operator = sheet::FilterOperator2::GREATER;
         }
 
@@ -4349,12 +4348,12 @@ static void lcl_setTableFieldsFromCriteria( OUString& sCriteria1, uno::Reference
         bIsNumeric = true;
         if ( sCriteria1.startsWith( LESSTHANEQUALS ) )
         {
-            sCriteria1 = sCriteria1.copy( LESSTHANEQUALS.getLength() );
+            sCriteria1 = sCriteria1.copy( strlen(LESSTHANEQUALS) );
             rFilterField.Operator = sheet::FilterOperator2::LESS_EQUAL;
         }
         else
         {
-            sCriteria1 = sCriteria1.copy( LESSTHAN.getLength() );
+            sCriteria1 = sCriteria1.copy( strlen(LESSTHAN) );
             rFilterField.Operator = sheet::FilterOperator2::LESS;
         }
 
@@ -5605,7 +5604,7 @@ 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 OUString FunctionName( "IsError" );
+    static const char FunctionName[] = "IsError";
     uno::Sequence< uno::Any > Params(1);
     uno::Reference< excel::XRange > aRange( this );
     Params[0] = uno::makeAny( aRange );
diff --git a/sc/source/ui/vba/vbastyle.cxx b/sc/source/ui/vba/vbastyle.cxx
index 173a0c6652f9..09181f83db5b 100644
--- a/sc/source/ui/vba/vbastyle.cxx
+++ b/sc/source/ui/vba/vbastyle.cxx
@@ -23,7 +23,7 @@
 using namespace ::ooo::vba;
 using namespace ::com::sun::star;
 
-static OUString DISPLAYNAME("DisplayName");
+static const char DISPLAYNAME[] = "DisplayName";
 
 uno::Reference< container::XNameAccess >
 ScVbaStyle::getStylesNameContainer( const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException )
diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index d6090a877a1e..85729b5612d5 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -301,11 +301,11 @@ ScVbaWindow::ScrollWorkbookTabs( const uno::Any& /*Sheets*/, const uno::Any& /*P
 uno::Any SAL_CALL
 ScVbaWindow::getCaption() throw (uno::RuntimeException, std::exception)
 {
-    static OUString sCrud(" - OpenOffice.org Calc" );
-    static sal_Int32 nCrudLen = sCrud.getLength();
+    static const char sCrud[] = " - OpenOffice.org Calc";
+    static const sal_Int32 nCrudLen = strlen(sCrud);
 
     OUString sTitle;
-    getFrameProps()->getPropertyValue( OUString( SC_UNONAME_TITLE ) ) >>= sTitle;
+    getFrameProps()->getPropertyValue( SC_UNONAME_TITLE ) >>= sTitle;
     sal_Int32 nCrudIndex = sTitle.indexOf( sCrud );
     // adjust title ( by removing crud )
     // sCrud string present
@@ -326,7 +326,7 @@ ScVbaWindow::getCaption() throw (uno::RuntimeException, std::exception)
 
             if ( !sTitle.equals( sName ) )
             {
-                static OUString sDot(".");
+                static const char sDot[] = ".";
                 // starts with title
                 if ( sName.startsWith( sTitle ) )
                     // extention starts immediately after
diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx
index 98a3f74cdd32..fc36732a557b 100644
--- a/sc/source/ui/vba/vbaworkbooks.cxx
+++ b/sc/source/ui/vba/vbaworkbooks.cxx
@@ -235,7 +235,7 @@ 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 OUString sRestOfFormat(",34,0,1" );
+        static const char sRestOfFormat[] = ",34,0,1";
 
         OUString sFormat;
         sal_Int16 nFormat = 0; // default indicator
diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx
index ccf2d02c5667..49b8c7f6d5ee 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -110,7 +110,7 @@ static void getNewSpreadsheetName (OUString &aNewName, const OUString& aOldName,
 {
     if (!xSpreadDoc.is())
         throw lang::IllegalArgumentException( "getNewSpreadsheetName() xSpreadDoc is null", uno::Reference< uno::XInterface  >(), 1 );
-    static OUString aUnderScore( "_" );
+    static const char aUnderScore[] =  "_";
     int currentNum =2;
     aNewName = aOldName + aUnderScore + OUString::number(currentNum) ;
     SCTAB nTab = 0;
-- 
cgit