| LibreOffice Module sc (master) 1
    | 
#include "vbarange.hxx"#include <comphelper/servicehelper.hxx>#include <comphelper/types.hxx>#include <cppuhelper/exc_hlp.hxx>#include <o3tl/any.hxx>#include <o3tl/safeint.hxx>#include <o3tl/unit_conversion.hxx>#include <rtl/math.hxx>#include <comphelper/diagnose_ex.hxx>#include <o3tl/string_view.hxx>#include <com/sun/star/script/ArrayWrapper.hpp>#include <com/sun/star/script/XTypeConverter.hpp>#include <com/sun/star/script/vba/VBAEventId.hpp>#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>#include <com/sun/star/sheet/XDatabaseRange.hpp>#include <com/sun/star/sheet/XUnnamedDatabaseRanges.hpp>#include <com/sun/star/sheet/XGoalSeek.hpp>#include <com/sun/star/sheet/XSheetOperation.hpp>#include <com/sun/star/sheet/CellFlags.hpp>#include <com/sun/star/table/XColumnRowRange.hpp>#include <com/sun/star/sheet/XCellAddressable.hpp>#include <com/sun/star/table/CellContentType.hpp>#include <com/sun/star/sheet/XCellSeries.hpp>#include <com/sun/star/text/XTextRange.hpp>#include <com/sun/star/sheet/XCellRangeAddressable.hpp>#include <com/sun/star/table/CellAddress.hpp>#include <com/sun/star/table/CellRangeAddress.hpp>#include <com/sun/star/sheet/XSpreadsheetView.hpp>#include <com/sun/star/sheet/XCellRangeReferrer.hpp>#include <com/sun/star/sheet/XSheetCellRange.hpp>#include <com/sun/star/sheet/XSpreadsheet.hpp>#include <com/sun/star/sheet/XSheetCellCursor.hpp>#include <com/sun/star/sheet/XArrayFormulaRange.hpp>#include <com/sun/star/sheet/XNamedRange.hpp>#include <com/sun/star/sheet/XNamedRanges.hpp>#include <com/sun/star/sheet/XPrintAreas.hpp>#include <com/sun/star/sheet/XCellRangesQuery.hpp>#include <com/sun/star/beans/XPropertySet.hpp>#include <com/sun/star/frame/XModel.hpp>#include <com/sun/star/view/XSelectionSupplier.hpp>#include <com/sun/star/table/XTableRows.hpp>#include <com/sun/star/table/XTableColumns.hpp>#include <com/sun/star/table/TableSortField.hpp>#include <com/sun/star/util/XMergeable.hpp>#include <com/sun/star/uno/XComponentContext.hpp>#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>#include <com/sun/star/util/XNumberFormatsSupplier.hpp>#include <com/sun/star/util/XNumberFormats.hpp>#include <com/sun/star/util/NumberFormat.hpp>#include <com/sun/star/util/XNumberFormatTypes.hpp>#include <com/sun/star/util/XReplaceable.hpp>#include <com/sun/star/util/XSortable.hpp>#include <com/sun/star/sheet/XCellRangeMovement.hpp>#include <com/sun/star/sheet/FormulaResult.hpp>#include <com/sun/star/sheet/FilterOperator2.hpp>#include <com/sun/star/sheet/TableFilterField2.hpp>#include <com/sun/star/sheet/XSheetFilterDescriptor2.hpp>#include <com/sun/star/sheet/FilterConnection.hpp>#include <com/sun/star/util/TriState.hpp>#include <com/sun/star/sheet/XSubTotalCalculatable.hpp>#include <com/sun/star/sheet/XSubTotalDescriptor.hpp>#include <com/sun/star/sheet/GeneralFunction.hpp>#include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>#include <com/sun/star/sheet/XSheetAnnotations.hpp>#include <ooo/vba/excel/XlPasteSpecialOperation.hpp>#include <ooo/vba/excel/XlPasteType.hpp>#include <ooo/vba/excel/XlFindLookIn.hpp>#include <ooo/vba/excel/XlLookAt.hpp>#include <ooo/vba/excel/XlSearchOrder.hpp>#include <ooo/vba/excel/XlSortOrder.hpp>#include <ooo/vba/excel/XlYesNoGuess.hpp>#include <ooo/vba/excel/XlSortOrientation.hpp>#include <ooo/vba/excel/XlSortMethod.hpp>#include <ooo/vba/excel/XlDirection.hpp>#include <ooo/vba/excel/XlSortDataOption.hpp>#include <ooo/vba/excel/XlDeleteShiftDirection.hpp>#include <ooo/vba/excel/XlInsertShiftDirection.hpp>#include <ooo/vba/excel/XlReferenceStyle.hpp>#include <ooo/vba/excel/XlBordersIndex.hpp>#include <ooo/vba/excel/XlPageBreak.hpp>#include <ooo/vba/excel/XlAutoFilterOperator.hpp>#include <ooo/vba/excel/XlAutoFillType.hpp>#include <ooo/vba/excel/XlCellType.hpp>#include <ooo/vba/excel/XlSpecialCellsValue.hpp>#include <ooo/vba/excel/XlConsolidationFunction.hpp>#include <ooo/vba/excel/XlSearchDirection.hpp>#include <scitems.hxx>#include <svl/srchitem.hxx>#include <cellsuno.hxx>#include <dbdata.hxx>#include <docfunc.hxx>#include <columnspanset.hxx>#include <queryparam.hxx>#include <sortparam.hxx>#include <sfx2/dispatch.hxx>#include <sfx2/app.hxx>#include <sfx2/bindings.hxx>#include <sfx2/viewfrm.hxx>#include <sc.hrc>#include <unonames.hxx>#include "excelvbahelper.hxx"#include "vbaapplication.hxx"#include "vbafont.hxx"#include "vbacomment.hxx"#include "vbainterior.hxx"#include "vbacharacters.hxx"#include "vbaborders.hxx"#include "vbaworksheet.hxx"#include "vbavalidation.hxx"#include "vbahyperlinks.hxx"#include <tabvwsh.hxx>#include <rangelst.hxx>#include <convuno.hxx>#include <compiler.hxx>#include <patattr.hxx>#include <olinetab.hxx>#include <transobj.hxx>#include <queryentry.hxx>#include <markdata.hxx>#include <basic/sberrors.hxx>#include <cppuhelper/implbase.hxx>#include <global.hxx>#include "vbastyle.hxx"#include "vbaname.hxx"#include <utility>#include <vector>#include <vbahelper/vbacollectionimpl.hxx>#include <com/sun/star/bridge/oleautomation/Date.hpp>#include <tokenarray.hxx>#include <tokenuno.hxx>#include <memory>Go to the source code of this file.
| Typedefs | |
| typedef ::cppu::WeakImplHelper< container::XEnumeration > | CellsEnumeration_BASE | 
| typedef ::std::vector< CellPos > | vCellPos | 
| Functions | |
| static sal_uInt16 | lcl_pointsToTwips (double nVal) | 
| static double | lcl_TwipsToPoints (sal_uInt16 nVal) | 
| static double | lcl_Round2DecPlaces (double nVal) | 
| static uno::Any | lcl_makeRange (const uno::Reference< XHelperInterface > &rParent, const uno::Reference< uno::XComponentContext > &rContext, const uno::Any &rAny, bool bIsRows, bool bIsColumns) | 
| static uno::Reference< excel::XRange > | lcl_makeXRangeFromSheetCellRanges (const uno::Reference< XHelperInterface > &xParent, const uno::Reference< uno::XComponentContext > &xContext, const uno::Reference< sheet::XSheetCellRanges > &xLocSheetCellRanges, ScDocShell *pDoc) | 
| static ScDocShell * | getDocShellFromIf (const uno::Reference< uno::XInterface > &xIf) | 
| static ScDocShell * | getDocShellFromRange (const uno::Reference< table::XCellRange > &xRange) | 
| static ScDocShell * | getDocShellFromRanges (const uno::Reference< sheet::XSheetCellRangeContainer > &xRanges) | 
| static uno::Reference< frame::XModel > | getModelFromXIf (const uno::Reference< uno::XInterface > &xIf) | 
| static uno::Reference< frame::XModel > | getModelFromRange (const uno::Reference< table::XCellRange > &xRange) | 
| static ScDocument & | getDocumentFromRange (const uno::Reference< table::XCellRange > &xRange) | 
| constexpr OUStringLiteral | STR_ERRORMESSAGE_APPLIESTOSINGLERANGEONLY (u"The command you chose cannot be performed with multiple selections.\nSelect a single range and click the command again") | 
| bool | getScRangeListForAddress (const OUString &sName, ScDocShell *pDocSh, const ScRange &refRange, ScRangeList &aCellRanges, formula::FormulaGrammar::AddressConvention aConv) | 
| static rtl::Reference< ScVbaRange > | getRangeForName (const uno::Reference< uno::XComponentContext > &xContext, const OUString &sName, ScDocShell *pDocSh, const table::CellRangeAddress &pAddr, formula::FormulaGrammar::AddressConvention eConv=formula::FormulaGrammar::CONV_XL_A1) | 
| static table::CellRangeAddress | getCellRangeAddressForVBARange (const uno::Any &aParam, ScDocShell *pDocSh) | 
| static uno::Reference< XCollection > | lcl_setupBorders (const uno::Reference< excel::XRange > &xParentRange, const uno::Reference< uno::XComponentContext > &xContext, const uno::Reference< table::XCellRange > &xRange) | 
| static bool | cellInRange (const table::CellRangeAddress &rAddr, sal_Int32 nCol, sal_Int32 nRow) | 
| static void | setCursor (SCCOL nCol, SCROW nRow, const uno::Reference< frame::XModel > &xModel, bool bInSel=true) | 
| static InsertDeleteFlags | getPasteFlags (sal_Int32 Paste) | 
| static ScPasteFunc | getPasteFormulaBits (sal_Int32 Operation) | 
| static uno::Reference< beans::XPropertySet > | getRowOrColumnProps (const uno::Reference< table::XCellRange > &xCellRange, bool bRows) | 
| static uno::Reference< table::XCellRange > | processKey (const uno::Any &Key, const uno::Reference< uno::XComponentContext > &xContext, ScDocShell *pDocSh) | 
| static sal_Int32 | findSortPropertyIndex (const uno::Sequence< beans::PropertyValue > &props, const OUString &sPropName) | 
| static void | updateTableSortField (const uno::Reference< table::XCellRange > &xParentRange, const uno::Reference< table::XCellRange > &xColRowKey, sal_Int16 nOrder, table::TableSortField &aTableField, bool bIsSortColumn, bool bMatchCase) | 
| static double | getDefaultCharWidth (ScDocShell *pDocShell) | 
| static uno::Reference< sheet::XCellRangeReferrer > | getNamedRange (const uno::Reference< uno::XInterface > &xIf, const uno::Reference< table::XCellRange > &thisRange) | 
| static ScDBData * | lcl_GetDBData_Impl (ScDocShell *pDocShell, sal_Int16 nSheet) | 
| static void | lcl_SelectAll (ScDocShell *pDocShell, const ScQueryParam &aParam) | 
| static ScQueryParam | lcl_GetQueryParam (ScDocShell *pDocShell, sal_Int16 nSheet) | 
| static void | lcl_SetAllQueryForField (ScDocShell *pDocShell, SCCOLROW nField, sal_Int16 nSheet) | 
| static void | lcl_setTableFieldsFromCriteria (OUString &sCriteria1, const uno::Reference< beans::XPropertySet > &xDescProps, sheet::TableFilterField2 &rFilterField) | 
| static void | lcl_mergeCellsOfRange (const uno::Reference< table::XCellRange > &xCellRange, bool _bMerge) | 
| static sal_Int32 | getContentResultFlags (const uno::Any &aValue) | 
| static sal_Int32 | lcl_getFormulaResultFlags (const uno::Any &aType) | 
| SAL_DLLPUBLIC_EXPORT css::uno::XInterface * | Calc_ScVbaRange_get_implementation (css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &args) | 
| Variables | |
| const double | fExtraWidth = 182.0 / 256.0 | 
| const sal_Int16 | supportedIndexTable [] = { excel::XlBordersIndex::xlEdgeLeft, excel::XlBordersIndex::xlEdgeTop, excel::XlBordersIndex::xlEdgeBottom, excel::XlBordersIndex::xlEdgeRight, excel::XlBordersIndex::xlDiagonalDown, excel::XlBordersIndex::xlDiagonalUp, excel::XlBordersIndex::xlInsideVertical, excel::XlBordersIndex::xlInsideHorizontal } | 
| constexpr OUStringLiteral | ISVISIBLE = u"IsVisible" | 
| const char | EQUALS [] = "=" | 
| const char | NOTEQUALS [] = "<>" | 
| const char | GREATERTHAN [] = ">" | 
| const char | GREATERTHANEQUALS [] = ">=" | 
| const char | LESSTHAN [] = "<" | 
| const char | LESSTHANEQUALS [] = "<=" | 
| constexpr OUStringLiteral | CELLSTYLE = u"CellStyle" | 
| constexpr OUStringLiteral | sNA = u"#N/A" | 
| typedef ::cppu::WeakImplHelper< container::XEnumeration > CellsEnumeration_BASE | 
Definition at line 584 of file vbarange.cxx.
| typedef ::std::vector< CellPos > vCellPos | 
Definition at line 585 of file vbarange.cxx.
| SAL_DLLPUBLIC_EXPORT css::uno::XInterface * Calc_ScVbaRange_get_implementation | ( | css::uno::XComponentContext * | context, | 
| css::uno::Sequence< css::uno::Any > const & | args | ||
| ) | 
Definition at line 5772 of file vbarange.cxx.
References args.
| 
 | static | 
Definition at line 2329 of file vbarange.cxx.
Referenced by ScVbaRange::Activate().
| 
 | static | 
| uno::RuntimeException | 
Definition at line 3380 of file vbarange.cxx.
References props.
Referenced by ScVbaRange::Sort().
| 
 | static | 
| uno::RuntimeException | 
Definition at line 1385 of file vbarange.cxx.
References ScUnoConversion::FillApiRange(), ScRangeList::front(), getScRangeListForAddress(), and ScRangeList::size().
Referenced by ScVbaRange::Address().
| 
 | static | 
Definition at line 5541 of file vbarange.cxx.
References ERRCODE_BASIC_BAD_PARAMETER.
Referenced by ScVbaRange::SpecialCellsImpl().
| 
 | static | 
Definition at line 3831 of file vbarange.cxx.
References ScPatternAttr::fillFontOnly(), ScDocument::GetDefPattern(), ScDocShell::GetDocument(), ScDocument::GetRefDevice(), OutputDevice::GetTextWidth(), o3tl::mm100, o3tl::pt, and OutputDevice::SetFont().
Referenced by ScVbaRange::getColumnWidth(), and ScVbaRange::setColumnWidth().
| 
 | static | 
| uno::RuntimeException | 
Definition at line 367 of file vbarange.cxx.
Referenced by getDocShellFromRange(), getDocShellFromRanges(), and getModelFromXIf().
| 
 | static | 
| uno::RuntimeException | 
Definition at line 377 of file vbarange.cxx.
References getDocShellFromIf().
Referenced by ScVbaRange::AutoFill(), ScVbaRange::Autofit(), getDocumentFromRange(), ScVbaRange::getPageBreak(), ScVbaRange::getScDocShell(), ScVbaRange::getWorksheet(), ScVbaRange::Insert(), ScVbaRange::PrintOut(), ScVbaRange::setPageBreak(), and ScVbaRange::setRowHeight().
| 
 | static | 
| uno::RuntimeException | 
Definition at line 386 of file vbarange.cxx.
References getDocShellFromIf().
| 
 | static | 
Definition at line 409 of file vbarange.cxx.
References getDocShellFromRange(), and ScDocShell::GetDocument().
Referenced by ScVbaRange::characters(), ScVbaRange::getCalcRowHeight(), ScVbaRange::getPageBreak(), ScVbaRange::getScDocument(), ScVbaRange::getShowDetail(), and lcl_setupBorders().
| 
 | static | 
| uno::RuntimeException | 
Definition at line 401 of file vbarange.cxx.
References getModelFromXIf().
Referenced by ScVbaRange::Cut(), and ScVbaRange::End().
| 
 | static | 
| uno::RuntimeException | 
Definition at line 394 of file vbarange.cxx.
References getDocShellFromIf(), and ScDocShell::GetModel().
Referenced by getModelFromRange().
| 
 | static | 
Definition at line 4190 of file vbarange.cxx.
Referenced by ScVbaRange::getName().
| 
 | static | 
Definition at line 2864 of file vbarange.cxx.
References ALL, ATTRIB, DATETIME, FORMULA, NONE, NOTE, Paste, SPECIAL_BOOLEAN, STRING, and VALUE.
Referenced by ScVbaRange::PasteSpecial().
| 
 | static | 
Definition at line 2891 of file vbarange.cxx.
References ADD, DIV, MUL, NONE, and SUB.
Referenced by ScVbaRange::PasteSpecial().
| 
 | static | 
| uno::RuntimeException | 
Definition at line 1242 of file vbarange.cxx.
References ScUnoConversion::FillScRange(), ScRangeList::front(), getScRangeListForAddress(), ooo::vba::excel::getUnoSheetModuleObj(), ScRangeList::size(), and sName.
Referenced by ScVbaRange::getRangeObjectForName(), and processKey().
| 
 | static | 
| uno::RuntimeException | 
Definition at line 3030 of file vbarange.cxx.
Referenced by ScVbaRange::getHidden(), and ScVbaRange::setHidden().
| bool getScRangeListForAddress | ( | const OUString & | sName, | 
| ScDocShell * | pDocSh, | ||
| const ScRange & | refRange, | ||
| ScRangeList & | aCellRanges, | ||
| formula::FormulaGrammar::AddressConvention | aConv = formula::FormulaGrammar::CONV_XL_A1 | ||
| ) | 
| css::uno::RuntimeException | 
Definition at line 1173 of file vbarange.cxx.
References ScRange::aEnd, ScRange::aStart, ScAddress::Col(), ScDocument::GetAddressConvention(), ScVbaRange::getCellRangesForAddress(), ScDocShell::GetCurTab(), ScDocShell::GetDocument(), ScDocShell::GetModel(), ScModelObj::getPropertyValue(), ScDocument::GetRangeName(), i, nIndex, ScAddress::Row(), ScAddress::SetCol(), ScAddress::SetRow(), ScAddress::SetTab(), ScRangeList::size(), sName, ScAddress::Tab(), TAB_3D, and ZERO.
Referenced by getCellRangeAddressForVBARange(), getRangeForName(), and ScVbaPageSetup::setPrintArea().
| 
 | static | 
Definition at line 4329 of file vbarange.cxx.
References ScDocument::GetAnonymousDBData(), and ScDocShell::GetDocument().
Referenced by lcl_GetQueryParam().
| 
 | static | 
| script::BasicErrorException | 
Definition at line 5563 of file vbarange.cxx.
References ERRCODE_BASIC_BAD_PARAMETER, and nType.
Referenced by ScVbaRange::SpecialCellsImpl().
| 
 | static | 
Definition at line 4357 of file vbarange.cxx.
References ScDBData::GetQueryParam(), and lcl_GetDBData_Impl().
Referenced by ScVbaRange::AutoFilter(), and lcl_SetAllQueryForField().
| 
 | static | 
Definition at line 196 of file vbarange.cxx.
| 
 | static | 
Definition at line 202 of file vbarange.cxx.
References ScUnoConversion::FillScRange(), ScRangeList::front(), ScRangeList::push_back(), and ScRangeList::size().
Referenced by ScVbaRange::SpecialCellsImpl().
| 
 | static | 
| uno::RuntimeException | 
Definition at line 5330 of file vbarange.cxx.
Referenced by ScVbaRange::Merge(), and ScVbaRange::UnMerge().
| 
 | static | 
Definition at line 174 of file vbarange.cxx.
Referenced by ScVbaRange::setColumnWidth(), and ScVbaRange::setRowHeight().
| 
 | static | 
Definition at line 186 of file vbarange.cxx.
Referenced by ScVbaRange::getCalcColWidth(), ScVbaRange::getCalcRowHeight(), ScVbaRange::getColumnWidth(), ScVbaRange::getRowHeight(), ScVbaRange::setColumnWidth(), and ScVbaRange::setRowHeight().
| 
 | static | 
Definition at line 4339 of file vbarange.cxx.
References ScDocShell::GetBestViewShell(), ScViewData::GetView(), ScDocShell::GetViewData(), ScTabView::GetViewData(), and ScDBFunc::Query().
Referenced by lcl_SetAllQueryForField().
| 
 | static | 
Definition at line 4368 of file vbarange.cxx.
References lcl_GetQueryParam(), lcl_SelectAll(), and ScQueryParamBase::RemoveEntryByField().
Referenced by ScVbaRange::AutoFilter().
| 
 | static | 
Definition at line 4376 of file vbarange.cxx.
References EQUALS, ScGlobal::getLocaleData(), GREATERTHAN, GREATERTHANEQUALS, LESSTHAN, LESSTHANEQUALS, o3tl::make_unsigned(), NOTEQUALS, LocaleDataWrapper::stringToDouble(), and VBAToRegexp().
Referenced by ScVbaRange::AutoFilter().
| 
 | static | 
| uno::RuntimeException | 
Definition at line 1425 of file vbarange.cxx.
References getDocumentFromRange(), and ScDocument::GetDocumentShell().
Referenced by ScVbaRange::getBorders().
| 
 | static | 
Definition at line 180 of file vbarange.cxx.
Referenced by ScVbaRange::getCalcColWidth(), ScVbaRange::getCalcRowHeight(), ScVbaRange::getColumnWidth(), and ScVbaRange::getRowHeight().
| 
 | static | 
Definition at line 3355 of file vbarange.cxx.
References getRangeForName().
Referenced by ScVbaRange::Sort().
| 
 | static | 
Definition at line 2335 of file vbarange.cxx.
References ooo::vba::excel::getBestViewShell(), ScTabView::MoveCursorAbs(), SC_FOLLOW_NONE, ScTabView::SetCursor(), and xModel.
Referenced by ScVbaRange::Activate().
| 
 | constexpr | 
Referenced by ScVbaRange::AutoFilter(), ScVbaRange::AutoOutline(), and ScVbaRange::groupUnGroup().
| 
 | static | 
| uno::RuntimeException | 
Definition at line 3393 of file vbarange.cxx.
Referenced by ScVbaRange::Sort().
| 
 | constexpr | 
Definition at line 681 of file vbarange.cxx.
Referenced by ScVbaRange::getStyle(), and ScVbaRange::setStyle().
| const char EQUALS[] = "=" | 
Definition at line 674 of file vbarange.cxx.
Referenced by lcl_setTableFieldsFromCriteria().
| const double fExtraWidth = 182.0 / 256.0 | 
Definition at line 170 of file vbarange.cxx.
Referenced by ScVbaRange::getColumnWidth(), and ScVbaRange::setColumnWidth().
| const char GREATERTHAN[] = ">" | 
Definition at line 676 of file vbarange.cxx.
Referenced by lcl_setTableFieldsFromCriteria().
| const char GREATERTHANEQUALS[] = ">=" | 
Definition at line 677 of file vbarange.cxx.
Referenced by lcl_setTableFieldsFromCriteria().
| 
 | constexpr | 
Definition at line 673 of file vbarange.cxx.
Referenced by ScVbaRange::getHidden(), and ScVbaRange::setHidden().
| const char LESSTHAN[] = "<" | 
Definition at line 678 of file vbarange.cxx.
Referenced by lcl_setTableFieldsFromCriteria().
| const char LESSTHANEQUALS[] = "<=" | 
Definition at line 679 of file vbarange.cxx.
Referenced by lcl_setTableFieldsFromCriteria().
| const char NOTEQUALS[] = "<>" | 
Definition at line 675 of file vbarange.cxx.
Referenced by lcl_setTableFieldsFromCriteria().
| 
 | constexpr | 
Definition at line 985 of file vbarange.cxx.
| const sal_Int16 supportedIndexTable[] = { excel::XlBordersIndex::xlEdgeLeft, excel::XlBordersIndex::xlEdgeTop, excel::XlBordersIndex::xlEdgeBottom, excel::XlBordersIndex::xlEdgeRight, excel::XlBordersIndex::xlDiagonalDown, excel::XlBordersIndex::xlDiagonalUp, excel::XlBordersIndex::xlInsideVertical, excel::XlBordersIndex::xlInsideHorizontal } | 
Definition at line 172 of file vbarange.cxx.
Referenced by ScVbaRange::BorderAround().