loplugin:ostr in sc/.../vba

Change-Id: Ifdf0ebba617432f49e2c14c8a52c495dc1c6a36a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167853
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin
2024-05-20 14:40:36 +02:00
parent 9312f954b6
commit 5a602ed852
64 changed files with 489 additions and 489 deletions
+16 -16
View File
@@ -64,7 +64,7 @@ GetUnnamedDataBaseRanges( const ScDocShell* pShell )
if ( pShell )
xModel.set( pShell->GetModel(), uno::UNO_SET_THROW );
uno::Reference< beans::XPropertySet > xModelProps( xModel, uno::UNO_QUERY_THROW );
uno::Reference< sheet::XUnnamedDatabaseRanges > xUnnamedDBRanges( xModelProps->getPropertyValue("UnnamedDatabaseRanges"), uno::UNO_QUERY_THROW );
uno::Reference< sheet::XUnnamedDatabaseRanges > xUnnamedDBRanges( xModelProps->getPropertyValue(u"UnnamedDatabaseRanges"_ustr), uno::UNO_QUERY_THROW );
return xUnnamedDBRanges;
}
@@ -80,7 +80,7 @@ GetAutoFiltRange( const ScDocShell* pShell, sal_Int16 nSheet )
uno::Reference< sheet::XDatabaseRange > xDBRange( xUnnamedDBRanges->getByTable( nSheet ) , uno::UNO_QUERY_THROW );
bool bHasAuto = false;
uno::Reference< beans::XPropertySet > xProps( xDBRange, uno::UNO_QUERY_THROW );
xProps->getPropertyValue("AutoFilter") >>= bHasAuto;
xProps->getPropertyValue(u"AutoFilter"_ustr) >>= bHasAuto;
if ( bHasAuto )
{
xDataBaseRange=xDBRange;
@@ -94,7 +94,7 @@ ScDocShell* GetDocShellFromRange( const uno::Reference< uno::XInterface >& xRang
ScCellRangesBase* pScCellRangesBase = dynamic_cast<ScCellRangesBase*>( xRange.get() );
if ( !pScCellRangesBase )
{
throw uno::RuntimeException("Failed to access underlying doc shell uno range object" );
throw uno::RuntimeException(u"Failed to access underlying doc shell uno range object"_ustr );
}
return pScCellRangesBase->GetDocShell();
}
@@ -285,7 +285,7 @@ getUnoSheetModuleObj( const uno::Reference< sheet::XSpreadsheet >& xSheet )
{
uno::Reference< beans::XPropertySet > xProps( xSheet, uno::UNO_QUERY_THROW );
OUString sCodeName;
xProps->getPropertyValue("CodeName") >>= sCodeName;
xProps->getPropertyValue(u"CodeName"_ustr) >>= sCodeName;
// #TODO #FIXME ideally we should 'throw' here if we don't get a valid parent, but... it is possible
// to create a module ( and use 'Option VBASupport 1' ) for a calc document, in this scenario there
// are *NO* special document module objects ( of course being able to switch between vba/non vba mode at
@@ -327,7 +327,7 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
if ( !pShell )
return;
OUString aPrjName( "Standard" );
OUString aPrjName( u"Standard"_ustr );
pShell->GetBasicManager()->SetName( aPrjName );
/* Set library container to VBA compatibility mode. This will create
@@ -347,7 +347,7 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
if( xLib.is() )
{
uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xVBACodeNamedObjectAccess( pShell->GetModel()->createInstance("ooo.vba.VBAObjectModuleObjectProvider"), uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xVBACodeNamedObjectAccess( pShell->GetModel()->createInstance(u"ooo.vba.VBAObjectModuleObjectProvider"_ustr), uno::UNO_QUERY_THROW );
// set up the module info for the workbook and sheets in the newly created
// spreadsheet
ScDocument& rDoc = pShell->GetDocument();
@@ -376,9 +376,9 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
sModuleInfo.ModuleType = script::ModuleType::DOCUMENT;
xVBAModuleInfo->insertModuleInfo( rName, sModuleInfo );
if( xLib->hasByName( rName ) )
xLib->replaceByName( rName, uno::Any( OUString( "Option VBASupport 1\n") ) );
xLib->replaceByName( rName, uno::Any( u"Option VBASupport 1\n"_ustr ) );
else
xLib->insertByName( rName, uno::Any( OUString( "Option VBASupport 1\n" ) ) );
xLib->insertByName( rName, uno::Any( u"Option VBASupport 1\n"_ustr ) );
}
}
}
@@ -455,7 +455,7 @@ void ExportAsFixedFormatHelper(
From >>= nFrom;
To >>= nTo;
OUString sRange("-");
OUString sRange(u"-"_ustr);
css::uno::Sequence<css::beans::PropertyValue> aFilterData;
if (nFrom || nTo)
@@ -466,7 +466,7 @@ void ExportAsFixedFormatHelper(
sRange += OUString::number(nTo);
aFilterData.realloc(aFilterData.getLength() + 1);
aFilterData.getArray()[aFilterData.getLength() - 1] = comphelper::makePropertyValue("PageRange", sRange);
aFilterData.getArray()[aFilterData.getLength() - 1] = comphelper::makePropertyValue(u"PageRange"_ustr, sRange);
}
OUString sQuality;
@@ -475,12 +475,12 @@ void ExportAsFixedFormatHelper(
if (sQuality.equalsIgnoreAsciiCase(u"xlQualityMinimum") || sQuality == "1")
{
aFilterData.realloc(aFilterData.getLength() + 1);
aFilterData.getArray()[aFilterData.getLength() - 1] = comphelper::makePropertyValue("Quality", sal_Int32(70));
aFilterData.getArray()[aFilterData.getLength() - 1] = comphelper::makePropertyValue(u"Quality"_ustr, sal_Int32(70));
}
else if (sQuality.equalsIgnoreAsciiCase(u"xlQualityStandard") || sQuality == "0")
{
aFilterData.realloc(aFilterData.getLength() + 1);
aFilterData.getArray()[aFilterData.getLength() - 1] = comphelper::makePropertyValue("UseLosslessCompression", true);
aFilterData.getArray()[aFilterData.getLength() - 1] = comphelper::makePropertyValue(u"UseLosslessCompression"_ustr, true);
}
else
{
@@ -492,9 +492,9 @@ void ExportAsFixedFormatHelper(
// init set of params for storeToURL() call
css::uno::Sequence<css::beans::PropertyValue> storeProps{
comphelper::makePropertyValue("FilterData", aFilterData),
comphelper::makePropertyValue("FilterName", OUString("calc_pdf_Export")),
comphelper::makePropertyValue("URL", sURL)
comphelper::makePropertyValue(u"FilterData"_ustr, aFilterData),
comphelper::makePropertyValue(u"FilterName"_ustr, u"calc_pdf_Export"_ustr),
comphelper::makePropertyValue(u"URL"_ustr, sURL)
};
bool bIncludeDocProperties = true;
@@ -533,7 +533,7 @@ void ExportAsFixedFormatHelper(
if ((OpenAfterPublish >>= bOpenAfterPublish) && bOpenAfterPublish)
{
uno::Reference<css::system::XSystemShellExecute> xSystemShellExecute(css::system::SystemShellExecute::create(::comphelper::getProcessComponentContext()));
xSystemShellExecute->execute(aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), "", css::system::SystemShellExecuteFlags::URIS_ONLY);
xSystemShellExecute->execute(aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), u""_ustr, css::system::SystemShellExecuteFlags::URIS_ONLY);
}
}
+1 -1
View File
@@ -100,7 +100,7 @@ template < typename ImplObject >
{
ImplObject* pObj = comphelper::getFromUnoTunnel<ImplObject>(rxWrapperIf);
if ( !pObj )
throw css::uno::RuntimeException("Internal error, can't extract implementation object", rxWrapperIf );
throw css::uno::RuntimeException(u"Internal error, can't extract implementation object"_ustr, rxWrapperIf );
return pObj;
}
+30 -30
View File
@@ -281,7 +281,7 @@ ScVbaApplication::getSelection()
if (!aSelection.is())
{
throw uno::RuntimeException( "failed to obtain current selection" );
throw uno::RuntimeException( u"failed to obtain current selection"_ustr );
}
uno::Reference< lang::XServiceInfo > xServiceInfo( aSelection, uno::UNO_QUERY_THROW );
@@ -306,7 +306,7 @@ ScVbaApplication::getSelection()
uno::Reference< lang::XServiceInfo > xShapeServiceInfo( xShape, uno::UNO_QUERY_THROW );
if ( xShapeServiceInfo->supportsService("com.sun.star.drawing.Text") )
if ( xShapeServiceInfo->supportsService(u"com.sun.star.drawing.Text"_ustr) )
{
return uno::Any( uno::Reference< msforms::XTextBoxShape >(
new ScVbaTextBoxShape( mxContext, xShape, xShapes, xModel ) ) );
@@ -319,8 +319,8 @@ ScVbaApplication::getSelection()
}
return uno::Any( uno::Reference< msforms::XShape >(new ScVbaShape( this, mxContext, xShape, xShapes, xModel, ScVbaShape::getType( xShape ) ) ) );
}
else if( xServiceInfo->supportsService("com.sun.star.sheet.SheetCellRange") ||
xServiceInfo->supportsService("com.sun.star.sheet.SheetCellRanges") )
else if( xServiceInfo->supportsService(u"com.sun.star.sheet.SheetCellRange"_ustr) ||
xServiceInfo->supportsService(u"com.sun.star.sheet.SheetCellRanges"_ustr) )
{
uno::Reference< table::XCellRange > xRange( aSelection, ::uno::UNO_QUERY);
if ( !xRange.is() )
@@ -345,7 +345,7 @@ ScVbaApplication::getActiveCell()
uno::Reference< table::XCellRange > xRange( xView->getActiveSheet(), ::uno::UNO_QUERY_THROW);
ScTabViewShell* pViewShell = excel::getCurrentBestViewShell(mxContext);
if ( !pViewShell )
throw uno::RuntimeException("No ViewShell available" );
throw uno::RuntimeException(u"No ViewShell available"_ustr );
ScViewData& rTabView = pViewShell->GetViewData();
sal_Int32 nCursorX = rTabView.GetCurX();
@@ -377,7 +377,7 @@ ScVbaApplication::GetOpenFilename(const uno::Any& /*aFileFilter*/, const uno::An
// Check, if the implementation of XFileDialogSelectedItems is what we expect
if (!pItems)
throw uno::RuntimeException("Unexpected XFileDialogSelectedItems implementation");
throw uno::RuntimeException(u"Unexpected XFileDialogSelectedItems implementation"_ustr);
auto const & rItemVector = pItems->getItems();
@@ -529,7 +529,7 @@ ScVbaApplication::setStatusBar( const uno::Any& _statusbar )
}
}
else
throw uno::RuntimeException("Invalid parameter. It should be a string or False" );
throw uno::RuntimeException(u"Invalid parameter. It should be a string or False"_ustr );
}
::sal_Int32 SAL_CALL
@@ -576,7 +576,7 @@ ScVbaApplication::wait( double time )
SbxVariableRef aRef = new SbxVariable;
aRef->PutDouble( time );
aArgs->Put(aRef.get(), 1);
SbMethod* pMeth = static_cast<SbMethod*>(pBasic->GetRtl()->Find( "WaitUntil", SbxClassType::Method ));
SbMethod* pMeth = static_cast<SbMethod*>(pBasic->GetRtl()->Find( u"WaitUntil"_ustr, SbxClassType::Method ));
if ( pMeth )
{
@@ -600,7 +600,7 @@ ScVbaApplication::Names( const css::uno::Any& aIndex )
uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW );
uno::Reference< beans::XPropertySet > xPropertySet( xModel, uno::UNO_QUERY_THROW );
uno::Reference< sheet::XNamedRanges > xNamedRanges( xPropertySet->getPropertyValue(
"NamedRanges" ), uno::UNO_QUERY_THROW );
u"NamedRanges"_ustr ), uno::UNO_QUERY_THROW );
css::uno::Reference< excel::XNames > xNames ( new ScVbaNames( this , mxContext , xNamedRanges , xModel ) );
if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID )
@@ -628,7 +628,7 @@ ScVbaApplication::getActiveSheet()
if ( !result.is() )
{
// Fixme - check if this is reasonable/desired behavior
throw uno::RuntimeException("No activeSheet available" );
throw uno::RuntimeException(u"No activeSheet available"_ustr );
}
return result;
@@ -655,7 +655,7 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll )
{
bool aScroll = false;
if( !(Scroll >>= aScroll) )
throw uno::RuntimeException("second parameter should be boolean" );
throw uno::RuntimeException(u"second parameter should be boolean"_ustr );
bScroll = aScroll;
@@ -702,7 +702,7 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll )
//and the createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) to get a root browse::XBrowseNode.
//for query XInvocation interface.
//but how to directly get the XInvocation?
throw uno::RuntimeException("invalid reference for range name, it should be procedure name" );
throw uno::RuntimeException(u"invalid reference for range name, it should be procedure name"_ustr );
}
return;
}
@@ -736,7 +736,7 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll )
}
return;
}
throw uno::RuntimeException("invalid reference or name" );
throw uno::RuntimeException(u"invalid reference or name"_ustr );
}
sal_Int32 SAL_CALL
@@ -786,7 +786,7 @@ ScVbaApplication::setCursor( sal_Int32 _cursor )
break;
}
default:
throw uno::RuntimeException("Unknown value for Cursor pointer" );
throw uno::RuntimeException(u"Unknown value for Cursor pointer"_ustr );
// TODO: isn't this a flaw in the API? It should be allowed to throw an
// IllegalArgumentException, or so
}
@@ -802,7 +802,7 @@ ScVbaApplication::setCursor( sal_Int32 _cursor )
OUString SAL_CALL
ScVbaApplication::getName()
{
return "Microsoft Excel";
return u"Microsoft Excel"_ustr;
}
// #TODO #FIXME get/setDisplayAlerts are just stub impl
@@ -863,7 +863,7 @@ ScVbaApplication::setDisplayFullScreen( sal_Bool bSet )
// #FIXME calling ScViewUtil::SetFullScreen( *pShell, bSet );
// directly results in a strange crash, using dispatch instead
if ( bSet != getDisplayFullScreen() )
dispatchRequests( getCurrentDocument(), ".uno:FullScreen" );
dispatchRequests( getCurrentDocument(), u".uno:FullScreen"_ustr );
}
sal_Bool SAL_CALL
@@ -883,8 +883,8 @@ ScVbaApplication::setDisplayScrollBars( sal_Bool bSet )
// use uno here as it does all he repainting etc. magic
uno::Reference< sheet::XSpreadsheetView > xView( getCurrentDocument()->getCurrentController(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xProps( xView, uno::UNO_QUERY );
xProps->setPropertyValue("HasVerticalScrollBar", uno::Any( bSet ) );
xProps->setPropertyValue("HasHorizontalScrollBar", uno::Any( bSet ) );
xProps->setPropertyValue(u"HasVerticalScrollBar"_ustr, uno::Any( bSet ) );
xProps->setPropertyValue(u"HasHorizontalScrollBar"_ustr, uno::Any( bSet ) );
}
sal_Bool SAL_CALL
@@ -936,12 +936,12 @@ ScVbaApplication::setIteration( sal_Bool bSet )
mxContext->getServiceManager(), uno::UNO_SET_THROW );
uno::Reference< frame::XDesktop > xDesktop
(xSMgr->createInstanceWithContext( "com.sun.star.frame.Desktop" , mxContext), uno::UNO_QUERY_THROW );
(xSMgr->createInstanceWithContext( u"com.sun.star.frame.Desktop"_ustr , mxContext), uno::UNO_QUERY_THROW );
uno::Reference< container::XEnumeration > xComponents = xDesktop->getComponents()->createEnumeration();
while ( xComponents->hasMoreElements() )
{
uno::Reference< lang::XServiceInfo > xServiceInfo( xComponents->nextElement(), uno::UNO_QUERY );
if ( xServiceInfo.is() && xServiceInfo->supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) )
if ( xServiceInfo.is() && xServiceInfo->supportsService( u"com.sun.star.sheet.SpreadsheetDocument"_ustr ) )
{
uno::Reference< beans::XPropertySet > xProps( xServiceInfo, uno::UNO_QUERY );
if ( xProps.is() )
@@ -1002,19 +1002,19 @@ ScVbaApplication::setDefaultFilePath( const OUString& DefaultFilePath )
OUString SAL_CALL
ScVbaApplication::getDefaultFilePath()
{
return getOfficePath( "Work");
return getOfficePath( u"Work"_ustr);
}
OUString SAL_CALL
ScVbaApplication::getLibraryPath()
{
return getOfficePath( "Basic");
return getOfficePath( u"Basic"_ustr);
}
OUString SAL_CALL
ScVbaApplication::getTemplatesPath()
{
return getOfficePath( "Template");
return getOfficePath( u"Template"_ustr);
}
OUString SAL_CALL
@@ -1034,7 +1034,7 @@ ScVbaApplication::getOperatingSystem()
return "Macintosh";
#elif defined(UNX)
// M. Office is not available on Unix systems, so it is not documented.
return "Unix";
return u"Unix"_ustr;
#else
return OUString("Unknown");
#endif
@@ -1395,7 +1395,7 @@ uno::Any SAL_CALL
ScVbaApplication::Caller( const uno::Any& /*aIndex*/ )
{
StarBASIC* pBasic = SfxApplication::GetBasic();
SbMethod* pMeth = static_cast<SbMethod*>(pBasic->GetRtl()->Find( "FuncCaller", SbxClassType::Method ));
SbMethod* pMeth = static_cast<SbMethod*>(pBasic->GetRtl()->Find( u"FuncCaller"_ustr, SbxClassType::Method ));
uno::Any aRet;
if ( pMeth )
{
@@ -1490,7 +1490,7 @@ void SAL_CALL ScVbaApplication::Undo()
OUString SAL_CALL
ScVbaApplication::getIID()
{
return "{82154425-0FBF-11d4-8313-005004526AB4}";
return u"{82154425-0FBF-11d4-8313-005004526AB4}"_ustr;
}
// XConnectable
@@ -1498,7 +1498,7 @@ ScVbaApplication::getIID()
OUString SAL_CALL
ScVbaApplication::GetIIDForClassItselfNotCoclass()
{
return "{82154426-0FBF-11D4-8313-005004526AB4}";
return u"{82154426-0FBF-11D4-8313-005004526AB4}"_ustr;
}
TypeAndIID SAL_CALL
@@ -1506,7 +1506,7 @@ ScVbaApplication::GetConnectionPoint()
{
TypeAndIID aResult =
{ cppu::UnoType<excel::XApplicationOutgoing>::get(),
"{82154427-0FBF-11D4-8313-005004526AB4}"
u"{82154427-0FBF-11D4-8313-005004526AB4}"_ustr
};
return aResult;
@@ -1534,7 +1534,7 @@ ScVbaApplication::CallSinks( const OUString& Method, uno::Sequence< uno::Any >&
OUString
ScVbaApplication::getServiceImplName()
{
return "ScVbaApplication";
return u"ScVbaApplication"_ustr;
}
uno::Sequence< OUString >
@@ -1542,7 +1542,7 @@ ScVbaApplication::getServiceNames()
{
static uno::Sequence< OUString > aServiceNames
{
"ooo.vba.excel.Application"
u"ooo.vba.excel.Application"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -100,7 +100,7 @@ ScVbaAssistant::Name( )
OUString
ScVbaAssistant::getServiceImplName()
{
return "ScVbaAssistant";
return u"ScVbaAssistant"_ustr;
}
uno::Sequence< OUString >
@@ -108,7 +108,7 @@ ScVbaAssistant::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.Assistant"
u"ooo.vba.Assistant"_ustr
};
return aServiceNames;
}
+9 -9
View File
@@ -68,7 +68,7 @@ ScVbaAxes::createAxis( const uno::Reference< excel::XChart >& xChart, const uno:
{
ScVbaChart* pChart = static_cast< ScVbaChart* >( xChart.get() );
if ( !pChart )
throw uno::RuntimeException("Object failure, can't access chart implementation" );
throw uno::RuntimeException(u"Object failure, can't access chart implementation"_ustr );
uno::Reference< beans::XPropertySet > xAxisPropertySet;
if ((nType == xlCategory) || (nType == xlSeriesAxis) || (nType == xlValue))
@@ -102,18 +102,18 @@ public:
// primary
bool bBool = false;
uno::Reference< beans::XPropertySet > xDiagramPropertySet( pChart->xDiagramPropertySet() );
if ( ( xDiagramPropertySet->getPropertyValue("HasXAxis") >>= bBool ) && bBool )
if ( ( xDiagramPropertySet->getPropertyValue(u"HasXAxis"_ustr) >>= bBool ) && bBool )
mCoordinates.emplace_back( xlPrimary, xlCategory );
if ( ( xDiagramPropertySet->getPropertyValue("HasYAxis") >>= bBool ) && bBool )
if ( ( xDiagramPropertySet->getPropertyValue(u"HasYAxis"_ustr) >>= bBool ) && bBool )
mCoordinates.emplace_back( xlPrimary, xlSeriesAxis );
if ( pChart->is3D() )
mCoordinates.emplace_back( xlPrimary, xlValue );
// secondary
if ( ( xDiagramPropertySet->getPropertyValue("HasSecondaryXAxis") >>= bBool ) && bBool )
if ( ( xDiagramPropertySet->getPropertyValue(u"HasSecondaryXAxis"_ustr) >>= bBool ) && bBool )
mCoordinates.emplace_back( xlSecondary, xlCategory );
if ( ( xDiagramPropertySet->getPropertyValue("HasSecondaryYAxis") >>= bBool ) && bBool )
if ( ( xDiagramPropertySet->getPropertyValue(u"HasSecondaryYAxis"_ustr) >>= bBool ) && bBool )
mCoordinates.emplace_back( xlSecondary, xlSeriesAxis );
}
@@ -129,7 +129,7 @@ public:
{
css::uno::Any anyEx = cppu::getCaughtException();
throw css::lang::WrappedTargetException(
"Error Getting Index!",
u"Error Getting Index!"_ustr,
getXWeak(),
anyEx );
}
@@ -178,7 +178,7 @@ ScVbaAxes::Item( const css::uno::Any& _nType, const css::uno::Any& _oAxisGroup)
sal_Int32 nAxisGroup = xlPrimary;
sal_Int32 nType = -1;
if ( !_nType.hasValue() || !( _nType >>= nType ) )
throw uno::RuntimeException("Axes::Item Failed to extract type" );
throw uno::RuntimeException(u"Axes::Item Failed to extract type"_ustr );
if ( _oAxisGroup.hasValue() )
_oAxisGroup >>= nAxisGroup ;
@@ -195,7 +195,7 @@ ScVbaAxes::createCollectionObject(const css::uno::Any& aSource)
OUString
ScVbaAxes::getServiceImplName()
{
return "ScVbaAxes";
return u"ScVbaAxes"_ustr;
}
uno::Sequence< OUString >
@@ -203,7 +203,7 @@ ScVbaAxes::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Axes"
u"ooo.vba.excel.Axes"_ustr
};
return aServiceNames;
}
+28 -28
View File
@@ -39,7 +39,7 @@ ScVbaAxis::getChartPtr()
{
ScVbaChart* pChart = moChartParent.get();
if ( !pChart )
throw uno::RuntimeException("Can't access parent chart impl" );
throw uno::RuntimeException(u"Can't access parent chart impl"_ustr );
return pChart;
}
@@ -240,13 +240,13 @@ ScVbaAxis::setHasTitle( sal_Bool _bHasTitle )
switch(nType)
{
case xlCategory:
pChart->mxDiagramPropertySet->setPropertyValue("HasXAxisTitle", uno::Any(_bHasTitle));
pChart->mxDiagramPropertySet->setPropertyValue(u"HasXAxisTitle"_ustr, uno::Any(_bHasTitle));
break;
case xlSeriesAxis:
pChart->mxDiagramPropertySet->setPropertyValue("HasZAxisTitle", uno::Any(_bHasTitle));
pChart->mxDiagramPropertySet->setPropertyValue(u"HasZAxisTitle"_ustr, uno::Any(_bHasTitle));
break;
default: // xlValue:
pChart->mxDiagramPropertySet->setPropertyValue("HasYAxisTitle", uno::Any(_bHasTitle));
pChart->mxDiagramPropertySet->setPropertyValue(u"HasYAxisTitle"_ustr, uno::Any(_bHasTitle));
}
}
@@ -267,13 +267,13 @@ ScVbaAxis::getHasTitle( )
switch(nType)
{
case xlCategory:
pChart->mxDiagramPropertySet->getPropertyValue("HasXAxisTitle") >>= bHasTitle;
pChart->mxDiagramPropertySet->getPropertyValue(u"HasXAxisTitle"_ustr) >>= bHasTitle;
break;
case xlSeriesAxis:
pChart->mxDiagramPropertySet->getPropertyValue("HasZAxisTitle") >>= bHasTitle;
pChart->mxDiagramPropertySet->getPropertyValue(u"HasZAxisTitle"_ustr) >>= bHasTitle;
break;
default: // xlValue:
pChart->mxDiagramPropertySet->getPropertyValue("HasYAxisTitle") >>= bHasTitle;
pChart->mxDiagramPropertySet->getPropertyValue(u"HasYAxisTitle"_ustr) >>= bHasTitle;
}
}
catch (const uno::Exception& e)
@@ -289,7 +289,7 @@ ScVbaAxis::setMinorUnit( double _fMinorUnit )
try
{
if (isValueAxis())
mxPropertySet->setPropertyValue("StepHelp", uno::Any(_fMinorUnit));
mxPropertySet->setPropertyValue(u"StepHelp"_ustr, uno::Any(_fMinorUnit));
}
catch (uno::Exception& )
{
@@ -304,7 +304,7 @@ ScVbaAxis::getMinorUnit( )
try
{
if (isValueAxis())
mxPropertySet->getPropertyValue("StepHelp") >>= fMinor;
mxPropertySet->getPropertyValue(u"StepHelp"_ustr) >>= fMinor;
}
catch (uno::Exception& )
{
@@ -319,7 +319,7 @@ ScVbaAxis::setMinorUnitIsAuto( sal_Bool _bMinorUnitIsAuto )
try
{
if (isValueAxis())
mxPropertySet->setPropertyValue("AutoStepHelp", uno::Any(_bMinorUnitIsAuto));
mxPropertySet->setPropertyValue(u"AutoStepHelp"_ustr, uno::Any(_bMinorUnitIsAuto));
}
catch (uno::Exception& )
{
@@ -335,7 +335,7 @@ ScVbaAxis::getMinorUnitIsAuto( )
{
if (isValueAxis())
{
mxPropertySet->getPropertyValue("AutoStepHelp") >>= bIsAuto;
mxPropertySet->getPropertyValue(u"AutoStepHelp"_ustr) >>= bIsAuto;
}
}
catch (const uno::Exception&)
@@ -365,7 +365,7 @@ ScVbaAxis::setMajorUnit( double _fMajorUnit )
{
if (isValueAxis())
{
mxPropertySet->setPropertyValue("StepMain", uno::Any(_fMajorUnit));
mxPropertySet->setPropertyValue(u"StepMain"_ustr, uno::Any(_fMajorUnit));
}
}
catch (const uno::Exception&)
@@ -381,7 +381,7 @@ ScVbaAxis::getMajorUnit( )
try
{
if (isValueAxis())
mxPropertySet->getPropertyValue("StepMain") >>= fMax;
mxPropertySet->getPropertyValue(u"StepMain"_ustr) >>= fMax;
}
catch (const uno::Exception&)
{
@@ -397,7 +397,7 @@ ScVbaAxis::setMajorUnitIsAuto( sal_Bool _bMajorUnitIsAuto )
{
if (isValueAxis())
{
mxPropertySet->setPropertyValue("AutoStepMain", uno::Any( _bMajorUnitIsAuto ));
mxPropertySet->setPropertyValue(u"AutoStepMain"_ustr, uno::Any( _bMajorUnitIsAuto ));
}
}
catch (const uno::Exception&)
@@ -414,7 +414,7 @@ ScVbaAxis::getMajorUnitIsAuto( )
{
if (isValueAxis())
{
mxPropertySet->getPropertyValue("AutoStepMain") >>= bIsAuto;
mxPropertySet->getPropertyValue(u"AutoStepMain"_ustr) >>= bIsAuto;
}
}
catch (const uno::Exception&)
@@ -431,7 +431,7 @@ ScVbaAxis::setMaximumScale( double _fMaximumScale )
{
if ( isValueAxis() )
{
mxPropertySet->setPropertyValue("Max", uno::Any(_fMaximumScale));
mxPropertySet->setPropertyValue(u"Max"_ustr, uno::Any(_fMaximumScale));
}
}
catch (const uno::Exception&)
@@ -448,7 +448,7 @@ ScVbaAxis::getMaximumScale( )
{
if (isValueAxis())
{
mxPropertySet->getPropertyValue("Max") >>= fMax;
mxPropertySet->getPropertyValue(u"Max"_ustr) >>= fMax;
}
}
catch (const uno::Exception&)
@@ -465,7 +465,7 @@ ScVbaAxis::setMaximumScaleIsAuto( sal_Bool _bMaximumScaleIsAuto )
try
{
if ( isValueAxis() )
mxPropertySet->setPropertyValue("AutoMax", uno::Any( _bMaximumScaleIsAuto ));
mxPropertySet->setPropertyValue(u"AutoMax"_ustr, uno::Any( _bMaximumScaleIsAuto ));
}
catch (const uno::Exception&)
@@ -481,7 +481,7 @@ ScVbaAxis::getMaximumScaleIsAuto( )
try
{
if (isValueAxis())
mxPropertySet->getPropertyValue("AutoMax") >>= bIsAuto;
mxPropertySet->getPropertyValue(u"AutoMax"_ustr) >>= bIsAuto;
}
catch (const uno::Exception&)
{
@@ -496,7 +496,7 @@ ScVbaAxis::setMinimumScale( double _fMinimumScale )
try
{
if (isValueAxis())
mxPropertySet->setPropertyValue("Min", uno::Any( _fMinimumScale ) );
mxPropertySet->setPropertyValue(u"Min"_ustr, uno::Any( _fMinimumScale ) );
}
catch ( uno::Exception& )
{
@@ -511,7 +511,7 @@ ScVbaAxis::getMinimumScale( )
try
{
if (isValueAxis())
mxPropertySet->getPropertyValue("Min") >>= fMin;
mxPropertySet->getPropertyValue(u"Min"_ustr) >>= fMin;
}
catch (const uno::Exception& e)
{
@@ -527,7 +527,7 @@ ScVbaAxis::setMinimumScaleIsAuto( sal_Bool _bMinimumScaleIsAuto )
{
if (isValueAxis())
{
mxPropertySet->setPropertyValue("AutoMin", uno::Any(_bMinimumScaleIsAuto));
mxPropertySet->setPropertyValue(u"AutoMin"_ustr, uno::Any(_bMinimumScaleIsAuto));
}
}
catch (const uno::Exception&)
@@ -544,7 +544,7 @@ ScVbaAxis::getMinimumScaleIsAuto( )
{
if (isValueAxis())
{
mxPropertySet->getPropertyValue("AutoMin") >>= bIsAuto;
mxPropertySet->getPropertyValue(u"AutoMin"_ustr) >>= bIsAuto;
}
}
catch (const uno::Exception&)
@@ -570,10 +570,10 @@ ScVbaAxis::setScaleType( ::sal_Int32 _nScaleType )
switch (_nScaleType)
{
case xlScaleLinear:
mxPropertySet->setPropertyValue("Logarithmic", uno::Any( false ) );
mxPropertySet->setPropertyValue(u"Logarithmic"_ustr, uno::Any( false ) );
break;
case xlScaleLogarithmic:
mxPropertySet->setPropertyValue("Logarithmic", uno::Any( true ) );
mxPropertySet->setPropertyValue(u"Logarithmic"_ustr, uno::Any( true ) );
break;
default:
// According to MS the parameter is ignored and no Error is thrown
@@ -596,7 +596,7 @@ ScVbaAxis::getScaleType( )
if (isValueAxis())
{
bool bisLogarithmic = false;
mxPropertySet->getPropertyValue( "Logarithmic" ) >>= bisLogarithmic;
mxPropertySet->getPropertyValue( u"Logarithmic"_ustr ) >>= bisLogarithmic;
if (bisLogarithmic)
nScaleType = xlScaleLogarithmic;
else
@@ -648,7 +648,7 @@ void SAL_CALL ScVbaAxis::setLeft( double left )
OUString
ScVbaAxis::getServiceImplName()
{
return "ScVbaAxis";
return u"ScVbaAxis"_ustr;
}
uno::Sequence< OUString >
@@ -656,7 +656,7 @@ ScVbaAxis::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Axis"
u"ooo.vba.excel.Axis"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -29,7 +29,7 @@ ScVbaAxisTitle::ScVbaAxisTitle( const uno::Reference< XHelperInterface >& xParen
OUString
ScVbaAxisTitle::getServiceImplName()
{
return "ScVbaAxisTitle";
return u"ScVbaAxisTitle"_ustr;
}
uno::Sequence< OUString >
@@ -37,7 +37,7 @@ ScVbaAxisTitle::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames = comphelper::concatSequences(
AxisTitleBase::getServiceNames(),
uno::Sequence<OUString> { "ooo.vba.excel.AxisTitle" } );
uno::Sequence<OUString> { u"ooo.vba.excel.AxisTitle"_ustr } );
return aServiceNames;
}
+11 -11
View File
@@ -148,13 +148,13 @@ private:
protected:
virtual OUString getServiceImplName() override
{
return "ScVbaBorder";
return u"ScVbaBorder"_ustr;
}
virtual css::uno::Sequence<OUString> getServiceNames() override
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Border"
u"ooo.vba.excel.Border"_ustr
};
return aServiceNames;
}
@@ -167,7 +167,7 @@ public:
table::BorderLine aBorderLine;
if ( getBorderLine( aBorderLine ) )
return uno::Any( OORGBToXLRGB( Color(ColorTransparency, aBorderLine.Color) ) );
throw uno::RuntimeException("No Implementation available" );
throw uno::RuntimeException(u"No Implementation available"_ustr );
}
void SAL_CALL setColor( const uno::Any& _color ) override
{
@@ -175,7 +175,7 @@ public:
_color >>= nColor;
table::BorderLine aBorderLine;
if ( !getBorderLine( aBorderLine ) )
throw uno::RuntimeException("No Implementation available" );
throw uno::RuntimeException(u"No Implementation available"_ustr );
aBorderLine.Color = XLRGBToOORGB( nColor );
setBorderLine( aBorderLine );
@@ -230,7 +230,7 @@ public:
break;
}
}
throw uno::RuntimeException("Method failed" );
throw uno::RuntimeException(u"Method failed"_ustr );
}
void SAL_CALL setWeight( const uno::Any& _weight ) override
{
@@ -238,7 +238,7 @@ public:
_weight >>= nWeight;
table::BorderLine aBorderLine;
if ( !getBorderLine( aBorderLine ) )
throw uno::RuntimeException("Method failed" );
throw uno::RuntimeException(u"Method failed"_ustr );
switch ( nWeight )
{
@@ -255,7 +255,7 @@ public:
aBorderLine.OuterLineWidth = OOLineHairline;
break;
default:
throw uno::RuntimeException("Bad param" );
throw uno::RuntimeException(u"Bad param"_ustr );
}
setBorderLine( aBorderLine );
@@ -284,7 +284,7 @@ public:
_linestyle >>= nLineStyle;
table::BorderLine aBorderLine;
if ( !getBorderLine( aBorderLine ) )
throw uno::RuntimeException("Method failed" );
throw uno::RuntimeException(u"Method failed"_ustr );
switch ( nLineStyle )
{
@@ -298,7 +298,7 @@ public:
case XlLineStyle::xlSlantDashDot:
break;
default:
throw uno::RuntimeException("Bad param" );
throw uno::RuntimeException(u"Bad param"_ustr );
}
setBorderLine( aBorderLine );
@@ -576,7 +576,7 @@ void SAL_CALL ScVbaBorders::setWeight( const uno::Any& _weight )
OUString
ScVbaBorders::getServiceImplName()
{
return "ScVbaBorders";
return u"ScVbaBorders"_ustr;
}
uno::Sequence< OUString >
@@ -584,7 +584,7 @@ ScVbaBorders::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Borders"
u"ooo.vba.excel.Borders"_ustr
};
return aServiceNames;
}
+3 -3
View File
@@ -98,7 +98,7 @@ void SAL_CALL
ScVbaCharacters::setFont( const uno::Reference< excel::XFont >& /*_font*/ )
{
// #TODO #FIXME needs implementation, or can't be done?
throw uno::RuntimeException("Not Implemented" );
throw uno::RuntimeException(u"Not Implemented"_ustr );
}
// Methods
@@ -119,7 +119,7 @@ ScVbaCharacters::Delete( )
OUString
ScVbaCharacters::getServiceImplName()
{
return "ScVbaCharacters";
return u"ScVbaCharacters"_ustr;
}
uno::Sequence< OUString >
@@ -127,7 +127,7 @@ ScVbaCharacters::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Characters"
u"ooo.vba.excel.Characters"_ustr
};
return aServiceNames;
}
+11 -11
View File
@@ -264,7 +264,7 @@ ScVbaChart::setChartType( ::sal_Int32 _nChartType )
case xlSurfaceWireframe:
case xlSurfaceTopView:
case xlSurfaceTopViewWireframe:
setDiagram( "com.sun.star.chart.BarDiagram");
setDiagram( u"com.sun.star.chart.BarDiagram"_ustr);
break;
case xlLine:
case xl3DLine:
@@ -273,7 +273,7 @@ ScVbaChart::setChartType( ::sal_Int32 _nChartType )
case xlLineMarkers:
case xlLineMarkersStacked:
case xlLineMarkersStacked100:
setDiagram( "com.sun.star.chart.LineDiagram");
setDiagram( u"com.sun.star.chart.LineDiagram"_ustr);
break;
case xl3DArea:
case xlArea:
@@ -281,17 +281,17 @@ ScVbaChart::setChartType( ::sal_Int32 _nChartType )
case xlAreaStacked100:
case xl3DAreaStacked:
case xl3DAreaStacked100:
setDiagram( "com.sun.star.chart.AreaDiagram" );
setDiagram( u"com.sun.star.chart.AreaDiagram"_ustr );
break;
case xlDoughnut:
case xlDoughnutExploded:
setDiagram( "com.sun.star.chart.DonutDiagram" );
setDiagram( u"com.sun.star.chart.DonutDiagram"_ustr );
break;
case xlStockHLC:
case xlStockOHLC:
case xlStockVHLC:
case xlStockVOHLC:
setDiagram( "com.sun.star.chart.StockDiagram");
setDiagram( u"com.sun.star.chart.StockDiagram"_ustr);
mxDiagramPropertySet->setPropertyValue( UPDOWN, uno::Any((_nChartType == xlStockOHLC) || (_nChartType == xlStockVOHLC)));
mxDiagramPropertySet->setPropertyValue( VOLUME, uno::Any((_nChartType == xlStockVHLC) || (_nChartType == xlStockVOHLC)));
break;
@@ -302,13 +302,13 @@ ScVbaChart::setChartType( ::sal_Int32 _nChartType )
case xl3DPie:
case xlPie:
case xlBarOfPie: // not possible (Zoom pie)
setDiagram( "com.sun.star.chart.PieDiagram");
setDiagram( u"com.sun.star.chart.PieDiagram"_ustr);
break;
case xlRadar:
case xlRadarMarkers:
case xlRadarFilled:
setDiagram( "com.sun.star.chart.NetDiagram");
setDiagram( u"com.sun.star.chart.NetDiagram"_ustr);
break;
case xlXYScatter:
case xlBubble: // not possible
@@ -317,7 +317,7 @@ ScVbaChart::setChartType( ::sal_Int32 _nChartType )
case xlXYScatterLinesNoMarkers:
case xlXYScatterSmooth:
case xlXYScatterSmoothNoMarkers:
setDiagram( "com.sun.star.chart.XYDiagram");
setDiagram( u"com.sun.star.chart.XYDiagram"_ustr);
switch(_nChartType)
{
case xlXYScatter:
@@ -554,7 +554,7 @@ ScVbaChart::Activate()
uno::Reference< XHelperInterface > xParent( getParent() );
ScVbaChartObject* pChartObj = static_cast< ScVbaChartObject* >( xParent.get() );
if ( !pChartObj )
throw script::BasicErrorException( OUString(), uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_BASIC_METHOD_FAILED), "no ChartObject as parent" );
throw script::BasicErrorException( OUString(), uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_BASIC_METHOD_FAILED), u"no ChartObject as parent"_ustr );
pChartObj->Activate();
@@ -1041,7 +1041,7 @@ ScVbaChart::getAxisPropertySet(sal_Int32 _nAxisType, sal_Int32 _nAxisGroup)
OUString
ScVbaChart::getServiceImplName()
{
return "ScVbaChart";
return u"ScVbaChart"_ustr;
}
uno::Sequence< OUString >
@@ -1049,7 +1049,7 @@ ScVbaChart::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Chart"
u"ooo.vba.excel.Chart"_ustr
};
return aServiceNames;
}
+4 -4
View File
@@ -99,7 +99,7 @@ ScVbaChartObject::Delete()
uno::Reference< excel::XChartObjects > xColl( xParent->ChartObjects( uno::Any() ), uno::UNO_QUERY_THROW );
ScVbaChartObjects* pChartObjectsImpl = static_cast< ScVbaChartObjects* >( xColl.get() );
if (!pChartObjectsImpl)
throw script::BasicErrorException( OUString(), uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_BASIC_METHOD_FAILED), "Parent is not ChartObjects" );
throw script::BasicErrorException( OUString(), uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_BASIC_METHOD_FAILED), u"Parent is not ChartObjects"_ustr );
pChartObjectsImpl->removeByName( getPersistName() );
@@ -119,7 +119,7 @@ ScVbaChartObject::Activate()
}
catch (uno::Exception& )
{
throw script::BasicErrorException( OUString(), uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_BASIC_METHOD_FAILED), "ChartObject Activate internal error" );
throw script::BasicErrorException( OUString(), uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_BASIC_METHOD_FAILED), u"ChartObject Activate internal error"_ustr );
}
}
@@ -132,7 +132,7 @@ ScVbaChartObject::getChart()
OUString
ScVbaChartObject::getServiceImplName()
{
return "ScVbaChartObject";
return u"ScVbaChartObject"_ustr;
}
uno::Sequence< OUString >
@@ -140,7 +140,7 @@ ScVbaChartObject::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.ChartObject"
u"ooo.vba.excel.ChartObject"_ustr
};
return aServiceNames;
}
+6 -6
View File
@@ -74,7 +74,7 @@ public:
{
css::uno::Any anyEx(cppu::getCaughtException());
throw lang::WrappedTargetException(
"Error creating ScVbaChartObject!",
u"Error creating ScVbaChartObject!"_ustr,
getXWeak(),
anyEx );
}
@@ -106,10 +106,10 @@ ScVbaChartObjects::getChartObjectNames() const
ScCellRangesBase* pUno = dynamic_cast< ScCellRangesBase* >( xIf.get() );
ScDocShell* pDocShell = nullptr;
if ( !pUno )
throw uno::RuntimeException("Failed to obtain the impl class from the drawpage" );
throw uno::RuntimeException(u"Failed to obtain the impl class from the drawpage"_ustr );
pDocShell = pUno->GetDocShell();
if ( !pDocShell )
throw uno::RuntimeException("Failed to obtain the docshell implclass" );
throw uno::RuntimeException(u"Failed to obtain the docshell implclass"_ustr );
uno::Reference< sheet::XSpreadsheets > xSpreadsheets = pDocShell->GetModel()->getSheets();
std::vector< OUString > aChartNamesVector;
@@ -143,7 +143,7 @@ ScVbaChartObjects::Add( double _nX, double _nY, double _nWidth, double _nHeight
aRectangle.Width = Millimeter::getInHundredthsOfOneMillimeter(_nWidth);
aRectangle.Height = Millimeter::getInHundredthsOfOneMillimeter(_nHeight);
// Note the space at the end of the stem ("Chart "). In ChartSheets only "Chart" is the stem
OUString sPersistChartName = ContainerUtilities::getUniqueName( getChartObjectNames(), "Chart " , std::u16string_view(), 1);
OUString sPersistChartName = ContainerUtilities::getUniqueName( getChartObjectNames(), u"Chart "_ustr , std::u16string_view(), 1);
xTableCharts->addNewByName(sPersistChartName, aRectangle, aCellRangeAddress, true, false );
uno::Reference< excel::XChartObject > xChartObject( getItemByStringIndex( sPersistChartName ), uno::UNO_QUERY_THROW );
xChartObject->getChart()->setChartType(excel::XlChartType::xlColumnClustered);
@@ -191,7 +191,7 @@ ScVbaChartObjects::createCollectionObject( const css::uno::Any& aSource )
OUString
ScVbaChartObjects::getServiceImplName()
{
return "ScVbaChartObjects";
return u"ScVbaChartObjects"_ustr;
}
css::uno::Sequence<OUString>
@@ -199,7 +199,7 @@ ScVbaChartObjects::getServiceNames()
{
static uno::Sequence< OUString > const sNames
{
"ooo.vba.excel.ChartObjects"
u"ooo.vba.excel.ChartObjects"_ustr
};
return sNames;
}
+2 -2
View File
@@ -29,7 +29,7 @@ ScVbaChartTitle::ScVbaChartTitle( const uno::Reference< XHelperInterface >& xPar
OUString
ScVbaChartTitle::getServiceImplName()
{
return "ScVbaChartTitle";
return u"ScVbaChartTitle"_ustr;
}
uno::Sequence< OUString >
@@ -37,7 +37,7 @@ ScVbaChartTitle::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames = comphelper::concatSequences(
ChartTitleBase::getServiceNames(),
uno::Sequence< OUString > { "ooo.vba.excel.Chart" } );
uno::Sequence< OUString > { u"ooo.vba.excel.Chart"_ustr } );
return aServiceNames;
}
+4 -4
View File
@@ -50,7 +50,7 @@ ScVbaComment::ScVbaComment(
mxRange( xRange )
{
if ( !xRange.is() )
throw lang::IllegalArgumentException("range is not set ", uno::Reference< uno::XInterface >() , 1 );
throw lang::IllegalArgumentException(u"range is not set "_ustr, uno::Reference< uno::XInterface >() , 1 );
getAnnotation();
}
@@ -203,7 +203,7 @@ ScVbaComment::Text( const uno::Any& aText, const uno::Any& aStart, const uno::An
xAnnoText->insertString( xRange, sText, bOverwrite );
return xAnnoText->getString();
}
throw uno::RuntimeException("ScVbaComment::Text - bad Start value " );
throw uno::RuntimeException(u"ScVbaComment::Text - bad Start value "_ustr );
}
else if ( aText.hasValue() )
{
@@ -218,7 +218,7 @@ ScVbaComment::Text( const uno::Any& aText, const uno::Any& aStart, const uno::An
OUString
ScVbaComment::getServiceImplName()
{
return "ScVbaComment";
return u"ScVbaComment"_ustr;
}
uno::Sequence< OUString >
@@ -226,7 +226,7 @@ ScVbaComment::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.ScVbaComment"
u"ooo.vba.excel.ScVbaComment"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -97,7 +97,7 @@ ScVbaComments::getElementType()
OUString
ScVbaComments::getServiceImplName()
{
return "ScVbaComments";
return u"ScVbaComments"_ustr;
}
css::uno::Sequence<OUString>
@@ -105,7 +105,7 @@ ScVbaComments::getServiceNames()
{
static uno::Sequence< OUString > const sNames
{
"ooo.vba.excel.Comments"
u"ooo.vba.excel.Comments"_ustr
};
return sNames;
}
+2 -2
View File
@@ -70,7 +70,7 @@ ScVbaDialog::mapIndexToName( sal_Int32 nIndex )
OUString
ScVbaDialog::getServiceImplName()
{
return "ScVbaDialog";
return u"ScVbaDialog"_ustr;
}
uno::Sequence< OUString >
@@ -78,7 +78,7 @@ ScVbaDialog::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Dialog"
u"ooo.vba.excel.Dialog"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -35,7 +35,7 @@ ScVbaDialogs::Item( const uno::Any &aItem )
OUString
ScVbaDialogs::getServiceImplName()
{
return "ScVbaDialogs";
return u"ScVbaDialogs"_ustr;
}
uno::Sequence< OUString >
@@ -43,7 +43,7 @@ ScVbaDialogs::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Dialogs"
u"ooo.vba.excel.Dialogs"_ustr
};
return aServiceNames;
}
+4 -4
View File
@@ -621,12 +621,12 @@ void SAL_CALL ScVbaEventsHelper::notifyEvent( const css::document::EventObject&
OUString ScVbaEventsHelper::getImplementationName()
{
return "ScVbaEventsHelper";
return u"ScVbaEventsHelper"_ustr;
}
css::uno::Sequence<OUString> ScVbaEventsHelper::getSupportedServiceNames()
{
return {"com.sun.star.script.vba.VBASpreadsheetEventProcessor"};
return {u"com.sun.star.script.vba.VBASpreadsheetEventProcessor"_ustr};
}
// protected ------------------------------------------------------------------
@@ -658,7 +658,7 @@ bool ScVbaEventsHelper::implPrepareEvent( EventQueue& rEventQueue,
rEventQueue.emplace_back(WORKBOOK_ACTIVATE );
uno::Sequence< uno::Any > aArgs{ uno::Any(mxModel->getCurrentController()) };
rEventQueue.emplace_back( WORKBOOK_WINDOWACTIVATE, aArgs );
if (!hasModule("Auto_Open"))
if (!hasModule(u"Auto_Open"_ustr))
rEventQueue.emplace_back(AUTO_OPEN );
// remember initial selection
maOldSelection <<= mxModel->getCurrentSelection();
@@ -779,7 +779,7 @@ void ScVbaEventsHelper::implPostProcessEvent( EventQueue& rEventQueue,
case WORKBOOK_BEFORECLOSE:
/* Execute Auto_Close only if not cancelled by event handler, but
before UI asks user whether to cancel closing the document. */
if (!bCancel && !hasModule("Auto_Close"))
if (!bCancel && !hasModule(u"Auto_Close"_ustr))
rEventQueue.emplace_back(AUTO_CLOSE );
break;
}
+3 -3
View File
@@ -35,7 +35,7 @@ using namespace ::ooo::vba;
ScVbaFileDialog::ScVbaFileDialog( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const sal_Int32 nType )
: ScVbaFileDialog_BASE( xParent, xContext)
, m_nType(nType)
, m_sTitle("FileDialog")
, m_sTitle(u"FileDialog"_ustr)
, m_bMultiSelectMode(false)
{}
@@ -158,7 +158,7 @@ sal_Int32 ScVbaFileDialog::Show()
OUString
ScVbaFileDialog::getServiceImplName()
{
return "ScVbaFileDialog";
return u"ScVbaFileDialog"_ustr;
}
uno::Sequence<OUString>
@@ -166,7 +166,7 @@ ScVbaFileDialog::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.FileDialog"
u"ooo.vba.FileDialog"_ustr
};
return aServiceNames;
}
+4 -4
View File
@@ -73,9 +73,9 @@ ScVbaFileDialogSelectedItems::createCollectionObject( const uno::Any& aSource )
{
sal_Int32 nPosition = -1;
if (!(aSource >>= nPosition))
throw uno::RuntimeException("not an sal_Int32");
throw uno::RuntimeException(u"not an sal_Int32"_ustr);
if (nPosition < 0 || o3tl::make_unsigned(nPosition) >= m_sItems.size())
throw uno::RuntimeException("out of range");
throw uno::RuntimeException(u"out of range"_ustr);
OUString sPath = m_sItems[nPosition];
return uno::Any( sPath );
@@ -107,7 +107,7 @@ sal_Int32 ScVbaFileDialogSelectedItems::getCount()
OUString
ScVbaFileDialogSelectedItems::getServiceImplName()
{
return "ScVbaFileDialogSelectedItems";
return u"ScVbaFileDialogSelectedItems"_ustr;
}
uno::Sequence<OUString>
@@ -115,7 +115,7 @@ ScVbaFileDialogSelectedItems::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.FileDialogSelectedItems"
u"ooo.vba.FileDialogSelectedItems"_ustr
};
return aServiceNames;
}
+13 -13
View File
@@ -98,14 +98,14 @@ ScVbaFont::setStandardFontSize( const uno::Any& /*aValue*/ )
//XXX #TODO# #FIXME#
//mxFont->setPropertyValue("CharSize", ( uno::Any )fValue );
throw uno::RuntimeException(
"setStandardFontSize not supported" );
u"setStandardFontSize not supported"_ustr );
}
uno::Any SAL_CALL
ScVbaFont::getStandardFontSize()
{
//XXX #TODO# #FIXME#
throw uno::RuntimeException( "getStandardFontSize not supported" );
throw uno::RuntimeException( u"getStandardFontSize not supported"_ustr );
// return uno::Any();
}
@@ -113,14 +113,14 @@ void SAL_CALL
ScVbaFont::setStandardFont( const uno::Any& /*aValue*/ )
{
//XXX #TODO# #FIXME#
throw uno::RuntimeException("setStandardFont not supported" );
throw uno::RuntimeException(u"setStandardFont not supported"_ustr );
}
uno::Any SAL_CALL
ScVbaFont::getStandardFont()
{
//XXX #TODO# #FIXME#
throw uno::RuntimeException("getStandardFont not supported");
throw uno::RuntimeException(u"getStandardFont not supported"_ustr);
// return uno::Any();
}
@@ -212,10 +212,10 @@ ScVbaFont::setUnderline( const uno::Any& aValue )
nValue = awt::FontUnderline::DOUBLE;
break;
default:
throw uno::RuntimeException("Unknown value for Underline" );
throw uno::RuntimeException(u"Unknown value for Underline"_ustr );
}
mxFont->setPropertyValue("CharUnderline", uno::Any(nValue) );
mxFont->setPropertyValue(u"CharUnderline"_ustr, uno::Any(nValue) );
}
@@ -231,7 +231,7 @@ ScVbaFont::getUnderline()
if(mbFormControl)
return uno::Any( nValue );
mxFont->getPropertyValue("CharUnderline") >>= nValue;
mxFont->getPropertyValue(u"CharUnderline"_ustr) >>= nValue;
switch ( nValue )
{
case awt::FontUnderline::DOUBLE:
@@ -244,7 +244,7 @@ ScVbaFont::getUnderline()
nValue = excel::XlUnderlineStyle::xlUnderlineStyleNone;
break;
default:
throw uno::RuntimeException("Unknown value retrieved for Underline" );
throw uno::RuntimeException(u"Unknown value retrieved for Underline"_ustr );
}
return uno::Any( nValue );
@@ -290,7 +290,7 @@ uno::Any
ScVbaFont::getColor()
{
// #TODO #FIXME - behave like getXXX above ( wrt. GetDataSet )
uno::Any aAny = OORGBToXLRGB( mxFont->getPropertyValue("CharColor") );
uno::Any aAny = OORGBToXLRGB( mxFont->getPropertyValue(u"CharColor"_ustr) );
return aAny;
}
@@ -298,7 +298,7 @@ void SAL_CALL
ScVbaFont::setOutlineFont( const uno::Any& aValue )
{
if(!mbFormControl)
mxFont->setPropertyValue("CharContoured", aValue );
mxFont->setPropertyValue(u"CharContoured"_ustr, aValue );
}
uno::Any SAL_CALL
@@ -307,13 +307,13 @@ ScVbaFont::getOutlineFont()
if ( GetDataSet() )
if ( GetDataSet()->GetItemState( ATTR_FONT_CONTOUR) == SfxItemState::INVALID )
return aNULL();
return mbFormControl ? uno::Any( false ) : mxFont->getPropertyValue("CharContoured");
return mbFormControl ? uno::Any( false ) : mxFont->getPropertyValue(u"CharContoured"_ustr);
}
OUString
ScVbaFont::getServiceImplName()
{
return "ScVbaFont";
return u"ScVbaFont"_ustr;
}
uno::Sequence< OUString >
@@ -321,7 +321,7 @@ ScVbaFont::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Font"
u"ooo.vba.excel.Font"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -64,7 +64,7 @@ ScVbaFormat< Ifc... >::ScVbaFormat( const uno::Reference< XHelperInterface >& xP
uno::Reference< frame::XModel > xModel,
bool bCheckAmbiguoity )
: ScVbaFormat_BASE( xParent, xContext ),
m_aDefaultLocale( "en", "US", OUString() ),
m_aDefaultLocale( u"en"_ustr, u"US"_ustr, OUString() ),
mxPropertySet(std::move( _xPropertySet )),
mxModel(std::move( xModel )),
mbCheckAmbiguoity( bCheckAmbiguoity ),
@@ -805,7 +805,7 @@ ScVbaFormat< Ifc... >::getCurrentDataSet()
{
SfxItemSet* pDataSet = excel::ScVbaCellRangeAccess::GetDataSet( getCellRangesBase() );
if ( !pDataSet )
throw uno::RuntimeException("Can't access Itemset for XPropertySet" );
throw uno::RuntimeException(u"Can't access Itemset for XPropertySet"_ustr );
return pDataSet;
}
+2 -2
View File
@@ -142,7 +142,7 @@ ScVbaFormatCondition::notifyRange()
OUString
ScVbaFormatCondition::getServiceImplName()
{
return "ScVbaFormatCondition";
return u"ScVbaFormatCondition"_ustr;
}
uno::Sequence< OUString >
@@ -150,7 +150,7 @@ ScVbaFormatCondition::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.FormatCondition"
u"ooo.vba.excel.FormatCondition"_ustr
};
return aServiceNames;
}
+6 -6
View File
@@ -168,17 +168,17 @@ ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, cons
else
aValue <<= ScVbaFormatCondition::retrieveAPIOperator(_aOperator);
beans::PropertyValue aProperty( "Operator", 0, aValue, beans::PropertyState_DIRECT_VALUE );
beans::PropertyValue aProperty( u"Operator"_ustr, 0, aValue, beans::PropertyState_DIRECT_VALUE );
aPropertyValueVector.push_back( aProperty );
if ( _aFormula1.hasValue() )
{
beans::PropertyValue aProp( "Formula1", 0, uno::Any( getA1Formula( _aFormula1 ) ), beans::PropertyState_DIRECT_VALUE );
beans::PropertyValue aProp( u"Formula1"_ustr, 0, uno::Any( getA1Formula( _aFormula1 ) ), beans::PropertyState_DIRECT_VALUE );
aPropertyValueVector.push_back( aProp );
}
if ( _aFormula2.hasValue() )
{
beans::PropertyValue aProp( "Formula2", 0, uno::Any( getA1Formula( _aFormula2 ) ), beans::PropertyState_DIRECT_VALUE );
beans::PropertyValue aProp( u"Formula2"_ustr, 0, uno::Any( getA1Formula( _aFormula2 ) ), beans::PropertyState_DIRECT_VALUE );
aPropertyValueVector.push_back( aProp );
}
aProperty.Name = "StyleName";
@@ -239,7 +239,7 @@ ScVbaFormatConditions::getStyleName()
if ( !pStyles )
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
uno::Sequence< OUString > sCellStyleNames = pStyles->getStyleNames();
return ContainerUtilities::getUniqueName(sCellStyleNames, "Excel_CondFormat", u"_");
return ContainerUtilities::getUniqueName(sCellStyleNames, u"Excel_CondFormat"_ustr, u"_");
}
void
@@ -274,7 +274,7 @@ ScVbaFormatConditions::removeFormatCondition( const OUString& _sStyleName, bool
OUString
ScVbaFormatConditions::getServiceImplName()
{
return "ScVbaFormatConditions";
return u"ScVbaFormatConditions"_ustr;
}
uno::Sequence< OUString >
@@ -282,7 +282,7 @@ ScVbaFormatConditions::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.FormatConditions"
u"ooo.vba.excel.FormatConditions"_ustr
};
return aServiceNames;
}
+10 -10
View File
@@ -205,7 +205,7 @@ ScVbaGlobals::getDebug()
{
uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW );
uno::Reference< uno::XInterface > xVBADebug = xServiceManager->createInstanceWithContext(
"ooo.vba.Debug", mxContext );
u"ooo.vba.Debug"_ustr, mxContext );
return uno::Any( xVBADebug );
}
catch( uno::Exception& )
@@ -227,13 +227,13 @@ ScVbaGlobals::getAvailableServiceNames( )
ScVbaGlobals_BASE::getAvailableServiceNames(),
uno::Sequence< OUString >
{
"ooo.vba.excel.Range",
"ooo.vba.excel.Workbook",
"ooo.vba.excel.Window",
"ooo.vba.excel.Worksheet",
"ooo.vba.excel.Application",
"ooo.vba.excel.Hyperlink",
"com.sun.star.script.vba.VBASpreadsheetEventProcessor"
u"ooo.vba.excel.Range"_ustr,
u"ooo.vba.excel.Workbook"_ustr,
u"ooo.vba.excel.Window"_ustr,
u"ooo.vba.excel.Worksheet"_ustr,
u"ooo.vba.excel.Application"_ustr,
u"ooo.vba.excel.Hyperlink"_ustr,
u"com.sun.star.script.vba.VBASpreadsheetEventProcessor"_ustr
} );
return serviceNames;
}
@@ -241,7 +241,7 @@ ScVbaGlobals::getAvailableServiceNames( )
OUString
ScVbaGlobals::getServiceImplName()
{
return "ScVbaGlobals";
return u"ScVbaGlobals"_ustr;
}
uno::Sequence< OUString >
@@ -249,7 +249,7 @@ ScVbaGlobals::getServiceNames()
{
static uno::Sequence< OUString > aServiceNames
{
"ooo.vba.excel.Globals"
u"ooo.vba.excel.Globals"_ustr
};
return aServiceNames;
}
+7 -7
View File
@@ -55,7 +55,7 @@ ScVbaHyperlink::ScVbaHyperlink( const uno::Reference< XHelperInterface >& rxAnch
UrlComponents aUrlComp;
OUString aTextToDisplay;
if( !(rAddress >>= aUrlComp.first) || aUrlComp.first.isEmpty() )
throw uno::RuntimeException("Cannot get address" );
throw uno::RuntimeException(u"Cannot get address"_ustr );
rSubAddress >>= aUrlComp.second;
rScreenTip >>= maScreenTip;
rTextToDisplay >>= aTextToDisplay;
@@ -84,7 +84,7 @@ ScVbaHyperlink::ScVbaHyperlink( const uno::Reference< XHelperInterface >& rxAnch
}
// create and initialize a new URL text field
uno::Reference< lang::XMultiServiceFactory > xFactory( ScVbaRange::getUnoModel( xAnchorRange ), uno::UNO_QUERY_THROW );
uno::Reference< text::XTextContent > xUrlField( xFactory->createInstance("com.sun.star.text.TextField.URL"), uno::UNO_QUERY_THROW );
uno::Reference< text::XTextContent > xUrlField( xFactory->createInstance(u"com.sun.star.text.TextField.URL"_ustr), uno::UNO_QUERY_THROW );
mxTextField.set( xUrlField, uno::UNO_QUERY_THROW );
setUrlComponents( aUrlComp );
setTextToDisplay( aTextToDisplay );
@@ -155,14 +155,14 @@ OUString ScVbaHyperlink::getTextToDisplay()
{
ensureTextField();
OUString aTextToDisplay;
mxTextField->getPropertyValue("Representation") >>= aTextToDisplay;
mxTextField->getPropertyValue(u"Representation"_ustr) >>= aTextToDisplay;
return aTextToDisplay;
}
void ScVbaHyperlink::setTextToDisplay( const OUString& rTextToDisplay )
{
ensureTextField();
mxTextField->setPropertyValue("Representation", uno::Any( rTextToDisplay ) );
mxTextField->setPropertyValue(u"Representation"_ustr, uno::Any( rTextToDisplay ) );
}
sal_Int32 SAL_CALL ScVbaHyperlink::getType()
@@ -195,7 +195,7 @@ uno::Reference< msforms::XShape > SAL_CALL ScVbaHyperlink::getShape()
return uno::Reference< msforms::XShape >( getParent(), uno::UNO_QUERY_THROW );
}
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaHyperlink, "ooo.vba.excel.Hyperlink" )
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaHyperlink, u"ooo.vba.excel.Hyperlink"_ustr )
// private --------------------------------------------------------------------
@@ -209,7 +209,7 @@ ScVbaHyperlink::UrlComponents ScVbaHyperlink::getUrlComponents()
{
ensureTextField();
OUString aUrl;
mxTextField->getPropertyValue("URL") >>= aUrl;
mxTextField->getPropertyValue(u"URL"_ustr) >>= aUrl;
sal_Int32 nHashPos = aUrl.indexOf( '#' );
if( nHashPos < 0 )
return UrlComponents( aUrl, OUString() );
@@ -222,7 +222,7 @@ void ScVbaHyperlink::setUrlComponents( const UrlComponents& rUrlComp )
OUStringBuffer aUrl( rUrlComp.first );
if( !rUrlComp.second.isEmpty() )
aUrl.append( "#" + rUrlComp.second );
mxTextField->setPropertyValue("URL", uno::Any( aUrl.makeStringAndClear() ) );
mxTextField->setPropertyValue(u"URL"_ustr, uno::Any( aUrl.makeStringAndClear() ) );
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+2 -2
View File
@@ -39,7 +39,7 @@ bool lclContains( const ScRangeList& rScOuter, const uno::Reference< excel::XRan
{
const ScRangeList& rScInner = ScVbaRange::getScRangeList( rxInner );
if( rScInner.empty() || rScOuter.empty() )
throw uno::RuntimeException("Empty range objects" );
throw uno::RuntimeException(u"Empty range objects"_ustr );
for( size_t nIndex = 0, nCount = rScInner.size(); nIndex < nCount; ++nIndex )
if( !rScOuter.Contains( rScInner[ nIndex ] ) )
@@ -272,6 +272,6 @@ uno::Any ScVbaHyperlinks::createCollectionObject( const uno::Any& rSource )
// XHelperInterface -----------------------------------------------------------
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaHyperlinks, "ooo.vba.excel.Hyperlinks" )
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaHyperlinks, u"ooo.vba.excel.Hyperlinks"_ustr )
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+8 -8
View File
@@ -72,7 +72,7 @@ ScVbaInterior::ScVbaInterior( const uno::Reference< XHelperInterface >& xParent,
m_aPattColor = Color(0);
m_nPattern = 0;
if ( !m_xProps.is() )
throw lang::IllegalArgumentException("properties", uno::Reference< uno::XInterface >(), 2 );
throw lang::IllegalArgumentException(u"properties"_ustr, uno::Reference< uno::XInterface >(), 2 );
}
uno::Any
@@ -238,7 +238,7 @@ ScVbaInterior::GetMixedColorComp( sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 n
uno::Reference< container::XNameContainer >
ScVbaInterior::GetAttributeContainer()
{
return uno::Reference < container::XNameContainer > ( m_xProps->getPropertyValue("UserDefinedAttributes"), uno::UNO_QUERY_THROW );
return uno::Reference < container::XNameContainer > ( m_xProps->getPropertyValue(u"UserDefinedAttributes"_ustr), uno::UNO_QUERY_THROW );
}
sal_Int32
ScVbaInterior::GetAttributeData( uno::Any const & aValue )
@@ -277,7 +277,7 @@ ScVbaInterior::SetUserDefinedAttributes( const OUString& sName, const uno::Any&
if( xNameContainer->hasByName( sName ) )
xNameContainer->removeByName( sName );
xNameContainer->insertByName( sName, aValue );
m_xProps->setPropertyValue("UserDefinedAttributes", uno::Any( xNameContainer ) );
m_xProps->setPropertyValue(u"UserDefinedAttributes"_ustr, uno::Any( xNameContainer ) );
}
}
// OOo do not support below API
@@ -294,7 +294,7 @@ void SAL_CALL
ScVbaInterior::setPattern( const uno::Any& _pattern )
{
if( !(_pattern >>= m_nPattern) )
throw uno::RuntimeException("Invalid Pattern index" );
throw uno::RuntimeException(u"Invalid Pattern index"_ustr );
SetUserDefinedAttributes( PATTERN, SetAttributeData( m_nPattern ) );
SetMixedColor();
@@ -340,7 +340,7 @@ ScVbaInterior::setPatternColor( const uno::Any& _patterncolor )
{
sal_Int32 nPattColor = 0;
if( !(_patterncolor >>= nPattColor) )
throw uno::RuntimeException("Invalid Pattern Color" );
throw uno::RuntimeException(u"Invalid Pattern Color"_ustr );
SetUserDefinedAttributes( PATTERNCOLOR, SetAttributeData( XLRGBToOORGB( nPattColor ) ) );
SetMixedColor();
@@ -359,7 +359,7 @@ ScVbaInterior::setPatternColorIndex( const uno::Any& _patterncolorindex )
{
sal_Int32 nColorIndex = 0;
if( !(_patterncolorindex >>= nColorIndex) )
throw uno::RuntimeException("Invalid Pattern Color" );
throw uno::RuntimeException(u"Invalid Pattern Color"_ustr );
if( nColorIndex == 0 )
return;
@@ -405,7 +405,7 @@ void SAL_CALL ScVbaInterior::setPatternTintAndShade(const uno::Any& /*rAny*/)
OUString
ScVbaInterior::getServiceImplName()
{
return "ScVbaInterior";
return u"ScVbaInterior"_ustr;
}
uno::Sequence< OUString >
@@ -413,7 +413,7 @@ ScVbaInterior::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Interior"
u"ooo.vba.excel.Interior"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -52,7 +52,7 @@ ScVbaMenu::MenuItems( const uno::Any& aIndex )
OUString
ScVbaMenu::getServiceImplName()
{
return "ScVbaMenu";
return u"ScVbaMenu"_ustr;
}
uno::Sequence<OUString>
@@ -60,7 +60,7 @@ ScVbaMenu::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Menu"
u"ooo.vba.excel.Menu"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -33,7 +33,7 @@ ScVbaMenuBar::Menus( const uno::Any& aIndex )
OUString
ScVbaMenuBar::getServiceImplName()
{
return "ScVbaMenuBar";
return u"ScVbaMenuBar"_ustr;
}
uno::Sequence<OUString>
@@ -41,7 +41,7 @@ ScVbaMenuBar::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.MenuBar"
u"ooo.vba.excel.MenuBar"_ustr
};
return aServiceNames;
}
+4 -4
View File
@@ -90,20 +90,20 @@ ScVbaMenuBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ )
if( nIndex == excel::XlSheetType::xlWorksheet )
{
uno::Any aSource;
aSource <<= OUString( "Worksheet Menu Bar" );
aSource <<= u"Worksheet Menu Bar"_ustr;
uno::Reference< XCommandBar > xCommandBar( m_xCommandBars->Item( aSource, uno::Any() ), uno::UNO_QUERY_THROW );
uno::Reference< excel::XMenuBar > xMenuBar( new ScVbaMenuBar( this, mxContext, xCommandBar ) );
return uno::Any( xMenuBar );
}
throw uno::RuntimeException("Not implemented" );
throw uno::RuntimeException(u"Not implemented"_ustr );
}
// XHelperInterface
OUString
ScVbaMenuBars::getServiceImplName()
{
return "ScVbaMenuBars";
return u"ScVbaMenuBars"_ustr;
}
uno::Sequence<OUString>
@@ -111,7 +111,7 @@ ScVbaMenuBars::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.MenuBars"
u"ooo.vba.excel.MenuBars"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -50,7 +50,7 @@ ScVbaMenuItem::Delete( )
OUString
ScVbaMenuItem::getServiceImplName()
{
return "ScVbaMenuItem";
return u"ScVbaMenuItem"_ustr;
}
uno::Sequence<OUString>
@@ -58,7 +58,7 @@ ScVbaMenuItem::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.MenuItem"
u"ooo.vba.excel.MenuItem"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -123,7 +123,7 @@ uno::Reference< excel::XMenuItem > SAL_CALL ScVbaMenuItems::Add( const OUString&
OUString
ScVbaMenuItems::getServiceImplName()
{
return "ScVbaMenuItems";
return u"ScVbaMenuItems"_ustr;
}
uno::Sequence<OUString>
@@ -131,7 +131,7 @@ ScVbaMenuItems::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.MenuItems"
u"ooo.vba.excel.MenuItems"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -109,7 +109,7 @@ uno::Reference< excel::XMenu > SAL_CALL ScVbaMenus::Add( const OUString& Caption
OUString
ScVbaMenus::getServiceImplName()
{
return "ScVbaMenus";
return u"ScVbaMenus"_ustr;
}
uno::Sequence<OUString>
@@ -117,7 +117,7 @@ ScVbaMenus::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Menus"
u"ooo.vba.excel.Menus"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -203,7 +203,7 @@ ScVbaName::Delete()
OUString
ScVbaName::getServiceImplName()
{
return "ScVbaName";
return u"ScVbaName"_ustr;
}
uno::Sequence< OUString >
@@ -211,7 +211,7 @@ ScVbaName::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Name"
u"ooo.vba.excel.Name"_ustr
};
return aServiceNames;
}
+4 -4
View File
@@ -79,7 +79,7 @@ ScVbaNames::getScDocument()
uno::Reference< frame::XModel > xModel( getModel() , uno::UNO_SET_THROW );
ScTabViewShell * pTabViewShell = excel::getBestViewShell( xModel );
if ( !pTabViewShell )
throw uno::RuntimeException( "No ViewShell available" );
throw uno::RuntimeException( u"No ViewShell available"_ustr );
ScViewData& rViewData = pTabViewShell->GetViewData();
return rViewData.GetDocument();
}
@@ -113,7 +113,7 @@ ScVbaNames::Add( const css::uno::Any& Name ,
sName = sName.copy(nIndex+1);
if (ScRangeData::IsNameValid(sName, getScDocument())
!= ScRangeData::IsNameValidType::NAME_VALID)
throw uno::RuntimeException( "This Name is not valid ." );
throw uno::RuntimeException( u"This Name is not valid ."_ustr );
}
}
uno::Reference< table::XCellRange > xUnoRange;
@@ -245,7 +245,7 @@ ScVbaNames::createCollectionObject( const uno::Any& aSource )
OUString
ScVbaNames::getServiceImplName()
{
return "ScVbaNames";
return u"ScVbaNames"_ustr;
}
css::uno::Sequence<OUString>
@@ -253,7 +253,7 @@ ScVbaNames::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.NamedRanges"
u"ooo.vba.excel.NamedRanges"_ustr
};
return aServiceNames;
}
+3 -3
View File
@@ -38,7 +38,7 @@ ScVbaOLEObject::ScVbaOLEObject( const uno::Reference< XHelperInterface >& xParen
xChild.set( xChild->getParent(), uno::UNO_QUERY_THROW );
uno::Reference<frame::XModel> xModel( xChild->getParent(), uno::UNO_QUERY_THROW );
uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW );
uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext("ooo.vba.ControlProvider", mxContext ), uno::UNO_QUERY_THROW );
uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext(u"ooo.vba.ControlProvider"_ustr, mxContext ), uno::UNO_QUERY_THROW );
m_xControl.set( xControlProvider->createControl( xControlShape, xModel ) );
}
@@ -134,7 +134,7 @@ void SAL_CALL ScVbaOLEObject::setLinkedCell( const OUString& _linkedcell )
OUString
ScVbaOLEObject::getServiceImplName()
{
return "ScVbaOLEObject";
return u"ScVbaOLEObject"_ustr;
}
uno::Sequence< OUString >
@@ -142,7 +142,7 @@ ScVbaOLEObject::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.OLEObject"
u"ooo.vba.excel.OLEObject"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -169,7 +169,7 @@ ScVbaOLEObjects::getElementType()
OUString
ScVbaOLEObjects::getServiceImplName()
{
return "ScVbaOLEObjects";
return u"ScVbaOLEObjects"_ustr;
}
uno::Sequence< OUString >
@@ -177,7 +177,7 @@ ScVbaOLEObjects::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.OLEObjects"
u"ooo.vba.excel.OLEObjects"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -42,7 +42,7 @@ ScVbaOutline::ShowLevels( const uno::Any& RowLevels, const uno::Any& ColumnLevel
OUString
ScVbaOutline::getServiceImplName()
{
return "ScVbaOutline";
return u"ScVbaOutline"_ustr;
}
uno::Sequence< OUString >
@@ -50,7 +50,7 @@ ScVbaOutline::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Outline"
u"ooo.vba.excel.Outline"_ustr
};
return aServiceNames;
}
+8 -8
View File
@@ -41,7 +41,7 @@ ScVbaPageBreak< Ifc... >::ScVbaPageBreak( const uno::Reference< XHelperInterface
template< typename... Ifc >
sal_Int32 ScVbaPageBreak< Ifc... >::getType()
{
uno::Any aValue = mxRowColPropertySet->getPropertyValue("IsStartOfNewPage");
uno::Any aValue = mxRowColPropertySet->getPropertyValue(u"IsStartOfNewPage"_ustr);
bool hasPageBreak = false;
aValue >>= hasPageBreak;
@@ -66,11 +66,11 @@ void ScVbaPageBreak< Ifc... >::setType(sal_Int32 type)
if( type == excel::XlPageBreak::xlPageBreakNone )
{
mxRowColPropertySet->setPropertyValue("IsStartOfNewPage", uno::Any(false));
mxRowColPropertySet->setPropertyValue(u"IsStartOfNewPage"_ustr, uno::Any(false));
return;
}
mxRowColPropertySet->setPropertyValue("IsStartOfNewPage", uno::Any(true));
mxRowColPropertySet->setPropertyValue(u"IsStartOfNewPage"_ustr, uno::Any(true));
if( type == excel::XlPageBreak::xlPageBreakManual )
maTablePageBreakData.ManualBreak = true;
else
@@ -80,7 +80,7 @@ void ScVbaPageBreak< Ifc... >::setType(sal_Int32 type)
template< typename... Ifc >
void ScVbaPageBreak< Ifc... >::Delete()
{
mxRowColPropertySet->setPropertyValue("IsStartOfNewPage", uno::Any(false));
mxRowColPropertySet->setPropertyValue(u"IsStartOfNewPage"_ustr, uno::Any(false));
}
template< typename... Ifc >
@@ -96,7 +96,7 @@ template class ScVbaPageBreak< excel::XHPageBreak >;
OUString
ScVbaHPageBreak::getServiceImplName()
{
return "ScVbaHPageBreak";
return u"ScVbaHPageBreak"_ustr;
}
uno::Sequence< OUString >
@@ -104,7 +104,7 @@ ScVbaHPageBreak::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.HPageBreak"
u"ooo.vba.excel.HPageBreak"_ustr
};
return aServiceNames;
}
@@ -127,7 +127,7 @@ ScVbaVPageBreak::~ScVbaVPageBreak()
OUString
ScVbaVPageBreak::getServiceImplName()
{
return "ScVbaVPageBreak";
return u"ScVbaVPageBreak"_ustr;
}
uno::Sequence< OUString >
@@ -135,7 +135,7 @@ ScVbaVPageBreak::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.VPageBreak"
u"ooo.vba.excel.VPageBreak"_ustr
};
return aServiceNames;
}
+5 -5
View File
@@ -180,7 +180,7 @@ uno::Any RangePageBreaks::Add( const css::uno::Any& Before )
sal_Int32 nAPIRowColIndex = getAPIStartofRange( xRange );
uno::Reference< container::XIndexAccess > xIndexAccess = getRowColContainer();
uno::Reference< beans::XPropertySet > xRowColPropertySet( xIndexAccess->getByIndex(nAPIRowColIndex), uno::UNO_QUERY_THROW );
xRowColPropertySet->setPropertyValue("IsStartOfNewPage", uno::Any(true));
xRowColPropertySet->setPropertyValue(u"IsStartOfNewPage"_ustr, uno::Any(true));
sheet::TablePageBreakData aTablePageBreakData;
aTablePageBreakData.ManualBreak = true;
aTablePageBreakData.Position = nAPIRowColIndex;
@@ -250,7 +250,7 @@ ScVbaHPageBreaks::getElementType()
OUString
ScVbaHPageBreaks::getServiceImplName()
{
return "ScVbaHPageBreaks";
return u"ScVbaHPageBreaks"_ustr;
}
uno::Sequence< OUString >
@@ -258,7 +258,7 @@ ScVbaHPageBreaks::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.HPageBreaks"
u"ooo.vba.excel.HPageBreaks"_ustr
};
return aServiceNames;
}
@@ -307,7 +307,7 @@ ScVbaVPageBreaks::getElementType()
OUString
ScVbaVPageBreaks::getServiceImplName()
{
return "ScVbaVPageBreaks";
return u"ScVbaVPageBreaks"_ustr;
}
uno::Sequence< OUString >
@@ -315,7 +315,7 @@ ScVbaVPageBreaks::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.VPageBreaks"
u"ooo.vba.excel.VPageBreaks"_ustr
};
return aServiceNames;
}
+44 -44
View File
@@ -50,17 +50,17 @@ ScVbaPageSetup::ScVbaPageSetup(const uno::Reference< XHelperInterface >& xParent
// query for current page style
mxModel.set( xModel, uno::UNO_SET_THROW );
uno::Reference< beans::XPropertySet > xSheetProps( mxSheet, uno::UNO_QUERY_THROW );
uno::Any aValue = xSheetProps->getPropertyValue("PageStyle");
uno::Any aValue = xSheetProps->getPropertyValue(u"PageStyle"_ustr);
OUString aStyleName;
aValue >>= aStyleName;
uno::Reference< style::XStyleFamiliesSupplier > xStyleFamiliesSup( mxModel, uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xStyleFamilies = xStyleFamiliesSup->getStyleFamilies();
uno::Reference< container::XNameAccess > xPageStyle( xStyleFamilies->getByName("PageStyles"), uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xPageStyle( xStyleFamilies->getByName(u"PageStyles"_ustr), uno::UNO_QUERY_THROW );
mxPageProps.set( xPageStyle->getByName(aStyleName), uno::UNO_QUERY_THROW );
mnOrientLandscape = excel::XlPageOrientation::xlLandscape;
mnOrientPortrait = excel::XlPageOrientation::xlPortrait;
mxPageProps->getPropertyValue("IsLandscape") >>= mbIsLandscape;
mxPageProps->getPropertyValue(u"IsLandscape"_ustr) >>= mbIsLandscape;
}
OUString SAL_CALL ScVbaPageSetup::getPrintArea()
@@ -139,7 +139,7 @@ void SAL_CALL ScVbaPageSetup::setFooterMargin( double margin )
uno::Any SAL_CALL ScVbaPageSetup::getFitToPagesTall()
{
return mxPageProps->getPropertyValue("ScaleToPagesY");
return mxPageProps->getPropertyValue(u"ScaleToPagesY"_ustr);
}
void SAL_CALL ScVbaPageSetup::setFitToPagesTall( const uno::Any& fitToPagesTall)
@@ -153,7 +153,7 @@ void SAL_CALL ScVbaPageSetup::setFitToPagesTall( const uno::Any& fitToPagesTall)
fitToPagesTall >>= scaleToPageY;
}
mxPageProps->setPropertyValue("ScaleToPagesY", uno::Any( scaleToPageY ));
mxPageProps->setPropertyValue(u"ScaleToPagesY"_ustr, uno::Any( scaleToPageY ));
}
catch( uno::Exception& )
{
@@ -162,7 +162,7 @@ void SAL_CALL ScVbaPageSetup::setFitToPagesTall( const uno::Any& fitToPagesTall)
uno::Any SAL_CALL ScVbaPageSetup::getFitToPagesWide()
{
return mxPageProps->getPropertyValue("ScaleToPagesX");
return mxPageProps->getPropertyValue(u"ScaleToPagesX"_ustr);
}
void SAL_CALL ScVbaPageSetup::setFitToPagesWide( const uno::Any& fitToPagesWide)
@@ -176,7 +176,7 @@ void SAL_CALL ScVbaPageSetup::setFitToPagesWide( const uno::Any& fitToPagesWide)
fitToPagesWide >>= scaleToPageX;
}
mxPageProps->setPropertyValue("ScaleToPagesX", uno::Any( scaleToPageX ));
mxPageProps->setPropertyValue(u"ScaleToPagesX"_ustr, uno::Any( scaleToPageX ));
}
catch( uno::Exception& )
{
@@ -185,7 +185,7 @@ void SAL_CALL ScVbaPageSetup::setFitToPagesWide( const uno::Any& fitToPagesWide)
uno::Any SAL_CALL ScVbaPageSetup::getZoom()
{
return mxPageProps->getPropertyValue("PageScale");
return mxPageProps->getPropertyValue(u"PageScale"_ustr);
}
void SAL_CALL ScVbaPageSetup::setZoom( const uno::Any& zoom)
@@ -213,9 +213,9 @@ void SAL_CALL ScVbaPageSetup::setZoom( const uno::Any& zoom)
// these only exist in S08
sal_uInt16 nScale = 0;
mxPageProps->setPropertyValue("ScaleToPages", uno::Any( nScale ));
mxPageProps->setPropertyValue("ScaleToPagesX", uno::Any( nScale ));
mxPageProps->setPropertyValue("ScaleToPagesY", uno::Any( nScale ));
mxPageProps->setPropertyValue(u"ScaleToPages"_ustr, uno::Any( nScale ));
mxPageProps->setPropertyValue(u"ScaleToPagesX"_ustr, uno::Any( nScale ));
mxPageProps->setPropertyValue(u"ScaleToPagesY"_ustr, uno::Any( nScale ));
}
catch (const beans::UnknownPropertyException&)
{
@@ -228,7 +228,7 @@ void SAL_CALL ScVbaPageSetup::setZoom( const uno::Any& zoom)
{
}
mxPageProps->setPropertyValue("PageScale", uno::Any( pageScale ));
mxPageProps->setPropertyValue(u"PageScale"_ustr, uno::Any( pageScale ));
}
OUString SAL_CALL ScVbaPageSetup::getLeftHeader()
@@ -236,7 +236,7 @@ OUString SAL_CALL ScVbaPageSetup::getLeftHeader()
OUString leftHeader;
try
{
uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue("RightPageHeaderContent"), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue(u"RightPageHeaderContent"_ustr), uno::UNO_QUERY_THROW);
uno::Reference< text::XText > xText = xHeaderContent->getLeftText();
leftHeader = xText->getString();
}
@@ -251,10 +251,10 @@ void SAL_CALL ScVbaPageSetup::setLeftHeader( const OUString& leftHeader)
{
try
{
uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue("RightPageHeaderContent"), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue(u"RightPageHeaderContent"_ustr), uno::UNO_QUERY_THROW);
uno::Reference< text::XText > xText = xHeaderContent->getLeftText();
xText->setString( leftHeader );
mxPageProps->setPropertyValue("RightPageHeaderContent", uno::Any(xHeaderContent) );
mxPageProps->setPropertyValue(u"RightPageHeaderContent"_ustr, uno::Any(xHeaderContent) );
}
catch( uno::Exception& )
{
@@ -266,7 +266,7 @@ OUString SAL_CALL ScVbaPageSetup::getCenterHeader()
OUString centerHeader;
try
{
uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue("RightPageHeaderContent"), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue(u"RightPageHeaderContent"_ustr), uno::UNO_QUERY_THROW);
uno::Reference< text::XText > xText = xHeaderContent->getCenterText();
centerHeader = xText->getString();
}
@@ -281,10 +281,10 @@ void SAL_CALL ScVbaPageSetup::setCenterHeader( const OUString& centerHeader)
{
try
{
uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue("RightPageHeaderContent"), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue(u"RightPageHeaderContent"_ustr), uno::UNO_QUERY_THROW);
uno::Reference< text::XText > xText = xHeaderContent->getCenterText();
xText->setString( centerHeader );
mxPageProps->setPropertyValue("RightPageHeaderContent", uno::Any(xHeaderContent) );
mxPageProps->setPropertyValue(u"RightPageHeaderContent"_ustr, uno::Any(xHeaderContent) );
}
catch( uno::Exception& )
{
@@ -296,7 +296,7 @@ OUString SAL_CALL ScVbaPageSetup::getRightHeader()
OUString rightHeader;
try
{
uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue("RightPageHeaderContent"), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue(u"RightPageHeaderContent"_ustr), uno::UNO_QUERY_THROW);
uno::Reference< text::XText > xText = xHeaderContent->getRightText();
rightHeader = xText->getString();
}
@@ -311,10 +311,10 @@ void SAL_CALL ScVbaPageSetup::setRightHeader( const OUString& rightHeader)
{
try
{
uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue("RightPageHeaderContent"), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XHeaderFooterContent> xHeaderContent( mxPageProps->getPropertyValue(u"RightPageHeaderContent"_ustr), uno::UNO_QUERY_THROW);
uno::Reference< text::XText > xText = xHeaderContent->getRightText();
xText->setString( rightHeader );
mxPageProps->setPropertyValue("RightPageHeaderContent", uno::Any(xHeaderContent) );
mxPageProps->setPropertyValue(u"RightPageHeaderContent"_ustr, uno::Any(xHeaderContent) );
}
catch( uno::Exception& )
{
@@ -326,7 +326,7 @@ OUString SAL_CALL ScVbaPageSetup::getLeftFooter()
OUString leftFooter;
try
{
uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue("RightPageFooterContent"), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue(u"RightPageFooterContent"_ustr), uno::UNO_QUERY_THROW);
uno::Reference< text::XText > xText = xFooterContent->getLeftText();
leftFooter = xText->getString();
}
@@ -341,10 +341,10 @@ void SAL_CALL ScVbaPageSetup::setLeftFooter( const OUString& leftFooter)
{
try
{
uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue("RightPageFooterContent"), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue(u"RightPageFooterContent"_ustr), uno::UNO_QUERY_THROW);
uno::Reference< text::XText > xText = xFooterContent->getLeftText();
xText->setString( leftFooter );
mxPageProps->setPropertyValue("RightPageFooterContent", uno::Any(xFooterContent) );
mxPageProps->setPropertyValue(u"RightPageFooterContent"_ustr, uno::Any(xFooterContent) );
}
catch( uno::Exception& )
{
@@ -356,7 +356,7 @@ OUString SAL_CALL ScVbaPageSetup::getCenterFooter()
OUString centerFooter;
try
{
uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue("RightPageFooterContent"), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue(u"RightPageFooterContent"_ustr), uno::UNO_QUERY_THROW);
uno::Reference< text::XText > xText = xFooterContent->getCenterText();
centerFooter = xText->getString();
}
@@ -371,10 +371,10 @@ void SAL_CALL ScVbaPageSetup::setCenterFooter( const OUString& centerFooter)
{
try
{
uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue("RightPageFooterContent"), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue(u"RightPageFooterContent"_ustr), uno::UNO_QUERY_THROW);
uno::Reference< text::XText > xText = xFooterContent->getCenterText();
xText->setString( centerFooter );
mxPageProps->setPropertyValue("RightPageFooterContent", uno::Any(xFooterContent) );
mxPageProps->setPropertyValue(u"RightPageFooterContent"_ustr, uno::Any(xFooterContent) );
}
catch( uno::Exception& )
{
@@ -387,7 +387,7 @@ OUString SAL_CALL ScVbaPageSetup::getRightFooter()
OUString rightFooter;
try
{
uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue("RightPageFooterContent"), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue(u"RightPageFooterContent"_ustr), uno::UNO_QUERY_THROW);
uno::Reference< text::XText > xText = xFooterContent->getRightText();
rightFooter = xText->getString();
}
@@ -402,10 +402,10 @@ void SAL_CALL ScVbaPageSetup::setRightFooter( const OUString& rightFooter)
{
try
{
uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue("RightPageFooterContent"), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XHeaderFooterContent> xFooterContent( mxPageProps->getPropertyValue(u"RightPageFooterContent"_ustr), uno::UNO_QUERY_THROW);
uno::Reference< text::XText > xText = xFooterContent->getRightText();
xText->setString( rightFooter );
mxPageProps->setPropertyValue("RightPageFooterContent", uno::Any(xFooterContent) );
mxPageProps->setPropertyValue(u"RightPageFooterContent"_ustr, uno::Any(xFooterContent) );
}
catch( uno::Exception& )
{
@@ -417,7 +417,7 @@ sal_Int32 SAL_CALL ScVbaPageSetup::getOrder()
sal_Int32 order = excel::XlOrder::xlDownThenOver;
try
{
uno::Any aValue = mxPageProps->getPropertyValue("PrintDownFirst");
uno::Any aValue = mxPageProps->getPropertyValue(u"PrintDownFirst"_ustr);
bool bPrintDownFirst = false;
aValue >>= bPrintDownFirst;
if( !bPrintDownFirst )
@@ -446,7 +446,7 @@ void SAL_CALL ScVbaPageSetup::setOrder(sal_Int32 order)
try
{
mxPageProps->setPropertyValue("PrintDownFirst", uno::Any( bOrder ));
mxPageProps->setPropertyValue(u"PrintDownFirst"_ustr, uno::Any( bOrder ));
}
catch (const uno::Exception&)
{
@@ -458,7 +458,7 @@ sal_Int32 SAL_CALL ScVbaPageSetup::getFirstPageNumber()
sal_Int16 number = 0;
try
{
uno::Any aValue = mxPageProps->getPropertyValue("FirstPageNumber");
uno::Any aValue = mxPageProps->getPropertyValue(u"FirstPageNumber"_ustr);
aValue >>= number;
}
catch( uno::Exception& )
@@ -482,7 +482,7 @@ void SAL_CALL ScVbaPageSetup::setFirstPageNumber( sal_Int32 firstPageNumber)
{
uno::Any aValue;
aValue <<= static_cast<sal_Int16>(firstPageNumber);
mxPageProps->setPropertyValue("FirstPageNumber", aValue );
mxPageProps->setPropertyValue(u"FirstPageNumber"_ustr, aValue );
}
catch (const uno::Exception&)
{
@@ -494,7 +494,7 @@ sal_Bool SAL_CALL ScVbaPageSetup::getCenterVertically()
bool centerVertically = false;
try
{
uno::Any aValue = mxPageProps->getPropertyValue("CenterVertically");
uno::Any aValue = mxPageProps->getPropertyValue(u"CenterVertically"_ustr);
aValue >>= centerVertically;
}
catch (const uno::Exception&)
@@ -507,7 +507,7 @@ void SAL_CALL ScVbaPageSetup::setCenterVertically( sal_Bool centerVertically)
{
try
{
mxPageProps->setPropertyValue("CenterVertically", uno::Any( centerVertically ));
mxPageProps->setPropertyValue(u"CenterVertically"_ustr, uno::Any( centerVertically ));
}
catch (const uno::Exception&)
{
@@ -519,7 +519,7 @@ sal_Bool SAL_CALL ScVbaPageSetup::getCenterHorizontally()
bool centerHorizontally = false;
try
{
uno::Any aValue = mxPageProps->getPropertyValue("CenterHorizontally");
uno::Any aValue = mxPageProps->getPropertyValue(u"CenterHorizontally"_ustr);
aValue >>= centerHorizontally;
}
catch (const uno::Exception&)
@@ -532,7 +532,7 @@ void SAL_CALL ScVbaPageSetup::setCenterHorizontally( sal_Bool centerHorizontally
{
try
{
mxPageProps->setPropertyValue("CenterHorizontally", uno::Any( centerHorizontally ));
mxPageProps->setPropertyValue(u"CenterHorizontally"_ustr, uno::Any( centerHorizontally ));
}
catch (const uno::Exception&)
{
@@ -544,7 +544,7 @@ sal_Bool SAL_CALL ScVbaPageSetup::getPrintHeadings()
bool printHeadings = false;
try
{
uno::Any aValue = mxPageProps->getPropertyValue("PrintHeaders");
uno::Any aValue = mxPageProps->getPropertyValue(u"PrintHeaders"_ustr);
aValue >>= printHeadings;
}
catch (const uno::Exception&)
@@ -557,7 +557,7 @@ void SAL_CALL ScVbaPageSetup::setPrintHeadings( sal_Bool printHeadings)
{
try
{
mxPageProps->setPropertyValue("PrintHeaders", uno::Any( printHeadings ));
mxPageProps->setPropertyValue(u"PrintHeaders"_ustr, uno::Any( printHeadings ));
}
catch( uno::Exception& )
{
@@ -592,7 +592,7 @@ void SAL_CALL ScVbaPageSetup::setPrintTitleColumns( const OUString& /*_printtitl
sal_Int32 SAL_CALL ScVbaPageSetup::getPaperSize()
{
awt::Size aSize; // current papersize
mxPageProps->getPropertyValue( "Size" ) >>= aSize;
mxPageProps->getPropertyValue( u"Size"_ustr ) >>= aSize;
if ( mbIsLandscape )
::std::swap( aSize.Width, aSize.Height );
@@ -612,14 +612,14 @@ void SAL_CALL ScVbaPageSetup::setPaperSize( sal_Int32 papersize )
aPaperSize.Width = rConvertedSize.mnWidth;
if ( mbIsLandscape )
::std::swap( aPaperSize.Width, aPaperSize.Height );
mxPageProps->setPropertyValue( "Size", uno::Any( aPaperSize ) );
mxPageProps->setPropertyValue( u"Size"_ustr, uno::Any( aPaperSize ) );
}
}
OUString
ScVbaPageSetup::getServiceImplName()
{
return "ScVbaPageSetup";
return u"ScVbaPageSetup"_ustr;
}
uno::Sequence< OUString >
@@ -627,7 +627,7 @@ ScVbaPageSetup::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.PageSetup"
u"ooo.vba.excel.PageSetup"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -102,11 +102,11 @@ ScVbaPalette::getPalette() const
uno::Reference< container::XIndexAccess > xIndex;
uno::Reference< beans::XPropertySet > xProps;
if ( !m_pShell )
throw uno::RuntimeException("Can't extract palette, no doc shell" );
throw uno::RuntimeException(u"Can't extract palette, no doc shell"_ustr );
xProps.set( m_pShell->GetModel(), uno::UNO_QUERY_THROW );
xIndex.set( xProps->getPropertyValue("ColorPalette"), uno::UNO_QUERY );
xIndex.set( xProps->getPropertyValue(u"ColorPalette"_ustr), uno::UNO_QUERY );
if ( !xIndex.is() )
return new DefaultPalette();
return xIndex;
+2 -2
View File
@@ -51,7 +51,7 @@ ScVbaPane::setScrollColumn( sal_Int32 _scrollcolumn )
{
if( _scrollcolumn < 1 )
{
throw uno::RuntimeException("Column number should not be less than 1" );
throw uno::RuntimeException(u"Column number should not be less than 1"_ustr );
}
m_xViewPane->setFirstVisibleColumn( _scrollcolumn - 1 );
}
@@ -67,7 +67,7 @@ ScVbaPane::setScrollRow( sal_Int32 _scrollrow )
{
if( _scrollrow < 1 )
{
throw uno::RuntimeException("Row number should not be less than 1" );
throw uno::RuntimeException(u"Row number should not be less than 1"_ustr );
}
m_xViewPane->setFirstVisibleRow( _scrollrow - 1 );
}
+2 -2
View File
@@ -36,7 +36,7 @@ ScVbaPivotCache::Refresh()
OUString
ScVbaPivotCache::getServiceImplName()
{
return "ScVbaPivotCache";
return u"ScVbaPivotCache"_ustr;
}
uno::Sequence< OUString >
@@ -44,7 +44,7 @@ ScVbaPivotCache::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.PivotCache"
u"ooo.vba.excel.PivotCache"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -39,7 +39,7 @@ ScVbaPivotTable::PivotCache()
OUString
ScVbaPivotTable::getServiceImplName()
{
return "ScVbaPivotTable";
return u"ScVbaPivotTable"_ustr;
}
uno::Sequence< OUString >
@@ -47,7 +47,7 @@ ScVbaPivotTable::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.PivotTable"
u"ooo.vba.excel.PivotTable"_ustr
};
return aServiceNames;
}
+2 -2
View File
@@ -73,7 +73,7 @@ ScVbaPivotTables::getElementType()
OUString
ScVbaPivotTables::getServiceImplName()
{
return "ScVbaPivotTables";
return u"ScVbaPivotTables"_ustr;
}
css::uno::Sequence<OUString>
@@ -81,7 +81,7 @@ ScVbaPivotTables::getServiceNames()
{
static uno::Sequence< OUString > const sNames
{
"ooo.vba.excel.PivotTables"
u"ooo.vba.excel.PivotTables"_ustr
};
return sNames;
}
+85 -85
View File
@@ -231,7 +231,7 @@ ScCellRangesBase* ScVbaRange::getCellRangesBase()
return dynamic_cast<ScCellRangesBase*>( mxRanges.get() );
if( mxRange.is() )
return dynamic_cast<ScCellRangesBase*>( mxRange.get() );
throw uno::RuntimeException("General Error creating range - Unknown" );
throw uno::RuntimeException(u"General Error creating range - Unknown"_ustr );
}
ScCellRangeObj* ScVbaRange::getCellRangeObj()
@@ -243,7 +243,7 @@ SfxItemSet* ScVbaRange::getCurrentDataSet( )
{
SfxItemSet* pDataSet = excel::ScVbaCellRangeAccess::GetDataSet( getCellRangesBase() );
if ( !pDataSet )
throw uno::RuntimeException("Can't access Itemset for range" );
throw uno::RuntimeException(u"Can't access Itemset for range"_ustr );
return pDataSet;
}
@@ -366,7 +366,7 @@ getDocShellFromIf( const uno::Reference< uno::XInterface >& xIf )
{
ScCellRangesBase* pUno = dynamic_cast<ScCellRangesBase*>( xIf.get() );
if ( !pUno )
throw uno::RuntimeException("Failed to access underlying uno range object" );
throw uno::RuntimeException(u"Failed to access underlying uno range object"_ustr );
return pUno->GetDocShell();
}
@@ -408,7 +408,7 @@ getDocumentFromRange( const uno::Reference< table::XCellRange >& xRange )
{
ScDocShell* pDocShell = getDocShellFromRange( xRange );
if ( !pDocShell )
throw uno::RuntimeException("Failed to access underlying docshell from uno range object" );
throw uno::RuntimeException(u"Failed to access underlying docshell from uno range object"_ustr );
ScDocument& rDoc = pDocShell->GetDocument();
return rDoc;
}
@@ -461,14 +461,14 @@ const ScRangeList& ScVbaRange::getScRangeList()
{
if( ScCellRangesBase* pScRangesBase = getCellRangesBase() )
return pScRangesBase->GetRangeList();
throw uno::RuntimeException("Cannot obtain UNO range implementation object" );
throw uno::RuntimeException(u"Cannot obtain UNO range implementation object"_ustr );
}
const ScRangeList& ScVbaRange::getScRangeList( const uno::Reference< excel::XRange >& rxRange )
{
if( ScVbaRange* pScVbaRange = getImplementation( rxRange ) )
return pScVbaRange->getScRangeList();
throw uno::RuntimeException("Cannot obtain VBA range implementation object" );
throw uno::RuntimeException(u"Cannot obtain VBA range implementation object"_ustr );
}
namespace {
@@ -488,7 +488,7 @@ public:
uno::Reference< beans::XPropertySet > getNumberProps()
{
tools::Long nIndexKey = 0;
uno::Any aValue = mxRangeProps->getPropertyValue( "NumberFormat" );
uno::Any aValue = mxRangeProps->getPropertyValue( u"NumberFormat"_ustr );
aValue >>= nIndexKey;
if ( mxFormats.is() )
@@ -525,7 +525,7 @@ public:
uno::Reference< beans::XPropertySet > xNumberProps( getNumberProps(), uno::UNO_SET_THROW );
OUString aFormatString;
uno::Any aString = xNumberProps->getPropertyValue( "FormatString" );
uno::Any aString = xNumberProps->getPropertyValue( u"FormatString"_ustr );
aString >>= aFormatString;
return aFormatString;
}
@@ -534,7 +534,7 @@ public:
{
uno::Reference< beans::XPropertySet > xNumberProps = getNumberProps();
sal_Int16 nType = ::comphelper::getINT16(
xNumberProps->getPropertyValue( "Type" ) );
xNumberProps->getPropertyValue( u"Type"_ustr ) );
return nType;
}
@@ -546,24 +546,24 @@ public:
{
lang::Locale aLocale;
uno::Reference< beans::XPropertySet > xNumProps = getNumberProps();
xNumProps->getPropertyValue( "Locale" ) >>= aLocale;
xNumProps->getPropertyValue( u"Locale"_ustr ) >>= aLocale;
nNewIndex = mxFormats->queryKey( rFormat, aLocale, false );
if ( nNewIndex == -1 ) // format not defined
nNewIndex = mxFormats->addNew( rFormat, aLocale );
}
mxRangeProps->setPropertyValue( "NumberFormat", uno::Any( nNewIndex ) );
mxRangeProps->setPropertyValue( u"NumberFormat"_ustr, uno::Any( nNewIndex ) );
}
void setNumberFormat( sal_Int16 nType )
{
uno::Reference< beans::XPropertySet > xNumberProps = getNumberProps();
lang::Locale aLocale;
xNumberProps->getPropertyValue( "Locale" ) >>= aLocale;
xNumberProps->getPropertyValue( u"Locale"_ustr ) >>= aLocale;
uno::Reference<util::XNumberFormatTypes> xTypes( mxFormats, uno::UNO_QUERY );
if ( xTypes.is() )
{
sal_Int32 nNewIndex = xTypes->getStandardFormat( nType, aLocale );
mxRangeProps->setPropertyValue( "NumberFormat", uno::Any( nNewIndex ) );
mxRangeProps->setPropertyValue( u"NumberFormat"_ustr, uno::Any( nNewIndex ) );
}
}
@@ -764,7 +764,7 @@ CellValueSetter::processValue( const uno::Any& aValue, const uno::Reference< tab
// then we need to reset the logical format. ( see case uno::TypeClass_BOOLEAN:
// handling above )
if ( cellFormat.isBooleanType() )
cellFormat.setNumberFormat("General");
cellFormat.setNumberFormat(u"General"_ustr);
xCell->setValue( nDouble );
}
else
@@ -817,7 +817,7 @@ void CellValueGetter::visitNode( sal_Int32 /*x*/, sal_Int32 /*y*/, const uno::Re
sal_Int32 nResultType = sheet::FormulaResult::VALUE;
// some formulas give textual results
xProp->getPropertyValue( "FormulaResultType2" ) >>= nResultType;
xProp->getPropertyValue( u"FormulaResultType2"_ustr ) >>= nResultType;
if ( nResultType == sheet::FormulaResult::STRING )
{
@@ -1171,7 +1171,7 @@ ScVbaRange::getCellRangesForAddress( ScRefFlags& rResFlags, std::u16string_view
bool getScRangeListForAddress( const OUString& sName, ScDocShell* pDocSh, const ScRange& refRange, ScRangeList& aCellRanges, formula::FormulaGrammar::AddressConvention aConv )
{
// see if there is a match with a named range
uno::Reference< container::XNameAccess > xNameAccess( pDocSh->GetModel()->getPropertyValue( "NamedRanges" ), uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xNameAccess( pDocSh->GetModel()->getPropertyValue( u"NamedRanges"_ustr ), uno::UNO_QUERY_THROW );
// Strange enough you can have Range( "namedRange1, namedRange2, etc," )
// loop around each ',' separated name
std::vector< OUString > vNames;
@@ -1302,10 +1302,10 @@ uno::Reference< sheet::XSheetCellRange > lclExpandToMerged( const uno::Reference
uno::Reference< sheet::XSheetCellRangeContainer > lclExpandToMerged( const uno::Reference< sheet::XSheetCellRangeContainer >& rxCellRanges )
{
if( !rxCellRanges.is() )
throw uno::RuntimeException("Missing cell ranges object" );
throw uno::RuntimeException(u"Missing cell ranges object"_ustr );
sal_Int32 nCount = rxCellRanges->getCount();
if( nCount < 1 )
throw uno::RuntimeException("Missing cell ranges object" );
throw uno::RuntimeException(u"Missing cell ranges object"_ustr );
ScRangeList aScRanges;
for( sal_Int32 nIndex = 0; nIndex < nCount; ++nIndex )
@@ -1413,7 +1413,7 @@ static table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& a
break;
default:
throw uno::RuntimeException("Can't extract CellRangeAddress from type" );
throw uno::RuntimeException(u"Can't extract CellRangeAddress from type"_ustr );
}
return lclGetRangeAddress( xRangeParam );
}
@@ -1452,9 +1452,9 @@ ScVbaRange::ScVbaRange( const uno::Reference< XHelperInterface >& xParent, const
mbIsColumns( bIsColumns )
{
if ( !xContext.is() )
throw lang::IllegalArgumentException("context is not set ", uno::Reference< uno::XInterface >() , 1 );
throw lang::IllegalArgumentException(u"context is not set "_ustr, uno::Reference< uno::XInterface >() , 1 );
if ( !xRange.is() )
throw lang::IllegalArgumentException("range is not set ", uno::Reference< uno::XInterface >() , 1 );
throw lang::IllegalArgumentException(u"range is not set "_ustr, uno::Reference< uno::XInterface >() , 1 );
uno::Reference< container::XIndexAccess > xIndex( new SingleRangeIndexAccess( xRange ) );
m_Areas = new ScVbaRangeAreas( mxParent, mxContext, xIndex, mbIsRows, mbIsColumns );
@@ -2050,7 +2050,7 @@ ScVbaRange::setFormulaArray(const uno::Any& rFormula)
// but for the moment it's just easier to treat them the same for setting
// seems
uno::Reference< lang::XMultiServiceFactory > xModelFactory( getUnoModel(), uno::UNO_QUERY_THROW );
uno::Reference< sheet::XFormulaParser > xParser( xModelFactory->createInstance( "com.sun.star.sheet.FormulaParser" ), uno::UNO_QUERY_THROW );
uno::Reference< sheet::XFormulaParser > xParser( xModelFactory->createInstance( u"com.sun.star.sheet.FormulaParser"_ustr ), uno::UNO_QUERY_THROW );
uno::Reference< sheet::XCellRangeAddressable > xSource( mxRange, uno::UNO_QUERY_THROW);
table::CellRangeAddress aRangeAddress = xSource->getRangeAddress();
@@ -2299,7 +2299,7 @@ ScVbaRange::Select()
{
ScCellRangesBase* pUnoRangesBase = getCellRangesBase();
if ( !pUnoRangesBase )
throw uno::RuntimeException("Failed to access underlying uno range object" );
throw uno::RuntimeException(u"Failed to access underlying uno range object"_ustr );
ScDocShell* pShell = pUnoRangesBase->GetDocShell();
if ( !pShell )
return;
@@ -2441,10 +2441,10 @@ ScVbaRange::Rows(const uno::Any& aIndex )
aRange.aEnd.SetRow( aRange.aStart.Row() + ( nEndRow - nStartRow ));
}
else
throw uno::RuntimeException("Illegal param" );
throw uno::RuntimeException(u"Illegal param"_ustr );
if ( aRange.aStart.Row() < 0 || aRange.aEnd.Row() < 0 )
throw uno::RuntimeException("Internal failure, illegal param" );
throw uno::RuntimeException(u"Internal failure, illegal param"_ustr );
// return a normal range ( even for multi-selection
uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pUnoRangesBase->GetDocShell(), aRange ) );
return new ScVbaRange( mxParent, mxContext, xRange, true );
@@ -2483,10 +2483,10 @@ ScVbaRange::Columns(const uno::Any& aIndex )
aRange.aEnd.SetCol( aRange.aStart.Col() + ( nEndCol - nStartCol ));
}
else
throw uno::RuntimeException("Illegal param" );
throw uno::RuntimeException(u"Illegal param"_ustr );
if ( aRange.aStart.Col() < 0 || aRange.aEnd.Col() < 0 )
throw uno::RuntimeException("Internal failure, illegal param" );
throw uno::RuntimeException(u"Internal failure, illegal param"_ustr );
}
// Columns() - no params
uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pUnoRangesBase->GetDocShell(), aRange ) );
@@ -2564,7 +2564,7 @@ ScVbaRange::Copy(const ::uno::Any& Destination)
{
// TODO copy with multiple selections should work here too
if ( m_Areas->getCount() > 1 )
throw uno::RuntimeException("That command cannot be used on multiple selections" );
throw uno::RuntimeException(u"That command cannot be used on multiple selections"_ustr );
uno::Reference< excel::XRange > xRange( Destination, uno::UNO_QUERY_THROW );
uno::Any aRange = xRange->getCellRange();
uno::Reference< table::XCellRange > xCellRange;
@@ -2591,7 +2591,7 @@ void
ScVbaRange::Cut(const ::uno::Any& Destination)
{
if ( m_Areas->getCount() > 1 )
throw uno::RuntimeException("That command cannot be used on multiple selections" );
throw uno::RuntimeException(u"That command cannot be used on multiple selections"_ustr );
if (Destination.hasValue())
{
uno::Reference< excel::XRange > xRange( Destination, uno::UNO_QUERY_THROW );
@@ -2698,7 +2698,7 @@ ScVbaRange::setWrapText( const uno::Any& aIsWrapped )
uno::Reference< beans::XPropertySet > xProps(mxRange, ::uno::UNO_QUERY_THROW );
bool bIsWrapped = extractBoolFromAny( aIsWrapped );
xProps->setPropertyValue( "IsTextWrapped", uno::Any( bIsWrapped ) );
xProps->setPropertyValue( u"IsTextWrapped"_ustr, uno::Any( bIsWrapped ) );
}
uno::Any
@@ -2726,7 +2726,7 @@ ScVbaRange::getWrapText()
return aNULL();
uno::Reference< beans::XPropertySet > xProps(mxRange, ::uno::UNO_QUERY_THROW );
uno::Any aValue = xProps->getPropertyValue( "IsTextWrapped" );
uno::Any aValue = xProps->getPropertyValue( u"IsTextWrapped"_ustr );
return aValue;
}
@@ -2766,7 +2766,7 @@ ScVbaRange::Range( const uno::Any &Cell1, const uno::Any &Cell2, bool bForceUseI
xAddressable.set( xReferrer, uno::UNO_QUERY_THROW );
if( !Cell1.hasValue() )
throw uno::RuntimeException( "Invalid Argument" );
throw uno::RuntimeException( u"Invalid Argument"_ustr );
table::CellRangeAddress parentRangeAddress = xAddressable->getRangeAddress();
@@ -2911,11 +2911,11 @@ void SAL_CALL
ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, const uno::Any& SkipBlanks, const uno::Any& Transpose )
{
if ( m_Areas->getCount() > 1 )
throw uno::RuntimeException("That command cannot be used on multiple selections" );
throw uno::RuntimeException(u"That command cannot be used on multiple selections"_ustr );
ScDocShell* pShell = getScDocShell();
if (!pShell)
throw uno::RuntimeException("That command cannot be used with no ScDocShell" );
throw uno::RuntimeException(u"That command cannot be used with no ScDocShell"_ustr );
uno::Reference< frame::XModel > xModel(pShell->GetModel(), uno::UNO_SET_THROW);
uno::Reference< view::XSelectionSupplier > xSelection( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
@@ -3051,7 +3051,7 @@ ScVbaRange::getHidden()
{
uno::Reference< beans::XPropertySet > xProps = getRowOrColumnProps( mxRange, mbIsRows );
if ( !( xProps->getPropertyValue( ISVISIBLE ) >>= bIsVisible ) )
throw uno::RuntimeException("Failed to get IsVisible property" );
throw uno::RuntimeException(u"Failed to get IsVisible property"_ustr );
}
catch( const uno::Exception& e )
{
@@ -3105,7 +3105,7 @@ ScVbaRange::Replace( const OUString& What, const OUString& Replacement, const un
// sanity check required params
if ( What.isEmpty() )
throw uno::RuntimeException("Range::Replace, missing params" );
throw uno::RuntimeException(u"Range::Replace, missing params"_ustr );
// #TODO #FIXME SearchFormat & ReplacesFormat are not processed
// What do we do about MatchByte... we don't seem to support that
const SvxSearchItem& globalSearchOptions = ScGlobal::GetSearchItem();
@@ -3131,7 +3131,7 @@ ScVbaRange::Replace( const OUString& What, const OUString& Replacement, const un
else if ( nLook == excel::XlLookAt::xlWhole )
bSearchWords = true;
else
throw uno::RuntimeException("Range::Replace, illegal value for LookAt" );
throw uno::RuntimeException(u"Range::Replace, illegal value for LookAt"_ustr );
// set global search props ( affects the find dialog
// and of course the defaults for this method
newOptions.SetWordOnly( bSearchWords );
@@ -3147,7 +3147,7 @@ ScVbaRange::Replace( const OUString& What, const OUString& Replacement, const un
else if ( nSearchOrder == excel::XlSearchOrder::xlByRows )
bSearchByRow = true;
else
throw uno::RuntimeException("Range::Replace, illegal value for SearchOrder" );
throw uno::RuntimeException(u"Range::Replace, illegal value for SearchOrder"_ustr );
newOptions.SetRowDirection( bSearchByRow );
xDescriptor->setPropertyValue( SC_UNO_SRCHBYROW, uno::Any( bSearchByRow ) );
@@ -3211,7 +3211,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
sWhat = OUString::number( fWhat );
}
else
throw uno::RuntimeException("Range::Find, missing search-for-what param" );
throw uno::RuntimeException(u"Range::Find, missing search-for-what param"_ustr );
const SvxSearchItem& globalSearchOptions = ScGlobal::GetSearchItem();
SvxSearchItem newOptions( globalSearchOptions );
@@ -3230,7 +3230,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
{
// After must be a single cell in the range
if( xAfterRange->getCount() > 1 )
throw uno::RuntimeException("After must be a single cell." );
throw uno::RuntimeException(u"After must be a single cell."_ustr );
uno::Reference< excel::XRange > xCell( Cells( uno::Any( xAfterRange->getRow() ), uno::Any( xAfterRange->getColumn() ) ), uno::UNO_SET_THROW );
xStartCell.set( xAfterRange->getCellRange(), uno::UNO_QUERY_THROW );
}
@@ -3254,10 +3254,10 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
nSearchType = SvxSearchCellType::VALUE;
break;
default:
throw uno::RuntimeException("Range::Find, illegal value for LookIn." );
throw uno::RuntimeException(u"Range::Find, illegal value for LookIn."_ustr );
}
newOptions.SetCellType( nSearchType );
xDescriptor->setPropertyValue( "SearchType", uno::Any( static_cast<sal_uInt16>(nSearchType) ) );
xDescriptor->setPropertyValue( u"SearchType"_ustr, uno::Any( static_cast<sal_uInt16>(nSearchType) ) );
}
}
@@ -3271,7 +3271,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
else if ( nLookAt == excel::XlLookAt::xlWhole )
bSearchWords = true;
else
throw uno::RuntimeException("Range::Find, illegal value for LookAt" );
throw uno::RuntimeException(u"Range::Find, illegal value for LookAt"_ustr );
newOptions.SetWordOnly( bSearchWords );
xDescriptor->setPropertyValue( SC_UNO_SRCHWORDS, uno::Any( bSearchWords ) );
}
@@ -3286,7 +3286,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
else if ( nSearchOrder == excel::XlSearchOrder::xlByRows )
bSearchByRow = true;
else
throw uno::RuntimeException("Range::Find, illegal value for SearchOrder" );
throw uno::RuntimeException(u"Range::Find, illegal value for SearchOrder"_ustr );
newOptions.SetRowDirection( bSearchByRow );
xDescriptor->setPropertyValue( SC_UNO_SRCHBYROW, uno::Any( bSearchByRow ) );
@@ -3304,9 +3304,9 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
else if( nSearchDirection == excel::XlSearchDirection::xlPrevious )
bSearchBackwards = true;
else
throw uno::RuntimeException("Range::Find, illegal value for SearchDirection" );
throw uno::RuntimeException(u"Range::Find, illegal value for SearchDirection"_ustr );
newOptions.SetBackward( bSearchBackwards );
xDescriptor->setPropertyValue( "SearchBackwards", uno::Any( bSearchBackwards ) );
xDescriptor->setPropertyValue( u"SearchBackwards"_ustr, uno::Any( bSearchBackwards ) );
}
}
@@ -3316,7 +3316,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
{
// SearchCaseSensitive
if( !( MatchCase >>= bMatchCase ) )
throw uno::RuntimeException("Range::Find illegal value for MatchCase" );
throw uno::RuntimeException(u"Range::Find illegal value for MatchCase"_ustr );
}
xDescriptor->setPropertyValue( SC_UNO_SRCHCASE, uno::Any( bMatchCase ) );
@@ -3362,11 +3362,11 @@ static uno::Reference< table::XCellRange > processKey( const uno::Any& Key, cons
OUString sRangeName = ::comphelper::getString( Key );
table::CellRangeAddress aRefAddr;
if ( !pDocSh )
throw uno::RuntimeException("Range::Sort no docshell to calculate key param" );
throw uno::RuntimeException(u"Range::Sort no docshell to calculate key param"_ustr );
xKeyRange = getRangeForName( xContext, sRangeName, pDocSh, aRefAddr );
}
else
throw uno::RuntimeException("Range::Sort illegal type value for key param" );
throw uno::RuntimeException(u"Range::Sort illegal type value for key param"_ustr );
uno::Reference< table::XCellRange > xKey;
xKey.set( xKeyRange->getCellRange(), uno::UNO_QUERY_THROW );
return xKey;
@@ -3381,7 +3381,7 @@ const OUString& sPropName )
[&sPropName](const beans::PropertyValue& rProp) { return rProp.Name == sPropName; });
if ( pProp == props.end() )
throw uno::RuntimeException("Range::Sort unknown sort property" );
throw uno::RuntimeException(u"Range::Sort unknown sort property"_ustr );
return static_cast<sal_Int32>(std::distance(props.begin(), pProp));
}
@@ -3407,7 +3407,7 @@ static void updateTableSortField( const uno::Reference< table::XCellRange >& xPa
( !bIsSortColumn || colRowKeyAddress.StartRow < parentRangeAddress.StartRow ||
colRowKeyAddress.StartRow > parentRangeAddress.EndRow )
)
throw uno::RuntimeException("Illegal Key param" );
throw uno::RuntimeException(u"Illegal Key param"_ustr );
//determine col/row index
if ( bIsSortColumn )
@@ -3429,7 +3429,7 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
{
// #TODO# #FIXME# can we do something with Type
if ( m_Areas->getCount() > 1 )
throw uno::RuntimeException("That command cannot be used on multiple selections" );
throw uno::RuntimeException(u"That command cannot be used on multiple selections"_ustr );
sal_Int16 nDataOption1 = excel::XlSortDataOption::xlSortNormal;
sal_Int16 nDataOption2 = excel::XlSortDataOption::xlSortNormal;
@@ -3573,7 +3573,7 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
ScDocShell* pDocShell = getScDocShell();
xKey1 = processKey( Key1, mxContext, pDocShell );
if ( !xKey1.is() )
throw uno::RuntimeException("Range::Sort needs a key1 param" );
throw uno::RuntimeException(u"Range::Sort needs a key1 param"_ustr );
if ( Key2.hasValue() )
xKey2 = processKey( Key2, mxContext, pDocShell );
@@ -3583,7 +3583,7 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
uno::Reference< util::XSortable > xSort( xRangeCurrent, uno::UNO_QUERY_THROW );
uno::Sequence< beans::PropertyValue > sortDescriptor = xSort->createSortDescriptor();
auto psortDescriptor = sortDescriptor.getArray();
sal_Int32 nTableSortFieldIndex = findSortPropertyIndex( sortDescriptor, "SortFields" );
sal_Int32 nTableSortFieldIndex = findSortPropertyIndex( sortDescriptor, u"SortFields"_ustr );
uno::Sequence< table::TableSortField > sTableFields(1);
sal_Int32 nTableIndex = 0;
@@ -3601,10 +3601,10 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
}
psortDescriptor[ nTableSortFieldIndex ].Value <<= sTableFields;
sal_Int32 nIndex = findSortPropertyIndex( sortDescriptor, "IsSortColumns" );
sal_Int32 nIndex = findSortPropertyIndex( sortDescriptor, u"IsSortColumns"_ustr );
psortDescriptor[ nIndex ].Value <<= bIsSortColumns;
nIndex = findSortPropertyIndex( sortDescriptor, "ContainsHeader" );
nIndex = findSortPropertyIndex( sortDescriptor, u"ContainsHeader"_ustr );
psortDescriptor[ nIndex ].Value <<= bContainsHeader;
rDoc.SetSortParam( aSortParam, nTab );
@@ -3670,7 +3670,7 @@ ScVbaRange::End( ::sal_Int32 Direction )
nSID = SID_CURSORBLKRIGHT;
break;
default:
throw uno::RuntimeException(": Invalid ColumnIndex" );
throw uno::RuntimeException(u": Invalid ColumnIndex"_ustr );
}
if ( pDispatcher )
{
@@ -3710,7 +3710,7 @@ uno::Reference< excel::XCharacters > SAL_CALL
ScVbaRange::characters( const uno::Any& Start, const uno::Any& Length )
{
if ( !isSingleCellRange() )
throw uno::RuntimeException("Can't create Characters property for multicell range " );
throw uno::RuntimeException(u"Can't create Characters property for multicell range "_ustr );
uno::Reference< text::XSimpleText > xSimple(mxRange->getCellByPosition(0,0) , uno::UNO_QUERY_THROW );
ScDocument& rDoc = getDocumentFromRange(mxRange);
@@ -3747,7 +3747,7 @@ ScVbaRange::Delete( const uno::Any& Shift )
mode = sheet::CellDeleteMode_LEFT;
break;
default:
throw uno::RuntimeException("Illegal parameter " );
throw uno::RuntimeException(u"Illegal parameter "_ustr );
}
}
else
@@ -3800,7 +3800,7 @@ ScVbaRange::createEnumeration()
OUString SAL_CALL
ScVbaRange::getDefaultMethodName( )
{
return "Item";
return u"Item"_ustr;
}
// returns calc internal col. width ( in points )
@@ -3938,7 +3938,7 @@ uno::Reference< excel::XRange >
ScVbaRange::getArea( sal_Int32 nIndex )
{
if ( !m_Areas.is() )
throw uno::RuntimeException("No areas available" );
throw uno::RuntimeException(u"No areas available"_ustr );
uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::Any( ++nIndex ), uno::Any() ), uno::UNO_QUERY_THROW );
return xRange;
}
@@ -4160,7 +4160,7 @@ ScVbaRange::getPosition() const
xProps.set( mxRange, uno::UNO_QUERY_THROW );
else
xProps.set( mxRanges, uno::UNO_QUERY_THROW );
xProps->getPropertyValue( "Position" ) >>= aPoint;
xProps->getPropertyValue( u"Position"_ustr ) >>= aPoint;
return aPoint;
}
uno::Any SAL_CALL
@@ -4186,7 +4186,7 @@ ScVbaRange::getTop()
static uno::Reference< sheet::XCellRangeReferrer > getNamedRange( const uno::Reference< uno::XInterface >& xIf, const uno::Reference< table::XCellRange >& thisRange )
{
uno::Reference< beans::XPropertySet > xProps( xIf, uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xNameAccess( xProps->getPropertyValue( "NamedRanges" ), uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xNameAccess( xProps->getPropertyValue( u"NamedRanges"_ustr ), uno::UNO_QUERY_THROW );
const uno::Sequence< OUString > sNames = xNameAccess->getElementNames();
// uno::Reference< table::XCellRange > thisRange( getCellRange(), uno::UNO_QUERY_THROW );
@@ -4282,7 +4282,7 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC
{
uno::Reference< beans::XPropertySet > xPropSet( getCurrentExcelDoc(xContext), uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xNamed( xPropSet->getPropertyValue( "NamedRanges" ), uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xNamed( xPropSet->getPropertyValue( u"NamedRanges"_ustr ), uno::UNO_QUERY_THROW );
uno::Reference< sheet::XCellRangeReferrer > xReferrer;
try
{
@@ -4395,7 +4395,7 @@ static void lcl_setTableFieldsFromCriteria( OUString& sCriteria1, const uno::Ref
sCriteria1 = VBAToRegexp( sCriteria1 );
// UseRegularExpressions
if ( xDescProps.is() )
xDescProps->setPropertyValue( "UseRegularExpressions", uno::Any( true ) );
xDescProps->setPropertyValue( u"UseRegularExpressions"_ustr, uno::Any( true ) );
}
}
@@ -4410,7 +4410,7 @@ static void lcl_setTableFieldsFromCriteria( OUString& sCriteria1, const uno::Ref
sCriteria1 = VBAToRegexp( sCriteria1 );
// UseRegularExpressions
if ( xDescProps.is() )
xDescProps->setPropertyValue( "UseRegularExpressions", uno::Any( true ) );
xDescProps->setPropertyValue( u"UseRegularExpressions"_ustr, uno::Any( true ) );
}
}
else if ( sCriteria1.startsWith( GREATERTHAN ) )
@@ -4497,7 +4497,7 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const
if ( pRange )
{
if ( pRange->isSingleCellRange() )
throw uno::RuntimeException("Can't create AutoFilter" );
throw uno::RuntimeException(u"Can't create AutoFilter"_ustr );
RangeHelper currentRegion( pRange->mxRange );
autoFiltAddress = currentRegion.getCellRangeAddressable()->getRangeAddress();
}
@@ -4531,14 +4531,14 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const
xDataBaseRange.set( xDBRanges->getByTable(nSheet ), uno::UNO_QUERY_THROW );
}
if ( !xDataBaseRange.is() )
throw uno::RuntimeException("Failed to find the autofilter placeholder range" );
throw uno::RuntimeException(u"Failed to find the autofilter placeholder range"_ustr );
uno::Reference< beans::XPropertySet > xDBRangeProps( xDataBaseRange, uno::UNO_QUERY_THROW );
// set autofilter
xDBRangeProps->setPropertyValue( "AutoFilter", uno::Any(true) );
xDBRangeProps->setPropertyValue( u"AutoFilter"_ustr, uno::Any(true) );
// set header (autofilter always need column headers)
uno::Reference< beans::XPropertySet > xFiltProps( xDataBaseRange->getFilterDescriptor(), uno::UNO_QUERY_THROW );
xFiltProps->setPropertyValue( "ContainsHeader", uno::Any( true ) );
xFiltProps->setPropertyValue( u"ContainsHeader"_ustr, uno::Any( true ) );
}
sal_Int32 nField = 0; // *IS* 1 based
@@ -4663,7 +4663,7 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const
nConn = sheet::FilterConnection_AND;
break;
default:
throw uno::RuntimeException("UnknownOption" );
throw uno::RuntimeException(u"UnknownOption"_ustr );
}
@@ -4742,7 +4742,7 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const
if( xSheetFilterDescriptor.is() )
xSheetFilterDescriptor->setFilterFields2( uno::Sequence< sheet::TableFilterField2 >() );
}
xDBRangeProps->setPropertyValue( "AutoFilter", uno::Any(!bHasAuto) );
xDBRangeProps->setPropertyValue( u"AutoFilter"_ustr, uno::Any(!bHasAuto) );
}
}
@@ -4770,7 +4770,7 @@ ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& /*CopyOrigin*/ )
mode = sheet::CellInsertMode_DOWN;
break;
default:
throw uno::RuntimeException("Illegal parameter " );
throw uno::RuntimeException(u"Illegal parameter "_ustr );
}
}
else
@@ -4848,7 +4848,7 @@ ScVbaRange::Hyperlinks( const uno::Any& aIndex )
uno::Reference< excel::XHyperlinks > xSheetHlinks( xWorksheet->Hyperlinks( uno::Any() ), uno::UNO_QUERY_THROW );
ScVbaHyperlinksRef xScSheetHlinks( dynamic_cast< ScVbaHyperlinks* >( xSheetHlinks.get() ) );
if( !xScSheetHlinks.is() )
throw uno::RuntimeException("Cannot obtain hyperlinks implementation object" );
throw uno::RuntimeException(u"Cannot obtain hyperlinks implementation object"_ustr );
// create a new local hyperlinks object based on the sheet hyperlinks
ScVbaHyperlinksRef xHlinks( new ScVbaHyperlinks( getParent(), mxContext, xScSheetHlinks, getScRangeList() ) );
@@ -4956,7 +4956,7 @@ uno::Any SAL_CALL ScVbaRange::getPrefixCharacter()
return lclGetPrefixVariant( lclGetPrefixChar( mxRange ) );
if( mxRanges.is() )
return lclGetPrefixVariant( lclGetPrefixChar( mxRanges ) );
throw uno::RuntimeException("Unexpected empty Range object" );
throw uno::RuntimeException(u"Unexpected empty Range object"_ustr );
}
uno::Any ScVbaRange::getShowDetail()
@@ -4965,7 +4965,7 @@ uno::Any ScVbaRange::getShowDetail()
// In MSO VBA, the specified range must be a single summary column or row in an outline. otherwise throw exception
if( m_Areas->getCount() > 1 )
throw uno::RuntimeException("Can not get Range.ShowDetail attribute " );
throw uno::RuntimeException(u"Can not get Range.ShowDetail attribute "_ustr );
RangeHelper helper( mxRange );
uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = helper.getSheetCellCursor();
@@ -4978,7 +4978,7 @@ uno::Any ScVbaRange::getShowDetail()
if( (thisAddress.StartRow != thisAddress.EndRow || thisAddress.EndRow != aOutlineAddress.EndRow ) &&
(thisAddress.StartColumn != thisAddress.EndColumn || thisAddress.EndColumn != aOutlineAddress.EndColumn ))
{
throw uno::RuntimeException("Can not set Range.ShowDetail attribute" );
throw uno::RuntimeException(u"Can not set Range.ShowDetail attribute"_ustr );
}
bool bColumn = thisAddress.StartRow != thisAddress.EndRow;
@@ -5002,7 +5002,7 @@ void ScVbaRange::setShowDetail(const uno::Any& aShowDetail)
// In MSO VBA, the specified range must be a single summary column or row in an outline. otherwise throw exception
if( m_Areas->getCount() > 1 )
throw uno::RuntimeException("Can not set Range.ShowDetail attribute" );
throw uno::RuntimeException(u"Can not set Range.ShowDetail attribute"_ustr );
bool bShowDetail = extractBoolFromAny( aShowDetail );
@@ -5017,7 +5017,7 @@ void ScVbaRange::setShowDetail(const uno::Any& aShowDetail)
if( (thisAddress.StartRow != thisAddress.EndRow || thisAddress.EndRow != aOutlineAddress.EndRow ) &&
(thisAddress.StartColumn != thisAddress.EndColumn || thisAddress.EndColumn != aOutlineAddress.EndColumn ))
{
throw uno::RuntimeException("Can not set Range.ShowDetail attribute" );
throw uno::RuntimeException(u"Can not set Range.ShowDetail attribute"_ustr );
}
// #FIXME, seems there is a different behavior between MSO and OOo.
@@ -5186,7 +5186,7 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const
eCmd = FILL_GROWTH;
break;
case excel::XlAutoFillType::xlFillFormats:
throw uno::RuntimeException("xlFillFormat not supported for AutoFill" );
throw uno::RuntimeException(u"xlFillFormat not supported for AutoFill"_ustr );
case excel::XlAutoFillType::xlFillValues:
case excel::XlAutoFillType::xlFillSeries:
case excel::XlAutoFillType::xlLinearTrend:
@@ -5660,7 +5660,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::Any( bAddPageBreaks));
xSubDescPropertySet->setPropertyValue(u"InsertPageBreaks"_ustr, uno::Any( bAddPageBreaks));
sal_Int32 nLen = _nTotalList.getLength();
uno::Sequence< sheet::SubTotalColumn > aColumns( nLen );
auto aColumnsRange = asNonConstRange(aColumns);
@@ -5726,7 +5726,7 @@ ScVbaRange::ExportAsFixedFormat(const css::uno::Any& Type, const css::uno::Any&
{
ScCellRangesBase* pUnoRangesBase = getCellRangesBase();
if (!pUnoRangesBase)
throw uno::RuntimeException("Failed to access underlying uno range object");
throw uno::RuntimeException(u"Failed to access underlying uno range object"_ustr);
ScDocShell* pShell = pUnoRangesBase->GetDocShell();
if (!pShell)
return;
@@ -5741,13 +5741,13 @@ ScVbaRange::ExportAsFixedFormat(const css::uno::Any& Type, const css::uno::Any&
OUString
ScVbaRange::getServiceImplName()
{
return "ScVbaRange";
return u"ScVbaRange"_ustr;
}
uno::Sequence< OUString >
ScVbaRange::getServiceNames()
{
return { "ooo.vba.excel.Range" };
return { u"ooo.vba.excel.Range"_ustr };
}
sal_Bool SAL_CALL
@@ -5761,7 +5761,7 @@ ScVbaRange::hasError()
uno::Sequence< uno::Any > Params{ uno::Any(aRange) };
uno::Sequence< sal_Int16 > OutParamIndex;
uno::Sequence< uno::Any > OutParam;
xInvoc->invoke( "IsError", Params, OutParamIndex, OutParam ) >>= dResult;
xInvoc->invoke( u"IsError"_ustr, Params, OutParamIndex, OutParam ) >>= dResult;
return dResult > 0.0;
}
+1 -1
View File
@@ -306,7 +306,7 @@ public:
// XDefaultMethod
OUString SAL_CALL getDefaultMethodName( ) override;
// XDefaultProperty
OUString SAL_CALL getDefaultPropertyName( ) override { return "Value"; }
OUString SAL_CALL getDefaultPropertyName( ) override { return u"Value"_ustr; }
// #TODO completely rewrite ScVbaRange, it's become a hackfest
// it needs to be closer to ScCellRangeBase in that the underlying
+21 -21
View File
@@ -150,18 +150,18 @@ void SAL_CALL ScVbaButtonCharacters::Delete()
// XHelperInterface
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButtonCharacters, "ooo.vba.excel.Characters" )
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButtonCharacters, u"ooo.vba.excel.Characters"_ustr )
// private
OUString ScVbaButtonCharacters::getFullString() const
{
return mxPropSet->getPropertyValue( "Label" ).get< OUString >();
return mxPropSet->getPropertyValue( u"Label"_ustr ).get< OUString >();
}
void ScVbaButtonCharacters::setFullString( const OUString& rString )
{
mxPropSet->setPropertyValue( "Label", uno::Any( rString ) );
mxPropSet->setPropertyValue( u"Label"_ustr, uno::Any( rString ) );
}
ScVbaSheetObjectBase::ScVbaSheetObjectBase(
@@ -229,12 +229,12 @@ void SAL_CALL ScVbaSheetObjectBase::setHeight( double fHeight )
OUString SAL_CALL ScVbaSheetObjectBase::getName()
{
return mxShapeProps->getPropertyValue( "Name" ).get< OUString >();
return mxShapeProps->getPropertyValue( u"Name"_ustr ).get< OUString >();
}
void SAL_CALL ScVbaSheetObjectBase::setName( const OUString& rName )
{
mxShapeProps->setPropertyValue( "Name", uno::Any( rName ) );
mxShapeProps->setPropertyValue( u"Name"_ustr, uno::Any( rName ) );
}
sal_Int32 SAL_CALL ScVbaSheetObjectBase::getPlacement()
@@ -318,12 +318,12 @@ ScVbaControlObjectBase::ScVbaControlObjectBase(
OUString SAL_CALL ScVbaControlObjectBase::getName()
{
return mxControlProps->getPropertyValue( "Name" ).get< OUString >();
return mxControlProps->getPropertyValue( u"Name"_ustr ).get< OUString >();
}
void SAL_CALL ScVbaControlObjectBase::setName( const OUString& rName )
{
mxControlProps->setPropertyValue( "Name", uno::Any( rName ) );
mxControlProps->setPropertyValue( u"Name"_ustr, uno::Any( rName ) );
}
OUString SAL_CALL ScVbaControlObjectBase::getOnAction()
@@ -379,12 +379,12 @@ void SAL_CALL ScVbaControlObjectBase::setOnAction( const OUString& rMacroName )
sal_Bool SAL_CALL ScVbaControlObjectBase::getPrintObject()
{
return mxControlProps->getPropertyValue( "Printable" ).get<bool>();
return mxControlProps->getPropertyValue( u"Printable"_ustr ).get<bool>();
}
void SAL_CALL ScVbaControlObjectBase::setPrintObject( sal_Bool bPrintObject )
{
mxControlProps->setPropertyValue( "Printable", uno::Any( bPrintObject ) );
mxControlProps->setPropertyValue( u"Printable"_ustr, uno::Any( bPrintObject ) );
}
// XControlObject attributes
@@ -427,12 +427,12 @@ ScVbaButton::ScVbaButton(
OUString SAL_CALL ScVbaButton::getCaption()
{
return mxControlProps->getPropertyValue( "Label" ).get< OUString >();
return mxControlProps->getPropertyValue( u"Label"_ustr ).get< OUString >();
}
void SAL_CALL ScVbaButton::setCaption( const OUString& rCaption )
{
mxControlProps->setPropertyValue( "Label", uno::Any( rCaption ) );
mxControlProps->setPropertyValue( u"Label"_ustr, uno::Any( rCaption ) );
}
uno::Reference< excel::XFont > SAL_CALL ScVbaButton::getFont()
@@ -447,7 +447,7 @@ void SAL_CALL ScVbaButton::setFont( const uno::Reference< excel::XFont >& /*rxFo
sal_Int32 SAL_CALL ScVbaButton::getHorizontalAlignment()
{
switch( mxControlProps->getPropertyValue( "Align" ).get< sal_Int16 >() )
switch( mxControlProps->getPropertyValue( u"Align"_ustr ).get< sal_Int16 >() )
{
case awt::TextAlign::LEFT: return excel::Constants::xlLeft;
case awt::TextAlign::RIGHT: return excel::Constants::xlRight;
@@ -466,12 +466,12 @@ void SAL_CALL ScVbaButton::setHorizontalAlignment( sal_Int32 nAlign )
case excel::Constants::xlCenter: nAwtAlign = awt::TextAlign::CENTER; break;
}
// form controls expect short value
mxControlProps->setPropertyValue( "Align", uno::Any( static_cast< sal_Int16 >( nAwtAlign ) ) );
mxControlProps->setPropertyValue( u"Align"_ustr, uno::Any( static_cast< sal_Int16 >( nAwtAlign ) ) );
}
sal_Int32 SAL_CALL ScVbaButton::getVerticalAlignment()
{
switch( mxControlProps->getPropertyValue( "VerticalAlign" ).get< style::VerticalAlignment >() )
switch( mxControlProps->getPropertyValue( u"VerticalAlign"_ustr ).get< style::VerticalAlignment >() )
{
case style::VerticalAlignment_TOP: return excel::Constants::xlTop;
case style::VerticalAlignment_BOTTOM: return excel::Constants::xlBottom;
@@ -490,7 +490,7 @@ void SAL_CALL ScVbaButton::setVerticalAlignment( sal_Int32 nAlign )
case excel::Constants::xlBottom: eAwtAlign = style::VerticalAlignment_BOTTOM; break;
case excel::Constants::xlCenter: eAwtAlign = style::VerticalAlignment_MIDDLE; break;
}
mxControlProps->setPropertyValue( "VerticalAlign", uno::Any( eAwtAlign ) );
mxControlProps->setPropertyValue( u"VerticalAlign"_ustr, uno::Any( eAwtAlign ) );
}
sal_Int32 SAL_CALL ScVbaButton::getOrientation()
@@ -506,22 +506,22 @@ void SAL_CALL ScVbaButton::setOrientation( sal_Int32 /*nOrientation*/ )
uno::Any SAL_CALL ScVbaButton::getValue()
{
return mxControlProps->getPropertyValue( "State" );
return mxControlProps->getPropertyValue( u"State"_ustr );
}
void SAL_CALL ScVbaButton::setValue( const uno::Any &nValue )
{
return mxControlProps->setPropertyValue( "State", nValue );
return mxControlProps->setPropertyValue( u"State"_ustr, nValue );
}
OUString SAL_CALL ScVbaButton::getText()
{
return mxControlProps->getPropertyValue( "Label" ).get< OUString >();
return mxControlProps->getPropertyValue( u"Label"_ustr ).get< OUString >();
}
void SAL_CALL ScVbaButton::setText( const OUString &aText )
{
return mxControlProps->setPropertyValue( "Label", uno::Any( aText ) );
return mxControlProps->setPropertyValue( u"Label"_ustr, uno::Any( aText ) );
}
// XButton methods
@@ -533,13 +533,13 @@ uno::Reference< excel::XCharacters > SAL_CALL ScVbaButton::Characters( const uno
// XHelperInterface
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButton, "ooo.vba.excel.Button" )
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButton, u"ooo.vba.excel.Button"_ustr )
// private
OUString ScVbaButton::implGetBaseName() const
{
return "Button";
return u"Button"_ustr;
}
void ScVbaButton::implSetDefaultProperties()
+9 -9
View File
@@ -264,7 +264,7 @@ sal_Bool SAL_CALL ScVbaObjectContainer::hasElements()
OUString ScVbaObjectContainer::implGetShapeName( const uno::Reference< drawing::XShape >& rxShape ) const
{
uno::Reference< beans::XPropertySet > xPropSet( rxShape, uno::UNO_QUERY_THROW );
return xPropSet->getPropertyValue( "Name" ).get< OUString >();
return xPropSet->getPropertyValue( u"Name"_ustr ).get< OUString >();
}
void ScVbaObjectContainer::implOnShapeCreated( const uno::Reference< drawing::XShape >& /*rxShape*/ )
@@ -423,14 +423,14 @@ uno::Reference< container::XIndexContainer > const & ScVbaControlContainer::crea
{
uno::Reference< form::XFormsSupplier > xFormsSupp( mxShapes, uno::UNO_QUERY_THROW );
uno::Reference< container::XNameContainer > xFormsNC( xFormsSupp->getForms(), uno::UNO_SET_THROW );
OUString aFormName = "Standard";
OUString aFormName = u"Standard"_ustr;
if( xFormsNC->hasByName( aFormName ) )
{
mxFormIC.set( xFormsNC->getByName( aFormName ), uno::UNO_QUERY_THROW );
}
else
{
uno::Reference< form::XForm > xForm( mxFactory->createInstance( "com.sun.star.form.component.Form" ), uno::UNO_QUERY_THROW );
uno::Reference< form::XForm > xForm( mxFactory->createInstance( u"com.sun.star.form.component.Form"_ustr ), uno::UNO_QUERY_THROW );
xFormsNC->insertByName( aFormName, uno::Any( xForm ) );
mxFormIC.set( xForm, uno::UNO_QUERY_THROW );
}
@@ -445,7 +445,7 @@ bool ScVbaControlContainer::implPickShape( const uno::Reference< drawing::XShape
uno::Reference< drawing::XControlShape > xControlShape( rxShape, uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xModelProps( xControlShape->getControl(), uno::UNO_QUERY_THROW );
sal_Int16 nClassId = -1;
return lclGetProperty( nClassId, xModelProps, "ClassId" ) &&
return lclGetProperty( nClassId, xModelProps, u"ClassId"_ustr ) &&
(nClassId == meType) && implCheckProperties( xModelProps );
}
catch( uno::Exception& )
@@ -456,7 +456,7 @@ bool ScVbaControlContainer::implPickShape( const uno::Reference< drawing::XShape
OUString ScVbaControlContainer::implGetShapeServiceName() const
{
return "com.sun.star.drawing.ControlShape";
return u"com.sun.star.drawing.ControlShape"_ustr;
}
bool ScVbaControlContainer::implCheckProperties( const uno::Reference< beans::XPropertySet >& /*rxModelProps*/ ) const
@@ -518,8 +518,8 @@ ScVbaButtonContainer::ScVbaButtonContainer(
rxParent, rxContext, rxModel, rxSheet,
cppu::UnoType<excel::XButton>::get(),
( bOptionButtons ?
OUString( "com.sun.star.form.component.RadioButton" ) :
OUString( "com.sun.star.form.component.CommandButton" ) ),
u"com.sun.star.form.component.RadioButton"_ustr :
u"com.sun.star.form.component.CommandButton"_ustr ),
( bOptionButtons ?
form::FormComponentType::RADIOBUTTON :
form::FormComponentType::COMMANDBUTTON) ),
@@ -540,7 +540,7 @@ bool ScVbaButtonContainer::implCheckProperties( const uno::Reference< beans::XPr
// do not insert toggle buttons into the 'Buttons' collection
bool bToggle = false;
return lclGetProperty( bToggle, rxModelProps, "Toggle" ) && !bToggle;
return lclGetProperty( bToggle, rxModelProps, u"Toggle"_ustr ) && !bToggle;
}
ScVbaButtons::ScVbaButtons(
@@ -553,6 +553,6 @@ ScVbaButtons::ScVbaButtons(
{
}
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButtons, "ooo.vba.excel.Buttons" )
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButtons, u"ooo.vba.excel.Buttons"_ustr )
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+4 -4
View File
@@ -31,7 +31,7 @@ uno::Reference< container::XNameAccess >
ScVbaStyle::getStylesNameContainer( const uno::Reference< frame::XModel >& xModel )
{
uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( xModel, uno::UNO_QUERY_THROW);
uno::Reference< container::XNameAccess > xStylesAccess( xStyleSupplier->getStyleFamilies()->getByName("CellStyles"), uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xStylesAccess( xStyleSupplier->getStyleFamilies()->getByName(u"CellStyles"_ustr), uno::UNO_QUERY_THROW );
return xStylesAccess;
}
@@ -50,7 +50,7 @@ void ScVbaStyle::initialise()
if (!mxModel.is() )
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, u"XModel Interface could not be retrieved" );
uno::Reference< lang::XServiceInfo > xServiceInfo( mxPropertySet, uno::UNO_QUERY_THROW );
if ( !xServiceInfo->supportsService("com.sun.star.style.CellStyle") )
if ( !xServiceInfo->supportsService(u"com.sun.star.style.CellStyle"_ustr) )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
@@ -167,7 +167,7 @@ ScVbaStyle::getMergeCells( )
OUString
ScVbaStyle::getServiceImplName()
{
return "ScVbaStyle";
return u"ScVbaStyle"_ustr;
}
uno::Sequence< OUString >
@@ -175,7 +175,7 @@ ScVbaStyle::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.XStyle"
u"ooo.vba.excel.XStyle"_ustr
};
return aServiceNames;
}
+4 -4
View File
@@ -133,7 +133,7 @@ ScVbaStyles::Add( const OUString& _sName, const uno::Any& _aBasedOn )
uno::Reference< excel::XStyle > aRet;
try
{
OUString sParentCellStyleName("Default");
OUString sParentCellStyleName(u"Default"_ustr);
if ( _aBasedOn.hasValue() )
{
uno::Reference< excel::XRange > oRange;
@@ -148,7 +148,7 @@ ScVbaStyles::Add( const OUString& _sName, const uno::Any& _aBasedOn )
}
}
uno::Reference< style::XStyle > xStyle( mxMSF->createInstance("com.sun.star.style.CellStyle"), uno::UNO_QUERY_THROW );
uno::Reference< style::XStyle > xStyle( mxMSF->createInstance(u"com.sun.star.style.CellStyle"_ustr), uno::UNO_QUERY_THROW );
if (!mxNameContainerCellStyles->hasByName(_sName))
{
@@ -184,7 +184,7 @@ ScVbaStyles::Delete(const OUString& _sStyleName)
OUString
ScVbaStyles::getServiceImplName()
{
return "ScVbaStyles";
return u"ScVbaStyles"_ustr;
}
uno::Sequence< OUString >
@@ -192,7 +192,7 @@ ScVbaStyles::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.XStyles"
u"ooo.vba.excel.XStyles"_ustr
};
return aServiceNames;
}
+1 -1
View File
@@ -50,7 +50,7 @@ ScVbaTextBoxShape::characters( const uno::Any& Start, const uno::Any& Length )
ScDocument* pDoc = pDocShell ? &pDocShell->GetDocument() : nullptr;
if ( !pDoc )
throw uno::RuntimeException("Failed to access document from shell" );
throw uno::RuntimeException(u"Failed to access document from shell"_ustr );
uno::Reference< text::XSimpleText > xSimple( m_xTextRange, uno::UNO_QUERY_THROW );
ScVbaPalette aPalette( pDoc->GetDocumentShell() );
+2 -2
View File
@@ -43,7 +43,7 @@ ScVbaTextFrame::Characters()
OUString
ScVbaTextFrame::getServiceImplName()
{
return "ScVbaTextFrame";
return u"ScVbaTextFrame"_ustr;
}
uno::Sequence< OUString >
@@ -51,7 +51,7 @@ ScVbaTextFrame::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.TextFrame"
u"ooo.vba.excel.TextFrame"_ustr
};
return aServiceNames;
}
+6 -6
View File
@@ -68,7 +68,7 @@ public:
{
try
{
xShapePropertySet->setPropertyValue("String", css::uno::Any( Text ));
xShapePropertySet->setPropertyValue(u"String"_ustr, css::uno::Any( Text ));
}
catch ( css::uno::Exception& )
{
@@ -80,7 +80,7 @@ public:
OUString sText;
try
{
xShapePropertySet->getPropertyValue("String") >>= sText;
xShapePropertySet->getPropertyValue(u"String"_ustr) >>= sText;
}
catch ( css::uno::Exception& )
{
@@ -109,7 +109,7 @@ public:
{
try
{
xShapePropertySet->setPropertyValue("TextRotation", css::uno::Any(_nOrientation*100));
xShapePropertySet->setPropertyValue(u"TextRotation"_ustr, css::uno::Any(_nOrientation*100));
}
catch (css::uno::Exception& )
{
@@ -121,7 +121,7 @@ public:
sal_Int32 nSOOrientation = 0;
try
{
xShapePropertySet->getPropertyValue("TextRotation") >>= nSOOrientation;
xShapePropertySet->getPropertyValue(u"TextRotation"_ustr) >>= nSOOrientation;
}
catch (css::uno::Exception& )
{
@@ -132,11 +132,11 @@ public:
// XHelperInterface
OUString getServiceImplName() override
{
return "TitleImpl";
return u"TitleImpl"_ustr;
}
css::uno::Sequence< OUString > getServiceNames() override
{
static const css::uno::Sequence< OUString > aServiceNames{ "ooo.vba.excel.XTitle" };
static const css::uno::Sequence< OUString > aServiceNames{ u"ooo.vba.excel.XTitle"_ustr };
return aServiceNames;
}
};
+7 -7
View File
@@ -238,10 +238,10 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un
sheet::ValidationType nValType = sheet::ValidationType_ANY;
xProps->getPropertyValue( SC_UNONAME_TYPE ) >>= nValType;
if ( nValType != sheet::ValidationType_ANY )
throw uno::RuntimeException("validation object already exists" );
throw uno::RuntimeException(u"validation object already exists"_ustr );
sal_Int32 nType = -1;
if ( !Type.hasValue() || !( Type >>= nType ) )
throw uno::RuntimeException("missing required param" );
throw uno::RuntimeException(u"missing required param"_ustr );
Delete(); // set up defaults
OUString sFormula1;
@@ -255,7 +255,7 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un
// for validate list
// at least formula1 is required
if ( !Formula1.hasValue() )
throw uno::RuntimeException("missing param" );
throw uno::RuntimeException(u"missing param"_ustr );
nValType = sheet::ValidationType_LIST;
xProps->setPropertyValue( SC_UNONAME_TYPE, uno::Any(nValType ));
// #TODO validate required params
@@ -267,7 +267,7 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un
xProps->setPropertyValue( SC_UNONAME_TYPE, uno::Any(nValType ));
break;
default:
throw uno::RuntimeException("unsupported operation..." );
throw uno::RuntimeException(u"unsupported operation..."_ustr );
}
sheet::ValidationAlertStyle eStyle = sheet::ValidationAlertStyle_STOP;
@@ -288,7 +288,7 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un
eStyle = sheet::ValidationAlertStyle_INFO;
break;
default:
throw uno::RuntimeException("bad param..." );
throw uno::RuntimeException(u"bad param..."_ustr );
}
}
@@ -384,7 +384,7 @@ ScVbaValidation::getType()
OUString
ScVbaValidation::getServiceImplName()
{
return "ScVbaValidation";
return u"ScVbaValidation"_ustr;
}
uno::Sequence< OUString >
@@ -392,7 +392,7 @@ ScVbaValidation::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Validation"
u"ooo.vba.excel.Validation"_ustr
};
return aServiceNames;
}
+6 -6
View File
@@ -106,14 +106,14 @@ public:
{
ScModelObj* pModel = static_cast< ScModelObj* >( xModel.get() );
if ( !pModel )
throw uno::RuntimeException("Cannot obtain current document" );
throw uno::RuntimeException(u"Cannot obtain current document"_ustr );
m_xModel = pModel;
ScDocShell* pDocShell = static_cast<ScDocShell*>(pModel->GetEmbeddedObject());
if ( !pDocShell )
throw uno::RuntimeException("Cannot obtain docshell" );
throw uno::RuntimeException(u"Cannot obtain docshell"_ustr );
ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel );
if ( !pViewShell )
throw uno::RuntimeException("Cannot obtain view shell" );
throw uno::RuntimeException(u"Cannot obtain view shell"_ustr );
SCTAB nTabCount = pDocShell->GetDocument().GetTableCount();
SCTAB nIndex = 0;
@@ -411,7 +411,7 @@ ScVbaWindow::setWindowState( const uno::Any& _windowstate )
else if (nwindowState == xlNormal)
pWork -> Restore();
else
throw uno::RuntimeException("Invalid Parameter" );
throw uno::RuntimeException(u"Invalid Parameter"_ustr );
}
}
@@ -846,7 +846,7 @@ void SAL_CALL ScVbaWindow::setTabRatio( double fRatio )
OUString
ScVbaWindow::getServiceImplName()
{
return "ScVbaWindow";
return u"ScVbaWindow"_ustr;
}
uno::Sequence< OUString >
@@ -854,7 +854,7 @@ ScVbaWindow::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Window"
u"ooo.vba.excel.Window"_ustr
};
return aServiceNames;
}
+3 -3
View File
@@ -134,7 +134,7 @@ public:
{
css::uno::Reference<css::container::XNameAccess> xNameAccess(m_xContext,
css::uno::UNO_QUERY_THROW);
const auto aAppplication = xNameAccess->getByName("Application");
const auto aAppplication = xNameAccess->getByName(u"Application"_ustr);
uno::Reference< container::XEnumeration > xEnum = new WindowComponentEnumImpl( m_xContext );
sal_Int32 nIndex=0;
@@ -256,7 +256,7 @@ ScVbaWindows::Arrange( ::sal_Int32 /*ArrangeStyle*/, const uno::Any& /*ActiveWor
OUString
ScVbaWindows::getServiceImplName()
{
return "ScVbaWindows";
return u"ScVbaWindows"_ustr;
}
css::uno::Sequence<OUString>
@@ -264,7 +264,7 @@ ScVbaWindows::getServiceNames()
{
static uno::Sequence< OUString > const sNames
{
"ooo.vba.excel.Windows"
u"ooo.vba.excel.Windows"_ustr
};
return sNames;
}
+14 -14
View File
@@ -92,26 +92,26 @@ bool ScVbaWorkbook::setFilterPropsFromFormat( sal_Int32 nFormat, uno::Sequence<
pProp->Value <<= SC_TEXT_CSV_FILTER_NAME;
break;
case excel::XlFileFormat::xlDBF4:
pProp->Value <<= OUString("DBF");
pProp->Value <<= u"DBF"_ustr;
break;
case excel::XlFileFormat::xlDIF:
pProp->Value <<= OUString("DIF");
pProp->Value <<= u"DIF"_ustr;
break;
case excel::XlFileFormat::xlWK3:
pProp->Value <<= OUString("Lotus");
pProp->Value <<= u"Lotus"_ustr;
break;
case excel::XlFileFormat::xlExcel4Workbook:
pProp->Value <<= OUString("MS Excel 4.0");
pProp->Value <<= u"MS Excel 4.0"_ustr;
break;
case excel::XlFileFormat::xlExcel5:
pProp->Value <<= OUString("MS Excel 5.0/95");
pProp->Value <<= u"MS Excel 5.0/95"_ustr;
break;
case excel::XlFileFormat::xlHtml:
pProp->Value <<= OUString("HTML (StarCalc)");
pProp->Value <<= u"HTML (StarCalc)"_ustr;
break;
case excel::XlFileFormat::xlExcel9795:
default:
pProp->Value <<= OUString("MS Excel 97");
pProp->Value <<= u"MS Excel 97"_ustr;
break;
}
}
@@ -286,7 +286,7 @@ OUString SAL_CALL ScVbaWorkbook::getAuthor()
{
uno::Reference<document::XDocumentPropertiesSupplier> xDPS( getModel(), uno::UNO_QUERY );
if (!xDPS.is())
return "?";
return u"?"_ustr;
uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties();
return xDocProps->getAuthor();
}
@@ -307,7 +307,7 @@ ScVbaWorkbook::SaveCopyAs( const OUString& sFileName )
osl::FileBase::getFileURLFromSystemPath( sFileName, aURL );
uno::Reference< frame::XStorable > xStor( getModel(), uno::UNO_QUERY_THROW );
uno::Sequence< beans::PropertyValue > storeProps{ comphelper::makePropertyValue(
"FilterName", OUString( "MS Excel 97" )) };
u"FilterName"_ustr, u"MS Excel 97"_ustr) };
xStor->storeToURL( aURL, storeProps );
}
@@ -349,7 +349,7 @@ ScVbaWorkbook::SaveAs( const uno::Any& FileName, const uno::Any& FileFormat, con
sal_Int32 nFileFormat = excel::XlFileFormat::xlExcel9795;
FileFormat >>= nFileFormat;
uno::Sequence storeProps{ comphelper::makePropertyValue("FilterName", uno::Any()) };
uno::Sequence storeProps{ comphelper::makePropertyValue(u"FilterName"_ustr, uno::Any()) };
setFilterPropsFromFormat( nFileFormat, storeProps );
uno::Reference< frame::XStorable > xStor( getModel(), uno::UNO_QUERY_THROW );
@@ -385,7 +385,7 @@ ScVbaWorkbook::Names( const uno::Any& aIndex )
{
uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_SET_THROW );
uno::Reference< beans::XPropertySet > xProps( xModel, uno::UNO_QUERY_THROW );
uno::Reference< sheet::XNamedRanges > xNamedRanges( xProps->getPropertyValue("NamedRanges"), uno::UNO_QUERY_THROW );
uno::Reference< sheet::XNamedRanges > xNamedRanges( xProps->getPropertyValue(u"NamedRanges"_ustr), uno::UNO_QUERY_THROW );
uno::Reference< XCollection > xNames( new ScVbaNames( this, mxContext, xNamedRanges, xModel ) );
if ( aIndex.hasValue() )
return xNames->Item( aIndex, uno::Any() );
@@ -395,7 +395,7 @@ ScVbaWorkbook::Names( const uno::Any& aIndex )
OUString
ScVbaWorkbook::getServiceImplName()
{
return "ScVbaWorkbook";
return u"ScVbaWorkbook"_ustr;
}
uno::Sequence< OUString >
@@ -403,7 +403,7 @@ ScVbaWorkbook::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Workbook"
u"ooo.vba.excel.Workbook"_ustr
};
return aServiceNames;
}
@@ -412,7 +412,7 @@ OUString SAL_CALL
ScVbaWorkbook::getCodeName()
{
uno::Reference< beans::XPropertySet > xModelProp( getModel(), uno::UNO_QUERY_THROW );
return xModelProp->getPropertyValue("CodeName").get< OUString >();
return xModelProp->getPropertyValue(u"CodeName"_ustr).get< OUString >();
}
sal_Int64
+11 -11
View File
@@ -183,8 +183,8 @@ ScVbaWorkbooks::isSpreadSheetFile( std::u16string_view sType )
OUString
ScVbaWorkbooks::getFileFilterType( const OUString& rFileName )
{
uno::Reference< document::XTypeDetection > xTypeDetect( mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.TypeDetection", mxContext), uno::UNO_QUERY_THROW );
uno::Sequence aMediaDesc{ comphelper::makePropertyValue("URL", rFileName) };
uno::Reference< document::XTypeDetection > xTypeDetect( mxContext->getServiceManager()->createInstanceWithContext(u"com.sun.star.document.TypeDetection"_ustr, mxContext), uno::UNO_QUERY_THROW );
uno::Sequence aMediaDesc{ comphelper::makePropertyValue(u"URL"_ustr, rFileName) };
OUString sType = xTypeDetect->queryTypeByDescriptor( aMediaDesc, true );
return sType;
}
@@ -227,7 +227,7 @@ ScVbaWorkbooks::Open( const OUString& rFileName, const uno::Any& /*UpdateLinks*/
Format >>= nFormat; // val of nFormat overwritten if extracted
// validate param
if ( nFormat < 1 || nFormat > 6 )
throw uno::RuntimeException("Illegal value for Format" );
throw uno::RuntimeException(u"Illegal value for Format"_ustr );
}
sal_Int16 nDelim = getCurrentDelim();
@@ -240,11 +240,11 @@ ScVbaWorkbooks::Open( const OUString& rFileName, const uno::Any& /*UpdateLinks*/
{
// Need to check Delimiter param
if ( !Delimiter.hasValue() )
throw uno::RuntimeException("Expected value for Delimiter" );
throw uno::RuntimeException(u"Expected value for Delimiter"_ustr );
OUString sStr;
Delimiter >>= sStr;
if ( sStr.isEmpty() )
throw uno::RuntimeException("Incorrect value for Delimiter" );
throw uno::RuntimeException(u"Incorrect value for Delimiter"_ustr );
nDelim = sStr[0];
@@ -254,15 +254,15 @@ ScVbaWorkbooks::Open( const OUString& rFileName, const uno::Any& /*UpdateLinks*/
sFormat = OUString::number( nDelim ) + ",34,0,1";
sProps = { comphelper::makePropertyValue("FilterOptions", sFormat),
comphelper::makePropertyValue("FilterName", SC_TEXT_CSV_FILTER_NAME),
sProps = { comphelper::makePropertyValue(u"FilterOptions"_ustr, sFormat),
comphelper::makePropertyValue(u"FilterName"_ustr, SC_TEXT_CSV_FILTER_NAME),
// Ensure WORKAROUND_CSV_TXT_BUG_i60158 gets called in typedetection.cxx so
// csv is forced for deep detected 'writerxxx' types
comphelper::makePropertyValue(
"DocumentService", OUString("com.sun.star.sheet.SpreadsheetDocument")) };
u"DocumentService"_ustr, u"com.sun.star.sheet.SpreadsheetDocument"_ustr) };
}
else if ( !isSpreadSheetFile( sType ) )
throw uno::RuntimeException("Bad Format" );
throw uno::RuntimeException(u"Bad Format"_ustr );
uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( openDocument( rFileName, ReadOnly, sProps ), uno::UNO_QUERY_THROW );
uno::Any aRet = getWorkbook( mxContext, xSpreadDoc, mxParent );
@@ -275,7 +275,7 @@ ScVbaWorkbooks::Open( const OUString& rFileName, const uno::Any& /*UpdateLinks*/
OUString
ScVbaWorkbooks::getServiceImplName()
{
return "ScVbaWorkbooks";
return u"ScVbaWorkbooks"_ustr;
}
css::uno::Sequence<OUString>
@@ -283,7 +283,7 @@ ScVbaWorkbooks::getServiceNames()
{
static uno::Sequence< OUString > const sNames
{
"ooo.vba.excel.Workbooks"
u"ooo.vba.excel.Workbooks"_ustr
};
return sNames;
}
+15 -15
View File
@@ -88,7 +88,7 @@ using namespace ooo::vba;
static void getNewSpreadsheetName (OUString &aNewName, std::u16string_view aOldName, const uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc )
{
if (!xSpreadDoc.is())
throw lang::IllegalArgumentException( "getNewSpreadsheetName() xSpreadDoc is null", uno::Reference< uno::XInterface >(), 1 );
throw lang::IllegalArgumentException( u"getNewSpreadsheetName() xSpreadDoc is null"_ustr, uno::Reference< uno::XInterface >(), 1 );
static const char aUnderScore[] = "_";
int currentNum =2;
aNewName = OUString::Concat(aOldName) + aUnderScore + OUString::number(currentNum) ;
@@ -102,7 +102,7 @@ static void getNewSpreadsheetName (OUString &aNewName, std::u16string_view aOldN
static void removeAllSheets( const uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc, const OUString& aSheetName)
{
if (!xSpreadDoc.is())
throw lang::IllegalArgumentException( "removeAllSheets() xSpreadDoc is null", uno::Reference< uno::XInterface >(), 1 );
throw lang::IllegalArgumentException( u"removeAllSheets() xSpreadDoc is null"_ustr, uno::Reference< uno::XInterface >(), 1 );
uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
uno::Reference <container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
@@ -134,8 +134,8 @@ openNewDoc(const OUString& aSheetName )
uno::Reference <frame::XDesktop2 > xComponentLoader = frame::Desktop::create(xContext);
uno::Reference<lang::XComponent > xComponent( xComponentLoader->loadComponentFromURL(
"private:factory/scalc",
"_blank", 0,
u"private:factory/scalc"_ustr,
u"_blank"_ustr, 0,
uno::Sequence < css::beans::PropertyValue >() ) );
uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( xComponent, uno::UNO_QUERY_THROW );
removeAllSheets(xSpreadDoc,aSheetName);
@@ -265,7 +265,7 @@ ScVbaWorksheet::getVisible()
{
uno::Reference< beans::XPropertySet > xProps( getSheet(), uno::UNO_QUERY_THROW );
bool bVisible = false;
xProps->getPropertyValue( "IsVisible" ) >>= bVisible;
xProps->getPropertyValue( u"IsVisible"_ustr ) >>= bVisible;
using namespace ::ooo::vba::excel::XlSheetVisibility;
return bVisible ? xlSheetVisible : (mbVeryHidden ? xlSheetVeryHidden : xlSheetHidden);
}
@@ -293,7 +293,7 @@ ScVbaWorksheet::setVisible( sal_Int32 nVisible )
throw uno::RuntimeException();
}
uno::Reference< beans::XPropertySet > xProps( getSheet(), uno::UNO_QUERY_THROW );
xProps->setPropertyValue( "IsVisible", uno::Any( bVisible ) );
xProps->setPropertyValue( u"IsVisible"_ustr, uno::Any( bVisible ) );
}
sal_Int16
@@ -308,7 +308,7 @@ ScVbaWorksheet::getEnableSelection()
uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( getModel(), uno::UNO_QUERY_THROW );
SCTAB nTab = 0;
if ( !ScVbaWorksheets::nameExists(xSpreadDoc, getName(), nTab) )
throw uno::RuntimeException("Sheet Name does not exist." );
throw uno::RuntimeException(u"Sheet Name does not exist."_ustr );
if ( ScDocShell* pShell = excel::getDocShell( getModel() ))
{
@@ -343,7 +343,7 @@ ScVbaWorksheet::setEnableSelection( sal_Int32 nSelection )
uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( getModel(), uno::UNO_QUERY_THROW );
SCTAB nTab = 0;
if ( !ScVbaWorksheets::nameExists(xSpreadDoc, getName(), nTab) )
throw uno::RuntimeException("Sheet Name does not exist." );
throw uno::RuntimeException(u"Sheet Name does not exist."_ustr );
if ( ScDocShell* pShell = excel::getDocShell( getModel() ))
{
@@ -662,7 +662,7 @@ ScVbaWorksheet::CheckSpelling( const uno::Any& /*CustomDictionary*/,const uno::A
{
// #TODO# #FIXME# unused params above, can we do anything with those
uno::Reference< frame::XModel > xModel( getModel() );
dispatchRequests(xModel,".uno:SpellDialog");
dispatchRequests(xModel,u".uno:SpellDialog"_ustr);
}
uno::Reference< excel::XRange >
@@ -761,7 +761,7 @@ uno::Any SAL_CALL
ScVbaWorksheet::Names( const css::uno::Any& aIndex )
{
css::uno::Reference<css::beans::XPropertySet> xProps(getSheet(), css::uno::UNO_QUERY_THROW);
uno::Reference< sheet::XNamedRanges > xNamedRanges( xProps->getPropertyValue("NamedRanges"), uno::UNO_QUERY_THROW );
uno::Reference< sheet::XNamedRanges > xNamedRanges( xProps->getPropertyValue(u"NamedRanges"_ustr), uno::UNO_QUERY_THROW );
uno::Reference< XCollection > xNames( new ScVbaNames( this, mxContext, xNamedRanges, mxModel ) );
if ( aIndex.hasValue() )
return xNames->Item( aIndex, uno::Any() );
@@ -897,7 +897,7 @@ ScVbaWorksheet::getIntrospection( )
uno::Any SAL_CALL
ScVbaWorksheet::invoke( const OUString& /*aFunctionName*/, const uno::Sequence< uno::Any >& /*aParams*/, uno::Sequence< ::sal_Int16 >& /*aOutParamIndex*/, uno::Sequence< uno::Any >& /*aOutParam*/ )
{
throw uno::RuntimeException("Unsupported"); // unsupported operation
throw uno::RuntimeException(u"Unsupported"_ustr); // unsupported operation
}
void SAL_CALL
@@ -911,7 +911,7 @@ ScVbaWorksheet::getValue( const OUString& aPropertyName )
uno::Reference< drawing::XControlShape > xControlShape( getControlShape( aPropertyName ), uno::UNO_QUERY_THROW );
uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW );
uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext("ooo.vba.ControlProvider", mxContext ), uno::UNO_QUERY_THROW );
uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext(u"ooo.vba.ControlProvider"_ustr, mxContext ), uno::UNO_QUERY_THROW );
uno::Reference< msforms::XControl > xControl( xControlProvider->createControl( xControlShape, getModel() ) );
return uno::Any( xControl );
}
@@ -990,7 +990,7 @@ ScVbaWorksheet::getControlShape( std::u16string_view sName )
OUString
ScVbaWorksheet::getServiceImplName()
{
return "ScVbaWorksheet";
return u"ScVbaWorksheet"_ustr;
}
void SAL_CALL
@@ -1011,7 +1011,7 @@ ScVbaWorksheet::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.Worksheet"
u"ooo.vba.excel.Worksheet"_ustr
};
return aServiceNames;
}
@@ -1020,7 +1020,7 @@ OUString SAL_CALL
ScVbaWorksheet::getCodeName()
{
uno::Reference< beans::XPropertySet > xSheetProp( mxSheet, uno::UNO_QUERY_THROW );
return xSheetProp->getPropertyValue("CodeName").get< OUString >();
return xSheetProp->getPropertyValue(u"CodeName"_ustr).get< OUString >();
}
sal_Int16
+6 -6
View File
@@ -261,7 +261,7 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After,
nSheetIndex++;
SCTAB nSheetName = nCount + 1;
OUString aStringBase( "Sheet" );
OUString aStringBase( u"Sheet"_ustr );
uno::Any result;
for (SCTAB i=0; i < nNewSheets; i++, nSheetName++)
{
@@ -339,7 +339,7 @@ ScVbaWorksheets::setVisible( const uno::Any& _visible )
{
bool bState = false;
if ( !(_visible >>= bState) )
throw uno::RuntimeException("Visible property doesn't support non boolean #FIXME" );
throw uno::RuntimeException(u"Visible property doesn't support non boolean #FIXME"_ustr );
uno::Reference< container::XEnumeration > xEnum( createEnumeration(), uno::UNO_SET_THROW );
while ( xEnum->hasMoreElements() )
@@ -355,7 +355,7 @@ ScVbaWorksheets::Select( const uno::Any& Replace )
{
ScTabViewShell* pViewShell = excel::getBestViewShell( mxModel );
if ( !pViewShell )
throw uno::RuntimeException("Cannot obtain view shell" );
throw uno::RuntimeException(u"Cannot obtain view shell"_ustr );
ScMarkData& rMarkData = pViewShell->GetViewData().GetMarkData();
bool bReplace = true;
@@ -450,7 +450,7 @@ ScVbaWorksheets::Item(const uno::Any& Index, const uno::Any& Index2)
OUString
ScVbaWorksheets::getServiceImplName()
{
return "ScVbaWorksheets";
return u"ScVbaWorksheets"_ustr;
}
css::uno::Sequence<OUString>
@@ -458,7 +458,7 @@ ScVbaWorksheets::getServiceNames()
{
static uno::Sequence< OUString > const sNames
{
"ooo.vba.excel.Worksheets"
u"ooo.vba.excel.Worksheets"_ustr
};
return sNames;
}
@@ -466,7 +466,7 @@ ScVbaWorksheets::getServiceNames()
bool ScVbaWorksheets::nameExists( const uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc, std::u16string_view name, SCTAB& nTab )
{
if (!xSpreadDoc.is())
throw lang::IllegalArgumentException( "nameExists() xSpreadDoc is null", uno::Reference< uno::XInterface >(), 1 );
throw lang::IllegalArgumentException( u"nameExists() xSpreadDoc is null"_ustr, uno::Reference< uno::XInterface >(), 1 );
uno::Reference <container::XIndexAccess> xIndex( xSpreadDoc->getSheets(), uno::UNO_QUERY );
if ( xIndex.is() )
{
+4 -4
View File
@@ -168,10 +168,10 @@ ScVbaWSFunction::invoke(const OUString& FunctionName, const uno::Sequence< uno::
{
uno::Reference< lang::XMultiComponentFactory > xSMgr( mxContext->getServiceManager(), uno::UNO_SET_THROW );
uno::Reference< sheet::XFunctionAccess > xFunctionAccess( xSMgr->createInstanceWithContext(
"com.sun.star.sheet.FunctionAccess", mxContext ),
u"com.sun.star.sheet.FunctionAccess"_ustr, mxContext ),
uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xPropSet( xFunctionAccess, uno::UNO_QUERY_THROW );
xPropSet->setPropertyValue("IsArrayFunction", uno::Any( bAsArray ) );
xPropSet->setPropertyValue(u"IsArrayFunction"_ustr, uno::Any( bAsArray ) );
aRet = xFunctionAccess->callFunction( FunctionName, aParamTemp );
}
@@ -282,7 +282,7 @@ ScVbaWSFunction::getExactName( const OUString& aApproximateName )
OUString
ScVbaWSFunction::getServiceImplName()
{
return "ScVbaWSFunction";
return u"ScVbaWSFunction"_ustr;
}
uno::Sequence< OUString >
@@ -290,7 +290,7 @@ ScVbaWSFunction::getServiceNames()
{
static uno::Sequence< OUString > const aServiceNames
{
"ooo.vba.excel.WorksheetFunction"
u"ooo.vba.excel.WorksheetFunction"_ustr
};
return aServiceNames;
}