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
 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. More...
 
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 a numeric value content, to treat the 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 35 of file stringutil.hxx.

Member Enumeration Documentation

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 40 of file stringutil.hxx.

Constructor & Destructor Documentation

ScSetStringParam::ScSetStringParam ( )

Definition at line 28 of file stringutil.cxx.

Member Function Documentation

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 45 of file stringutil.cxx.

References mbDetectNumberFormat, mbHandleApostrophe, meSetTextNumFormat, and Never.

Referenced by ScDPOutput::HeaderCell().

void ScSetStringParam::setTextInput ( )

Member Data Documentation

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 101 of file stringutil.hxx.

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

bool ScSetStringParam::mbDetectNumberFormat

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.

Definition at line 78 of file stringutil.hxx.

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

bool ScSetStringParam::mbHandleApostrophe

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

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

Definition at line 92 of file stringutil.hxx.

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

TextFormatPolicy ScSetStringParam::meSetTextNumFormat

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

Definition at line 84 of file stringutil.hxx.

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

sc::StartListeningType ScSetStringParam::meStartListening

Definition at line 94 of file stringutil.hxx.

Referenced by ScColumn::SetString().

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 71 of file stringutil.hxx.

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


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