sc/source/filter/inc/orcusinterface.hxx |    3 +++
 sc/source/filter/orcus/interface.cxx    |   15 +++++++++++++++
 2 files changed, 18 insertions(+)

New commits:
commit 9a96c395d52984628b759104f9ce2a7781d0e139
Author:     Kohei Yoshida <ko...@libreoffice.org>
AuthorDate: Mon Jul 17 22:22:48 2023 -0400
Commit:     Kohei Yoshida <ko...@libreoffice.org>
CommitDate: Tue Jul 18 14:34:16 2023 +0200

    Make the reference resolver really available for orcus
    
    It was there, but was never really made available.
    
    Change-Id: Id7093c4c6b52aa1831f42046a83991b923c70781
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154569
    Tested-by: Jenkins
    Reviewed-by: Kohei Yoshida <ko...@libreoffice.org>

diff --git a/sc/source/filter/inc/orcusinterface.hxx 
b/sc/source/filter/inc/orcusinterface.hxx
index 44318d0b1149..ed3966a2e136 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -706,6 +706,7 @@ class ScOrcusFactory : public 
orcus::spreadsheet::iface::import_factory
 
     CellStoreTokensType maCellStoreTokens;
     ScOrcusGlobalSettings maGlobalSettings;
+    ScOrcusRefResolver maRefResolver;
     ScOrcusSharedStrings maSharedStrings;
     ScOrcusNamedExpression maNamedExpressions;
     std::vector<std::unique_ptr<ScOrcusSheet>> maSheets;
@@ -726,6 +727,8 @@ public:
     virtual orcus::spreadsheet::iface::import_shared_strings* 
get_shared_strings() override;
     virtual orcus::spreadsheet::iface::import_named_expression* 
get_named_expression() override;
     virtual orcus::spreadsheet::iface::import_styles* get_styles() override;
+    virtual orcus::spreadsheet::iface::import_reference_resolver* 
get_reference_resolver(
+        orcus::spreadsheet::formula_ref_context_t cxt) override;
     virtual void finalize() override;
 
     ScDocumentImport& getDoc();
diff --git a/sc/source/filter/orcus/interface.cxx 
b/sc/source/filter/orcus/interface.cxx
index dac336ad35b8..52907f5f69c2 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -310,6 +310,7 @@ ScOrcusFactory::CellStoreToken::CellStoreToken(const 
ScAddress& rPos, OUString a
 ScOrcusFactory::ScOrcusFactory(ScDocument& rDoc, bool bSkipDefaultStyles) :
     maDoc(rDoc),
     maGlobalSettings(maDoc),
+    maRefResolver(maGlobalSettings),
     maSharedStrings(*this),
     maNamedExpressions(maDoc, maGlobalSettings),
     maStyles(*this, bSkipDefaultStyles),
@@ -409,6 +410,20 @@ orcus::spreadsheet::iface::import_styles* 
ScOrcusFactory::get_styles()
     return &maStyles;
 }
 
+os::iface::import_reference_resolver* 
ScOrcusFactory::get_reference_resolver(os::formula_ref_context_t cxt)
+{
+    switch (cxt)
+    {
+        case os::formula_ref_context_t::global:
+            return &maRefResolver;
+        case os::formula_ref_context_t::named_expression_base:
+        case os::formula_ref_context_t::named_range:
+            return nullptr;
+    }
+
+    return nullptr;
+}
+
 void ScOrcusFactory::finalize()
 {
     auto toFormulaCell = [this]( const CellStoreToken& rToken ) -> 
std::unique_ptr<ScFormulaCell>

Reply via email to