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>
68 #include <stlsheet.hxx>
69 #include <stlpool.hxx>
93 rxProgressBar->setPosition( fPosition );
103 mbShowPhonetic( false ),
126 mbCustomHeight( false ),
127 mbCustomFormat( false ),
128 mbShowPhonetic( false ),
130 mbCollapsed( false ),
132 mbThickBottom( false )
168 mnOperator( XML_between ),
169 mnErrorStyle( XML_stop ),
170 mbShowInputMsg( false ),
171 mbShowErrorMsg( false ),
172 mbNoDropDown( false ),
173 mbAllowBlank( false )
179 static const sal_Int32 spnTypeIds[] = {
180 XML_none, XML_whole, XML_decimal, XML_list, XML_date, XML_time, XML_textLength, XML_custom };
186 static const sal_Int32 spnOperators[] = {
187 XML_between, XML_notBetween, XML_equal, XML_notEqual,
188 XML_greaterThan, XML_lessThan, XML_greaterThanOrEqual, XML_lessThanOrEqual };
194 static const sal_Int32 spnErrorStyles[] = { XML_stop, XML_warning, XML_information };
225 Reference< XCellRange >
getColumn( sal_Int32 nCol )
const;
227 Reference< XCellRange >
getRow( sal_Int32 nRow )
const;
296 void setDefaultRowSettings(
double fHeight,
bool bCustomHeight,
bool bHidden,
bool bThickTop,
bool bThickBottom );
348 void convertOutlines( OutlineLevelVec& orLevels, sal_Int32 nColRow, sal_Int32 nLevel,
bool bCollapsed,
bool bRows );
350 void groupColumnsOrRows( sal_Int32 nFirstColRow, sal_Int32 nLastColRow,
bool bCollapsed,
bool bRows );
392 constexpr OUStringLiteral
gaSheetCellRanges( u
"com.sun.star.sheet.SheetCellRanges" );
396 mrMaxApiPos( rHelper.getAddressConverter().getMaxApiAddress() ),
398 maSheetData( *this ),
399 maCondFormats( *this ),
401 maAutoFilters( *this ),
402 maQueryTables( *this ),
403 maSheetSett( *this ),
405 maSheetViewSett( *this ),
406 mxProgressBar( rxProgressBar ),
407 mbFastRowProgress( false ),
408 meSheetType( eSheetType ),
409 mxSheet(getSheetFromDoc( nSheet )),
410 mbHasDefWidth( false )
445 Reference< XCell > xCell;
448 xCell =
mxSheet->getCellByPosition( rAddress.
Col(), rAddress.
Row() );
458 Reference< XCellRange > xRange;
471 Reference< XSheetCellRanges > xRanges;
475 Reference< XSheetCellRangeContainer > xRangeCont( xRanges, UNO_QUERY_THROW );
486 Reference< XCellRange >
xColumn;
489 Reference< XColumnRowRange > xColRowRange(
mxSheet, UNO_QUERY_THROW );
490 Reference< XTableColumns > xColumns( xColRowRange->getColumns(), UNO_SET_THROW );
491 xColumn.set( xColumns->getByIndex( nCol ), UNO_QUERY );
501 Reference< XCellRange >
xRow;
504 Reference< XColumnRowRange > xColRowRange(
mxSheet, UNO_QUERY_THROW );
505 Reference< XTableRows > xRows( xColRowRange->getRows(), UNO_SET_THROW );
506 xRow.set( xRows->getByIndex( nRow ), UNO_QUERY );
516 Reference< XDrawPage > xDrawPage;
519 xDrawPage = Reference< XDrawPageSupplier >(
mxSheet, UNO_QUERY_THROW )->
getDrawPage();
529 OSL_ENSURE( (
maDrawPageSize.Width > 0) && (
maDrawPageSize.Height > 0),
"WorksheetGlobals::getDrawPageSize - called too early, size invalid" );
543 sal_Int32 lclGetMidAddr( sal_Int32 nBegAddr, sal_Int32 nEndAddr, sal_Int32 nBegPos, sal_Int32 nEndPos, sal_Int32 nSearchPos )
546 return nBegAddr + 1 +
static_cast< sal_Int32
>(
static_cast< sal_Int64
>( nEndAddr - nBegAddr - 2 ) * (nSearchPos - nBegPos) / (nEndPos - nBegPos) );
549 bool lclPrepareInterval( sal_Int32 nBegAddr, sal_Int32& rnMidAddr, sal_Int32 nEndAddr,
550 sal_Int32 nBegPos, sal_Int32 nEndPos, sal_Int32 nSearchPos )
553 if( nSearchPos <= nBegPos )
555 rnMidAddr = nBegAddr;
560 if( (nSearchPos >= nEndPos) || (nBegAddr + 1 >= nEndAddr) )
562 rnMidAddr = nEndAddr;
568 rnMidAddr = lclGetMidAddr( nBegAddr, nEndAddr, nBegPos, nEndPos, nSearchPos );
572 bool lclUpdateInterval( sal_Int32& rnBegAddr, sal_Int32& rnMidAddr, sal_Int32& rnEndAddr,
573 sal_Int32& rnBegPos, sal_Int32 nMidPos, sal_Int32& rnEndPos, sal_Int32 nSearchPos )
576 if( nSearchPos < nMidPos )
579 if( rnBegAddr + 1 >= rnMidAddr )
583 rnEndAddr = rnMidAddr;
584 rnMidAddr = lclGetMidAddr( rnBegAddr, rnEndAddr, rnBegPos, rnEndPos, nSearchPos );
589 if( nSearchPos > nMidPos )
592 if( rnMidAddr + 1 >= rnEndAddr )
594 rnMidAddr = rnEndAddr;
599 rnBegAddr = rnMidAddr;
600 rnMidAddr = lclGetMidAddr( rnBegAddr, rnEndAddr, rnBegPos, rnEndPos, nSearchPos );
613 sal_Int32 nBegCol = 0;
614 sal_Int32 nBegRow = 0;
623 sal_Int32 nMidCol, nMidRow;
624 bool bLoopCols = lclPrepareInterval( nBegCol, nMidCol, nEndCol, aBegPos.X, aEndPos.X, rPosition.X );
625 bool bLoopRows = lclPrepareInterval( nBegRow, nMidRow, nEndRow, aBegPos.Y, aEndPos.Y, rPosition.Y );
631 while( bLoopCols || bLoopRows )
633 bLoopCols = bLoopCols && lclUpdateInterval( nBegCol, nMidCol, nEndCol, aBegPos.X, aMidPos.X, aEndPos.X, rPosition.X );
634 bLoopRows = bLoopRows && lclUpdateInterval( nBegRow, nMidRow, nEndRow, aBegPos.Y, aMidPos.Y, aEndPos.Y, rPosition.Y );
641 if( aMidPos.X > rPosition.X ) --nMidCol;
642 if( aMidPos.Y > rPosition.Y ) --nMidRow;
649 awt::Point aBotRight( rRect.X + rRect.Width, rRect.Y + rRect.Height );
651 bool bMultiCols = aStartAddr.
Col() < aEndAddr.
Col();
652 bool bMultiRows = aStartAddr.
Row() < aEndAddr.
Row();
653 if( bMultiCols || bMultiRows )
658 if( bMultiCols && (aBotRight.X <= aEndPos.X) )
660 if( bMultiRows && (aBotRight.Y <= aEndPos.Y) )
672 aPropSet.
setProperty( PROP_IsStartOfNewPage,
true );
790 bool bInsertModel =
true;
794 ColumnModelRangeMap::iterator aIt =
maColModels.upper_bound( nFirstCol );
795 OSL_ENSURE( aIt ==
maColModels.end(),
"WorksheetGlobals::setColModel - columns are unsorted" );
797 OSL_ENSURE( (aIt ==
maColModels.end()) || (nLastCol < aIt->
first),
"WorksheetGlobals::setColModel - multiple models of the same column" );
799 nLastCol = ::std::min( nLastCol, aIt->first - 1 );
805 sal_Int32& rnLastMapCol = aIt->second.second;
806 OSL_ENSURE( rnLastMapCol < nFirstCol,
"WorksheetGlobals::setColModel - multiple models of the same column" );
807 nFirstCol = ::std::max( rnLastMapCol + 1, nFirstCol );
808 if( (rnLastMapCol + 1 == nFirstCol) && (nFirstCol <= nLastCol) && aIt->second.first.isMergeable( rModel ) )
811 rnLastMapCol = nLastCol;
812 bInsertModel =
false;
816 if( nFirstCol <= nLastCol )
851 sal_Int32 nRow = rModel.
mnRow - 1;
855 bool bInsertModel =
true;
856 bool bUnusedRow =
true;
860 RowModelRangeMap::iterator aIt =
maRowModels.upper_bound( nRow );
861 OSL_ENSURE( aIt ==
maRowModels.end(),
"WorksheetGlobals::setRowModel - rows are unsorted" );
867 sal_Int32& rnLastMapRow = aIt->second.second;
868 bUnusedRow = rnLastMapRow < nRow;
869 OSL_ENSURE( bUnusedRow,
"WorksheetGlobals::setRowModel - multiple models of the same row" );
870 if( (rnLastMapRow + 1 == nRow) && aIt->second.first.isMergeable( rModel ) )
874 bInsertModel =
false;
899 double fNewPos =
static_cast<double>(nRow - rUsedArea.
aStart.
Row() + 1.0) / (rUsedArea.
aEnd.
Row() - rUsedArea.
aStart.
Row() + 1.0);
906 if (fCurPos < fNewPos && (fNewPos - fCurPos) > 0.3)
919 getStyles().getDefaultStyleName(), SfxStyleFamily::Para));
969 if( !aUrl.isEmpty() )
970 for(
ScAddress aAddress(link.maRange.aStart.Col(), link.maRange.aStart.Row(),
getSheetIndex() ); aAddress.
Row() <= link.maRange.aEnd.Row(); aAddress.IncRow() )
971 for( aAddress.SetCol(link.maRange.aStart.Col()); aAddress.Col() <= link.maRange.aEnd.Col(); aAddress.IncCol() )
978 OUStringBuffer aUrlBuffer;
979 if( !rHyperlink.
maTarget.isEmpty() )
982 aUrlBuffer.append(
'#' ).append( rHyperlink.
maLocation );
983 OUString aUrl = aUrlBuffer.makeStringAndClear();
985 if( aUrl.startsWith(
"#") )
987 sal_Int32 nSepPos = aUrl.lastIndexOf(
'!' );
994 if (nSepPos < aUrl.getLength() - 1)
1001 aUrl = aUrl.replaceAt( nSepPos, 1, OUString(
'.' ) );
1004 OUString aSheetName = aUrl.copy( 1, nSepPos - 1 );
1006 if( !aCalcName.isEmpty() )
1007 aUrl = aUrl.replaceAt( 1, nSepPos - 1, aCalcName );
1021 OUString
aStr = aCell.getString(&rDoc.
getDoc());
1025 SvxURLField aURLField(rUrl, aStr, SvxURLFormat::Repr);
1055 if( xValidation.is() )
1061 const OUString aToken =
validation.msRef.getToken( 0,
' ' );
1064 Reference<XCellRange> xDBCellRange;
1065 Reference<XCell> xCell;
1066 xDBCellRange = xSheet->getCellRangeByName( aToken );
1068 xCell = xDBCellRange->getCellByPosition( 0, 0 );
1069 Reference<XCellAddressable> xCellAddressable( xCell, UNO_QUERY_THROW );
1070 CellAddress aFirstCell = xCellAddressable->getCellAddress();
1071 Reference<XSheetCondition> xCondition( xValidation, UNO_QUERY_THROW );
1072 xCondition->setSourcePosition( aFirstCell );
1079 ValidationType
eType = ValidationType_ANY;
1082 case XML_custom: eType = ValidationType_CUSTOM;
break;
1083 case XML_date: eType = ValidationType_DATE;
break;
1084 case XML_decimal: eType = ValidationType_DECIMAL;
break;
1085 case XML_list: eType = ValidationType_LIST;
break;
1086 case XML_none: eType = ValidationType_ANY;
break;
1087 case XML_textLength: eType = ValidationType_TEXT_LEN;
break;
1088 case XML_time: eType = ValidationType_TIME;
break;
1089 case XML_whole: eType = ValidationType_WHOLE;
break;
1090 default: OSL_FAIL(
"WorksheetData::finalizeValidationRanges - unknown validation type" );
1095 ValidationAlertStyle eAlertStyle = ValidationAlertStyle_STOP;
1098 case XML_information: eAlertStyle = ValidationAlertStyle_INFO;
break;
1099 case XML_stop: eAlertStyle = ValidationAlertStyle_STOP;
break;
1100 case XML_warning: eAlertStyle = ValidationAlertStyle_WARNING;
break;
1101 default: OSL_FAIL(
"WorksheetData::finalizeValidationRanges - unknown error style" );
1103 aValProps.
setProperty( PROP_ErrorAlertStyle, eAlertStyle );
1106 sal_Int16 nVisibility =
validation.mbNoDropDown ? TableValidationVisibility::INVISIBLE : TableValidationVisibility::UNSORTED;
1107 aValProps.
setProperty( PROP_ShowList, nVisibility );
1123 Reference< XSheetCondition2 > xSheetCond( xValidation, UNO_QUERY_THROW );
1124 if( eType == ValidationType_CUSTOM )
1130 Reference< XMultiFormulaTokens > xTokens( xValidation, UNO_QUERY_THROW );
1131 xTokens->setTokens( 0,
validation.maTokens1 );
1132 xTokens->setTokens( 1,
validation.maTokens2 );
1139 aPropSet.
setProperty( PROP_Validation, xValidation );
1146 sal_Int32 nNextCol = 0;
1154 ValueRange aColRange( ::std::max( colModel.first, nNextCol ), ::std::min( colModel.second.second, nMaxCol ) );
1156 if( nNextCol < aColRange.
mnFirst )
1161 nNextCol = aColRange.
mnLast + 1;
1187 for(
SCCOL nCol = nStartCol; nCol <= nEndCol; ++nCol )
1205 sal_Int32 nNextRow = 0;
1213 ValueRange aRowRange( ::std::max( rowModel.first, nNextRow ), ::std::min( rowModel.second.second, nMaxRow ) );
1215 if( nNextRow < aRowRange.
mnFirst )
1220 nNextRow = aRowRange.
mnLast + 1;
1259 sal_Int32 nColRow, sal_Int32 nLevel,
bool bCollapsed,
bool bRows )
1264 OSL_ENSURE( nLevel >= 0,
"WorksheetGlobals::convertOutlines - negative outline level" );
1265 nLevel = ::std::max< sal_Int32 >( nLevel, 0 );
1267 sal_Int32 nSize = orLevels.size();
1268 if( nSize < nLevel )
1271 orLevels.insert(orLevels.end(), nLevel - nSize, nColRow);
1273 else if( nLevel < nSize )
1278 sal_Int32 nFirstInLevel = orLevels.back();
1279 orLevels.pop_back();
1290 Reference< XSheetOutline > xOutline(
mxSheet, UNO_QUERY_THROW );
1293 CellRangeAddress aRange(
getSheetIndex(), 0, nFirstColRow, 0, nLastColRow );
1294 xOutline->group( aRange, TableOrientation_ROWS );
1296 xOutline->hideDetail( aRange );
1300 CellRangeAddress aRange(
getSheetIndex(), nFirstColRow, 0, nLastColRow, 0 );
1301 xOutline->group( aRange, TableOrientation_COLUMNS );
1303 xOutline->hideDetail( aRange );
1355 aPropSet.
setProperty( PROP_TableLayout, WritingMode2::RL_TB );
1361 mrSheetGlob( rSheetGlob )
1373 WorksheetGlobalsRef xSheetGlob = std::make_shared<WorksheetGlobals>( rHelper, rxProgressBar, eSheetType, nSheet );
1374 if( !xSheetGlob->isValidSheet() )
1535 const ScAddress& rAddress,
const OUString& rValueStr, sal_Int32 nCellType )
1577 const ScAddress& rAddr, sal_Int32 nSharedId,
1578 const OUString& rCellValue, sal_Int32 nValueType )
1589 const ScAddress& rAddress, sal_Int32 nSharedId,
const OUString& rTokens )
void convertColumns()
Converts column properties for all columns in the sheet.
static css::uno::Sequence< css::table::CellRangeAddress > toApiSequence(const ScRangeList &orRanges)
Converts the passed range list to a sequence of cell range addresses.
SC_DLLPUBLIC ScRefFlags ParseAny(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1)
Helper class to provide access to global workbook data.
bool isSheetRightToLeft() const
Returns true, if the sheet layout is set to right-to-left.
HyperlinkModel()
Additional tooltip text.
SCTAB getSheetIndex() const
Returns the index of the current sheet.
static WorksheetGlobalsRef constructGlobals(const WorkbookHelper &rHelper, const ISegmentProgressBarRef &rxProgressBar, WorksheetType eSheetType, SCTAB nSheet)
bool mbFastRowProgress
Sheet progress bar.
void setBaseColumnWidth(sal_Int32 nWidth)
Sets base width for all columns (without padding pixels).
void setCurrentSheetIndex(SCTAB nSheet)
Sets the index of the current Calc sheet, if filter currently processes a sheet.
awt::Size maDrawPageSize
Path to legacy VML drawing fragment.
ScAddress getCellAddressFromPosition(const awt::Point &rPosition) const
Returns the address of the cell that contains the passed point in 1/100 mm.
ScDocumentImport & getDocImport()
SheetDataBuffer & getSheetData() const
Returns the buffer for cell contents and cell formatting.
Reference< XDrawPage > getDrawPage() const
Returns the XDrawPage interface of the draw page of the current sheet.
PageSettings & getPageSettings()
Returns the page/print settings for this sheet.
bool mbThickTop
True = row outline is collapsed.
bool getProperty(Type &orValue, sal_Int32 nPropId) const
UnitConverter & getUnitConverter() const
Returns the measurement unit converter.
void createSharedFormulaMapEntry(const ScAddress &rAddress, sal_Int32 nSharedId, const OUString &rTokens)
WorksheetSettings & getWorksheetSettings()
Returns the worksheet settings object.
void setColumnModel(const ColumnModel &rModel)
Sets column settings for a specific column range.
const awt::Size & getDrawPageSize() const
Returns the size of the entire drawing page in 1/100 mm.
void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)
bool validateCellRange(ScRange &orRange, bool bAllowOverflow, bool bTrackOverflow)
Checks the passed cell range, may try to fit it to current sheet limits.
Contains string data and a list of formatting runs for a rich formatted string.
OUString getCalcSheetName(sal_Int32 nWorksheet) const
Returns the finalized name of the specified worksheet.
SheetDataBuffer maSheetData
Cell ranges containing data validation settings.
::std::map< sal_Int32, RowModelRange > RowModelRangeMap
css::uno::Any getAnyProperty(sal_Int32 nPropId) const
bool mbHasDefWidth
Reference to the current sheet.
SC_DLLPUBLIC void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bHidden)
WorksheetGlobals & mrSheetGlob
void finalizeImport()
Converts all imported sheet view settings.
void convertOutlines(OutlineLevelVec &orLevels, sal_Int32 nColRow, sal_Int32 nLevel, bool bCollapsed, bool bRows)
Converts outline grouping for the passed column or row.
ColumnModel()
True = column outline is collapsed.
bool mbCustomFormat
True = row has custom height.
ScDocument & getScDocument()
void extendShapeBoundingBox(const awt::Rectangle &rShapeRect)
Extends the shape bounding box by the position and size of the passed rectangle.
ExtLst & getExtLst()
returns the ExtLst entries that need to be filled
RowModel maDefRowModel
Ranges of columns sorted by first column index.
css::uno::Reference< css::table::XCellRange > getCellRange(const ScRange &rRange) const
Returns the XCellRange interface for the passed cell range address.
Helper class that provides functions to convert values from and to different units.
void finalizeImport()
Inserts all web queries into the sheet.
SheetViewSettings & getSheetViewSettings()
Returns the view settings for this sheet.
This is very similar to ScCellValue, except that it references the original value instead of copying ...
#define STATIC_ARRAY_SELECT(array, index, def)
WorksheetSettings & getWorksheetSettings() const
Returns the worksheet settings object.
SC_DLLPUBLIC void ApplyAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, const SfxPoolItem &rAttr)
Accessor class to ScDocument.
ScRange maUsedArea
Reference to maximum Calc cell address from address converter.
SheetViewSettings & getSheetViewSettings() const
Returns the view settings for this sheet.
StylesBuffer & getStyles() const
Returns all cell formatting objects read from the styles substream.
void putFormulaTokens(const ScAddress &rAddress, const ApiTokenSequence &rTokens)
Inserts a formula cell directly into the Calc sheet.
void finalizeDrawings()
Imports the drawings of the sheet (DML, VML, DFF) and updates the used area.
ISegmentProgressBarRef mxFinalProgress
Progress bar for row/cell processing.
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...
void setEditCell(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
QueryTableBuffer maQueryTables
Sheet auto filters (not associated to a table).
const css::awt::Size & getDrawPageSize() const
Returns the size of the entire drawing page in 1/100 mm.
Fragment handler for a complete sheet drawing.
sal_Int32 scaleToMm100(double fValue, Unit eUnit) const
Converts the passed value to 1/100 millimeters.
Reference< XSheetCellRanges > getCellRangeList(const ScRangeList &rRanges) const
Returns the XSheetCellRanges interface for the passed cell range addresses.
void setDrawingPath(const OUString &rDrawingPath)
Sets the path to the DrawingML fragment of this sheet.
void setHyperlink(const HyperlinkModel &rModel)
Inserts the hyperlink URL into the spreadsheet.
CondFormatBuffer & getCondFormats() const
Returns the conditional formatting in this sheet.
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)...
bool mbShowPhonetic
True = cells in row have explicit formatting.
ViewSettings & getViewSettings() const
Returns the workbook and sheet view settings object.
void initializeWorksheetImport()
Initial conversion before importing the worksheet.
void setBiffType(sal_uInt8 nType)
Sets the passed BIFF validation type.
void finalizeValidationRanges() const
Inserts all imported data validations into their cell ranges.
const ScAddress & mrMaxApiPos
bool mbCustomHeight
Row outline level.
Reference< XSpreadsheet > mxSheet
Type of this sheet.
std::shared_ptr< WorksheetGlobals > WorksheetGlobalsRef
std::vector< ValidationModel > maValidations
Cell ranges containing hyperlinks.
void convertColumnFormat(sal_Int32 nFirstCol, sal_Int32 nLastCol, sal_Int32 nXfId)
Converts column default cell formatting.
Stores formatting data about a page break.
bool mbCollapsed
True = row is hidden.
void setRowFormat(sal_Int32 nRow, sal_Int32 nXfId, bool bCustomFormat)
Sets default cell formatting for the specified range of rows.
WorksheetType getSheetType() const
Returns the type of this sheet.
void setVmlDrawingPath(const OUString &rVmlDrawingPath)
Sets the path to the legacy VML drawing fragment of this sheet.
::oox::core::FilterBase & getBaseFilter() const
Returns the base filter object (base class of all filters).
void setCellArrayFormula(const ScRange &rRangeAddress, const ScAddress &rTokenAddress, const OUString &rTokenStr)
void putRichString(const ScAddress &rAddress, const RichString &rString, const oox::xls::Font *pFirstPortionFont)
Inserts a rich-string cell directly into the Calc sheet.
sal_Int16 getCurrentSheetIndex() const
Returns the index of the current Calc sheet, if filter currently processes a sheet.
WorksheetType meSheetType
Progress bar for finalization.
void applyAutoFilters()
Applies autofilters from created database range ( requires finalizeImport to have run before being ca...
CommentsBuffer & getComments() const
Returns the buffer for all cell comments in this sheet.
CommentsBuffer maComments
Buffer for conditional formatting.
uno::Reference< sdbc::XRow > xRow
void finalizeDrawingImport()
double mfHeight
0-based (!) column ranges of used cells.
void extendUsedArea(const ScAddress &rAddress)
Extends the used area of this sheet by the passed cell position.
SC_DLLPUBLIC void SetColWidthOnly(SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth)
bool isValidSheet() const
Returns true, if this helper refers to an existing Calc sheet.
std::vector< HyperlinkModel > maHyperlinks
Ranges of rows sorted by first row index.
static IWorksheetProgress * getWorksheetInterface(const WorksheetGlobalsRef &xRef)
SC_DLLPUBLIC void SetRowHeightOnly(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nNewHeight)
sal_Int32 mnLevel
Column default formatting.
bool isMergeable(const ColumnModel &rModel) const
Returns true, if this entry can be merged with the passed column range (column settings are equal)...
void setCellStyleToSheet(SCTAB nTab, const ScStyleSheet &rStyle)
Apply specified cell style to an entire sheet.
CommentsBuffer & getComments()
Returns the buffer for all cell comments in this sheet.
void setCellFormulaValue(const ScAddress &rAddress, const OUString &rValueStr, sal_Int32 nCellType)
Stores settings and formatting data about a sheet row.
void setBiffOperator(sal_uInt8 nOperator)
Sets the passed BIFF operator.
OUString getHyperlinkUrl(const HyperlinkModel &rHyperlink) const
Generates the final URL for the passed hyperlink.
awt::Rectangle maShapeBoundingBox
Current size of the drawing page in 1/100 mm.
AutoFilterBuffer maAutoFilters
Buffer for all cell comments in this sheet.
double mfWidth
1-based (!) range of the described columns.
sal_Int32 mnXfId
Column width in number of characters.
bool mbHidden
True = cells in row show phonetic settings.
void setCellFormula(const ScAddress &rTokenAddress, const OUString &)
VmlDrawingPtr mxVmlDrawing
View settings for this sheet.
::std::map< sal_Int32, ColumnModelRange > ColumnModelRangeMap
css::uno::Reference< css::drawing::XDrawPage > getDrawPage() const
Returns the XDrawPage interface of the draw page of the current sheet.
void convertRows()
Converts row properties for all rows in the sheet.
void setDrawingPath(const OUString &rDrawingPath)
Sets the path to the DrawingML fragment of this sheet.
ISegmentProgressBarRef mxProgressBar
Bounding box for all shapes from all drawings.
bool mbHidden
True = cells in column show phonetic settings.
bool mbCollapsed
True = column is hidden.
ISegmentProgressBarRef mxRowProgress
Do we have a progress bar thread ?
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 setDefaultColumnWidth(double fWidth)
Sets default width for all columns.
PageBreakModel()
True = manual page break.
void IncCol(SCCOL nDelta=1)
virtual void setCustomRowProgress(const ISegmentProgressBarRef &rxRowProgress) override
Reference< XCellRange > getCellRange(const ScRange &rRange) const
Returns the XCellRange interface for the passed cell range address.
ExtLst & getExtLst() const
Stores settings and formatting data about a range of sheet columns.
void UpdateRowProgress(const ScRange &rUsedArea, SCROW nRow)
Update the row import progress bar.
WorksheetType getSheetType() const
Returns the type of this sheet.
std::shared_ptr< ISegmentProgressBar > ISegmentProgressBarRef
::std::pair< ColumnModel, sal_Int32 > ColumnModelRange
void insertHyperlink(const ScAddress &rAddress, const OUString &rUrl)
Inserts a hyperlinks into the specified cell.
ScDocument & getScDocument()
HRESULT createInstance(REFIID iid, Ifc **ppIfc)
void setPageBreak(const PageBreakModel &rModel, bool bRowBreak)
Sets a column or row page break described in the passed struct.
std::unique_ptr< EditTextObject > CreateTextObject()
AutoFilterBuffer & getAutoFilters()
Returns the auto filters for the sheet.
void IncRow(SCROW nDelta=1)
void convert(const css::uno::Reference< css::text::XText > &rxText) const
Converts the string and writes it into the passed XText, replace old contents of the text object...
const Reference< XSpreadsheet > & getSheet() const
Returns the XSpreadsheet interface of the current sheet.
void insertColSpan(const ValueRange &rColSpan)
Inserts the passed column span into the row model.
SheetViewSettings maSheetViewSett
Page/print settings for this sheet.
static SC_DLLPUBLIC bool ConvertToTokenArray(ScDocument &rDoc, ScTokenArray &rTokenArray, const css::uno::Sequence< css::sheet::FormulaToken > &rSequence)
void setBaseColumnWidth(sal_Int32 nWidth)
Sets base width for all columns (without padding pixels).
inline::tools::Long HMMToTwips(::tools::Long nHMM)
void finalizeImport(sal_Int16 nSheet)
Applies filter settings to a new database range object (used for sheet autofilter or advanced filter ...
ScEditEngineDefaulter & getEditEngine() const
void setVmlDrawingPath(const OUString &rVmlDrawingPath)
Sets the path to the legacy VML drawing fragment of this sheet.
css::uno::Reference< css::table::XCell > getCell(const ScAddress &rAddress) const
Returns the XCell interface for the passed cell address.
VmlDrawing & getVmlDrawing()
Returns the VML drawing page for this sheet (OOXML/BIFF12 only).
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.
::std::map< OUString, ScDataBarFormatData * > ExtLst
CondFormatBuffer maCondFormats
Buffer for cell contents and cell formatting.
void initializeWorksheetImport()
Initial conversion before importing the worksheet.
ExtLst maExtLst
Collection of all VML shapes.
QueryTableBuffer & getQueryTables() const
Returns the buffer for all web query tables in this sheet.
ColumnModelRangeMap maColModels
Default column formatting.
void setColumnModel(const ColumnModel &rModel)
Sets column settings for a specific range of columns.
OUString maVmlDrawingPath
Path to DrawingML fragment.
void setValidation(const ValidationModel &rModel)
Inserts the data validation settings into the spreadsheet.
RowModel()
True = row has extra space below text.
::std::vector< sal_Int32 > OutlineLevelVec
sal_Int32 mnXfId
Row height in points.
CondFormatBuffer & getCondFormats()
Returns the conditional formatting in this sheet.
css::uno::Sequence< ApiToken > ApiTokenSequence
Stores data about ranges with data validation settings.
void finalizeDrawingImport()
Final import of drawing objects.
ScRange getCellRangeFromRectangle(const awt::Rectangle &rRect) const
Returns the cell range address that contains the passed rectangle in 1/100 mm.
PageSettings maPageSett
Global settings for this sheet.
void extendUsedArea(const ScAddress &rAddress)
Extends the used area of this sheet by the passed cell position.
void setFormulaCell(const ScAddress &rPos, const OUString &rFormula, formula::FormulaGrammar::Grammar eGrammar, const double *pResult=nullptr)
ColumnModel maDefColModel
Used area of the sheet, and sheet index of the sheet.
bool isMergeable(const RowModel &rModel) const
Returns true, if this entry can be merged with the passed row range (row settings are equal)...
void setColSpans(sal_Int32 nRow, const ValueRangeSet &rColSpans)
Sets column span information for a row.
css::awt::Point getCellPosition(sal_Int32 nCol, sal_Int32 nRow) const
Returns the absolute cell position in 1/100 mm.
void setSheetUsedArea(const ScRange &rUsedArea)
Stores the used area for a specific worksheet.
void finalizeImport()
Creates a page style for the spreadsheet and sets all page properties.
const css::uno::Reference< css::sheet::XSpreadsheet > & getSheet() const
Returns the XSpreadsheet interface of the current sheet.
WorksheetGlobals(const WorkbookHelper &rHelper, const ISegmentProgressBarRef &rxProgressBar, WorksheetType eSheetType, SCTAB nSheet)
Service name for a SheetCellRanges object.
void finalizeWorksheetImport()
Final conversion after importing the worksheet.
SheetDataBuffer & getSheetData()
Returns the buffer for cell contents and cell formatting.
ValueRangeSet maColSpans
1-based (!) index of the described row.
RowModelRangeMap maRowModels
Default row formatting.
Reference< XCell > getCell(const ScAddress &rAddress) const
Returns the XCell interface for the passed cell address.
English Metric Unit (1/360,000 cm).
SCTAB getSheetIndex() const
Returns the index of the current sheet.
void insert(const ValueRange &rRange)
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.
SC_DLLPUBLIC void SetManualHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bManual)
::std::unique_ptr< VmlDrawing > VmlDrawingPtr
QueryTableBuffer & getQueryTables()
Returns the buffer for all web query tables in this sheet.
SC_DLLPUBLIC void SetRowHidden(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bHidden)
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
void finalizeImport()
Converts the imported worksheet settings.
double scaleFromMm100(sal_Int32 nMm100, Unit eUnit) const
Converts the passed value from 1/100 millimeters to the passed unit.
constexpr TypedWhichId< SfxStringItem > ATTR_HYPERLINK(155)
TableBuffer & getTables() const
Returns the tables collection (equivalent to Calc's database ranges).
Reference< XCellRange > getColumn(sal_Int32 nCol) const
Returns the XCellRange interface for a column.
css::uno::Reference< css::sheet::XSpreadsheet > getSheetFromDoc(sal_Int32 nSheet) const
Returns a reference to the specified spreadsheet in the document model.
virtual ISegmentProgressBarRef getRowProgress() override
Allow the threaded importer to override our progress bar impl.
constexpr sal_uInt16 EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
WorksheetHelper(WorksheetGlobals &rSheetGlob)
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.
VmlDrawing & getVmlDrawing() const
Returns the VML drawing page for this sheet (OOXML/BIFF12 only).
WorksheetSettings maSheetSett
Buffer for all web query tables in this sheet.
void finalizeImport()
Final processing after the sheet has been imported.
void setHyperlink(const HyperlinkModel &rModel)
Inserts the hyperlink URL into the spreadsheet.
Stores data about a hyperlink range.
Reference< XCellRange > getRow(sal_Int32 nRow) const
Returns the XCellRange interface for a row.
sal_Int32 mnLevel
Row default formatting (see mbIsFormatted).
WorksheetType
An enumeration for all types of sheets in a workbook.
void setValidation(const ValidationModel &rModel)
Inserts the data validation settings into the spreadsheet.
constexpr OUStringLiteral first
constexpr OUStringLiteral gaSheetCellRanges(u"com.sun.star.sheet.SheetCellRanges")
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
::std::pair< RowModel, sal_Int32 > RowModelRange
AutoFilterBuffer & getAutoFilters() const
Returns the auto filters for the sheet.
void setPageBreak(const PageBreakModel &rModel, bool bRowBreak)
Sets a column or row page break described in the passed struct.
const ScAddress & getMaxXlsAddress() const
Returns the biggest valid cell address in the imported/exported Excel document.
void setRowModel(const RowModel &rModel)
Sets row settings for a specific row.
void finalizeWorksheetImport()
Final conversion after importing the worksheet.
OUString maDrawingPath
List of extended elements.
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()
void finalizeHyperlinkRanges()
Inserts all imported hyperlinks into their cell ranges.
bool mbThickBottom
True = row has extra space above text.
bool setProperty(sal_Int32 nPropId, const Type &rValue)
void setRowModel(const RowModel &rModel)
Sets row settings for a specific range of rows.
PageSettings & getPageSettings() const
Returns the page/print settings for this sheet.
Manages the cell contents and cell formatting of a sheet.
bool mbManual
End of limited break.
AddressConverter & getAddressConverter() const
Returns the converter for string to cell address/range conversion.
FormulaBuffer & getFormulaBuffer() const
void groupColumnsOrRows(sal_Int32 nFirstColRow, sal_Int32 nLastColRow, bool bCollapsed, bool bRows)
Groups columns or rows for the given range.
void setDefaultColumnWidth(double fWidth)
Sets default width for all columns.
void setBiffErrorStyle(sal_uInt8 nErrorStyle)
Sets the passed BIFF error style.
WorksheetBuffer & getWorksheets() const
Returns the worksheet buffer containing sheet names and properties.