25#include <com/sun/star/awt/Point.hpp>
26#include <com/sun/star/awt/Size.hpp>
27#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
28#include <com/sun/star/sheet/ConditionOperator2.hpp>
29#include <com/sun/star/sheet/TableValidationVisibility.hpp>
30#include <com/sun/star/sheet/ValidationType.hpp>
31#include <com/sun/star/sheet/ValidationAlertStyle.hpp>
32#include <com/sun/star/sheet/XCellAddressable.hpp>
33#include <com/sun/star/sheet/XMultiFormulaTokens.hpp>
34#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
35#include <com/sun/star/sheet/XSheetCondition2.hpp>
36#include <com/sun/star/sheet/XSheetOutline.hpp>
37#include <com/sun/star/sheet/XSpreadsheet.hpp>
38#include <com/sun/star/table/XColumnRowRange.hpp>
39#include <com/sun/star/text/WritingMode2.hpp>
40#include <com/sun/star/lang/XMultiServiceFactory.hpp>
41#include <osl/diagnose.h>
42#include <rtl/ustrbuf.hxx>
45#include <oox/token/properties.hxx>
46#include <oox/token/tokens.hxx>
51#include <document.hxx>
65#include <tokenarray.hxx>
69#include <stlsheet.hxx>
97 rxProgressBar->setPosition( fPosition );
102sal_Int32 lclClampToNonNegativeInt32(
tools::Long aVal )
104 if ( aVal > SAL_MAX_INT32 || aVal < 0 )
106 SAL_WARN(
"sc.filter",
"Overflow detected, " << aVal <<
" does not fit into sal_Int32, or is negative." );
109 return static_cast<sal_Int32
>( aVal );
119 mbShowPhonetic( false ),
142 mbCustomHeight( false ),
143 mbCustomFormat( false ),
144 mbShowPhonetic( false ),
146 mbCollapsed( false ),
148 mbThickBottom( false )
178 mnOperator( XML_between ),
179 mnErrorStyle( XML_stop ),
180 mbShowInputMsg( false ),
181 mbShowErrorMsg( false ),
182 mbNoDropDown( false ),
183 mbAllowBlank( false )
189 static const sal_Int32 spnTypeIds[] = {
190 XML_none, XML_whole, XML_decimal, XML_list, XML_date, XML_time, XML_textLength, XML_custom };
196 static const sal_Int32 spnOperators[] = {
197 XML_between, XML_notBetween, XML_equal, XML_notEqual,
198 XML_greaterThan, XML_lessThan, XML_greaterThanOrEqual, XML_lessThanOrEqual };
204 static const sal_Int32 spnErrorStyles[] = { XML_stop, XML_warning, XML_information };
235 Reference< XCellRange >
getColumn( sal_Int32 nCol )
const;
237 Reference< XCellRange >
getRow( sal_Int32 nRow )
const;
306 void setDefaultRowSettings(
double fHeight,
bool bCustomHeight,
bool bHidden,
bool bThickTop,
bool bThickBottom );
353 void convertRows(
const std::vector<sc::ColRowSpan>& rSpans);
357 const std::vector<sc::ColRowSpan>& rSpans,
358 double fDefHeight = -1.0);
363 void groupColumnsOrRows( sal_Int32 nFirstColRow, sal_Int32 nLastColRow,
bool bCollapsed,
bool bRows );
409 mrMaxApiPos( rHelper.getAddressConverter().getMaxApiAddress() ),
411 maSheetData( *this ),
412 maCondFormats( *this ),
414 maAutoFilters( *this ),
415 maQueryTables( *this ),
416 maSheetSett( *this ),
418 maSheetViewSett( *this ),
419 mxProgressBar(
std::move( xProgressBar )),
420 mbFastRowProgress( false ),
421 meSheetType( eSheetType ),
422 mxSheet(getSheetFromDoc( nSheet )),
423 mbHasDefWidth( false )
458 Reference< XCell > xCell;
461 xCell =
mxSheet->getCellByPosition( rAddress.
Col(), rAddress.
Row() );
471 Reference< XCellRange > xRange;
484 Reference< XSheetCellRanges > xRanges;
488 Reference< XSheetCellRangeContainer > xRangeCont( xRanges, UNO_QUERY_THROW );
499 Reference< XCellRange >
xColumn;
502 Reference< XColumnRowRange > xColRowRange(
mxSheet, UNO_QUERY_THROW );
503 Reference< XTableColumns > xColumns( xColRowRange->getColumns(), UNO_SET_THROW );
504 xColumn.set( xColumns->getByIndex( nCol ), UNO_QUERY );
514 Reference< XCellRange > xRow;
517 Reference< XColumnRowRange > xColRowRange(
mxSheet, UNO_QUERY_THROW );
518 Reference< XTableRows > xRows( xColRowRange->getRows(), UNO_SET_THROW );
519 xRow.set( xRows->getByIndex( nRow ), UNO_QUERY );
529 Reference< XDrawPage > xDrawPage;
532 xDrawPage = Reference< XDrawPageSupplier >(
mxSheet, UNO_QUERY_THROW )->getDrawPage();
542 OSL_ENSURE( (
maDrawPageSize.Width > 0) && (
maDrawPageSize.Height > 0),
"WorksheetGlobals::getDrawPageSize - called too early, size invalid" );
549 awt::Point aPoint( lclClampToNonNegativeInt32( aMMRect.
Left() ),
550 lclClampToNonNegativeInt32( aMMRect.
Top() ) );
556sal_Int32 lclGetMidAddr( sal_Int32 nBegAddr, sal_Int32 nEndAddr, sal_Int32 nBegPos, sal_Int32 nEndPos, sal_Int32 nSearchPos )
559 return nBegAddr + 1 +
static_cast< sal_Int32
>(
static_cast< sal_Int64
>( nEndAddr - nBegAddr - 2 ) * (nSearchPos - nBegPos) / (nEndPos - nBegPos) );
562bool lclPrepareInterval( sal_Int32 nBegAddr, sal_Int32& rnMidAddr, sal_Int32 nEndAddr,
563 sal_Int32 nBegPos, sal_Int32 nEndPos, sal_Int32 nSearchPos )
566 if( nSearchPos <= nBegPos )
568 rnMidAddr = nBegAddr;
573 if( (nSearchPos >= nEndPos) || (nBegAddr + 1 >= nEndAddr) )
575 rnMidAddr = nEndAddr;
581 rnMidAddr = lclGetMidAddr( nBegAddr, nEndAddr, nBegPos, nEndPos, nSearchPos );
585bool lclUpdateInterval( sal_Int32& rnBegAddr, sal_Int32& rnMidAddr, sal_Int32& rnEndAddr,
586 sal_Int32& rnBegPos, sal_Int32 nMidPos, sal_Int32& rnEndPos, sal_Int32 nSearchPos )
589 if( nSearchPos < nMidPos )
592 if( rnBegAddr + 1 >= rnMidAddr )
596 rnEndAddr = rnMidAddr;
597 rnMidAddr = lclGetMidAddr( rnBegAddr, rnEndAddr, rnBegPos, rnEndPos, nSearchPos );
602 if( nSearchPos > nMidPos )
605 if( rnMidAddr + 1 >= rnEndAddr )
607 rnMidAddr = rnEndAddr;
612 rnBegAddr = rnMidAddr;
613 rnMidAddr = lclGetMidAddr( rnBegAddr, rnEndAddr, rnBegPos, rnEndPos, nSearchPos );
626 sal_Int32 nBegCol = 0;
627 sal_Int32 nBegRow = 0;
628 awt::Point aBegPos( 0, 0 );
636 sal_Int32 nMidCol, nMidRow;
637 bool bLoopCols = lclPrepareInterval( nBegCol, nMidCol, nEndCol, aBegPos.X, aEndPos.X, rPosition.X );
638 bool bLoopRows = lclPrepareInterval( nBegRow, nMidRow, nEndRow, aBegPos.Y, aEndPos.Y, rPosition.Y );
644 while( bLoopCols || bLoopRows )
646 bLoopCols = bLoopCols && lclUpdateInterval( nBegCol, nMidCol, nEndCol, aBegPos.X, aMidPos.X, aEndPos.X, rPosition.X );
647 bLoopRows = bLoopRows && lclUpdateInterval( nBegRow, nMidRow, nEndRow, aBegPos.Y, aMidPos.Y, aEndPos.Y, rPosition.Y );
654 if( aMidPos.X > rPosition.X ) --nMidCol;
655 if( aMidPos.Y > rPosition.Y ) --nMidRow;
662 awt::Point aBotRight( rRect.X + rRect.Width, rRect.Y + rRect.Height );
664 bool bMultiCols = aStartAddr.
Col() < aEndAddr.
Col();
665 bool bMultiRows = aStartAddr.
Row() < aEndAddr.
Row();
666 if( bMultiCols || bMultiRows )
671 if( bMultiCols && (aBotRight.X <= aEndPos.X) )
673 if( bMultiRows && (aBotRight.Y <= aEndPos.Y) )
685 aPropSet.
setProperty( PROP_IsStartOfNewPage,
true );
801 bool bInsertModel =
true;
805 ColumnModelRangeMap::iterator aIt =
maColModels.upper_bound( nFirstCol );
806 OSL_ENSURE( aIt ==
maColModels.end(),
"WorksheetGlobals::setColModel - columns are unsorted" );
808 OSL_ENSURE( (aIt ==
maColModels.end()) || (nLastCol < aIt->
first),
"WorksheetGlobals::setColModel - multiple models of the same column" );
810 nLastCol = ::std::min( nLastCol, aIt->first - 1 );
816 sal_Int32& rnLastMapCol = aIt->second.second;
817 OSL_ENSURE( rnLastMapCol < nFirstCol,
"WorksheetGlobals::setColModel - multiple models of the same column" );
818 nFirstCol = ::std::max( rnLastMapCol + 1, nFirstCol );
819 if( (rnLastMapCol + 1 == nFirstCol) && (nFirstCol <= nLastCol) && aIt->second.first.isMergeable( rModel ) )
822 rnLastMapCol = nLastCol;
823 bInsertModel =
false;
827 if( nFirstCol <= nLastCol )
862 sal_Int32 nRow = rModel.
mnRow - 1;
866 bool bInsertModel =
true;
867 bool bUnusedRow =
true;
871 RowModelRangeMap::iterator aIt =
maRowModels.upper_bound( nRow );
872 OSL_ENSURE( aIt ==
maRowModels.end(),
"WorksheetGlobals::setRowModel - rows are unsorted" );
878 sal_Int32& rnLastMapRow = aIt->second.second;
879 bUnusedRow = rnLastMapRow < nRow;
880 OSL_ENSURE( bUnusedRow,
"WorksheetGlobals::setRowModel - multiple models of the same row" );
881 if( (rnLastMapRow + 1 == nRow) && aIt->second.first.isMergeable( rModel ) )
885 bInsertModel =
false;
908 double fNewPos =
static_cast<double>(nRow - rUsedArea.
aStart.
Row() + 1.0) / (rUsedArea.
aEnd.
Row() - rUsedArea.
aStart.
Row() + 1.0);
915 if (fCurPos < fNewPos && (fNewPos - fCurPos) > 0.3)
928 getStyles().getDefaultStyleName(), SfxStyleFamily::Para));
958 std::vector<sc::ColRowSpan> aSpans;
975 if (!pDocColl->
empty())
978 for (
const auto& rxDB : rDBs)
980 if (rxDB->GetTab() == nTab && rxDB->HasAutoFilter())
983 rxDB->GetArea(aRange);
1010 if( !aUrl.isEmpty() )
1011 for(
ScAddress aAddress(link.maRange.aStart.Col(), link.maRange.aStart.Row(),
getSheetIndex() ); aAddress.
Row() <= link.maRange.aEnd.Row(); aAddress.IncRow() )
1012 for( aAddress.SetCol(link.maRange.aStart.Col()); aAddress.Col() <= link.maRange.aEnd.Col(); aAddress.IncCol() )
1019 OUStringBuffer aUrlBuffer;
1020 if( !rHyperlink.
maTarget.isEmpty() )
1023 aUrlBuffer.append(
"#" + rHyperlink.
maLocation );
1024 OUString aUrl = aUrlBuffer.makeStringAndClear();
1026 if( aUrl.startsWith(
"#") )
1028 sal_Int32 nSepPos = aUrl.lastIndexOf(
'!' );
1035 if (nSepPos < aUrl.getLength() - 1)
1042 aUrl = aUrl.replaceAt( nSepPos, 1, rtl::OUStringChar(
'.' ) );
1045 OUString aSheetName = aUrl.copy( 1, nSepPos - 1 );
1047 if( !aCalcName.isEmpty() )
1048 aUrl = aUrl.replaceAt( 1, nSepPos - 1, aCalcName );
1095 Reference< XPropertySet > xValidation( aPropSet.
getAnyProperty( PROP_Validation ), UNO_QUERY );
1096 if( xValidation.is() )
1102 const OUString aToken =
validation.msRef.getToken( 0,
' ' );
1105 Reference<XCellRange> xDBCellRange;
1106 Reference<XCell> xCell;
1107 xDBCellRange = xSheet->getCellRangeByName( aToken );
1109 xCell = xDBCellRange->getCellByPosition( 0, 0 );
1110 Reference<XCellAddressable> xCellAddressable( xCell, UNO_QUERY_THROW );
1111 CellAddress aFirstCell = xCellAddressable->getCellAddress();
1112 Reference<XSheetCondition> xCondition( xValidation, UNO_QUERY_THROW );
1113 xCondition->setSourcePosition( aFirstCell );
1120 ValidationType
eType = ValidationType_ANY;
1123 case XML_custom:
eType = ValidationType_CUSTOM;
break;
1124 case XML_date:
eType = ValidationType_DATE;
break;
1125 case XML_decimal:
eType = ValidationType_DECIMAL;
break;
1126 case XML_list:
eType = ValidationType_LIST;
break;
1128 case XML_textLength:
eType = ValidationType_TEXT_LEN;
break;
1129 case XML_time:
eType = ValidationType_TIME;
break;
1130 case XML_whole:
eType = ValidationType_WHOLE;
break;
1131 default: OSL_FAIL(
"WorksheetData::finalizeValidationRanges - unknown validation type" );
1136 ValidationAlertStyle eAlertStyle = ValidationAlertStyle_STOP;
1139 case XML_information: eAlertStyle = ValidationAlertStyle_INFO;
break;
1140 case XML_stop: eAlertStyle = ValidationAlertStyle_STOP;
break;
1141 case XML_warning: eAlertStyle = ValidationAlertStyle_WARNING;
break;
1142 default: OSL_FAIL(
"WorksheetData::finalizeValidationRanges - unknown error style" );
1144 aValProps.
setProperty( PROP_ErrorAlertStyle, eAlertStyle );
1147 sal_Int16 nVisibility =
validation.mbNoDropDown ? TableValidationVisibility::INVISIBLE : TableValidationVisibility::UNSORTED;
1148 aValProps.
setProperty( PROP_ShowList, nVisibility );
1164 Reference< XSheetCondition2 > xSheetCond( xValidation, UNO_QUERY_THROW );
1165 if(
eType == ValidationType_CUSTOM )
1171 Reference< XMultiFormulaTokens > xTokens( xValidation, UNO_QUERY_THROW );
1172 xTokens->setTokens( 0,
validation.maTokens1 );
1173 xTokens->setTokens( 1,
validation.maTokens2 );
1180 aPropSet.
setProperty( PROP_Validation, xValidation );
1187 sal_Int32 nNextCol = 0;
1195 ValueRange aColRange( ::std::max( colModel.first, nNextCol ), ::std::min( colModel.second.second, nMaxCol ) );
1197 if( nNextCol < aColRange.
mnFirst )
1202 nNextCol = aColRange.
mnLast + 1;
1228 for(
SCCOL nCol = nStartCol; nCol <= nEndCol; ++nCol )
1246 sal_Int32 nNextRow = 0;
1254 ValueRange aRowRange( ::std::max( rowModel.first, nNextRow ), ::std::min( rowModel.second.second, nMaxRow ) );
1256 if( nNextRow < aRowRange.
mnFirst )
1262 nNextRow = aRowRange.
mnLast + 1;
1273 const std::vector<sc::ColRowSpan>& rSpans,
double fDefHeight)
1295 for (
const auto& rSpan : rSpans)
1298 if (rSpan.mnStart <= nStartRow && nStartRow <= rSpan.mnEnd)
1300 SCROW nLast = ::std::min(nEndRow, rSpan.mnEnd);
1312 sal_Int32 nColRow, sal_Int32 nLevel,
bool bCollapsed,
bool bRows )
1317 OSL_ENSURE( nLevel >= 0,
"WorksheetGlobals::convertOutlines - negative outline level" );
1318 nLevel = ::std::max< sal_Int32 >( nLevel, 0 );
1320 sal_Int32 nSize = orLevels.size();
1321 if( nSize < nLevel )
1324 orLevels.insert(orLevels.end(), nLevel - nSize, nColRow);
1326 else if( nLevel < nSize )
1331 sal_Int32 nFirstInLevel = orLevels.back();
1332 orLevels.pop_back();
1343 Reference< XSheetOutline > xOutline(
mxSheet, UNO_QUERY_THROW );
1346 CellRangeAddress aRange(
getSheetIndex(), 0, nFirstColRow, 0, nLastColRow );
1347 xOutline->group( aRange, TableOrientation_ROWS );
1349 xOutline->hideDetail( aRange );
1353 CellRangeAddress aRange(
getSheetIndex(), nFirstColRow, 0, nLastColRow, 0 );
1354 xOutline->group( aRange, TableOrientation_COLUMNS );
1356 xOutline->hideDetail( aRange );
1420 aPropSet.
setProperty( PROP_TableLayout, WritingMode2::RL_TB );
1426 mrSheetGlob( rSheetGlob )
1438 WorksheetGlobalsRef xSheetGlob = std::make_shared<WorksheetGlobals>( rHelper, rxProgressBar, eSheetType, nSheet );
1439 if( !xSheetGlob->isValidSheet() )
1600 const ScAddress& rAddress,
const OUString& rValueStr, sal_Int32 nCellType )
1646 const ScAddress& rAddr, sal_Int32 nSharedId,
1647 const OUString& rCellValue, sal_Int32 nValueType )
1658 const ScAddress& rAddress, sal_Int32 nSharedId,
const OUString& rTokens )
HRESULT createInstance(REFIID iid, Ifc **ppIfc)
std::unique_ptr< EditTextObject > CreateTextObject()
void SetSingleLine(bool bValue)
void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)
void IncCol(SCCOL nDelta=1)
void IncRow(SCROW nDelta=1)
Stores global named database ranges.
bool HasAutoFilter() const
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
Accessor class to ScDocument.
void setEditCell(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
void setFormulaCell(const ScAddress &rPos, const OUString &rFormula, formula::FormulaGrammar::Grammar eGrammar, const double *pResult=nullptr)
void setCellStyleToSheet(SCTAB nTab, const ScStyleSheet &rStyle)
Apply specified cell style to an entire sheet.
SC_DLLPUBLIC ScTable * FetchTable(SCTAB nTab)
SC_DLLPUBLIC void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bHidden)
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
SC_DLLPUBLIC void SetColWidthOnly(SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth)
SC_DLLPUBLIC void ApplyAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, const SfxPoolItem &rAttr)
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
SC_DLLPUBLIC void SetRowHeightOnly(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nNewHeight)
SC_DLLPUBLIC void SetRowHidden(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bHidden)
SC_DLLPUBLIC void SetManualHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bManual)
SC_DLLPUBLIC ScDBData * GetAnonymousDBData(SCTAB nTab)
SC_DLLPUBLIC void SetRowFiltered(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bFiltered)
ScRefFlags ParseAny(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1)
void SetOptimalMinRowHeight(sal_uInt16 nSet)
static SC_DLLPUBLIC bool ConvertToTokenArray(ScDocument &rDoc, ScTokenArray &rTokenArray, const css::uno::Sequence< css::sheet::FormulaToken > &rSequence)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
css::uno::Any getAnyProperty(sal_Int32 nPropId) const
bool setProperty(sal_Int32 nPropId, const Type &rValue)
static css::uno::Sequence< css::table::CellRangeAddress > toApiSequence(const ScRangeList &orRanges)
Converts the passed range list to a sequence of cell range addresses.
void finalizeImport(sal_Int16 nSheet)
Applies filter settings to a new database range object (used for sheet autofilter or advanced filter ...
Fragment handler for a complete sheet drawing.
void finalizeImport()
Creates a page style for the spreadsheet and sets all page properties.
void finalizeImport()
Inserts all web queries into the sheet.
Contains string data and a list of formatting runs for a rich formatted string.
void convert(const css::uno::Reference< css::text::XText > &rxText)
Converts the string and writes it into the passed XText, replace old contents of the text object,...
Manages the cell contents and cell formatting of a sheet.
void setRowFormat(sal_Int32 nRow, sal_Int32 nXfId, bool bCustomFormat)
Sets default cell formatting for the specified range of rows.
void finalizeImport()
Final processing after the sheet has been imported.
bool isSheetRightToLeft() const
Returns true, if the sheet layout is set to right-to-left.
void finalizeImport()
Converts all imported sheet view settings.
void writeCellXfToDoc(ScDocumentImport &rDoc, const ScRange &rRange, sal_Int32 nXfId) const
Writes the cell formatting attributes of the specified XF to the passed property set.
double scaleValue(double fValue, Unit eFromUnit, Unit eToUnit) const
Converts the passed value between the passed units.
void setSheetUsedArea(const ScRange &rUsedArea)
Stores the used area for a specific worksheet.
Helper class to provide access to global workbook data.
ScEditEngineDefaulter & getEditEngine() const
css::uno::Reference< css::sheet::XSpreadsheet > getSheetFromDoc(sal_Int32 nSheet) const
Returns a reference to the specified spreadsheet in the document model.
bool importOoxFragment(const rtl::Reference< oox::core::FragmentHandler > &rxHandler)
Imports a fragment using the passed fragment handler, which contains the full path to the fragment st...
WorksheetBuffer & getWorksheets() const
Returns the worksheet buffer containing sheet names and properties.
void setCurrentSheetIndex(SCTAB nSheet)
Sets the index of the current Calc sheet, if filter currently processes a sheet.
AddressConverter & getAddressConverter() const
Returns the converter for string to cell address/range conversion.
sal_Int16 getCurrentSheetIndex() const
Returns the index of the current Calc sheet, if filter currently processes a sheet.
StylesBuffer & getStyles() const
Returns all cell formatting objects read from the styles substream.
FormulaBuffer & getFormulaBuffer() const
ScDocument & getScDocument()
ViewSettings & getViewSettings() const
Returns the workbook and sheet view settings object.
ScDocumentImport & getDocImport()
UnitConverter & getUnitConverter() const
Returns the measurement unit converter.
::oox::core::FilterBase & getBaseFilter() const
Returns the base filter object (base class of all filters).
OUString getCalcSheetName(sal_Int32 nWorksheet) const
Returns the finalized name of the specified worksheet.
void convertColumns()
Converts column properties for all columns in the sheet.
Reference< XSheetCellRanges > getCellRangeList(const ScRangeList &rRanges) const
Returns the XSheetCellRanges interface for the passed cell range addresses.
::std::unique_ptr< VmlDrawing > VmlDrawingPtr
void setPageBreak(const PageBreakModel &rModel, bool bRowBreak)
Sets a column or row page break described in the passed struct.
OUString getHyperlinkUrl(const HyperlinkModel &rHyperlink) const
Generates the final URL for the passed hyperlink.
void setColumnModel(const ColumnModel &rModel)
Sets column settings for a specific column range.
void finalizeHyperlinkRanges()
Inserts all imported hyperlinks into their cell ranges.
ScRange maUsedArea
Reference to maximum Calc cell address from address converter.
void extendShapeBoundingBox(const awt::Rectangle &rShapeRect)
Extends the shape bounding box by the position and size of the passed rectangle.
CommentsBuffer & getComments()
Returns the buffer for all cell comments in this sheet.
void extendUsedArea(const ScAddress &rAddress)
Extends the used area of this sheet by the passed cell position.
void finalizeWorksheetImport()
Final conversion after importing the worksheet.
void UpdateRowProgress(const ScRange &rUsedArea, SCROW nRow)
Update the row import progress bar.
std::vector< ValidationModel > maValidations
Cell ranges containing hyperlinks.
const awt::Size & getDrawPageSize() const
Returns the size of the entire drawing page in 1/100 mm.
awt::Rectangle maShapeBoundingBox
Current size of the drawing page in 1/100 mm.
virtual void setCustomRowProgress(const ISegmentProgressBarRef &rxRowProgress) override
void setValidation(const ValidationModel &rModel)
Inserts the data validation settings into the spreadsheet.
void initializeWorksheetImport()
Initial conversion before importing the worksheet.
WorksheetType getSheetType() const
Returns the type of this sheet.
VmlDrawing & getVmlDrawing()
Returns the VML drawing page for this sheet (OOXML/BIFF12 only).
QueryTableBuffer & getQueryTables()
Returns the buffer for all web query tables in this sheet.
ColumnModel maDefColModel
Used area of the sheet, and sheet index of the sheet.
ISegmentProgressBarRef mxFinalProgress
Progress bar for row/cell processing.
::std::map< sal_Int32, RowModelRange > RowModelRangeMap
::std::pair< ColumnModel, sal_Int32 > ColumnModelRange
Reference< XCellRange > getRow(sal_Int32 nRow) const
Returns the XCellRange interface for a row.
::std::vector< sal_Int32 > OutlineLevelVec
ColumnModelRangeMap maColModels
Default column formatting.
void insertHyperlink(const ScAddress &rAddress, const OUString &rUrl)
Inserts a hyperlinks into the specified cell.
std::vector< HyperlinkModel > maHyperlinks
Ranges of rows sorted by first row index.
const Reference< XSpreadsheet > & getSheet() const
Returns the XSpreadsheet interface of the current sheet.
WorksheetGlobals(const WorkbookHelper &rHelper, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, SCTAB nSheet)
Service name for a SheetCellRanges object.
void setDefaultRowSettings(double fHeight, bool bCustomHeight, bool bHidden, bool bThickTop, bool bThickBottom)
Sets default height and hidden state for all unused rows in the sheet.
void setRowModel(const RowModel &rModel)
Sets row settings for a specific row.
void convertOutlines(OutlineLevelVec &orLevels, sal_Int32 nColRow, sal_Int32 nLevel, bool bCollapsed, bool bRows)
Converts outline grouping for the passed column or row.
CommentsBuffer maComments
Buffer for conditional formatting.
AutoFilterBuffer maAutoFilters
Buffer for all cell comments in this sheet.
OUString maDrawingPath
List of extended elements.
ISegmentProgressBarRef mxRowProgress
Do we have a progress bar thread ?
CondFormatBuffer maCondFormats
Buffer for cell contents and cell formatting.
void convertRows(const std::vector< sc::ColRowSpan > &rSpans)
Converts row properties for all rows in the sheet.
bool mbFastRowProgress
Sheet progress bar.
void finalizeValidationRanges() const
Inserts all imported data validations into their cell ranges.
SheetDataBuffer maSheetData
Cell ranges containing data validation settings.
Reference< XCellRange > getColumn(sal_Int32 nCol) const
Returns the XCellRange interface for a column.
Reference< XCellRange > getCellRange(const ScRange &rRange) const
Returns the XCellRange interface for the passed cell range address.
bool isValidSheet() const
Returns true, if this helper refers to an existing Calc sheet.
void setDefaultColumnWidth(double fWidth)
Sets default width for all columns.
awt::Point getCellPosition(sal_Int32 nCol, sal_Int32 nRow) const
Returns the absolute position of the top-left corner of the cell in 1/100 mm.
PageSettings & getPageSettings()
Returns the page/print settings for this sheet.
QueryTableBuffer maQueryTables
Sheet auto filters (not associated to a table).
WorksheetType meSheetType
Progress bar for finalization.
RowModelRangeMap maRowModels
Default row formatting.
SheetViewSettings maSheetViewSett
Page/print settings for this sheet.
RowModel maDefRowModel
Ranges of columns sorted by first column index.
ExtLst & getExtLst()
returns the ExtLst entries that need to be filled
WorksheetSettings & getWorksheetSettings()
Returns the worksheet settings object.
SCTAB getSheetIndex() const
Returns the index of the current sheet.
ISegmentProgressBarRef mxProgressBar
Bounding box for all shapes from all drawings.
VmlDrawingPtr mxVmlDrawing
View settings for this sheet.
::std::map< sal_Int32, ColumnModelRange > ColumnModelRangeMap
void setHyperlink(const HyperlinkModel &rModel)
Inserts the hyperlink URL into the spreadsheet.
void setVmlDrawingPath(const OUString &rVmlDrawingPath)
Sets the path to the legacy VML drawing fragment of this sheet.
PageSettings maPageSett
Global settings for this sheet.
void finalizeDrawings()
Imports the drawings of the sheet (DML, VML, DFF) and updates the used area.
Reference< XSpreadsheet > mxSheet
Type of this sheet.
Reference< XCell > getCell(const ScAddress &rAddress) const
Returns the XCell interface for the passed cell address.
void convertColumnFormat(sal_Int32 nFirstCol, sal_Int32 nLastCol, sal_Int32 nXfId)
Converts column default cell formatting.
OUString maVmlDrawingPath
Path to DrawingML fragment.
void groupColumnsOrRows(sal_Int32 nFirstColRow, sal_Int32 nLastColRow, bool bCollapsed, bool bRows)
Groups columns or rows for the given range.
bool mbHasDefWidth
Reference to the current sheet.
ExtLst maExtLst
Collection of all VML shapes.
void setDrawingPath(const OUString &rDrawingPath)
Sets the path to the DrawingML fragment of this sheet.
SheetDataBuffer & getSheetData()
Returns the buffer for cell contents and cell formatting.
ScAddress getCellAddressFromPosition(const awt::Point &rPosition) const
Returns the address of the cell that contains the passed point in 1/100 mm.
const ScAddress & mrMaxApiPos
awt::Size maDrawPageSize
Path to legacy VML drawing fragment.
::std::pair< RowModel, sal_Int32 > RowModelRange
AutoFilterBuffer & getAutoFilters()
Returns the auto filters for the sheet.
virtual ISegmentProgressBarRef getRowProgress() override
Allow the threaded importer to override our progress bar impl.
void setBaseColumnWidth(sal_Int32 nWidth)
Sets base width for all columns (without padding pixels).
CondFormatBuffer & getCondFormats()
Returns the conditional formatting in this sheet.
Reference< XDrawPage > getDrawPage() const
Returns the XDrawPage interface of the draw page of the current sheet.
void finalizeDrawingImport()
WorksheetSettings maSheetSett
Buffer for all web query tables in this sheet.
ScRange getCellRangeFromRectangle(const awt::Rectangle &rRect) const
Returns the cell range address that contains the passed rectangle in 1/100 mm.
SheetViewSettings & getSheetViewSettings()
Returns the view settings for this sheet.
PageSettings & getPageSettings() const
Returns the page/print settings for this sheet.
css::awt::Point getCellPosition(sal_Int32 nCol, sal_Int32 nRow) const
Returns the absolute cell position in 1/100 mm.
void extendShapeBoundingBox(const css::awt::Rectangle &rShapeRect)
Extends the shape bounding box by the position and size of the passed rectangle (in 1/100 mm).
VmlDrawing & getVmlDrawing() const
Returns the VML drawing page for this sheet (OOXML/BIFF12 only).
void setCellFormula(const ScAddress &rTokenAddress, const OUString &)
void extendUsedArea(const ScAddress &rAddress)
Extends the used area of this sheet by the passed cell position.
CondFormatBuffer & getCondFormats() const
Returns the conditional formatting in this sheet.
const css::awt::Size & getDrawPageSize() const
Returns the size of the entire drawing page in 1/100 mm.
WorksheetType getSheetType() const
Returns the type of this sheet.
void setPageBreak(const PageBreakModel &rModel, bool bRowBreak)
Sets a column or row page break described in the passed struct.
void finalizeDrawingImport()
Final import of drawing objects.
ScDocument & getScDocument()
ExtLst & getExtLst() const
WorksheetGlobals & mrSheetGlob
WorksheetSettings & getWorksheetSettings() const
Returns the worksheet settings object.
void setDrawingPath(const OUString &rDrawingPath)
Sets the path to the DrawingML fragment of this sheet.
SheetDataBuffer & getSheetData() const
Returns the buffer for cell contents and cell formatting.
static WorksheetGlobalsRef constructGlobals(const WorkbookHelper &rHelper, const ISegmentProgressBarRef &rxProgressBar, WorksheetType eSheetType, SCTAB nSheet)
void createSharedFormulaMapEntry(const ScAddress &rAddress, sal_Int32 nSharedId, const OUString &rTokens)
void setDefaultColumnWidth(double fWidth)
Sets default width for all columns.
SCTAB getSheetIndex() const
Returns the index of the current sheet.
void putRichString(const ScAddress &rAddress, RichString &rString, const oox::xls::Font *pFirstPortionFont, bool bSingleLine=false)
Inserts a rich-string cell directly into the Calc sheet.
void setColumnModel(const ColumnModel &rModel)
Sets column settings for a specific range of columns.
void setCellArrayFormula(const ScRange &rRangeAddress, const ScAddress &rTokenAddress, const OUString &rTokenStr)
void setBaseColumnWidth(sal_Int32 nWidth)
Sets base width for all columns (without padding pixels).
void finalizeWorksheetImport()
Final conversion after importing the worksheet.
WorksheetHelper(WorksheetGlobals &rSheetGlob)
void putFormulaTokens(const ScAddress &rAddress, const ApiTokenSequence &rTokens)
Inserts a formula cell directly into the Calc sheet.
const css::uno::Reference< css::sheet::XSpreadsheet > & getSheet() const
Returns the XSpreadsheet interface of the current sheet.
css::uno::Reference< css::drawing::XDrawPage > getDrawPage() const
Returns the XDrawPage interface of the draw page of the current sheet.
void setValidation(const ValidationModel &rModel)
Inserts the data validation settings into the spreadsheet.
CommentsBuffer & getComments() const
Returns the buffer for all cell comments in this sheet.
AutoFilterBuffer & getAutoFilters() const
Returns the auto filters for the sheet.
SheetViewSettings & getSheetViewSettings() const
Returns the view settings for this sheet.
void setRowModel(const RowModel &rModel)
Sets row settings for a specific range of rows.
void initializeWorksheetImport()
Initial conversion before importing the worksheet.
css::uno::Reference< css::table::XCell > getCell(const ScAddress &rAddress) const
Returns the XCell interface for the passed cell address.
void setVmlDrawingPath(const OUString &rVmlDrawingPath)
Sets the path to the legacy VML drawing fragment of this sheet.
QueryTableBuffer & getQueryTables() const
Returns the buffer for all web query tables in this sheet.
static IWorksheetProgress * getWorksheetInterface(const WorksheetGlobalsRef &xRef)
void setHyperlink(const HyperlinkModel &rModel)
Inserts the hyperlink URL into the spreadsheet.
void setCellFormulaValue(const ScAddress &rAddress, const OUString &rValueStr, sal_Int32 nCellType)
void setDefaultRowSettings(double fHeight, bool bCustomHeight, bool bHidden, bool bThickTop, bool bThickBottom)
Sets default height and hidden state for all unused rows in the sheet.
css::uno::Reference< css::table::XCellRange > getCellRange(const ScRange &rRange) const
Returns the XCellRange interface for the passed cell range address.
void finalizeImport()
Converts the imported worksheet settings.
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
#define STATIC_ARRAY_SELECT(array, index, def)
#define SAL_WARN(area, stream)
constexpr OUStringLiteral first
constexpr auto toTwips(N number, Length from)
constexpr OUStringLiteral gaSheetCellRanges(u"com.sun.star.sheet.SheetCellRanges")
css::uno::Sequence< ApiToken > ApiTokenSequence
::std::map< OUString, ScDataBarFormatData * > ExtLst
@ ScreenX
English Metric Unit (1/360,000 cm).
@ Digit
Vertical screen pixels.
std::shared_ptr< WorksheetGlobals > WorksheetGlobalsRef
WorksheetType
An enumeration for all types of sheets in a workbook.
std::shared_ptr< ISegmentProgressBar > ISegmentProgressBarRef
constexpr TypedWhichId< SfxStringItem > ATTR_HYPERLINK(155)
This is very similar to ScCellValue, except that it references the original value instead of copying ...
OUString getString(const ScDocument *pDoc) const
Retrieve string value.
Stores settings and formatting data about a range of sheet columns.
sal_Int32 mnLevel
Column default formatting.
bool mbHidden
True = cells in column show phonetic settings.
bool isMergeable(const ColumnModel &rModel) const
Returns true, if this entry can be merged with the passed column range (column settings are equal).
sal_Int32 mnXfId
Column width in number of characters.
ColumnModel()
True = column outline is collapsed.
double mfWidth
1-based (!) range of the described columns.
bool mbCollapsed
True = column is hidden.
Stores data about a hyperlink range.
HyperlinkModel()
Additional tooltip text.
Stores formatting data about a page break.
bool mbManual
End of limited break.
PageBreakModel()
True = manual page break.
Stores settings and formatting data about a sheet row.
double mfHeight
1-based (!) index of the described row.
bool mbCustomHeight
Row outline level.
sal_Int32 mnLevel
Row default formatting (see mbIsFormatted).
bool mbCollapsed
True = row is hidden.
bool mbThickBottom
True = row has extra space above text.
sal_Int32 mnXfId
Row height in points.
bool mbShowPhonetic
True = cells in row have explicit formatting.
bool mbCustomFormat
True = row has custom height.
bool mbThickTop
True = row outline is collapsed.
bool isMergeable(const RowModel &rModel) const
Returns true, if this entry can be merged with the passed row range (row settings are equal).
bool mbHidden
True = cells in row show phonetic settings.
RowModel()
True = row has extra space below text.
Stores data about ranges with data validation settings.
void setBiffType(sal_uInt8 nType)
Sets the passed BIFF validation type.
void setBiffOperator(sal_uInt8 nOperator)
Sets the passed BIFF operator.
void setBiffErrorStyle(sal_uInt8 nErrorStyle)
Sets the passed BIFF error style.
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW