22 #include <string_view>
27 #include <com/sun/star/beans/XPropertySet.hpp>
28 #include <com/sun/star/beans/XIntrospectionAccess.hpp>
29 #include <com/sun/star/container/XNamed.hpp>
30 #include <com/sun/star/util/XProtectable.hpp>
31 #include <com/sun/star/table/XCellRange.hpp>
32 #include <com/sun/star/sheet/XSpreadsheetView.hpp>
33 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
34 #include <com/sun/star/sheet/XCalculatable.hpp>
35 #include <com/sun/star/sheet/XCellRangeAddressable.hpp>
36 #include <com/sun/star/sheet/XSheetCellRange.hpp>
37 #include <com/sun/star/sheet/XSheetCellCursor.hpp>
38 #include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
39 #include <com/sun/star/sheet/XUsedAreaCursor.hpp>
40 #include <com/sun/star/sheet/XSpreadsheets.hpp>
41 #include <com/sun/star/sheet/XSheetOutline.hpp>
42 #include <com/sun/star/sheet/XSheetPageBreak.hpp>
43 #include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
44 #include <com/sun/star/sheet/XNamedRanges.hpp>
45 #include <com/sun/star/frame/Desktop.hpp>
46 #include <com/sun/star/table/XTableChartsSupplier.hpp>
47 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
48 #include <com/sun/star/drawing/XControlShape.hpp>
49 #include <com/sun/star/form/XFormsSupplier.hpp>
50 #include <ooo/vba/excel/XApplication.hpp>
51 #include <ooo/vba/excel/XlEnableSelection.hpp>
52 #include <ooo/vba/excel/XlSheetVisibility.hpp>
53 #include <ooo/vba/XControlProvider.hpp>
81 #define STANDARDWIDTH 2267
82 #define STANDARDHEIGHT 427
87 static void getNewSpreadsheetName (OUString &aNewName, std::u16string_view aOldName,
const uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc )
90 throw lang::IllegalArgumentException(
"getNewSpreadsheetName() xSpreadDoc is null", uno::Reference< uno::XInterface >(), 1 );
91 static const char aUnderScore[] =
"_";
93 aNewName = OUString::Concat(aOldName) + aUnderScore + OUString::number(currentNum) ;
97 aNewName = OUString::Concat(aOldName) + aUnderScore + OUString::number(++currentNum);
101 static void removeAllSheets(
const uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc,
const OUString& aSheetName)
103 if (!xSpreadDoc.is())
104 throw lang::IllegalArgumentException(
"removeAllSheets() xSpreadDoc is null", uno::Reference< uno::XInterface >(), 1 );
105 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
106 uno::Reference <container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
111 uno::Reference<container::XNameContainer> xNameContainer(xSheets,uno::UNO_QUERY_THROW);
112 for (sal_Int32
i = xIndex->getCount() -1;
i>= 1;
i--)
114 uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(
i), uno::UNO_QUERY);
115 uno::Reference< container::XNamed > xNamed( xSheet, uno::UNO_QUERY_THROW );
116 xNameContainer->removeByName(xNamed->getName());
119 uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(0), uno::UNO_QUERY);
120 uno::Reference< container::XNamed > xNamed( xSheet, uno::UNO_QUERY_THROW );
121 xNamed->setName(aSheetName);
124 static uno::Reference<frame::XModel>
127 uno::Reference<frame::XModel>
xModel;
130 uno::Reference< uno::XComponentContext > xContext(
133 uno::Reference <frame::XDesktop2 > xComponentLoader = frame::Desktop::create(xContext);
135 uno::Reference<lang::XComponent > xComponent( xComponentLoader->loadComponentFromURL(
136 "private:factory/scalc",
138 uno::Sequence < css::beans::PropertyValue >() ) );
139 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( xComponent, uno::UNO_QUERY_THROW );
141 xModel.set(xSpreadDoc,uno::UNO_QUERY_THROW);
143 catch ( uno::Exception & )
150 const uno::Reference< sheet::XSpreadsheet >& xSheet,
151 const uno::Reference< frame::XModel >& xModel ) :
WorksheetImpl_BASE( xParent, xContext ), mxSheet( xSheet ),
mxModel(xModel), mbVeryHidden( false )
158 if ( args.getLength() < 3 )
159 throw lang::IllegalArgumentException();
162 args[2] >>= sSheetName;
164 uno::Reference< sheet::XSpreadsheetDocument > xSpreadDoc( mxModel, uno::UNO_QUERY_THROW );
165 uno::Reference< container::XNameAccess > xNameAccess( xSpreadDoc->getSheets(), uno::UNO_QUERY_THROW );
166 mxSheet.set( xNameAccess->getByName( sSheetName ), uno::UNO_QUERY_THROW );
175 class theScVbaWorksheetUnoTunnelId :
public rtl::Static< UnoTunnelIdInit, theScVbaWorksheetUnoTunnelId > {};
180 return theScVbaWorksheetUnoTunnelId::get().getSeq();
183 uno::Reference< ov::excel::XWorksheet >
186 uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor =
getSheet()->createCursor( );
187 uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW);
197 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( xModel, uno::UNO_QUERY_THROW );
199 uno::Reference <sheet::XSpreadsheets> xSheets( xSpreadDoc->getSheets(), uno::UNO_SET_THROW );
200 uno::Reference <container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY_THROW );
201 uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW);
205 pShell->GetDocument().GetCodeName( 0, aCodeName );
206 return uno::Reference< excel::XWorksheet >(
getUnoDocModule( aCodeName, pShell ), uno::UNO_QUERY_THROW );
209 css::uno::Reference< ov::excel::XWorksheet >
212 OUString aCurrSheetName =
getName();
213 ScVbaWorksheet* pDestSheet = excel::getImplFromDocModuleWrapper<ScVbaWorksheet>( xSheet );
215 uno::Reference <sheet::XSpreadsheetDocument> xDestDoc( pDestSheet->
getModel(), uno::UNO_QUERY );
216 uno::Reference <sheet::XSpreadsheetDocument> xSrcDoc(
getModel(), uno::UNO_QUERY );
220 OUString aSheetName = xSheet->getName();
226 aSheetName = aCurrSheetName;
227 if ( bSheetExists && bDestSheetExists )
232 uno::Reference<sheet::XSpreadsheets> xSheets = xDestDoc->getSheets();
236 xSheets->copyByName(aCurrSheetName,aSheetName,nDest);
241 if ( pDestDocShell && pSrcDocShell )
242 pDestDocShell->
TransferTab( *pSrcDocShell, nSrc, nDest,
true,
true );
246 uno::Reference< excel::XApplication > xApplication(
Application(), uno::UNO_QUERY_THROW );
247 uno::Reference< excel::XWorksheet > xNewSheet( xApplication->Worksheets( uno::makeAny( aSheetName ) ), uno::UNO_QUERY_THROW );
254 uno::Reference< container::XNamed > xNamed(
getSheet(), uno::UNO_QUERY_THROW );
255 return xNamed->getName();
261 uno::Reference< container::XNamed > xNamed(
getSheet(), uno::UNO_QUERY_THROW );
262 xNamed->setName( rName );
268 uno::Reference< beans::XPropertySet > xProps(
getSheet(), uno::UNO_QUERY_THROW );
270 xProps->getPropertyValue(
"IsVisible" ) >>= bVisible;
271 using namespace ::ooo::vba::excel::XlSheetVisibility;
272 return bVisible ? xlSheetVisible : (
mbVeryHidden ? xlSheetVeryHidden : xlSheetHidden);
278 using namespace ::ooo::vba::excel::XlSheetVisibility;
282 case xlSheetVisible:
case 1:
290 case xlSheetVeryHidden:
295 throw uno::RuntimeException();
297 uno::Reference< beans::XPropertySet > xProps(
getSheet(), uno::UNO_QUERY_THROW );
298 xProps->setPropertyValue(
"IsVisible",
uno::Any( bVisible ) );
310 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc(
getModel(), uno::UNO_QUERY_THROW );
313 throw uno::RuntimeException(
"Sheet Name does not exist." );
315 uno::Reference< frame::XModel >
xModel(
getModel(), uno::UNO_SET_THROW );
318 bool bLockedCells =
false;
319 bool bUnlockedCells =
false;
326 return excel::XlEnableSelection::xlNoRestrictions;
328 return excel::XlEnableSelection::xlUnlockedCells;
329 return excel::XlEnableSelection::xlNoSelection;
336 if( (nSelection != excel::XlEnableSelection::xlNoRestrictions) &&
337 (nSelection != excel::XlEnableSelection::xlUnlockedCells) &&
338 (nSelection != excel::XlEnableSelection::xlNoSelection) )
343 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc(
getModel(), uno::UNO_QUERY_THROW );
346 throw uno::RuntimeException(
"Sheet Name does not exist." );
348 uno::Reference< frame::XModel >
xModel(
getModel(), uno::UNO_SET_THROW );
352 bool bLockedCells =
false;
353 bool bUnlockedCells =
false;
354 if( nSelection == excel::XlEnableSelection::xlNoRestrictions )
357 bUnlockedCells =
true;
359 else if( nSelection == excel::XlEnableSelection::xlUnlockedCells )
361 bUnlockedCells =
true;
376 uno::Reference< frame::XModel >
xModel(
getModel(), uno::UNO_SET_THROW );
386 uno::Reference< frame::XModel >
xModel(
getModel(), uno::UNO_SET_THROW );
400 else if (!bAutoFilterMode)
409 uno::Reference< excel::XRange >
412 uno::Reference< sheet::XSheetCellRange > xSheetCellRange(
getSheet(), uno::UNO_QUERY_THROW );
413 uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor(
getSheet()->createCursorByRange( xSheetCellRange ), uno::UNO_SET_THROW );
414 uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW);
415 xUsedCursor->gotoStartOfUsedArea(
false );
416 xUsedCursor->gotoEndOfUsedArea(
true );
420 uno::Reference< excel::XOutline >
423 uno::Reference<sheet::XSheetOutline> xOutline(
getSheet(),uno::UNO_QUERY_THROW);
427 uno::Reference< excel::XPageSetup >
436 uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak(
getSheet(),uno::UNO_QUERY_THROW);
439 return xHPageBreaks->Item( aIndex,
uno::Any());
440 return uno::makeAny( xHPageBreaks );
446 uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak(
getSheet(), uno::UNO_QUERY_THROW );
449 return xVPageBreaks->Item( aIndex,
uno::Any());
450 return uno::makeAny( xVPageBreaks );
474 uno::Reference<util::XProtectable > xProtectable(
getSheet(), uno::UNO_QUERY_THROW);
475 return xProtectable->isProtected();
482 OUString aSheetName =
getName();
483 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc(
getModel(), uno::UNO_QUERY_THROW );
487 uno::Reference< frame::XModel >
xModel(
getModel(), uno::UNO_SET_THROW );
505 uno::Reference< sheet::XSpreadsheetView > xSpreadsheet(
506 getModel()->getCurrentController(), uno::UNO_QUERY_THROW );
507 xSpreadsheet->setActiveSheet(
getSheet());
519 uno::Reference<excel::XWorksheet> xSheet;
520 OUString aCurrSheetName =
getName();
522 if (!(Before >>= xSheet) && !(After >>=xSheet)&& !(Before.
hasValue()) && !(After.
hasValue()))
524 uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor =
getSheet()->createCursor( );
525 uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW);
540 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc(
getModel(), uno::UNO_QUERY_THROW );
547 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
548 xSheets->moveByName(aCurrSheetName,nDest);
555 uno::Reference<excel::XWorksheet> xSheet;
556 if (!(Before >>= xSheet) && !(After >>=xSheet)&& !(Before.
hasValue()) && !(After.
hasValue()))
563 xNewSheet->Activate();
570 uno::Reference<excel::XRange> xRange( Destination, uno::UNO_QUERY );
579 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc(
getModel(), uno::UNO_QUERY_THROW );
580 OUString aSheetName =
getName();
586 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
587 uno::Reference<container::XNameContainer> xNameContainer(xSheets,uno::UNO_QUERY_THROW);
588 xNameContainer->removeByName(aSheetName);
592 uno::Reference< excel::XWorksheet >
595 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc(
getModel(), uno::UNO_QUERY_THROW );
596 uno::Reference <sheet::XSpreadsheets> xSheets( xSpreadDoc->getSheets(), uno::UNO_SET_THROW );
597 uno::Reference <container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY_THROW );
601 return uno::Reference< excel::XWorksheet >();
602 nIdx = nIdx + offset;
603 uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(nIdx), uno::UNO_QUERY_THROW);
608 uno::Reference< excel::XWorksheet >
614 uno::Reference< excel::XWorksheet >
625 uno::Reference<util::XProtectable > xProtectable(
getSheet(), uno::UNO_QUERY_THROW);
627 Password >>= aPasswd;
628 xProtectable->protect( aPasswd );
634 uno::Reference<util::XProtectable > xProtectable(
getSheet(), uno::UNO_QUERY_THROW);
636 Password >>= aPasswd;
637 xProtectable->unprotect( aPasswd );
643 uno::Reference <sheet::XCalculatable> xReCalculate(
getModel(), uno::UNO_QUERY_THROW);
644 xReCalculate->calculate();
647 uno::Reference< excel::XRange >
651 , uno::Reference< table::XCellRange >(
getSheet(), uno::UNO_QUERY_THROW ) ) );
652 return xSheetRange->Range( Cell1, Cell2 );
663 uno::Reference< excel::XRange >
666 uno::Reference< table::XCellRange > xRange(
getSheet(),uno::UNO_QUERY_THROW );
672 uno::Reference< excel::XRange >
677 uno::Reference< table::XCellRange > xRange(
getSheet(), uno::UNO_QUERY_THROW );
678 uno::Reference< frame::XModel >
xModel(
getModel(), uno::UNO_SET_THROW );
683 uno::Reference< excel::XRange >
689 uno::Reference< excel::XRange >
700 uno::Reference< table::XTableChartsSupplier > xChartSupplier(
getSheet(), uno::UNO_QUERY_THROW );
701 uno::Reference< table::XTableCharts > xTableCharts = xChartSupplier->getCharts();
703 uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier(
mxSheet, uno::UNO_QUERY_THROW );
708 uno::Reference< XCollection > xColl(
mxCharts, uno::UNO_QUERY_THROW );
709 return xColl->Item( Index,
uno::Any() );
719 uno::Reference< css::sheet::XSpreadsheet > xSheet =
getSheet();
720 uno::Reference< sheet::XDataPilotTablesSupplier > xTables(xSheet, uno::UNO_QUERY_THROW ) ;
721 uno::Reference< container::XIndexAccess > xIndexAccess( xTables->getDataPilotTables(), uno::UNO_QUERY_THROW );
725 return xColl->Item( Index,
uno::Any() );
726 return uno::makeAny( xColl );
732 uno::Reference< css::sheet::XSpreadsheet > xSheet =
getSheet();
733 uno::Reference< sheet::XSheetAnnotationsSupplier > xAnnosSupp( xSheet, uno::UNO_QUERY_THROW );
734 uno::Reference< sheet::XSheetAnnotations > xAnnos( xAnnosSupp->getAnnotations(), uno::UNO_SET_THROW );
735 uno::Reference< container::XIndexAccess > xIndexAccess( xAnnos, uno::UNO_QUERY_THROW );
738 return xColl->Item( Index,
uno::Any() );
739 return uno::makeAny( xColl );
750 return uno::Reference< XCollection >(
mxHlinks, uno::UNO_QUERY_THROW )->Item( aIndex,
uno::Any() );
757 css::uno::Reference<css::beans::XPropertySet> xProps(
getSheet(), css::uno::UNO_QUERY_THROW);
758 uno::Reference< sheet::XNamedRanges > xNamedRanges( xProps->getPropertyValue(
"NamedRanges"), uno::UNO_QUERY_THROW );
760 if ( aIndex.hasValue() )
761 return xNames->Item( aIndex,
uno::Any() );
768 uno::Reference< sheet::XSpreadsheet > xSpreadsheet(
getSheet(), uno::UNO_SET_THROW );
769 uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW );
770 uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPageSupplier->getDrawPage(), uno::UNO_SET_THROW );
771 uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPage, uno::UNO_QUERY_THROW );
775 return xOleObjects->Item( Index,
uno::Any() );
782 uno::Reference< sheet::XSpreadsheet > xSpreadsheet(
getSheet(), uno::UNO_SET_THROW );
783 uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW );
784 uno::Reference< drawing::XShapes > xShapes( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
785 uno::Reference< container::XIndexAccess > xIndexAccess( xShapes, uno::UNO_QUERY_THROW );
789 return xVbaShapes->Item( aIndex,
uno::Any() );
790 return uno::makeAny( xVbaShapes );
798 if( !rxButtons.is() )
801 rxButtons->collectShapes();
803 return rxButtons->Item( rIndex,
uno::Any() );
804 return uno::Any( uno::Reference< XCollection >( rxButtons.get() ) );
816 throw uno::RuntimeException();
822 throw uno::RuntimeException();
828 throw uno::RuntimeException();
834 throw uno::RuntimeException();
840 throw uno::RuntimeException();
852 throw uno::RuntimeException();
858 throw uno::RuntimeException();
864 uno::Reference< frame::XModel >
xModel(
getModel(), uno::UNO_SET_THROW );
885 uno::Reference< beans::XIntrospectionAccess > SAL_CALL
888 return uno::Reference< beans::XIntrospectionAccess >();
892 ScVbaWorksheet::invoke(
const OUString& ,
const uno::Sequence< uno::Any >& , uno::Sequence< ::sal_Int16 >& , uno::Sequence< uno::Any >& )
894 throw uno::RuntimeException(
"Unsupported");
905 uno::Reference< drawing::XControlShape > xControlShape(
getControlShape( aPropertyName ), uno::UNO_QUERY_THROW );
907 uno::Reference<lang::XMultiComponentFactory > xServiceManager(
mxContext->getServiceManager(), uno::UNO_SET_THROW );
908 uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext(
"ooo.vba.ControlProvider",
mxContext ), uno::UNO_QUERY_THROW );
909 uno::Reference< msforms::XControl > xControl( xControlProvider->createControl( xControlShape,
getModel() ) );
910 return uno::makeAny( xControl );
919 uno::Reference< container::XNameAccess >
922 uno::Reference< container::XNameAccess > xFormControls;
925 uno::Reference< sheet::XSpreadsheet > xSpreadsheet(
getSheet(), uno::UNO_SET_THROW );
926 uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW );
927 uno::Reference< form::XFormsSupplier > xFormSupplier( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
928 uno::Reference< container::XIndexAccess > xIndexAccess( xFormSupplier->getForms(), uno::UNO_QUERY_THROW );
932 if( xIndexAccess->hasElements() )
933 xFormControls.set( xIndexAccess->getByIndex(0), uno::UNO_QUERY );
936 catch( uno::Exception& )
939 return xFormControls;
945 uno::Reference< container::XNameAccess > xFormControls(
getFormControls() );
946 if ( xFormControls.is() )
947 return xFormControls->hasByName( aName );
963 uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier(
getSheet(), uno::UNO_QUERY_THROW );
964 uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
966 sal_Int32
nCount = xIndexAccess->getCount();
971 uno::Reference< drawing::XControlShape > xControlShape( aUnoObj, uno::UNO_QUERY );
972 if( xControlShape.is() )
974 uno::Reference< container::XNamed > xNamed( xControlShape->getControl(), uno::UNO_QUERY_THROW );
975 if( sName == xNamed->getName() )
987 return "ScVbaWorksheet";
993 uno::Reference <sheet::XCalculatable> xCalculatable(
getModel(), uno::UNO_QUERY_THROW);
994 xCalculatable->enableAutomaticCalculation( bEnableCalculation);
999 uno::Reference <sheet::XCalculatable> xCalculatable(
getModel(), uno::UNO_QUERY_THROW);
1000 return xCalculatable->isAutomaticCalculationEnabled();
1003 uno::Sequence< OUString >
1008 "ooo.vba.excel.Worksheet"
1016 uno::Reference< beans::XPropertySet > xSheetProp(
mxSheet, uno::UNO_QUERY_THROW );
1017 return xSheetProp->getPropertyValue(
"CodeName").get< OUString >();
1023 uno::Reference< sheet::XCellRangeAddressable > xAddressable(
mxSheet, uno::UNO_QUERY_THROW );
1024 return xAddressable->getRangeAddress().Sheet;
1031 sal_Int32 nFrom = 0;
1032 bool bSelection =
false;
1036 if ( !( nFrom || nTo ) )
1039 uno::Reference< frame::XModel >
xModel(
getModel(), uno::UNO_SET_THROW );
1046 if (isUnoTunnelId<ScVbaWorksheet>(rId))
1048 return sal::static_int_cast<sal_Int64>(
reinterpret_cast<sal_IntPtr
>(
this));
1053 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
1055 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& args)
virtual css::uno::Any SAL_CALL Application() override
virtual void SAL_CALL Select() override
virtual void SAL_CALL Copy(const css::uno::Any &Before, const css::uno::Any &After) override
void PrintOutHelper(SfxViewShell const *pViewShell, const uno::Any &From, const uno::Any &To, const uno::Any &Copies, const uno::Any &Preview, const uno::Any &, const uno::Any &, const uno::Any &Collate, const uno::Any &PrToFileName, bool bUseSelection)
bool HasAutoFilter() const
void setUpDocumentModules(const uno::Reference< sheet::XSpreadsheetDocument > &xDoc)
virtual sal_Bool SAL_CALL hasProperty(const OUString &aName) override
SC_DLLPUBLIC ScDBData * GetAnonymousDBData(SCTAB nTab)
virtual css::uno::Any SAL_CALL DropDowns(const css::uno::Any &rIndex) override
SC_DLLPUBLIC void SetTabProtection(SCTAB nTab, const ScTableProtection *pProtect)
sheet protection state container
css::uno::Reference< T > getXSomethingFromArgs(css::uno::Sequence< css::uno::Any > const &args, sal_Int32 nPos, bool bCanBeNull=true)
virtual css::uno::Any SAL_CALL Names(const css::uno::Any &aIndex) override
SC_DLLPUBLIC bool ApplyFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * Calc_ScVbaWorksheet_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &args)
uno::Reference< XHelperInterface > getUnoDocModule(std::u16string_view aModName, SfxObjectShell const *pShell)
css::uno::Reference< ov::excel::XWorksheet > getSheetAtOffset(SCTAB offset)
virtual void SAL_CALL Delete() override
virtual void SAL_CALL Activate() override
css::uno::Reference< ov::excel::XHyperlinks > mxHlinks
css::uno::Reference< css::frame::XModel2 > mxModel
Sequence< OUString > aServiceNames
virtual css::uno::Any SAL_CALL Evaluate(const OUString &Name) override
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual css::uno::Any SAL_CALL getValue(const OUString &aPropertyName) override
css::uno::Reference< ov::excel::XWorksheet > createSheetCopy(css::uno::Reference< ov::excel::XWorksheet > const &xSheet, bool bAfter)
virtual short Execute()=0
css::uno::Any getButtons(const css::uno::Any &rIndex, bool bOptionButtons)
virtual css::uno::Any SAL_CALL ChartObjects(const css::uno::Any &Index) override
sal_uLong TransferTab(ScDocShell &rSrcDocShell, SCTAB nSrcPos, SCTAB nDestPos, bool bInsertNew, bool bNotifyAndPaint)
void implnCopy(const uno::Reference< frame::XModel > &xModel)
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Cells(const css::uno::Any &nRow, const css::uno::Any &nCol) override
virtual sal_Bool SAL_CALL getEnableCalculation() override
void setOption(Option eOption, bool bEnabled)
static uno::Reference< frame::XModel > openNewDoc(const OUString &aSheetName)
bool isOptionEnabled(Option eOption) const
virtual ::sal_Int32 SAL_CALL getStandardHeight() override
exports com.sun.star. frame
virtual css::uno::Any SAL_CALL VPageBreaks(const css::uno::Any &aIndex) override
virtual OUString SAL_CALL getName() override
virtual sal_Bool SAL_CALL getProtectContents() override
virtual void SAL_CALL setEnableCalculation(sal_Bool EnableCalculation) override
virtual void SAL_CALL setEnableSelection(sal_Int32 nSelection) override
Represents a collection of hyperlinks of a worksheet or of a range.
virtual void SAL_CALL PrintOut(const css::uno::Any &From, const css::uno::Any &To, const css::uno::Any &Copies, const css::uno::Any &Preview, const css::uno::Any &ActivePrinter, const css::uno::Any &PrintToFile, const css::uno::Any &Collate, const css::uno::Any &PrToFileName, const css::uno::Any &IgnorePrintAreas) override
virtual void SAL_CALL Move(const css::uno::Any &Before, const css::uno::Any &After) override
virtual void SAL_CALL setVisible(sal_Int32 nVisible) override
ScDocShell * getDocShell(const css::uno::Reference< css::frame::XModel > &xModel)
virtual void SAL_CALL setName(const OUString &rName) override
virtual sal_Bool SAL_CALL getAutoFilterMode() override
virtual css::uno::Reference< ov::excel::XPageSetup > SAL_CALL PageSetup() override
virtual void SAL_CALL Calculate() override
virtual void SAL_CALL Paste(const css::uno::Any &Destination, const css::uno::Any &Link) override
virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getNext() override
static void getNewSpreadsheetName(OUString &aNewName, std::u16string_view aOldName, const uno::Reference< sheet::XSpreadsheetDocument > &xSpreadDoc)
virtual css::uno::Any SAL_CALL Hyperlinks(const css::uno::Any &aIndex) override
const css::uno::Reference< css::sheet::XSpreadsheet > & getSheet() const
virtual VclPtr< AbstractScDataFormDlg > CreateScDataFormDlg(weld::Window *pParent, ScTabViewShell *pTabViewShell)=0
sal_Int16 getSheetID() const
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Rows(const css::uno::Any &aIndex) override
virtual css::uno::Any SAL_CALL invoke(const OUString &aFunctionName, const css::uno::Sequence< css::uno::Any > &aParams, css::uno::Sequence< ::sal_Int16 > &aOutParamIndex, css::uno::Sequence< css::uno::Any > &aOutParam) override
::rtl::Reference< ScVbaSheetObjectsBase > mxButtons[2]
virtual sal_Bool SAL_CALL getProtectDrawingObjects() override
static bool nameExists(const css::uno::Reference< css::sheet::XSpreadsheetDocument > &xSpreadDoc, std::u16string_view name, SCTAB &nTab)
virtual OUString getServiceImplName() override
css::uno::Reference< css::frame::XModel > mxModel
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Columns(const css::uno::Any &aIndex) override
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Range(const css::uno::Any &Cell1, const css::uno::Any &Cell2) override
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
const css::uno::Reference< css::frame::XModel > & getModel() const
css::uno::Reference< ov::excel::XChartObjects > mxCharts
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
virtual sal_Int32 SAL_CALL getVisible() override
virtual css::uno::Any SAL_CALL Spinners(const css::uno::Any &rIndex) override
css::uno::Reference< ov::excel::XWorksheet > createSheetCopyInNewDoc(const OUString &)
ScTabViewShell * getBestViewShell(const css::uno::Reference< css::frame::XModel > &xModel)
#define ERRCODE_BASIC_BAD_PARAMETER
virtual css::uno::Any SAL_CALL GroupBoxes(const css::uno::Any &rIndex) override
virtual css::uno::Any SAL_CALL ListBoxes(const css::uno::Any &rIndex) override
virtual sal_Int32 SAL_CALL getEnableSelection() override
virtual css::uno::Any SAL_CALL CheckBoxes(const css::uno::Any &rIndex) override
static void removeAllSheets(const uno::Reference< sheet::XSpreadsheetDocument > &xSpreadDoc, const OUString &aSheetName)
void setDefaultPropByIntrospection(const uno::Any &aObj, const uno::Any &aValue)
virtual css::uno::Any SAL_CALL ScrollBars(const css::uno::Any &rIndex) override
virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getPrevious() override
weld::Window * GetFrameWeld() const
css::uno::Reference< css::uno::XComponentContext > mxContext
virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent() override
virtual void SAL_CALL CheckSpelling(const css::uno::Any &CustomDictionary, const css::uno::Any &IgnoreUppercase, const css::uno::Any &AlwaysSuggest, const css::uno::Any &SpellingLang) override
virtual sal_Bool SAL_CALL getProtectionMode() override
virtual css::uno::Any SAL_CALL OLEObjects(const css::uno::Any &Index) override
virtual css::uno::Any SAL_CALL Buttons(const css::uno::Any &rIndex) override
static SC_DLLPUBLIC ScAbstractDialogFactory * Create()
virtual css::uno::Any SAL_CALL HPageBreaks(const css::uno::Any &aIndex) override
SC_DLLPUBLIC bool RemoveFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
virtual css::uno::Any SAL_CALL Labels(const css::uno::Any &rIndex) override
virtual ::sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rId) override
virtual css::uno::Any SAL_CALL Comments(const css::uno::Any &Index) override
Reference< XComponentContext > getProcessComponentContext()
css::uno::Reference< css::container::XNameAccess > getFormControls() const
virtual void SAL_CALL setAutoFilterMode(sal_Bool bAutoFilterMode) override
const ScDocument & GetDocument() const
virtual void SAL_CALL Protect(const css::uno::Any &Password, const css::uno::Any &DrawingObjects, const css::uno::Any &Contents, const css::uno::Any &Scenarios, const css::uno::Any &UserInterfaceOnly) override
virtual css::uno::Any SAL_CALL PivotTables(const css::uno::Any &Index) override
void implnPaste(const uno::Reference< frame::XModel > &xModel)
virtual css::uno::Any SAL_CALL OptionButtons(const css::uno::Any &rIndex) override
virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection() override
Reference< XModel > xModel
virtual void SAL_CALL setValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getUsedRange() override
virtual ~ScVbaWorksheet() override
css::uno::Reference< css::sheet::XSpreadsheet > mxSheet
virtual css::uno::Any SAL_CALL Shapes(const css::uno::Any &aIndex) override
css::uno::Reference< ov::excel::XRange > getSheetRange()
void dispatchRequests(const uno::Reference< frame::XModel > &xModel, const OUString &aUrl, const uno::Sequence< beans::PropertyValue > &sProps)
css::uno::Any getControlShape(std::u16string_view sName)
ScVbaWorksheet(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::sheet::XSpreadsheet > &xSheet, const css::uno::Reference< css::frame::XModel > &xModel)
virtual css::uno::Reference< ov::excel::XOutline > SAL_CALL Outline() override
virtual void SAL_CALL Unprotect(const css::uno::Any &Password) override
static css::uno::Reference< ov::excel::XRange > CellsHelper(const ScDocument &rDoc, const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::table::XCellRange > &xRange, const css::uno::Any &nRowIndex, const css::uno::Any &nColumnIndex)
virtual sal_Int16 SAL_CALL getIndex() override
virtual OUString SAL_CALL getCodeName() override
virtual sal_Bool SAL_CALL getProtectScenarios() override
virtual void SAL_CALL ShowDataForm() override
virtual ::sal_Int32 SAL_CALL getStandardWidth() override
void SetAutoFilter(bool bSet)
virtual sal_Bool SAL_CALL hasMethod(const OUString &aName) override
SC_DLLPUBLIC const ScTableProtection * GetTabProtection(SCTAB nTab) const