summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/column.hxx4
-rw-r--r--sc/inc/document.hxx3
-rw-r--r--sc/inc/stringutil.hxx35
-rw-r--r--sc/inc/table.hxx4
4 files changed, 41 insertions, 5 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 2fa63eb91d74..668d64bb4289 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -66,6 +66,7 @@ struct ScFunctionData;
struct ScLineFlags;
struct ScMergePatternState;
class ScFlatBoolRowSegments;
+struct ScSetStringParam;
#define COLUMN_DELTA 4
@@ -236,8 +237,7 @@ public:
// TRUE = Zahlformat gesetzt
BOOL SetString( SCROW nRow, SCTAB nTab, const String& rString,
formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO,
- SvNumberFormatter* pFormatter = NULL,
- bool bDetectNumberFormat = true );
+ ScSetStringParam* pParam = NULL );
void SetValue( SCROW nRow, const double& rVal);
void SetError( SCROW nRow, const USHORT nError);
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index b643023d3840..42928b56160a 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -146,6 +146,7 @@ class ScFormulaParserPool;
struct ScClipParam;
struct ScClipRangeNameData;
class ScRowBreakIterator;
+struct ScSetStringParam;
namespace com { namespace sun { namespace star {
namespace lang {
@@ -773,7 +774,7 @@ public:
// return TRUE = Zahlformat gesetzt
SC_DLLPUBLIC BOOL SetString(
SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
- SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true );
+ ScSetStringParam* pParam = NULL );
SC_DLLPUBLIC void SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal );
void SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError);
diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx
index c50c0d8cf156..c6433ebb1d04 100644
--- a/sc/inc/stringutil.hxx
+++ b/sc/inc/stringutil.hxx
@@ -32,6 +32,41 @@
#define SC_STRINGUTIL_HXX
#include "rtl/ustring.hxx"
+#include "scdllapi.h"
+
+class SvNumberFormatter;
+
+/**
+ * Store parameters used in the ScDocument::SetString() method. Various
+ * options for string-setting operation are specified herein.
+ */
+struct SC_DLLPUBLIC ScSetStringParam
+{
+ /**
+ * Stores the pointer to the number formatter instance to be used during
+ * number format detection. The caller must manage the life cycle of the
+ * instance.
+ */
+ SvNumberFormatter* mpNumFormatter;
+
+ /**
+ * When true, we try to detect special number format (dates etc) from the
+ * input string, when false, we only try to detect a basic decimal number
+ * format.
+ */
+ bool mbDetectNumberFormat;
+
+ /**
+ * When true, set the format of the cell to Text when a string cell is
+ * requested for a number input. We may want to do this during text file
+ * import (csv, html etc).
+ */
+ bool mbSetTextCellFormat;
+
+ ScSetStringParam();
+};
+
+// ============================================================================
class ScStringUtil
{
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 7f3b0097abbb..0ddce1f139f4 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -85,7 +85,7 @@ class CollatorWrapper;
class ScFlatUInt16RowSegments;
class ScFlatBoolRowSegments;
class ScFlatBoolColSegments;
-
+struct ScSetStringParam;
class ScTable
{
@@ -301,7 +301,7 @@ public:
void PutCell(SCCOL nCol, SCROW nRow, ULONG nFormatIndex, ScBaseCell* pCell);
// TRUE = Zahlformat gesetzt
BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
- SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true );
+ ScSetStringParam* pParam = NULL );
void SetValue( SCCOL nCol, SCROW nRow, const double& rVal );
void SetError( SCCOL nCol, SCROW nRow, USHORT nError);