summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2020-10-31 18:27:58 +0100
committerEike Rathke <erack@redhat.com>2020-10-31 21:30:31 +0100
commitc87a70c9f66256c85df7e7d33c3ebb46782593a7 (patch)
tree5f0d580d51db349cec99e76f097f404961a97bd7
parent0385dd46907455e5f6aeba4689ad8cce9b786702 (diff)
Implement ScDocument::GetSheetSeparator()
That can be reused. Change-Id: I4805fefa7585ddee026073e3b647020f8a993ab2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105123 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/inc/document.hxx6
-rw-r--r--sc/source/core/data/documen4.cxx8
2 files changed, 14 insertions, 0 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index edc0447949cf..5bab5a19d80c 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -803,6 +803,12 @@ public:
*/
bool InsertNewRangeName( SCTAB nTab, const OUString& rName, const ScAddress& rPos, const OUString& rExpr );
+ /** Obtain the sheet separator corresponding to the document's grammar.
+
+ @return '.' for our own grammars, '!' for Excel grammars.
+ */
+ SC_DLLPUBLIC sal_Unicode GetSheetSeparator() const;
+
SCTAB GetMaxTableNumber() const { return static_cast<SCTAB>(maTabs.size()) - 1; }
ScRangePairList* GetColNameRanges() { return xColNameRanges.get(); }
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 5e0e19f93035..9190ed109e44 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -1346,4 +1346,12 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc )
}
}
+sal_Unicode ScDocument::GetSheetSeparator() const
+{
+ const ScCompiler::Convention* pConv = ScCompiler::GetRefConvention(
+ FormulaGrammar::extractRefConvention( GetGrammar()));
+ assert(pConv);
+ return pConv ? pConv->getSpecialSymbol( ScCompiler::Convention::SHEET_SEPARATOR) : '.';
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */