summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-04-03 14:12:00 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-04-03 14:12:00 +0000
commit42be2faa45d5f43117b6e72d36d7df51c028a82b (patch)
tree23d0cab8a2af3a707e7a33f9327e257ddf1d8785
parentd847cf92cf4f2ee7927c3662f12e91ee84fb5331 (diff)
CWS-TOOLING: integrate CWS calcsheetref_DEV300
2009-03-30 17:47:46 +0200 er r270250 : #i100681# correctly quote sheet names
-rw-r--r--sc/source/core/tool/rangeutl.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index fcd693f7ce3d..b1654421b12c 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -46,6 +46,7 @@
#include "globstr.hrc"
#include "convuno.hxx"
#include "externalrefmgr.hxx"
+#include "compiler.hxx"
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -439,14 +440,12 @@ void ScRangeStringConverter::GetTokenByOffset(
}
}
-void ScRangeStringConverter::AppendTableName(OUStringBuffer& rBuf, const OUString& rTabName, sal_Unicode cQuote)
+void ScRangeStringConverter::AppendTableName(OUStringBuffer& rBuf, const OUString& rTabName, sal_Unicode /* cQuote */)
{
- bool bQuoted = rTabName.indexOf(sal_Unicode(' '), 0) >= 0;
- if (bQuoted)
- rBuf.append(cQuote);
- rBuf.append(rTabName);
- if (bQuoted)
- rBuf.append(cQuote);
+ // quote character is always "'"
+ String aQuotedTab(rTabName);
+ ScCompiler::CheckTabQuotes(aQuotedTab, ::formula::FormulaGrammar::CONV_OOO);
+ rBuf.append(aQuotedTab);
}
sal_Int32 ScRangeStringConverter::GetTokenCount( const OUString& rString, sal_Unicode cSeperator, sal_Unicode cQuote )
@@ -832,7 +831,7 @@ static void lcl_appendCellRangeAddress(
rBuf.append(cQuote);
rBuf.append(sal_Unicode('#'));
rBuf.append(sal_Unicode('$'));
- rBuf.append(rExtInfo1.maTabName);
+ ScRangeStringConverter::AppendTableName(rBuf, rExtInfo1.maTabName);
rBuf.append(sal_Unicode('.'));
String aAddr;
@@ -844,7 +843,7 @@ static void lcl_appendCellRangeAddress(
if (rExtInfo1.maTabName != rExtInfo2.maTabName)
{
rBuf.append(sal_Unicode('$'));
- rBuf.append(rExtInfo2.maTabName);
+ ScRangeStringConverter::AppendTableName(rBuf, rExtInfo2.maTabName);
rBuf.append(sal_Unicode('.'));
}