LibreOffice Module sc (master) 1
Public Types | Public Member Functions | Public Attributes | List of all members
ScSetStringParam Struct Reference

Store parameters used in the ScDocument::SetString() method. More...

#include <stringutil.hxx>

Collaboration diagram for ScSetStringParam:
[legend]

Public Types

enum  TextFormatPolicy {
  Always ,
  SpecialNumberOnly ,
  Keep ,
  Never
}
 Enum settings that take effect if mbDetectNumberFormat=false or if true a number was not detected. More...
 

Public Member Functions

 ScSetStringParam ()
 
void setTextInput ()
 Call this whenever you need to unconditionally set input as text, no matter what the input is. More...
 
void setNumericInput ()
 Call this whenever you need to maximize the chance of input being detected as a numeric value (numbers, dates, times etc). More...
 

Public Attributes

SvNumberFormattermpNumFormatter
 Stores the pointer to the number formatter instance to be used during number format detection. More...
 
bool mbDetectNumberFormat
 Specify which number formats are detected: mbDetectNumberFormat=true && mbDetectScientificNumberFormat=true : detect all special number formats : basic decimal number, date, scientific notation, etc mbDetectNumberFormat=false && mbDetectScientificNumberFormat=true : detect scientific notation and basic decimal number, but not other special number formats (date etc) mbDetectNumberFormat=false && mbDetectScientificNumberFormat=false : detect only basic decimal number, but not scientific notation or other special number formats (date etc) Note: mbDetectNumberFormat=true && mbDetectScientificNumberFormat=false not allowed. More...
 
bool mbDetectScientificNumberFormat
 
TextFormatPolicy meSetTextNumFormat
 Determine when to set the 'Text' number format to the cell where the input string is being set. More...
 
bool mbHandleApostrophe
 When true, treat input with a leading apostrophe as an escape character for all content, to treat also numeric value as a text. More...
 
sc::StartListeningType meStartListening
 
bool mbCheckLinkFormula
 When true and the string results in a compiled formula, check the formula tokens for presence of functions that could trigger access to external resources. More...
 

Detailed Description

Store parameters used in the ScDocument::SetString() method.

Various options for string-setting operation are specified herein.

Definition at line 34 of file stringutil.hxx.

Member Enumeration Documentation

◆ TextFormatPolicy

Enum settings that take effect if mbDetectNumberFormat=false or if true a number was not detected.

Enumerator
Always 

Set Text number format if the input string can be parsed as a number or formula text.

SpecialNumberOnly 

Set Text number format only when the input string is considered a special number but we only want to detect a simple number.

Keep 

Keep an existing number format, do not set Text number format and do not set another number format.

Never 

Never set Text number format.

Definition at line 39 of file stringutil.hxx.

Constructor & Destructor Documentation

◆ ScSetStringParam()

ScSetStringParam::ScSetStringParam ( )

Definition at line 28 of file stringutil.cxx.

Member Function Documentation

◆ setNumericInput()

void ScSetStringParam::setNumericInput ( )

Call this whenever you need to maximize the chance of input being detected as a numeric value (numbers, dates, times etc).

Definition at line 47 of file stringutil.cxx.

References mbDetectNumberFormat, mbDetectScientificNumberFormat, mbHandleApostrophe, meSetTextNumFormat, and Never.

Referenced by ScDPOutput::HeaderCell().

◆ setTextInput()

void ScSetStringParam::setTextInput ( )

Member Data Documentation

◆ mbCheckLinkFormula

bool ScSetStringParam::mbCheckLinkFormula

When true and the string results in a compiled formula, check the formula tokens for presence of functions that could trigger access to external resources.

This is to be set to true in import filter code, but not for user input.

Definition at line 103 of file stringutil.hxx.

Referenced by ScColumn::ParseString(), ScDocumentImport::setAutoInput(), ScImportExport::Text2Doc(), and ScEEImport::WriteToDocument().

◆ mbDetectNumberFormat

bool ScSetStringParam::mbDetectNumberFormat

Specify which number formats are detected: mbDetectNumberFormat=true && mbDetectScientificNumberFormat=true : detect all special number formats : basic decimal number, date, scientific notation, etc mbDetectNumberFormat=false && mbDetectScientificNumberFormat=true : detect scientific notation and basic decimal number, but not other special number formats (date etc) mbDetectNumberFormat=false && mbDetectScientificNumberFormat=false : detect only basic decimal number, but not scientific notation or other special number formats (date etc) Note: mbDetectNumberFormat=true && mbDetectScientificNumberFormat=false not allowed.

Definition at line 79 of file stringutil.hxx.

Referenced by ScDPOutput::FieldCell(), ScColumn::ParseString(), setNumericInput(), setTextInput(), and ScEEImport::WriteToDocument().

◆ mbDetectScientificNumberFormat

bool ScSetStringParam::mbDetectScientificNumberFormat

◆ mbHandleApostrophe

bool ScSetStringParam::mbHandleApostrophe

When true, treat input with a leading apostrophe as an escape character for all content, to treat also numeric value as a text.

When false, the whole string input including the leading apostrophe will be entered literally as string.

Definition at line 94 of file stringutil.hxx.

Referenced by ScDPOutput::FieldCell(), ScColumn::ParseString(), setNumericInput(), setTextInput(), and ScEEImport::WriteToDocument().

◆ meSetTextNumFormat

TextFormatPolicy ScSetStringParam::meSetTextNumFormat

Determine when to set the 'Text' number format to the cell where the input string is being set.

Definition at line 86 of file stringutil.hxx.

Referenced by ScDPOutput::FieldCell(), ScColumn::ParseString(), setNumericInput(), setTextInput(), ScUndoSetCell::SetValue(), and ScEEImport::WriteToDocument().

◆ meStartListening

sc::StartListeningType ScSetStringParam::meStartListening

Definition at line 96 of file stringutil.hxx.

Referenced by ScColumn::SetString().

◆ mpNumFormatter

SvNumberFormatter* ScSetStringParam::mpNumFormatter

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.

Definition at line 70 of file stringutil.hxx.

Referenced by ScColumn::ParseString(), and ScEEImport::WriteToDocument().


The documentation for this struct was generated from the following files: