diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-19 16:45:55 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-28 13:28:31 -0500 |
commit | 1157cbc99391c121bbe5e75291ce7a2cc75f5eba (patch) | |
tree | 1d4cff9f336690469d36e214a79ded44ffb9541b /sc/source/ui/xmlsource | |
parent | 83c2f4c830559ce3aa0b448a604c93882af4f231 (diff) |
Separate the XML part of orcus filters into own class.
Along with other reorganization of the orcus interface code...
This XML context object will be used to store data specific to each
loaded XML file, such as XML stream, namespace repository and so on.
Change-Id: I21c43ab0026954c5d52f4985a169934f8fb9f704
Diffstat (limited to 'sc/source/ui/xmlsource')
-rw-r--r-- | sc/source/ui/xmlsource/xmlsourcedlg.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index fa85970617ca..5019306d6e7f 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -208,7 +208,11 @@ void ScXMLSourceDlg::LoadSourceFileStructure(const OUString& rPath) if (!pOrcus) return; - pOrcus->loadXMLStructure(rPath, maLbTree, maXMLParam); + mpXMLContext.reset(pOrcus->createXMLContext(*mpDoc, rPath)); + if (!mpXMLContext) + return; + + mpXMLContext->loadXMLStructure(maLbTree, maXMLParam); } void ScXMLSourceDlg::HandleGetFocus(Control* pCtrl) @@ -454,6 +458,9 @@ void getFieldLinks(ScOrcusImportXMLParam::RangeLink& rRangeLink, const SvTreeLis void ScXMLSourceDlg::OkPressed() { + if (!mpXMLContext) + return; + // Begin import. ScOrcusImportXMLParam aParam; @@ -493,11 +500,8 @@ void ScXMLSourceDlg::OkPressed() } // Now do the import. - ScOrcusFilters* pOrcus = ScFormatFilter::Get().GetOrcusFilters(); - if (!pOrcus) - return; - pOrcus->importXML(*mpDoc, maSrcPath, aParam); + mpXMLContext->importXML(aParam); // Don't forget to broadcast the change. SfxObjectShell* pShell = mpDoc->GetDocumentShell(); |