20 #include <config_feature_opencl.h>
31 #include <svx/svxids.hrc>
34 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
36 #include <officecfg/Office/Common.hxx>
37 #include <officecfg/Office/Calc.hxx>
56 #include <com/sun/star/beans/PropertyAttribute.hpp>
57 #include <com/sun/star/util/Date.hpp>
58 #include <com/sun/star/sheet/XNamedRanges.hpp>
59 #include <com/sun/star/sheet/XLabelRanges.hpp>
60 #include <com/sun/star/sheet/XSelectedSheetsSupplier.hpp>
61 #include <com/sun/star/sheet/XUnnamedDatabaseRanges.hpp>
62 #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
63 #include <com/sun/star/script/XLibraryContainer.hpp>
64 #include <com/sun/star/lang/XInitialization.hpp>
65 #include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
66 #include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
67 #include <com/sun/star/document/IndexedPropertyValues.hpp>
68 #include <com/sun/star/script/XInvocation.hpp>
69 #include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
70 #include <com/sun/star/beans/XFastPropertySet.hpp>
77 #if HAVE_FEATURE_OPENCL
87 #include <docfunc.hxx>
117 #include <unonames.hxx>
119 #include <editsh.hxx>
120 #include <drawsh.hxx>
128 #include <strings.hrc>
133 #define SC_UNO_VBAGLOBNAME "VBAGlobalConstantName"
186 {
u"", 0, css::uno::Type(), 0, 0 }
188 return aDocOptPropertyMap_Impl;
202 {
u"", 0, css::uno::Type(), 0, 0 }
204 return aColumnsPropertyMap_Impl;
220 {
u"", 0, css::uno::Type(), 0, 0 }
222 return aRowsPropertyMap_Impl;
228 #define SCMODELOBJ_SERVICE "com.sun.star.sheet.SpreadsheetDocument"
229 #define SCDOCSETTINGS_SERVICE "com.sun.star.sheet.SpreadsheetDocumentSettings"
230 #define SCDOC_SERVICE "com.sun.star.document.OfficeDocument"
253 sal_Int32 nNumProps= 10, nIdx = 0;
255 m_aUIProperties.resize(nNumProps);
258 m_aUIProperties[nIdx].Name =
"OptionsUIFile";
259 m_aUIProperties[nIdx++].Value <<= OUString(
"modules/scalc/ui/printeroptions.ui");
263 OUString aAppGroupname(
ScResId( SCSTR_PRINTOPT_PRODNAME ) );
265 m_aUIProperties[nIdx++].Value = setGroupControlOpt(
"tabcontrol-page2", aAppGroupname, OUString());
268 m_aUIProperties[nIdx++].Value = setSubgroupControlOpt(
"pages",
ScResId( SCSTR_PRINTOPT_PAGES ), OUString());
271 m_aUIProperties[nIdx++].Value = setBoolControlOpt(
"suppressemptypages",
ScResId( SCSTR_PRINTOPT_SUPPRESSEMPTY ),
272 ".HelpID:vcl:PrintDialog:IsSuppressEmptyPages:CheckBox",
273 "IsSuppressEmptyPages",
278 m_aUIProperties[nIdx++].Value = setSubgroupControlOpt(
"printrange",
ScResId( SCSTR_PRINTOPT_PAGES ),
283 uno::Sequence< OUString > aChoices{
284 ScResId( SCSTR_PRINTOPT_ALLSHEETS ),
285 ScResId( SCSTR_PRINTOPT_SELECTEDSHEETS ),
286 ScResId( SCSTR_PRINTOPT_SELECTEDCELLS )};
287 uno::Sequence< OUString > aHelpIds{
288 ".HelpID:vcl:PrintDialog:PrintContent:ListBox"};
289 m_aUIProperties[nIdx++].Value = setChoiceListControlOpt(
"printextrabox", OUString(),
290 aHelpIds,
"PrintContent",
291 aChoices, nContent );
295 m_aUIProperties[nIdx++].Value = setSubgroupControlOpt(
"fromwhich",
ScResId( SCSTR_PRINTOPT_FROMWHICH ),
300 OUString aPrintRangeName(
"PrintRange" );
301 aChoices.realloc( 2 );
302 aHelpIds.realloc( 2 );
303 uno::Sequence< OUString > aWidgetIds( 2 );
304 aChoices[0] =
ScResId( SCSTR_PRINTOPT_PRINTALLPAGES );
305 aHelpIds[0] =
".HelpID:vcl:PrintDialog:PrintRange:RadioButton:0";
306 aWidgetIds[0] =
"rbAllPages";
307 aChoices[1] =
ScResId( SCSTR_PRINTOPT_PRINTPAGES );
308 aHelpIds[1] =
".HelpID:vcl:PrintDialog:PrintRange:RadioButton:1";
309 aWidgetIds[1] =
"rbRangePages";
310 m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, OUString(),
318 m_aUIProperties[nIdx++].Value = setEditControlOpt(
"pagerange", OUString(),
319 ".HelpID:vcl:PrintDialog:PageRange:Edit",
320 "PageRange", OUString(), aPageRangeOpt);
323 m_aUIProperties[ nIdx++ ].Value = setChoiceListControlOpt(
"evenoddbox",
325 uno::Sequence<OUString>(),
327 uno::Sequence<OUString>(),
329 uno::Sequence< sal_Bool >(),
332 assert(nIdx == nNumProps);
343 for (beans::PropertyValue & rPropValue : m_aUIProperties)
345 uno::Sequence<beans::PropertyValue> aUIProp;
346 if ( rPropValue.Value >>= aUIProp )
348 for (
auto& rProp : aUIProp)
350 OUString
aName = rProp.Name;
351 if ( aName ==
"Property" )
353 beans::PropertyValue aPropertyValue;
354 if ( rProp.Value >>= aPropertyValue )
356 if ( aPropertyValue.Name ==
"PrintContent" )
358 aPropertyValue.Value <<= nContent;
359 rProp.Value <<= aPropertyValue;
361 else if ( aPropertyValue.Name ==
"IsSuppressEmptyPages" )
363 aPropertyValue.Value <<= bSuppress;
364 rProp.Value <<= aPropertyValue;
369 rPropValue.Value <<= aUIProp;
384 if(!rDoc.GetDrawLayer())
389 return *rDoc.GetDrawLayer();
413 xNumberAgg->setDelegator(uno::Reference<uno::XInterface>());
429 uno::Reference<util::XNumberFormatsSupplier> xFormatter(
432 xNumberAgg.set(uno::Reference<uno::XAggregation>( xFormatter, uno::UNO_QUERY ));
437 xFormatter =
nullptr;
440 xNumberAgg->setDelegator( static_cast<cppu::OWeakObject*>(
this) );
507 constexpr
size_t nMaxIter = 5;
510 pViewShell && nIter < nMaxIter;
513 if (pViewShell->GetDocId() != rDocId)
529 int nOutputWidth,
int nOutputHeight,
530 int nTilePosX,
int nTilePosY,
549 pViewData = pActiveViewData;
564 pGridWindow->
PaintTile( rDevice, nOutputWidth, nOutputHeight,
565 nTilePosX, nTilePosY, nTileWidth, nTileHeight );
568 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
597 const bool bIsSelected =
false;
599 OUString aPartInfo =
"{ \"visible\": \"" +
600 OUString::number(static_cast<unsigned int>(bIsVisible)) +
601 "\", \"selected\": \"" +
602 OUString::number(static_cast<unsigned int>(bIsSelected)) +
619 return (pViewData->
GetDocument().
GetHashCode(nPart, nHashCode) ? OUString::number(nHashCode) : OUString());
637 pWindow = pViewData->GetActiveWin();
640 vcl::Window* pChartWindow = aChartHelper.GetWindow();
642 pWindow = pChartWindow;
664 const double fPPTX = pViewData->
GetPPTX();
665 const double fPPTY = pViewData->
GetPPTY();
667 auto GetColWidthPx = [pThisDoc, fPPTX, nTab](
SCCOL nCol) {
668 const sal_uInt16 nSize = pThisDoc->
GetColWidth(nCol, nTab);
675 if (nDocWidthPixel > 0 && nDocHeightPixel > 0)
678 aSize.
setWidth(nDocWidthPixel / fPPTX);
679 aSize.
setHeight(nDocHeightPixel / fPPTY);
719 nCount, nButtons, nModifier,
725 if (nType != LOK_MOUSEEVENT_MOUSEMOVE)
734 LokMouseEventData aMouseEventData(nType, aPos, nCount, MouseEventModifiers::SIMPLECLICK,
735 nButtons, nModifier);
753 bool bHandled =
false;
767 case LOK_SETTEXTSELECTION_START:
770 case LOK_SETTEXTSELECTION_END:
773 case LOK_SETTEXTSELECTION_RESET:
783 else if (pDrawView && pDrawView->
IsTextEdit())
792 case LOK_SETTEXTSELECTION_START:
795 case LOK_SETTEXTSELECTION_END:
798 case LOK_SETTEXTSELECTION_RESET:
826 uno::Reference<datatransfer::XTransferable> xTransferable;
829 xTransferable = pShell->GetEditView()->GetTransferable();
838 xTransferable = pDrawShell->GetDrawView()->CopyToTransferable();
842 xTransferable.set( pObj );
845 if (!xTransferable.is())
848 return xTransferable;
865 double fPPTX = pViewData->
GetPPTX();
866 double fPPTY = pViewData->
GetPPTY();
873 int nPixelX = nX * fPPTX;
874 int nPixelY = nY * fPPTY;
878 case LOK_SETGRAPHICSELECTION_START:
886 case LOK_SETGRAPHICSELECTION_END:
954 const Fraction newZoomY(nTilePixelHeight_ * TWIPS_PER_PIXEL, nTileTwipHeight_);
959 pViewData->
SetZoom(newZoomX, newZoomY,
true);
966 pDrawView->resetGridOffsetsForAllSdrPageViews();
984 bool bFiltered,
bool bGroups)
1011 rJsonWriter.
put(
"commandName",
".uno:CellCursor");
1021 return PointerStyle::Arrow;
1025 return PointerStyle::Arrow;
1035 pChangeTrack->GetChangeTrackInfo(rJson);
1052 comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs))
1079 std::vector<sc::NoteEntry> aNotes;
1082 auto commentsNode = rJsonWriter.
startNode(
"comments");
1085 auto commentNode = rJsonWriter.
startNode(
"");
1087 rJsonWriter.
put(
"id", aNote.mpNote->GetId());
1088 rJsonWriter.
put(
"tab", aNote.maPos.Tab());
1089 rJsonWriter.
put(
"author", aNote.mpNote->GetAuthor());
1090 rJsonWriter.
put(
"dateTime", aNote.mpNote->GetDate());
1091 rJsonWriter.
put(
"text", aNote.mpNote->GetText());
1098 SCCOL nX = aNote.maPos.Col();
1099 SCROW nY = aNote.maPos.Row();
1105 double fPPTX = pViewData->
GetPPTX();
1106 double fPPTY = pViewData->
GetPPTY();
1108 Size(nSizeXPix / fPPTX, nSizeYPix / fPPTY));
1110 rJsonWriter.
put(
"cellPos", aRect.toString());
1121 std::vector<sc::NoteEntry> aNotes;
1124 auto commentsNode = rJsonWriter.
startNode(
"commentsPos");
1127 auto commentNode = rJsonWriter.
startNode(
"");
1129 rJsonWriter.
put(
"id", aNote.mpNote->GetId());
1130 rJsonWriter.
put(
"tab", aNote.maPos.Tab());
1137 SCCOL nX = aNote.maPos.Col();
1138 SCROW nY = aNote.maPos.Row();
1144 double fPPTX = pViewData->
GetPPTX();
1145 double fPPTY = pViewData->
GetPPTY();
1147 Size(nSizeXPix / fPPTX, nSizeYPix / fPPTY));
1149 rJsonWriter.
put(
"cellPos", aRect.toString());
1159 assert(!rFunctionName.isEmpty());
1171 SC_MOD()->SetAppOptions(aAppOptions);
1173 for (
const beans::PropertyValue&
rValue : rArguments)
1175 if (
rValue.Name ==
".uno:SpellOnline" &&
rValue.Value.has<
bool>())
1187 SC_MOD()->SetInputOptions(aInputOptions);
1228 aRet =
xNumberAgg->queryAggregation( rType );
1246 static const uno::Sequence<uno::Type>
aTypes = [&]()
1248 uno::Sequence<uno::Type> aAggTypes;
1256 aAggTypes = (*xNumProv)->getTypes();
1262 uno::Sequence<uno::Type>
1287 return css::uno::Sequence<sal_Int8>();
1295 if ( nId == SfxHintId::Dying )
1301 comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>(
1302 uno::Reference<util::XNumberFormatsSupplier>(
xNumberAgg, uno::UNO_QUERY) );
1310 else if ( nId == SfxHintId::DataChanged )
1354 return css::uno::Reference< ::css::chart2::data::XDataProvider > (
1375 for (
const beans::PropertyValue& rProp : rOptions)
1377 const OUString & rPropName = rProp.Name;
1381 uno::Reference<awt::XDevice> xRenderDevice(rProp.Value, uno::UNO_QUERY);
1382 if ( xRenderDevice.is() )
1384 VCLXDevice* pDevice = comphelper::getUnoTunnelImplementation<VCLXDevice>( xRenderDevice );
1403 sal_Int32 nNumeric = 0;
1405 bool bRangeValid =
false;
1406 bool bRectValid =
false;
1414 rTargetRange = aAddress;
1423 ( nNumeric = rTarget.toInt32() ) > 0 && nNumeric <= rDoc.
MaxRow()+1 )
1426 rTargetRange =
ScAddress( 0, static_cast<SCROW>(nNumeric-1), nSourceTab );
1429 else if ( rDoc.
GetTable( rTarget, nNameTab ) )
1443 for (
SCTAB i=0;
i<nTabCount && !bRangeValid;
i++)
1446 OSL_ENSURE(pPage,
"Page ?");
1451 while (pObject && !bRangeValid)
1456 rTargetRange = rDoc.
GetRange(
i, rTargetRect );
1457 bRangeValid = bRectValid =
true;
1459 pObject = aIter.
Next();
1465 if ( bRangeValid && !bRectValid )
1477 const uno::Sequence< beans::PropertyValue >& rOptions,
1480 bool& rbRenderToGraphic )
const
1482 OSL_ENSURE( !rMark.
IsMarked() && !rMark.
IsMultiMarked(),
"FillRenderMarkData: MarkData must be empty" );
1483 OSL_ENSURE(
pDocShell,
"FillRenderMarkData: DocShell must be set" );
1487 uno::Reference<frame::XController> xView;
1490 bool bSelectedSheetsOnly =
false;
1491 bool bSuppressEmptyPages =
true;
1493 bool bHasPrintContent =
false;
1494 sal_Int32 nPrintContent = 0;
1495 sal_Int32 nPrintRange = 0;
1496 sal_Int32 nEOContent = 0;
1497 OUString aPageRange;
1499 for(
const auto& rOption : rOptions )
1501 if ( rOption.Name ==
"IsOnlySelectedSheets" )
1503 rOption.Value >>= bSelectedSheetsOnly;
1505 else if ( rOption.Name ==
"IsSuppressEmptyPages" )
1507 rOption.Value >>= bSuppressEmptyPages;
1509 else if ( rOption.Name ==
"PageRange" )
1511 rOption.Value >>= aPageRange;
1513 else if ( rOption.Name ==
"PrintRange" )
1515 rOption.Value >>= nPrintRange;
1517 else if ( rOption.Name ==
"EvenOdd" )
1519 rOption.Value >>= nEOContent;
1521 else if ( rOption.Name ==
"PrintContent" )
1523 bHasPrintContent =
true;
1524 rOption.Value >>= nPrintContent;
1526 else if ( rOption.Name ==
"View" )
1528 rOption.Value >>= xView;
1530 else if ( rOption.Name ==
"RenderToGraphic" )
1532 rOption.Value >>= rbRenderToGraphic;
1537 if ( bHasPrintContent )
1538 bSelectedSheetsOnly = ( nPrintContent != 0 );
1540 uno::Reference<uno::XInterface> xInterface(aSelection, uno::UNO_QUERY);
1541 if ( xInterface.is() )
1543 ScCellRangesBase* pSelObj = comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xInterface );
1544 uno::Reference< drawing::XShapes > xShapes( xInterface, uno::UNO_QUERY );
1547 bool bSheet = ( comphelper::getUnoTunnelImplementation<ScTableSheetObj>( xInterface ) !=
nullptr );
1568 if ( bCursor || bSheet )
1581 else if( xShapes.is() )
1585 uno::Reference< drawing::XShape > xShape( xShapes->getByIndex(0), uno::UNO_QUERY );
1586 SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
1589 SdrObject *pSdrObj = pShape->GetSdrObject();
1609 else if ( comphelper::getUnoTunnelImplementation<ScModelObj>( xInterface ) ==
this )
1615 for (
SCTAB nTab = 0; nTab < nTabCount; nTab++)
1624 uno::Reference<sheet::XSelectedSheetsSupplier> xSelectedSheets(xView, uno::UNO_QUERY);
1625 if (bSelectedSheetsOnly && xSelectedSheets.is())
1627 const uno::Sequence<sal_Int32> aSelected = xSelectedSheets->getSelectedSheets();
1630 for (
const auto& rSelected : aSelected)
1632 SCTAB nSelected =
static_cast<SCTAB>(rSelected);
1634 aSelectedTabs.insert(nSelected);
1645 if ( nPrintRange == 1 )
1646 rPagesStr = aPageRange;
1654 const uno::Sequence<beans::PropertyValue>& rOptions)
1659 throw lang::DisposedException( OUString(),
1660 static_cast< sheet::XSpreadsheetDocument* >(
this) );
1666 bool bRenderToGraphic =
false;
1667 if ( !
FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr, bRenderToGraphic ) )
1683 sal_Int32 nContent = 0;
1684 sal_Int32 nEOContent = 0;
1685 bool bSinglePageSheets =
false;
1686 for (
const auto&
rValue : rOptions)
1688 if (
rValue.Name ==
"PrintRange" )
1690 rValue.Value >>= nContent;
1692 else if (
rValue.Name ==
"SinglePageSheets" )
1694 rValue.Value >>= bSinglePageSheets;
1696 else if (
rValue.Name ==
"EvenOdd" )
1698 rValue.Value >>= nEOContent;
1702 if (bSinglePageSheets)
1707 bool bIsPrintEvenPages = (nEOContent != 1 && nContent == 0) || nContent != 0;
1708 bool bIsPrintOddPages = (nEOContent != 2 && nContent == 0) || nContent != 0;
1710 for ( sal_Int32 nPage = 1; nPage <= nPages; nPage++ )
1716 sal_Int32 nSelectCount =
static_cast<sal_Int32
>(
maValidPages.size() );
1718 if ( nEOContent == 1 || nEOContent == 2 )
1719 return nSelectCount;
1721 if ( !aPagesStr.isEmpty() )
1724 nSelectCount = aRangeEnum.
size();
1726 return (nSelectCount > 0) ? nSelectCount : 1;
1729 static sal_Int32
lcl_GetRendererNum( sal_Int32 nSelRenderer,
const OUString& rPagesStr, sal_Int32 nTotalPages )
1731 if ( rPagesStr.isEmpty() )
1732 return nSelRenderer;
1737 for ( ; nSelRenderer > 0 && aIter != aEnd; --nSelRenderer )
1749 const uno::Any& aSelection,
const uno::Sequence<beans::PropertyValue>& rOptions )
1754 throw lang::DisposedException( OUString(),
1755 static_cast< sheet::XSpreadsheetDocument* >(
this) );
1763 bool bRenderToGraphic =
false;
1764 bool bSinglePageSheets =
false;
1765 if (
FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr, bRenderToGraphic ) )
1774 for (
const auto&
rValue : rOptions)
1776 if (
rValue.Name ==
"SinglePageSheets" )
1778 rValue.Value >>= bSinglePageSheets;
1783 if (bSinglePageSheets)
1788 if ( nRenderer < 0 )
1790 if ( nSelRenderer != 0 )
1791 throw lang::IllegalArgumentException();
1795 awt::Size aPageSize;
1798 assert( aMark.IsMarked());
1800 aMark.GetMarkArea( aRange );
1802 aRange.aStart.Col(), aRange.aStart.Row(),
1803 aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aStart.Tab()));
1804 aPageSize.Width = aMMRect.
GetWidth();
1809 SCTAB const nCurTab = 0;
1811 Size aTwips = aDefaultFunc.GetPageSize();
1813 aPageSize.Height =
TwipsToHMM( aTwips.Height());
1832 if (bSinglePageSheets)
1833 nTab = nSelRenderer;
1841 const ScRange* pSelRange =
nullptr;
1842 if ( bSinglePageSheets )
1844 awt::Size aPageSize;
1856 table::CellRangeAddress aRangeAddress( nTab,
1863 aPageSize.Width = aMMRect.GetWidth();
1864 aPageSize.Height = aMMRect.GetHeight();
1866 awt::Size aCalcPageSize ( aMMRect.GetSize().Width(), aMMRect.GetSize().Height() );
1867 awt::Point aCalcPagePos( aMMRect.getX(), aMMRect.getY() );
1869 uno::Sequence<beans::PropertyValue> aSequence(5);
1870 beans::PropertyValue* pArray = aSequence.getArray();
1872 pArray[0].Value <<= aPageSize;
1875 pArray[1].Value <<=
true;
1877 pArray[2].Value <<= aRangeAddress;
1879 pArray[3].Value <<= aCalcPageSize;
1881 pArray[4].Value <<= aCalcPagePos;
1890 else if ( aMark.IsMarked() )
1892 aMark.GetMarkArea( aRange );
1893 pSelRange = &aRange;
1896 awt::Size aPageSize;
1897 bool bWasCellRange =
false;
1901 bWasCellRange =
true;
1902 aCellRange = aRange;
1906 aPageSize.Width = aMMRect.
GetWidth();
1911 std::unique_ptr<ScPrintFunc, o3tl::default_delete<ScPrintFunc>> pPrintFunc;
1916 pPrintFuncCache->GetFirstAttr(nTab), nTotalPages, pSelRange, &aStatus.GetOptions()));
1917 pPrintFunc->SetRenderFlag(
true );
1919 sal_Int32 nContent = 0;
1920 sal_Int32 nEOContent = 0;
1921 for (
const auto&
rValue : rOptions)
1923 if (
rValue.Name ==
"PrintRange" )
1925 rValue.Value >>= nContent;
1927 else if (
rValue.Name ==
"EvenOdd" )
1929 rValue.Value >>= nEOContent;
1936 bool bOddOrEven = (nContent == 0 && nEOContent == 1) || (nContent == 1 && nEOContent == 2);
1943 aPage.
Select( nRenderer+1 );
1948 (
void)pPrintFunc->DoPrint( aPage, nTabStart, nDisplayStart,
false,
nullptr );
1950 bWasCellRange = pPrintFunc->GetLastSourceRange( aCellRange );
1951 Size aTwips = pPrintFunc->GetPageSize();
1964 uno::Sequence<beans::PropertyValue> aSequence(nPropCount);
1965 beans::PropertyValue* pArray = aSequence.getArray();
1967 pArray[0].Value <<= aPageSize;
1970 pArray[1].Value <<=
true;
1971 if ( bWasCellRange )
1973 table::CellRangeAddress aRangeAddress( nTab,
1980 awt::Size aCalcPageSize ( aMMRect.GetSize().Width(), aMMRect.GetSize().Height() );
1981 awt::Point aCalcPagePos( aMMRect.getX(), aMMRect.getY() );
1984 pArray[2].Value <<= aRangeAddress;
1986 pArray[3].Value <<= aCalcPageSize;
1988 pArray[4].Value <<= aCalcPagePos;
2000 const uno::Sequence<beans::PropertyValue>& rOptions )
2005 throw lang::DisposedException( OUString(),
2006 static_cast< sheet::XSpreadsheetDocument* >(
this) );
2012 bool bRenderToGraphic =
false;
2013 bool bSinglePageSheets =
false;
2014 if ( !
FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr, bRenderToGraphic ) )
2015 throw lang::IllegalArgumentException();
2023 for (
const auto&
rValue : rOptions)
2025 if (
rValue.Name ==
"SinglePageSheets" )
2027 rValue.Value >>= bSinglePageSheets;
2032 if (bSinglePageSheets)
2036 if ( nRenderer < 0 )
2037 throw lang::IllegalArgumentException();
2041 throw lang::IllegalArgumentException();
2046 const ScRange* pSelRange =
nullptr;
2047 if ( bSinglePageSheets )
2049 awt::Size aPageSize;
2052 rDoc.
GetDataStart( nSelRenderer, nStartCol, nStartRow );
2064 aPageSize.Width = aMMRect.
GetWidth();
2069 if (nVisTab != nSelRenderer)
2071 nVisTab = nSelRenderer;
2079 else if ( aMark.IsMarked() )
2081 aMark.GetMarkArea( aRange );
2082 pSelRange = &aRange;
2093 aViewData.SetTabNo( aRange.
aStart.
Tab() );
2096 const double nPrintFactor = 1.0;
2105 struct DrawViewKeeper
2107 std::unique_ptr<FmFormView> mpDrawView;
2113 mpDrawView->HideSdrPage();
2129 aDrawViewKeeper.mpDrawView.reset(
new FmFormView(
2132 aDrawViewKeeper.mpDrawView->ShowSdrPage(aDrawViewKeeper.mpDrawView->GetModel()->GetPage(nTab));
2133 aDrawViewKeeper.mpDrawView->SetPrintPreview();
2140 std::unique_ptr<ScPrintFunc, o3tl::default_delete<ScPrintFunc>> pPrintFunc;
2147 pPrintFunc->SetDrawView( aDrawViewKeeper.mpDrawView.get() );
2148 pPrintFunc->SetRenderFlag(
true );
2150 pPrintFunc->SetExclusivelyDrawOleAndDrawObjects();
2152 sal_Int32 nContent = 0;
2153 sal_Int32 nEOContent = 0;
2154 for (
const auto&
rValue : rOptions)
2156 if (
rValue.Name ==
"PrintRange" )
2158 rValue.Value >>= nContent;
2160 else if (
rValue.Name ==
"EvenOdd" )
2162 rValue.Value >>= nEOContent;
2169 bool bOddOrEven = (nContent == 0 && nEOContent == 1) || (nContent == 0 && nEOContent == 2);
2176 aPage.
Select( nRenderer+1 );
2182 if ( nRenderer == nTabStart )
2190 sal_Int32 nDestID = pPDFData->
CreateDest( aArea );
2192 rDoc.
GetName( nTab, aTabName );
2201 rDoc.
GetName( nTab, aTabName );
2207 (
void)pPrintFunc->DoPrint( aPage, nTabStart, nDisplayStart,
true,
nullptr );
2222 std::vector< vcl::PDFExtOutDevBookmarkEntry >& rBookmarks = pPDFData->
GetBookmarks();
2223 for (
const auto& rBookmark : rBookmarks )
2225 OUString aBookmark = rBookmark.aBookmark;
2226 if ( aBookmark.toChar() ==
'#' )
2230 OUString aTarget( aBookmark.copy( 1 ) );
2234 bool bIsSheet =
false;
2235 bool bValid =
lcl_ParseTarget( aTarget, aTargetRange, aTargetRect, bIsSheet, rDoc, nTab );
2239 sal_Int32 nPage = -1;
2253 if (
pPrintFuncCache->FindLocation( aTargetRange.aStart, aLocation ) )
2255 nPage = aLocation.
nPage;
2277 if ( nX1 > aLocationPixel.
Right() ) nX1 = aLocationPixel.
Right();
2278 if ( nX2 > aLocationPixel.
Right() ) nX2 = aLocationPixel.
Right();
2279 if ( nY1 > aLocationPixel.
Bottom() ) nY1 = aLocationPixel.
Bottom();
2280 if ( nY2 > aLocationPixel.
Bottom() ) nY2 = aLocationPixel.
Bottom();
2296 pPDFData->
SetLinkURL( rBookmark.nLinkId, aBookmark );
2317 bool bLocked =
false;
2347 sal_uInt16 nRet = 0;
2387 OSL_FAIL(
"no DocShell");
2401 OSL_FAIL(
"no DocShell");
2411 OSL_FAIL(
"no DocShell");
2417 bool bEnabled(bEnabledIn);
2430 OSL_FAIL(
"no DocShell");
2453 throw lang::IllegalArgumentException();
2463 OSL_FAIL(
"no DocShell");
2475 OSL_FAIL(
"no DocShell");
2482 const table::CellAddress& aFormulaPosition,
2483 const table::CellAddress& aVariablePosition,
2484 const OUString& aGoalValue )
2487 sheet::GoalResult aResult;
2488 aResult.Divergence = DBL_MAX;
2493 double fValue = 0.0;
2494 bool bFound = rDoc.
Solver(
2495 static_cast<SCCOL>(aFormulaPosition.Column), static_cast<SCROW>(aFormulaPosition.Row), aFormulaPosition.Sheet,
2496 static_cast<SCCOL>(aVariablePosition.Column), static_cast<SCROW>(aVariablePosition.Row), aVariablePosition.Sheet,
2497 aGoalValue, fValue );
2498 aResult.Result = fValue;
2500 aResult.Divergence = 0.0;
2523 const uno::Reference<sheet::XConsolidationDescriptor>& xDescriptor )
2532 xImpl->setFunction( xDescriptor->getFunction() );
2533 xImpl->setSources( xDescriptor->getSources() );
2534 xImpl->setStartOutputPosition( xDescriptor->getStartOutputPosition() );
2535 xImpl->setUseColumnHeaders( xDescriptor->getUseColumnHeaders() );
2536 xImpl->setUseRowHeaders( xDescriptor->getUseRowHeaders() );
2537 xImpl->setInsertLinks( xDescriptor->getInsertLinks() );
2567 xRet.set( xCont, uno::UNO_QUERY_THROW );
2569 uno::Sequence< beans::PropertyValue >
aSeq;
2573 OUString sOUName(sName);
2575 aSeq[0].Value <<= sOUName;
2578 aSeq[1].Value <<= nPosLeft;
2581 aSeq[2].Value <<= nPosTop;
2582 xCont->insertByIndex( 0, uno::makeAny( aSeq ) );
2595 static uno::Reference<beans::XPropertySetInfo> aRef(
2601 const OUString& aPropertyName,
const uno::Any& aValue )
2623 bHardRecalc =
false;
2627 lang::Locale aLocale;
2628 if ( aValue >>= aLocale )
2639 if ( aValue >>= sCodeName )
2644 lang::Locale aLocale;
2645 if ( aValue >>= aLocale )
2655 lang::Locale aLocale;
2656 if ( aValue >>= aLocale )
2672 pBindings->
Invalidate( SID_FM_OPEN_READONLY );
2682 pBindings->
Invalidate( SID_FM_AUTOCONTROLFOCUS );
2694 ? officecfg::Office::Common::Undo::Steps::get() : 0);
2700 bool bChangeAllowed =
true;
2701 if (!bRecordChangesEnabled)
2722 else if ( aPropertyName ==
"BuildId" )
2726 else if ( aPropertyName ==
"SavedObject" )
2729 aValue >>= aObjName;
2730 if ( !aObjName.isEmpty() )
2738 if ( aNewOpt != rOldOpt )
2767 lang::Locale aLocale;
2781 lang::Locale aLocale;
2790 lang::Locale aLocale;
2835 aRet <<= bOpenInDesign;
2842 aRet <<= bAutoControlFocus;
2867 aRet <<= OUString(
"ThisExcelDoc" );
2909 aRet <<= uno::Reference< awt::XDevice >( pXDev );
2911 else if ( aPropertyName ==
"BuildId" )
2915 else if ( aPropertyName ==
"InternalDocument" )
2933 OUString const & aServiceSpecifier,
2938 uno::Reference<uno::XInterface> xRet;
2940 if ( nType != ServiceType::INVALID )
2946 case ServiceType::GRADTAB: xRet.set(xDrawGradTab);
break;
2947 case ServiceType::HATCHTAB: xRet.set(xDrawHatchTab);
break;
2948 case ServiceType::BITMAPTAB: xRet.set(xDrawBitmapTab);
break;
2949 case ServiceType::TRGRADTAB: xRet.set(xDrawTrGradTab);
break;
2950 case ServiceType::MARKERTAB: xRet.set(xDrawMarkerTab);
break;
2951 case ServiceType::DASHTAB: xRet.set(xDrawDashTab);
break;
2952 case ServiceType::CHDATAPROV: xRet.set(xChartDataProv);
break;
2953 case ServiceType::VBAOBJECTPROVIDER: xRet.set(xObjProvider);
break;
2960 ( nType != ServiceType::CHDATAPROV ||
2961 ( pDocShell->GetCreateMode() != SfxObjectCreateMode::INTERNAL ));
2966 if ( !xRet.is() && bCreate )
2973 case ServiceType::GRADTAB: xDrawGradTab.set(xRet);
break;
2974 case ServiceType::HATCHTAB: xDrawHatchTab.set(xRet);
break;
2975 case ServiceType::BITMAPTAB: xDrawBitmapTab.set(xRet);
break;
2976 case ServiceType::TRGRADTAB: xDrawTrGradTab.set(xRet);
break;
2977 case ServiceType::MARKERTAB: xDrawMarkerTab.set(xRet);
break;
2978 case ServiceType::DASHTAB: xDrawDashTab.set(xRet);
break;
2979 case ServiceType::CHDATAPROV: xChartDataProv.set(xRet);
break;
2980 case ServiceType::VBAOBJECTPROVIDER: xObjProvider.set(xRet);
break;
2992 xRet = arguments ==
nullptr
2995 aServiceSpecifier, *arguments);
2998 catch ( lang::ServiceNotRegisteredException & )
3005 uno::Reference<drawing::XShape> xShape( xRet, uno::UNO_QUERY );
3017 const OUString& aServiceSpecifier )
3020 return create(aServiceSpecifier,
nullptr);
3024 const OUString& ServiceSpecifier,
3025 const uno::Sequence<uno::Any>& aArgs )
3030 uno::Reference<uno::XInterface> xInt(
create(ServiceSpecifier, &aArgs));
3032 if ( aArgs.hasElements() )
3036 uno::Reference<lang::XInitialization> xInit( xInt, uno::UNO_QUERY );
3038 xInit->initialize( aArgs );
3055 return "ScModelObj";
3074 const uno::Sequence<sal_Int8 >& rId )
3076 if ( isUnoTunnelId<ScModelObj>(rId) )
3078 return sal::static_int_cast<sal_Int64>(
reinterpret_cast<sal_IntPtr
>(
this));
3081 if ( isUnoTunnelId<SfxObjectShell>(rId) )
3083 return sal::static_int_cast<sal_Int64>(
reinterpret_cast<sal_IntPtr
>(
pDocShell ));
3097 if(
auto xTunnelAgg =
o3tl::tryAccess<uno::Reference<lang::XUnoTunnel>>(
3100 return (*xTunnelAgg)->getSomething( rId );
3109 class theScModelObjUnoTunnelId :
public rtl::Static< UnoTunnelIdInit, theScModelObjUnoTunnelId> {};
3114 return theScModelObjUnoTunnelId::get().getSeq();
3141 const uno::Sequence< beans::PropertyValue >& rProperties )
3145 util::ChangesEvent
aEvent;
3146 aEvent.Source.set( static_cast< cppu::OWeakObject* >(
this ) );
3147 aEvent.Base <<= aEvent.Source;
3149 size_t nRangeCount = rRanges.
size();
3150 aEvent.Changes.realloc( static_cast< sal_Int32 >( nRangeCount ) );
3153 uno::Reference< table::XCellRange > xRangeObj;
3165 util::ElementChange& rChange = aEvent.Changes[
static_cast< sal_Int32
>(
nIndex ) ];
3166 rChange.Accessor <<= rOperation;
3167 rChange.Element <<= rProperties;
3168 rChange.ReplacedElement <<= xRangeObj;
3176 static_cast< util::XChangesListener*
>( aIter.
next() )->changesOccurred( aEvent );
3178 catch( uno::Exception& )
3186 if ( !(rOperation ==
"cell-change" &&
pDocShell) )
3193 for (
const SCTAB& nTab : aMarkData)
3195 if (nTab >= nTabCount)
3204 size_t nRangeCount = rRanges.
size();
3211 size_t nTabRangeCount = aTabRanges.
size();
3212 if ( nTabRangeCount > 0 )
3214 uno::Reference<uno::XInterface>
xTarget;
3215 if ( nTabRangeCount == 1 )
3217 ScRange const & rRange = aTabRanges[ 0 ];
3226 uno::Sequence<uno::Any> aParams(1);
3227 aParams[0] <<= xTarget;
3230 uno::Sequence<sal_Int16> aOutArgsIndex;
3231 uno::Sequence<uno::Any> aOutArgs;
3251 for (
SCTAB nTab = 0; nTab < nTabCount; nTab++)
3260 uno::Sequence<uno::Any> aParams;
3261 uno::Sequence<sal_Int16> aOutArgsIndex;
3262 uno::Sequence<uno::Any> aOutArgs;
3269 uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( rDoc.
GetVbaEventProcessor(), uno::UNO_SET_THROW );
3270 uno::Sequence< uno::Any > aArgs( 1 );
3271 aArgs[ 0 ] <<= nTab;
3274 catch( uno::Exception& )
3298 officecfg::Office::Common::Misc::UseOpenCL::set(bEnable, batch);
3306 #if HAVE_FEATURE_OPENCL
3307 sc::FormulaGroupInterpreter::switchOpenCLDevice(OUString(),
true);
3322 SC_MOD()->SetFormulaOptions(aOptions);
3323 #if !HAVE_FEATURE_OPENCL
3326 sc::FormulaGroupInterpreter::switchOpenCLDevice(OUString(),
true, bForce);
3337 SC_MOD()->SetFormulaOptions(aOptions);
3342 if(nPlatform < 0 || nDevice < 0)
3343 throw uno::RuntimeException();
3345 #if !HAVE_FEATURE_OPENCL
3346 throw uno::RuntimeException();
3348 std::vector<OpenCLPlatformInfo> aPlatformInfo;
3349 sc::FormulaGroupInterpreter::fillOpenCLInfo(aPlatformInfo);
3351 throw uno::RuntimeException();
3354 throw uno::RuntimeException();
3356 OUString aDeviceString = aPlatformInfo[nPlatform].maVendor +
" " + aPlatformInfo[nPlatform].maDevices[nDevice].maName;
3357 sc::FormulaGroupInterpreter::switchOpenCLDevice(aDeviceString,
false);
3363 #if !HAVE_FEATURE_OPENCL
3366 sal_Int32 nPlatformId;
3367 sal_Int32 nDeviceId;
3368 sc::FormulaGroupInterpreter::getOpenCLDeviceInfo(nDeviceId, nPlatformId);
3375 #if !HAVE_FEATURE_OPENCL
3378 sal_Int32 nPlatformId;
3379 sal_Int32 nDeviceId;
3380 sc::FormulaGroupInterpreter::getOpenCLDeviceInfo(nDeviceId, nPlatformId);
3387 #if !HAVE_FEATURE_OPENCL
3388 return uno::Sequence<sheet::opencl::OpenCLPlatform>();
3390 std::vector<OpenCLPlatformInfo> aPlatformInfo;
3391 sc::FormulaGroupInterpreter::fillOpenCLInfo(aPlatformInfo);
3393 uno::Sequence<sheet::opencl::OpenCLPlatform> aRet(aPlatformInfo.size());
3394 for(
size_t i = 0;
i < aPlatformInfo.size(); ++
i)
3396 aRet[
i].Name = aPlatformInfo[
i].maName;
3397 aRet[
i].Vendor = aPlatformInfo[
i].maVendor;
3399 aRet[
i].Devices.realloc(aPlatformInfo[
i].maDevices.size());
3400 for(
size_t j = 0; j < aPlatformInfo[
i].maDevices.size(); ++j)
3403 aRet[
i].Devices[j].Name = rDevice.
maName;
3404 aRet[
i].Devices[j].Vendor = rDevice.
maVendor;
3405 aRet[
i].Devices[j].Driver = rDevice.
maDriver;
3416 void setOpcodeSubsetTest(
bool bFlag)
3419 officecfg::Office::Calc::Formula::Calculation::OpenCLSubsetOnly::set(bFlag, batch);
3427 setOpcodeSubsetTest(
true);
3432 setOpcodeSubsetTest(
false);
3437 return officecfg::Office::Calc::Formula::Calculation::OpenCLSubsetOnly::get();
3443 officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::set(number, batch);
3449 return officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::get();
3470 if ( rHint.
GetId() == SfxHintId::Dying )
3481 OSL_ENSURE(pDrawLayer,
"Cannot create Draw-Layer");
3482 if ( pDrawLayer && nIndex >= 0 && nIndex < pDocShell->GetDocument().GetTableCount() )
3484 SdrPage* pPage = pDrawLayer->
GetPage(static_cast<sal_uInt16>(nIndex));
3485 OSL_ENSURE(pPage,
"Draw-Page not found");
3488 return uno::Reference<drawing::XDrawPage> (pPage->
getUnoPage(), uno::UNO_QUERY);
3500 uno::Reference<drawing::XDrawPage> xRet;
3506 aNewName,
true,
true ) )
3515 SvxDrawPage* pImp = comphelper::getUnoTunnelImplementation<SvxDrawPage>( xPage );
3542 throw lang::IndexOutOfBoundsException();
3544 return uno::makeAny(xPage);
3577 if ( rHint.
GetId() == SfxHintId::Dying )
3587 if (
pDocShell && nIndex >= 0 && nIndex < pDocShell->GetDocument().GetTableCount() )
3613 throw uno::RuntimeException();
3627 throw uno::RuntimeException();
3631 const OUString& aCopy, sal_Int16 nDestination )
3644 SCTAB nResultTab =
static_cast<SCTAB>(nDestination);
3646 if (nResultTab >= nTabCount)
3647 nResultTab = nTabCount - 1;
3655 throw uno::RuntimeException();
3662 bool bIllArg =
false;
3668 uno::Reference<uno::XInterface> xInterface(aElement, uno::UNO_QUERY);
3669 if ( xInterface.is() )
3671 ScTableSheetObj* pSheetObj = comphelper::getUnoTunnelImplementation<ScTableSheetObj>( xInterface );
3676 if ( rDoc.
GetTable( aName, nDummy ) )
3679 throw container::ElementExistException();
3698 throw lang::IllegalArgumentException();
3700 throw uno::RuntimeException();
3708 bool bIllArg =
false;
3714 uno::Reference<uno::XInterface> xInterface(aElement, uno::UNO_QUERY);
3715 if ( xInterface.is() )
3717 ScTableSheetObj* pSheetObj = comphelper::getUnoTunnelImplementation<ScTableSheetObj>( xInterface );
3724 throw container::NoSuchElementException();
3746 throw lang::IllegalArgumentException();
3748 throw uno::RuntimeException();
3760 throw container::NoSuchElementException();
3765 throw uno::RuntimeException();
3769 const uno::Reference < sheet::XSpreadsheetDocument > & xDocSrc,
3770 const OUString& srcName,
const sal_Int32 nDestPosition )
3776 if ( !xDocSrc.is() )
3777 throw uno::RuntimeException();
3778 ScModelObj* pObj = comphelper::getUnoTunnelImplementation<ScModelObj>(xDocSrc);
3783 if ( !pDocShellSrc->GetDocument().GetTable( srcName, nIndexSrc ) )
3784 throw lang::IllegalArgumentException();
3788 SCTAB nIndexDest =
static_cast<SCTAB>(nDestPosition);
3789 if (nIndexDest > nCount || nIndexDest < 0)
3790 throw lang::IndexOutOfBoundsException();
3794 *pDocShellSrc, nIndexSrc, nIndexDest,
true,
true );
3804 uno::Reference<table::XCellRange> xSheet(static_cast<ScCellRangeObj*>(
GetObjectByIndex_Impl(static_cast<sal_uInt16>(nSheet))));
3806 throw lang::IndexOutOfBoundsException();
3808 return xSheet->getCellByPosition(nColumn, nRow);
3814 uno::Reference<table::XCellRange> xSheet(static_cast<ScCellRangeObj*>(
GetObjectByIndex_Impl(static_cast<sal_uInt16>(nSheet))));
3816 throw lang::IndexOutOfBoundsException();
3818 return xSheet->getCellRangeByPosition(nLeft, nTop, nRight, nBottom);
3824 uno::Sequence < uno::Reference < table::XCellRange > > xRet;
3829 throw lang::IllegalArgumentException();
3833 throw lang::IllegalArgumentException();
3835 xRet.realloc(nCount);
3868 throw lang::IndexOutOfBoundsException();
3870 return uno::makeAny(xSheet);
3894 throw container::NoSuchElementException();
3896 return uno::makeAny(xSheet);
3907 uno::Sequence<OUString>
aSeq(nCount);
3908 OUString* pAry = aSeq.getArray();
3916 return uno::Sequence<OUString>();
3932 pDocShell( pDocSh ),
3950 if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
3954 else if ( rHint.
GetId() == SfxHintId::Dying )
3997 throw uno::RuntimeException();
4016 throw uno::RuntimeException();
4040 throw lang::IndexOutOfBoundsException();
4042 return uno::makeAny(xColumn);
4063 throw container::NoSuchElementException();
4065 return uno::makeAny(xColumn);
4072 uno::Sequence<OUString>
aSeq(nCount);
4073 OUString* pAry = aSeq.getArray();
4096 static uno::Reference<beans::XPropertySetInfo> aRef(
4102 const OUString& aPropertyName,
const uno::Any& aValue )
4106 throw uno::RuntimeException();
4113 sal_Int32 nNewWidth = 0;
4114 if ( aValue >>= nNewWidth )
4149 throw uno::RuntimeException();
4160 aAny <<= static_cast<sal_Int32>(
TwipsToHMM(nWidth));
4189 pDocShell( pDocSh ),
4194 pDocShell->GetDocument().AddUnoObject(*
this);
4207 if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
4211 else if ( rHint.
GetId() == SfxHintId::Dying )
4244 throw uno::RuntimeException();
4260 throw uno::RuntimeException();
4284 throw lang::IndexOutOfBoundsException();
4286 return uno::makeAny(xRow);
4306 static uno::Reference<beans::XPropertySetInfo> aRef(
4312 const OUString& aPropertyName,
const uno::Any& aValue )
4316 throw uno::RuntimeException();
4324 sal_Int32 nNewHeight = 0;
4346 sal_Int32 nNewHeight = 0;
4347 if ( aValue >>= nNewHeight )
4403 xRangeObj->setPropertyValue( aPropertyName, aValue );
4411 throw uno::RuntimeException();
4422 aAny <<= static_cast<sal_Int32>(
TwipsToHMM(nHeight));
4457 aAny = xRangeObj->getPropertyValue( aPropertyName );
4477 const OUString& ,
const uno::Any& )
4489 pDocShell( pDocSh ),
4492 pDocShell->GetDocument().AddUnoObject(*
this);
4507 if ( rHint.
GetId() == SfxHintId::Dying )
4537 const table::CellAddress& aPosition,
const OUString& rText )
4542 OSL_ENSURE( aPosition.Sheet ==
nTab,
"addAnnotation with a wrong Sheet" );
4543 ScAddress aPos( static_cast<SCCOL>(aPosition.Column), static_cast<SCROW>(aPosition.Row),
nTab );
4558 aMarkData.SetMultiMarkArea(
ScRange(aPos) );
4572 return new ScIndexEnumeration(
this,
"com.sun.star.sheet.CellAnnotationsEnumeration");
4594 if (!xAnnotation.is())
4595 throw lang::IndexOutOfBoundsException();
4597 return uno::makeAny(xAnnotation);
4613 pDocShell( pDocSh ),
4629 if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
4633 else if ( rHint.
GetId() == SfxHintId::Dying )
4652 if (aTabName == rName)
4665 if (
pDocShell && nIndex >= 0 && nIndex < nCount )
4681 const uno::Sequence<table::CellRangeAddress>& aRanges,
4682 const OUString& aComment )
4691 for (
const table::CellRangeAddress& rRange : aRanges)
4693 OSL_ENSURE( rRange.Sheet ==
nTab,
"addScenario with a wrong Tab" );
4694 ScRange aRange( static_cast<SCCOL>(rRange.StartColumn), static_cast<SCROW>(rRange.StartRow),
nTab,
4695 static_cast<SCCOL>(rRange.EndColumn), static_cast<SCROW>(rRange.EndRow),
nTab );
4697 aMarkData.SetMultiMarkArea( aRange );
4735 while (nNext < nTabCount && rDoc.
IsScenario(nNext))
4750 throw lang::IndexOutOfBoundsException();
4752 return uno::makeAny(xScen);
4772 throw container::NoSuchElementException();
4774 return uno::makeAny(xScen);
4781 uno::Sequence<OUString>
aSeq(nCount);
4787 OUString* pAry = aSeq.getArray();
virtual css::sheet::GoalResult SAL_CALL seekGoal(const css::table::CellAddress &aFormulaPosition, const css::table::CellAddress &aVariablePosition, const OUString &aGoalValue) override
XGoalSeek.
SC_DLLPUBLIC bool IsDocProtected() const
Stores the selection in the ScPrintFuncCache so it is only used for the same selection again...
virtual void SAL_CALL lockControllers() override
ScPrintSelectionMode GetMode() const
static Type GetProviderType(const OUString &rServiceName)
SC_DLLPUBLIC bool GetPrintArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow, bool bNotes=true) const
#define SC_UNO_IGNORECASE
SCTAB nTab
Collection belongs to the sheet.
virtual void SAL_CALL acquire() override
SfxViewFrame * GetViewFrame() const
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
OUString const & getRuntimeUID() const
virtual sal_Int32 SAL_CALL getFormulaCellNumberLimit() override
#define SCMODELOBJ_SERVICE
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
XPropertySet.
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
XEnumerationAccess.
bool GetScenarioIndex_Impl(std::u16string_view rName, SCTAB &rIndex)
bool setGraphicSelection(int nType, int nX, int nY, double fScaleX=1.0, double fScaleY=1.0)
virtual void SAL_CALL disableOpcodeSubsetTest() override
void SetAutoComplete(bool bNew)
#define SC_UNO_ISADJUSTHEIGHTENABLED
virtual css::uno::Type SAL_CALL getElementType() override
XElementAccess.
void SetDigitLanguage(LanguageType)
void setGrabBagItem(const css::uno::Any &rVal)
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
#define SC_UNO_SPELLONLINE
css::uno::Reference< css::uno::XInterface > create(OUString const &aServiceSpecifier, css::uno::Sequence< css::uno::Any > const *arguments)
virtual void SAL_CALL enableAutomaticDeviceSelection(sal_Bool bForce) override
bool hasValidSignatures() const
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
XNameAccess.
void setOpenCLConfigToDefault()
virtual void SAL_CALL addChangesListener(const css::uno::Reference< css::util::XChangesListener > &aListener) override
XChangesNotifier.
virtual void getCellCursor(tools::JsonWriter &rJsonWriter) override
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
#define PROP_UNO_CALCASSHOWN
virtual void SAL_CALL lockControllers() override
SC_DLLPUBLIC bool GetDataStart(SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow) const
virtual void SAL_CALL unprotect(const OUString &aPassword) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const OUString &aServiceSpecifier) override
XMultiServiceFactory.
void SetConsolidateDlgData(std::unique_ptr< ScConsolidateParam > pData)
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
static bool HasValidData(const css::uno::Reference< css::datatransfer::XTransferable > &rTransferable)
virtual const tools::Rectangle & GetCurrentBoundRect() const
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
virtual css::uno::Reference< css::sheet::XSpreadsheets > SAL_CALL getSheets() override
XSpreadsheetDocument.
virtual void SAL_CALL enableOpenCL(sal_Bool bEnable) override
bool Unprotect(SCTAB nTab, const OUString &rPassword, bool bApi)
#define SC_UNONAME_VISFLAG
Iterator begin(const o3tl::sorted_vector< sal_Int32 > *i_pPossibleValues=nullptr) const
static bool HitAny(const Point &aPos)
virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) override
virtual void completeFunction(const OUString &rFunctionName) override
SC_DLLPUBLIC CRFlags GetColFlags(SCCOL nCol, SCTAB nTab) const
virtual void SAL_CALL release() override
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLinks() override
XLinkTargetSupplier.
SC_DLLPUBLIC bool DeleteContents(const ScMarkData &rMark, InsertDeleteFlags nFlags, bool bRecord, bool bApi)
virtual sal_Int32 SAL_CALL getCount() override
XIndexAccess.
virtual void SAL_CALL unlockControllers() override
ScTableRowObj * GetObjectByIndex_Impl(sal_Int32 nIndex) const
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
ScDocShell * GetDocShell() const
void setWidth(tools::Long nWidth)
ScInterpreterContext & GetThreadedContext() const
#define SC_UNO_ITERENABLED
static void PaintAllChartsOnTile(VirtualDevice &rDevice, int nOutputWidth, int nOutputHeight, int nTilePosX, int nTilePosY, tools::Long nTileWidth, tools::Long nTileHeight)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const OUString &ServiceSpecifier, const css::uno::Sequence< css::uno::Any > &Arguments) override
virtual void setTextSelection(int nType, int nX, int nY) override
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getViewData() override