diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-14 08:19:47 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-15 06:07:36 +0200 |
commit | 05bc93db2de56000f65764d7e394d03747cac23d (patch) | |
tree | 975de9ae83572aac8a5c3ea8db281e1017ee5be0 /sc/source/filter/xml/xmlexprt.cxx | |
parent | 8cbb414ed737f9ffc76e1258e6671769bf63fc6c (diff) |
Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 1
The header got some changes:
1. Move UnoTunnelIdInit and isUnoTunnelId into 'comphelper' namespace
2. Rename UnoTunnelIdInit to UnoIdInit, as a precondition to replace
of uses of OImplementationId with it, including in XTypeProvider
3. Introduce convenience functions 'getSomething_cast' to cast between
sal_Int64 and object pointers uniformly.
4. Rename getUnoTunnelImplementation to getFromUnoTunnel, both to make
it a bit shorter, and to reflect its function better. Templatize it
to take also css::uno::Any for convenience.
5. Introduce getSomethingImpl, inspired by sw::UnoTunnelImpl; allow it
handle cases both with and without fallback to parent.
6. Adjust UNO3_GETIMPLEMENTATION_* macros
TODO (in separate commits):
- Drop sw::UnoTunnelImpl and sw::UnoTunnelGetImplementation
- Replace all uses of OImplementationId in core with UnoIdInit
- Deprecate OImplementationId in <cppuhelper/typeprovider.hxx>
- Change implementations of getSomething to use getSomethingImpl
- Revise uses of getSomething to use getFromUnoTunnel
Change-Id: If4a3cb024130f1f552f988f0479589da1cd066e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122022
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/filter/xml/xmlexprt.cxx')
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 1821eefbbd53..79ea4631d5ac 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -458,7 +458,7 @@ void ScXMLExport::SetSourceStream( const uno::Reference<io::XInputStream>& xNewS // keep track of the bytes already read nSourceStreamPos = nRead; - const ScSheetSaveData* pSheetData = comphelper::getUnoTunnelImplementation<ScModelObj>(GetModel())->GetSheetSaveData(); + const ScSheetSaveData* pSheetData = comphelper::getFromUnoTunnel<ScModelObj>(GetModel())->GetSheetSaveData(); if (pSheetData) { // add the loaded namespaces to the name space map @@ -1849,7 +1849,7 @@ const ScXMLEditAttributeMap& ScXMLExport::GetEditAttributeMap() const void ScXMLExport::RegisterDefinedStyleNames( const uno::Reference< css::sheet::XSpreadsheetDocument > & xSpreadDoc ) { - ScFormatSaveData* pFormatData = comphelper::getUnoTunnelImplementation<ScModelObj>(xSpreadDoc)->GetFormatSaveData(); + ScFormatSaveData* pFormatData = comphelper::getFromUnoTunnel<ScModelObj>(xSpreadDoc)->GetFormatSaveData(); auto xAutoStylePool = GetAutoStylePool(); for (const auto& rFormatInfo : pFormatData->maIDToName) { @@ -1877,7 +1877,7 @@ void ScXMLExport::ExportContent_() if ( !xSpreadDoc.is() ) return; - ScSheetSaveData* pSheetData = comphelper::getUnoTunnelImplementation<ScModelObj>(xSpreadDoc)->GetSheetSaveData(); + ScSheetSaveData* pSheetData = comphelper::getFromUnoTunnel<ScModelObj>(xSpreadDoc)->GetSheetSaveData(); if (pSheetData) pSheetData->ResetSaveEntries(); @@ -2078,7 +2078,7 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x if (nKey) { uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( GetModel(), uno::UNO_QUERY ); - ScFormatSaveData* pFormatData = comphelper::getUnoTunnelImplementation<ScModelObj>(xSpreadDoc)->GetFormatSaveData(); + ScFormatSaveData* pFormatData = comphelper::getFromUnoTunnel<ScModelObj>(xSpreadDoc)->GetFormatSaveData(); auto itr = pFormatData->maIDToName.find(nKey); if (itr != pFormatData->maIDToName.end()) { @@ -2243,7 +2243,7 @@ void ScXMLExport::collectAutoStyles() RegisterDefinedStyleNames( xSpreadDoc); // re-create automatic styles with old names from stored data - ScSheetSaveData* pSheetData = comphelper::getUnoTunnelImplementation<ScModelObj>(xSpreadDoc)->GetSheetSaveData(); + ScSheetSaveData* pSheetData = comphelper::getFromUnoTunnel<ScModelObj>(xSpreadDoc)->GetSheetSaveData(); if (pSheetData && pDoc) { // formulas have to be calculated now, to detect changed results @@ -2422,7 +2422,7 @@ void ScXMLExport::collectAutoStyles() SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos ); uno::Reference<text::XSimpleText> xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xCursorProp(xCellText->createTextCursor(), uno::UNO_QUERY); - ScDrawTextCursor* pCursor = comphelper::getUnoTunnelImplementation<ScDrawTextCursor>( xCursorProp ); + ScDrawTextCursor* pCursor = comphelper::getFromUnoTunnel<ScDrawTextCursor>( xCursorProp ); if (pCursor) { pCursor->SetSelection( rNoteTextEntry.maSelection ); @@ -2463,7 +2463,7 @@ void ScXMLExport::collectAutoStyles() uno::Reference<text::XSimpleText> xCellText(xCellRange->getCellByPosition(aPos.Col(), aPos.Row()), uno::UNO_QUERY); xCursorProp.set(xCellText->createTextCursor(), uno::UNO_QUERY); } - ScCellTextCursor* pCursor = comphelper::getUnoTunnelImplementation<ScCellTextCursor>( xCursorProp ); + ScCellTextCursor* pCursor = comphelper::getFromUnoTunnel<ScCellTextCursor>( xCursorProp ); if (!pCursor) continue; pCursor->SetSelection( rTextEntry.maSelection ); @@ -5170,7 +5170,7 @@ void ScXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps) { rProps.realloc(4); beans::PropertyValue* pProps(rProps.getArray()); - ScModelObj* pDocObj(comphelper::getUnoTunnelImplementation<ScModelObj>( GetModel() )); + ScModelObj* pDocObj(comphelper::getFromUnoTunnel<ScModelObj>( GetModel() )); if (pDocObj) { SfxObjectShell* pEmbeddedObj = pDocObj->GetEmbeddedObject(); @@ -5322,7 +5322,7 @@ ErrCode ScXMLExport::exportDoc( enum XMLTokenEnum eClass ) uno::Reference< frame::XModel > xModel = GetModel(); if ( xModel.is() ) { - auto pFoundShell = comphelper::getUnoTunnelImplementation<SfxObjectShell>(xModel); + auto pFoundShell = comphelper::getFromUnoTunnel<SfxObjectShell>(xModel); if ( pFoundShell && ooo::vba::isAlienExcelDoc( *pFoundShell ) ) { xRowStylesPropertySetMapper = new XMLPropertySetMapper(aXMLScFromXLSRowStylesProperties, xScPropHdlFactory, true); |