Kaydet (Commit) 1d2f7047 authored tarafından Noel Grandin's avatar Noel Grandin

convert sc/source/ui/vba/*.cxx from String to OUString

Change-Id: If696cdf2293464dc2a21cab4bdc4f77223cf26c9
üst e12ae549
...@@ -303,7 +303,7 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >& ...@@ -303,7 +303,7 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
ScDocShell* pShell = excel::getDocShell( xModel ); ScDocShell* pShell = excel::getDocShell( xModel );
if ( pShell ) if ( pShell )
{ {
String aPrjName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) ); OUString aPrjName( "Standard" );
pShell->GetBasicManager()->SetName( aPrjName ); pShell->GetBasicManager()->SetName( aPrjName );
/* Set library container to VBA compatibility mode. This will create /* Set library container to VBA compatibility mode. This will create
...@@ -328,10 +328,10 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >& ...@@ -328,10 +328,10 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
// set up the module info for the workbook and sheets in the nealy created // set up the module info for the workbook and sheets in the nealy created
// spreadsheet // spreadsheet
ScDocument* pDoc = pShell->GetDocument(); ScDocument* pDoc = pShell->GetDocument();
String sCodeName = pDoc->GetCodeName(); OUString sCodeName = pDoc->GetCodeName();
if ( sCodeName.Len() == 0 ) if ( sCodeName.isEmpty() )
{ {
sCodeName = String( RTL_CONSTASCII_USTRINGPARAM("ThisWorkbook") ); sCodeName = "ThisWorkbook";
pDoc->SetCodeName( sCodeName ); pDoc->SetCodeName( sCodeName );
} }
......
...@@ -93,9 +93,9 @@ ScVbaCharacters::setFont( const uno::Reference< excel::XFont >& /*_font*/ ) thro ...@@ -93,9 +93,9 @@ ScVbaCharacters::setFont( const uno::Reference< excel::XFont >& /*_font*/ ) thro
// Methods // Methods
void SAL_CALL void SAL_CALL
ScVbaCharacters::Insert( const OUString& String ) throw (css::uno::RuntimeException) ScVbaCharacters::Insert( const OUString& rString ) throw (css::uno::RuntimeException)
{ {
m_xSimpleText->insertString( m_xTextRange, String, bReplace ); m_xSimpleText->insertString( m_xTextRange, rString, bReplace );
} }
void SAL_CALL void SAL_CALL
......
...@@ -574,8 +574,8 @@ ContainerUtilities::FieldInList( const uno::Sequence< OUString >& SearchList, co ...@@ -574,8 +574,8 @@ ContainerUtilities::FieldInList( const uno::Sequence< OUString >& SearchList, co
} }
bool NeedEsc(sal_Unicode cCode) bool NeedEsc(sal_Unicode cCode)
{ {
String sEsc(".^$+\\|{}()"); OUString sEsc(".^$+\\|{}()");
return (STRING_NOTFOUND != sEsc.Search(cCode)); return (-1 != sEsc.indexOf(cCode));
} }
OUString VBAToRegexp(const OUString &rIn, bool bForLike ) OUString VBAToRegexp(const OUString &rIn, bool bForLike )
......
...@@ -217,7 +217,7 @@ ScVbaNames::Add( const css::uno::Any& Name , ...@@ -217,7 +217,7 @@ ScVbaNames::Add( const css::uno::Any& Name ,
{ {
xArea.set( xRange->Areas( uno::makeAny( nArea ) ), uno::UNO_QUERY_THROW ); xArea.set( xRange->Areas( uno::makeAny( nArea ) ), uno::UNO_QUERY_THROW );
String sRangeAdd = xArea->Address( xAny2, xAny2 , xAny2 , xAny2, xAny2 ); OUString sRangeAdd = xArea->Address( xAny2, xAny2 , xAny2 , xAny2, xAny2 );
if ( nArea > 1 ) if ( nArea > 1 )
sTmp += ","; sTmp += ",";
sTmp = sTmp + "'" + xRange->getWorksheet()->getName() + "'." + sRangeAdd; sTmp = sTmp + "'" + xRange->getWorksheet()->getName() + "'." + sRangeAdd;
......
...@@ -3789,7 +3789,7 @@ double getDefaultCharWidth( ScDocShell* pDocShell ) ...@@ -3789,7 +3789,7 @@ double getDefaultCharWidth( ScDocShell* pDocShell )
::Font aDefFont; ::Font aDefFont;
pAttr->GetFont( aDefFont, SC_AUTOCOL_BLACK, pRefDevice ); pAttr->GetFont( aDefFont, SC_AUTOCOL_BLACK, pRefDevice );
pRefDevice->SetFont( aDefFont ); pRefDevice->SetFont( aDefFont );
long nCharWidth = pRefDevice->GetTextWidth( String( '0' ) ); // 1/100th mm long nCharWidth = pRefDevice->GetTextWidth( OUString( '0' ) ); // 1/100th mm
return lcl_hmmToPoints( nCharWidth ); return lcl_hmmToPoints( nCharWidth );
} }
......
...@@ -67,7 +67,7 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >& ...@@ -67,7 +67,7 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
ScDocShell* pShell = excel::getDocShell( xModel ); ScDocShell* pShell = excel::getDocShell( xModel );
if ( pShell ) if ( pShell )
{ {
String aPrjName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) ); OUString aPrjName( "Standard" );
pShell->GetBasicManager()->SetName( aPrjName ); pShell->GetBasicManager()->SetName( aPrjName );
/* Set library container to VBA compatibility mode. This will create /* Set library container to VBA compatibility mode. This will create
...@@ -92,10 +92,10 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >& ...@@ -92,10 +92,10 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
// set up the module info for the workbook and sheets in the nealy created // set up the module info for the workbook and sheets in the nealy created
// spreadsheet // spreadsheet
ScDocument* pDoc = pShell->GetDocument(); ScDocument* pDoc = pShell->GetDocument();
String sCodeName = pDoc->GetCodeName(); OUString sCodeName = pDoc->GetCodeName();
if ( sCodeName.Len() == 0 ) if ( sCodeName.isEmpty() )
{ {
sCodeName = String( RTL_CONSTASCII_USTRINGPARAM("ThisWorkbook") ); sCodeName = "ThisWorkbook";
pDoc->SetCodeName( sCodeName ); pDoc->SetCodeName( sCodeName );
} }
...@@ -333,9 +333,8 @@ ScVbaWorkbooks::Open( const OUString& rFileName, const uno::Any& /*UpdateLinks*/ ...@@ -333,9 +333,8 @@ ScVbaWorkbooks::Open( const OUString& rFileName, const uno::Any& /*UpdateLinks*/
throw uno::RuntimeException("Expected value for Delimiter", uno::Reference< uno::XInterface >() ); throw uno::RuntimeException("Expected value for Delimiter", uno::Reference< uno::XInterface >() );
OUString sStr; OUString sStr;
Delimiter >>= sStr; Delimiter >>= sStr;
String aUniStr( sStr ); if ( !sStr.isEmpty() )
if ( aUniStr.Len() ) nDelim = sStr[0];
nDelim = aUniStr.GetChar(0);
else else
throw uno::RuntimeException("Incorrect value for Delimiter", uno::Reference< uno::XInterface >() ); throw uno::RuntimeException("Incorrect value for Delimiter", uno::Reference< uno::XInterface >() );
} }
......
...@@ -269,7 +269,7 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After, ...@@ -269,7 +269,7 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After,
nSheetIndex++; nSheetIndex++;
SCTAB nSheetName = nCount + 1L; SCTAB nSheetName = nCount + 1L;
String aStringBase( RTL_CONSTASCII_USTRINGPARAM("Sheet") ); OUString aStringBase( "Sheet" );
uno::Any result; uno::Any result;
for (SCTAB i=0; i < nNewSheets; i++, nSheetName++) for (SCTAB i=0; i < nNewSheets; i++, nSheetName++)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment