24#include <document.hxx>
29#include <unonames.hxx>
40#include <com/sun/star/sheet/DataImportMode.hpp>
41#include <com/sun/star/table/TableOrientation.hpp>
42#include <osl/diagnose.h>
64 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
87 nSourceType(sheet::DataImportMode_NONE),
89 nSubTotalsUserListIndex(0),
92 bContainsSubTotal(false),
99 bSubTotalsBindFormatsToContent(false),
100 bSubTotalsIsCaseSensitive(false),
101 bSubTotalsInsertPageBreaks(false),
102 bSubTotalsSortGroups(false),
103 bSubTotalsEnabledUserList(false),
104 bSubTotalsAscending(true),
105 bFilterConditionSourceRange(false),
112 for(
auto &aIter : *rAttrList )
114 switch( aIter.getToken() )
162 sal_Int32 nOffset = 0;
172 nRefresh = std::max(
static_cast<sal_Int32
>(fTime * 86400.0), sal_Int32(0) );
196 sal_Int32 nElement,
const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
249 ::std::unique_ptr<ScDBData>
pData(
273 case sheet::DataImportMode_NONE:
276 case sheet::DataImportMode_SQL:
280 case sheet::DataImportMode_TABLE:
285 case sheet::DataImportMode_QUERY:
291 OSL_FAIL(
"Unknown data import mode");
294 pData->SetImportParam(aParam);
301 beans::PropertyValue aProperty;
303 table::TableOrientation eOrient =
mpQueryParam->bByRow ?
304 table::TableOrientation_ROWS : table::TableOrientation_COLUMNS;
305 aProperty.Value <<= eOrient;
318 pData->SetSortParam(aParam);
337 const uno::Sequence<sheet::SubTotalColumn>& rColumns = rSubTotalRule.aSubTotalColumns;
338 sal_Int32 nColCount = rColumns.getLength();
339 sal_Int16 nGroupColumn = rSubTotalRule.nSubTotalRuleGroupFieldNumber;
350 const sheet::SubTotalColumn* pAry = rColumns.getConstArray();
365 pData->SetSubTotalParam(aParam);
368 if (
pData->HasImportParam() && !
pData->HasImportSelection())
409 pData->GetArea(aRange);
411 setAutoFilterFlags(*pDoc, *
pData);
423 pData->GetArea(aRange);
425 if (setAutoFilterFlags(*pDoc, *
pData))
438 setAutoFilterFlags(*pDoc, *
pData);
448 pDatabaseRangeContext(pTempDatabaseRangeContext)
450 if ( rAttrList.is() )
452 for (
auto &aIter : *rAttrList)
454 switch (aIter.getToken())
476 sal_Int32 nElement,
const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
500 pDatabaseRangeContext(pTempDatabaseRangeContext)
502 if ( rAttrList.is() )
504 for (
auto &aIter : *rAttrList)
506 switch (aIter.getToken())
526 sal_Int32 nElement,
const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
550 pDatabaseRangeContext(pTempDatabaseRangeContext)
552 if ( rAttrList.is() )
554 for (
auto &aIter : *rAttrList)
556 switch (aIter.getToken())
575 sal_Int32 nElement,
const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
601 if ( rAttrList.is() )
604 if (aIter != rAttrList->end())
605 sConRes = aIter.toString();
607 if (!sConRes.isEmpty())
619 pDatabaseRangeContext(pTempDatabaseRangeContext)
621 if ( !rAttrList.is() )
624 for (
auto &aIter : *rAttrList)
626 switch (aIter.getToken())
646 sal_Int32 nElement,
const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
675 if ( !rAttrList.is() )
678 for (
auto &aIter : *rAttrList)
680 switch (aIter.getToken())
684 const OUString &sValue = aIter.toString();
685 if (sValue.getLength() > 8)
687 std::u16string_view sTemp = sValue.subView(0, 8);
688 if (sTemp ==
u"UserList")
691 sTemp = sValue.subView(8);
732 pDatabaseRangeContext(pTempDatabaseRangeContext)
734 if ( rAttrList.is() )
736 for (
auto &aIter : *rAttrList)
738 switch (aIter.getToken())
753 sal_Int32 nElement,
const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
781 pSubTotalRuleContext(pTempSubTotalRuleContext)
783 if ( !rAttrList.is() )
786 for (
auto &aIter : *rAttrList)
788 switch (aIter.getToken())
806 sheet::SubTotalColumn aSubTotalColumn;
bool insert(std::unique_ptr< ScDBData > p)
Takes ownership of p and attempts to insert it into the collection.
const Link< Timer *, void > & GetRefreshHandler() const
bool HasAutoFilter() const
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
static SC_DLLPUBLIC ScSubTotalFunc toSubTotalFunc(ScGeneralFunction eGenFunc)
void PrepareQuery(SCTAB nTab, ScQueryParam &rQueryParam)
std::unique_ptr< ScRefreshTimerControl > const & GetRefreshTimerControlAddress() const
SC_DLLPUBLIC bool ApplyFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
SC_DLLPUBLIC void SetAnonymousDBData(SCTAB nTab, std::unique_ptr< ScDBData > pDBData)
static bool GetRangeFromString(ScRange &rRange, std::u16string_view rRangeStr, const ScDocument &rDocument, formula::FormulaGrammar::AddressConvention eConv, sal_Int32 &nOffset, sal_Unicode cSeparator=' ', sal_Unicode cQuote='\'')
static void FillSortParam(ScSortParam &rParam, const css::uno::Sequence< css::beans::PropertyValue > &rSeq)
virtual ~ScXMLConResContext() override
ScXMLConResContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
static css::sheet::GeneralFunction GetFunctionFromString(std::u16string_view rString)
sal_Int16 nSubTotalsUserListIndex
css::sheet::DataImportMode nSourceType
void SetSubTotalsInsertPageBreaks(const bool bTemp)
std::vector< ScSubTotalRule > aSubTotalRules
ScXMLDatabaseRangeContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList)
void SetSubTotalsIsCaseSensitive(const bool bTemp)
void SetSubTotalsEnabledUserList(const bool bTemp)
OUString sDatabaseRangeName
void SetConnectionResource(const OUString &sTempConRes)
bool bFilterConditionSourceRange
bool bSubTotalsEnabledUserList
bool bSubTotalsSortGroups
OUString sConnectionResource
void SetDatabaseName(const OUString &sTempDatabaseName)
std::unique_ptr< ScQueryParam > mpQueryParam
ScRange aFilterConditionSourceRangeAddress
void SetSubTotalsAscending(const bool bTemp)
ScDBCollection::RangeType meRangeType
void SetSubTotalsUserListIndex(const sal_Int16 nTemp)
bool bSubTotalsInsertPageBreaks
void SetSubTotalsSortGroups(const bool bTemp)
std::unique_ptr< ScDBData > ConvertToDBData(const OUString &rName)
css::uno::Sequence< css::beans::PropertyValue > aSortSequence
virtual ~ScXMLDatabaseRangeContext() override
void SetSourceObject(const OUString &sTempSourceObject)
void SetSubTotalsBindFormatsToContent(const bool bTemp)
bool bSubTotalsBindFormatsToContent
void SetNative(const bool bTempNative)
void SetSourceType(const css::sheet::DataImportMode nTempSourceType)
void AddSubTotalRule(const ScSubTotalRule &rRule)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
bool bSubTotalsIsCaseSensitive
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
ScXMLDatabaseRangesContext(ScXMLImport &rImport)
virtual ~ScXMLDatabaseRangesContext() override
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
This class exists only to provide GetScImport() to its derived classes.
ScXMLImport & GetScImport()
ScDocument * GetDocument()
virtual ~ScXMLSortGroupsContext() override
ScXMLSortGroupsContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
ScXMLDatabaseRangeContext * pDatabaseRangeContext
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual ~ScXMLSourceQueryContext() override
ScXMLSourceQueryContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
ScXMLDatabaseRangeContext * pDatabaseRangeContext
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual ~ScXMLSourceSQLContext() override
ScXMLSourceSQLContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
ScXMLDatabaseRangeContext * pDatabaseRangeContext
ScXMLSourceTableContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
virtual ~ScXMLSourceTableContext() override
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
virtual ~ScXMLSubTotalFieldContext() override
ScXMLSubTotalFieldContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLSubTotalRuleContext *pSubTotalRuleContext)
ScXMLSubTotalRuleContext * pSubTotalRuleContext
void AddSubTotalColumn(const css::sheet::SubTotalColumn &rSubTotalColumn)
ScXMLSubTotalRuleContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
ScSubTotalRule aSubTotalRule
ScXMLDatabaseRangeContext * pDatabaseRangeContext
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
virtual ~ScXMLSubTotalRuleContext() override
ScXMLDatabaseRangeContext * pDatabaseRangeContext
ScXMLSubTotalRulesContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual ~ScXMLSubTotalRulesContext() override
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
ScGeneralFunction
the css::sheet::GeneralFunction enum is extended by constants in GeneralFunction2,...
constexpr OUStringLiteral STR_DB_GLOBAL_NONAME
constexpr OUStringLiteral STR_DB_LOCAL_NONAME
std::unique_ptr< sal_Int32[]> pData
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
XML_BIND_STYLES_TO_CONTENT
XML_ON_UPDATE_KEEP_STYLES
XML_DATABASE_SOURCE_QUERY
XML_GROUP_BY_FIELD_NUMBER
XML_DISPLAY_FILTER_BUTTONS
XML_DATABASE_SOURCE_TABLE
XML_PAGE_BREAKS_ON_GROUP_CHANGE
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
::std::vector< ScSortKeyState > maKeyState
sal_uInt16 GetSortKeyCount() const
bool bUserDef
sort user defined
bool bPagebreak
page break at change of group
bool bAscending
sort ascending
bool bGroupActive[MAXSUBTOTAL]
active groups
sal_uInt16 nUserIndex
index into list
SCCOL nField[MAXSUBTOTAL]
associated field
SCCOL nSubTotals[MAXSUBTOTAL]
number of SubTotals
std::unique_ptr< ScSubTotalFunc[]> pFunctions[MAXSUBTOTAL]
array of associated functions
std::unique_ptr< SCCOL[]> pSubTotals[MAXSUBTOTAL]
array of columns to be calculated
bool bIncludePattern
sort formats
sal_Int16 nSubTotalRuleGroupFieldNumber
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
constexpr OUStringLiteral SC_UNONAME_ORIENT
#define XML_ELEMENT(prefix, name)