no need to store reference to Import here
can just cast the parent member Change-Id: I990bd4da3afbd78da819038c7907c28de87faaaf Reviewed-on: https://gerrit.libreoffice.org/82567 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -86,7 +86,7 @@ using namespace ::com::sun::star::util;
|
|||||||
class RptMLMasterStylesContext_Impl:
|
class RptMLMasterStylesContext_Impl:
|
||||||
public XMLTextMasterStylesContext
|
public XMLTextMasterStylesContext
|
||||||
{
|
{
|
||||||
ORptFilter& m_rImport;
|
ORptFilter& GetImport() { return static_cast<ORptFilter&>(XMLTextMasterStylesContext::GetImport()); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -106,14 +106,13 @@ RptMLMasterStylesContext_Impl::RptMLMasterStylesContext_Impl(
|
|||||||
const OUString& rLName ,
|
const OUString& rLName ,
|
||||||
const uno::Reference< xml::sax::XAttributeList > & xAttrList ) :
|
const uno::Reference< xml::sax::XAttributeList > & xAttrList ) :
|
||||||
XMLTextMasterStylesContext( rImport, nPrfx, rLName, xAttrList )
|
XMLTextMasterStylesContext( rImport, nPrfx, rLName, xAttrList )
|
||||||
,m_rImport(rImport)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void RptMLMasterStylesContext_Impl::EndElement()
|
void RptMLMasterStylesContext_Impl::EndElement()
|
||||||
{
|
{
|
||||||
FinishStyles( true );
|
FinishStyles( true );
|
||||||
m_rImport.FinishStyles();
|
GetImport().FinishStyles();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// read a component (file + filter version)
|
/// read a component (file + filter version)
|
||||||
|
@@ -43,7 +43,6 @@ ScXMLExternalRefTabSourceContext::ScXMLExternalRefTabSourceContext(
|
|||||||
ScXMLImport& rImport,
|
ScXMLImport& rImport,
|
||||||
const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList, ScXMLExternalTabData& rRefInfo ) :
|
const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList, ScXMLExternalTabData& rRefInfo ) :
|
||||||
ScXMLImportContext( rImport ),
|
ScXMLImportContext( rImport ),
|
||||||
mrScImport(rImport),
|
|
||||||
mrExternalRefInfo(rRefInfo)
|
mrExternalRefInfo(rRefInfo)
|
||||||
{
|
{
|
||||||
using namespace ::xmloff::token;
|
using namespace ::xmloff::token;
|
||||||
@@ -98,7 +97,7 @@ static bool lcl_isValidRelativeURL(const OUString& rUrl)
|
|||||||
|
|
||||||
void SAL_CALL ScXMLExternalRefTabSourceContext::endFastElement( sal_Int32 /*nElement*/ )
|
void SAL_CALL ScXMLExternalRefTabSourceContext::endFastElement( sal_Int32 /*nElement*/ )
|
||||||
{
|
{
|
||||||
ScDocument* pDoc = mrScImport.GetDocument();
|
ScDocument* pDoc = GetScImport().GetDocument();
|
||||||
if (!pDoc)
|
if (!pDoc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -111,7 +110,6 @@ void SAL_CALL ScXMLExternalRefTabSourceContext::endFastElement( sal_Int32 /*nEle
|
|||||||
ScXMLExternalRefRowsContext::ScXMLExternalRefRowsContext(
|
ScXMLExternalRefRowsContext::ScXMLExternalRefRowsContext(
|
||||||
ScXMLImport& rImport, ScXMLExternalTabData& rRefInfo ) :
|
ScXMLImport& rImport, ScXMLExternalTabData& rRefInfo ) :
|
||||||
ScXMLImportContext( rImport ),
|
ScXMLImportContext( rImport ),
|
||||||
mrScImport(rImport),
|
|
||||||
mrExternalRefInfo(rRefInfo)
|
mrExternalRefInfo(rRefInfo)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -126,7 +124,7 @@ Reference< XFastContextHandler > SAL_CALL ScXMLExternalRefRowsContext::createFas
|
|||||||
// #i101319# row elements inside group, rows or header-rows
|
// #i101319# row elements inside group, rows or header-rows
|
||||||
// are treated like row elements directly in the table element
|
// are treated like row elements directly in the table element
|
||||||
|
|
||||||
const SvXMLTokenMap& rTokenMap = mrScImport.GetTableRowsElemTokenMap();
|
const SvXMLTokenMap& rTokenMap = GetScImport().GetTableRowsElemTokenMap();
|
||||||
sal_uInt16 nToken = rTokenMap.Get( nElement );
|
sal_uInt16 nToken = rTokenMap.Get( nElement );
|
||||||
sax_fastparser::FastAttributeList *pAttribList =
|
sax_fastparser::FastAttributeList *pAttribList =
|
||||||
sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList );
|
sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList );
|
||||||
@@ -137,10 +135,10 @@ Reference< XFastContextHandler > SAL_CALL ScXMLExternalRefRowsContext::createFas
|
|||||||
case XML_TOK_TABLE_ROWS_HEADER_ROWS:
|
case XML_TOK_TABLE_ROWS_HEADER_ROWS:
|
||||||
case XML_TOK_TABLE_ROWS_ROWS:
|
case XML_TOK_TABLE_ROWS_ROWS:
|
||||||
return new ScXMLExternalRefRowsContext(
|
return new ScXMLExternalRefRowsContext(
|
||||||
mrScImport, mrExternalRefInfo);
|
GetScImport(), mrExternalRefInfo);
|
||||||
case XML_TOK_TABLE_ROWS_ROW:
|
case XML_TOK_TABLE_ROWS_ROW:
|
||||||
return new ScXMLExternalRefRowContext(
|
return new ScXMLExternalRefRowContext(
|
||||||
mrScImport, pAttribList, mrExternalRefInfo);
|
GetScImport(), pAttribList, mrExternalRefInfo);
|
||||||
default:
|
default:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
@@ -40,7 +40,6 @@ public:
|
|||||||
virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
|
virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScXMLImport& mrScImport;
|
|
||||||
ScXMLExternalTabData& mrExternalRefInfo;
|
ScXMLExternalTabData& mrExternalRefInfo;
|
||||||
|
|
||||||
OUString maRelativeUrl;
|
OUString maRelativeUrl;
|
||||||
@@ -61,7 +60,6 @@ public:
|
|||||||
const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
|
const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScXMLImport& mrScImport;
|
|
||||||
ScXMLExternalTabData& mrExternalRefInfo;
|
ScXMLExternalTabData& mrExternalRefInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ using namespace ::xmloff::token;
|
|||||||
class SvXMLSectionListContext : public SvXMLImportContext
|
class SvXMLSectionListContext : public SvXMLImportContext
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
SwXMLSectionList & m_rImport;
|
SwXMLSectionList & GetImport() { return static_cast<SwXMLSectionList&>(SvXMLImportContext::GetImport()); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SvXMLSectionListContext(SwXMLSectionList& rImport);
|
SvXMLSectionListContext(SwXMLSectionList& rImport);
|
||||||
@@ -42,12 +42,11 @@ public:
|
|||||||
class SwXMLParentContext : public SvXMLImportContext
|
class SwXMLParentContext : public SvXMLImportContext
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
SwXMLSectionList & m_rImport;
|
SwXMLSectionList & GetImport() { return static_cast<SwXMLSectionList&>(SvXMLImportContext::GetImport()); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SwXMLParentContext(SwXMLSectionList& rImport)
|
SwXMLParentContext(SwXMLSectionList& rImport)
|
||||||
: SvXMLImportContext(rImport)
|
: SvXMLImportContext(rImport)
|
||||||
, m_rImport(rImport)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,11 +64,11 @@ public:
|
|||||||
Element == XML_ELEMENT(TEXT, XML_INSERTION) ||
|
Element == XML_ELEMENT(TEXT, XML_INSERTION) ||
|
||||||
Element == XML_ELEMENT(TEXT, XML_DELETION))
|
Element == XML_ELEMENT(TEXT, XML_DELETION))
|
||||||
{
|
{
|
||||||
return new SvXMLSectionListContext(m_rImport);
|
return new SvXMLSectionListContext(GetImport());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return new SwXMLParentContext(m_rImport);
|
return new SwXMLParentContext(GetImport());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -102,8 +101,7 @@ SvXMLImportContext * SwXMLSectionList::CreateFastContext(
|
|||||||
}
|
}
|
||||||
|
|
||||||
SvXMLSectionListContext::SvXMLSectionListContext( SwXMLSectionList& rImport )
|
SvXMLSectionListContext::SvXMLSectionListContext( SwXMLSectionList& rImport )
|
||||||
: SvXMLImportContext ( rImport ),
|
: SvXMLImportContext ( rImport )
|
||||||
m_rImport(rImport)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,10 +122,10 @@ css::uno::Reference<css::xml::sax::XFastContextHandler> SvXMLSectionListContext:
|
|||||||
if (aIter.getToken() == (XML_NAMESPACE_TEXT | XML_NAME))
|
if (aIter.getToken() == (XML_NAMESPACE_TEXT | XML_NAME))
|
||||||
sName = aIter.toString();
|
sName = aIter.toString();
|
||||||
if ( !sName.isEmpty() )
|
if ( !sName.isEmpty() )
|
||||||
m_rImport.m_rSectionList.push_back(sName);
|
GetImport().m_rSectionList.push_back(sName);
|
||||||
}
|
}
|
||||||
|
|
||||||
pContext = new SvXMLSectionListContext(m_rImport);
|
pContext = new SvXMLSectionListContext(GetImport());
|
||||||
return pContext;
|
return pContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user