Kaydet (Commit) 02944a63 authored tarafından Miklos Vajna's avatar Miklos Vajna

xmloff: remove no longer needed XMLFORM_CONSTASCII_STRING macro

Change-Id: I92a341ccafb018b10e884bbaec07574b706a02b4
üst 8fad9220
......@@ -36,8 +36,8 @@ namespace xmloff
//.........................................................................
#define MAP_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010 }
#define MAP_CONST( name, prefix, token, type, context ) { name.ascii, name.length, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010 }
#define MAP_CONST_P( name, prefix, token, type, context ) { name.ascii, name.length, prefix, token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010 }
#define MAP_CONST( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010 }
#define MAP_CONST_P( name, prefix, token, type, context ){ name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010 }
#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010 }
XMLPropertyMapEntry* getControlStylePropertyMap_Access( )
......
......@@ -181,7 +181,7 @@ namespace xmloff
::rtl::OUString sToWriteServiceName = sServiceName;
#define CHECK_N_TRANSLATE( name ) \
else if (sServiceName.equalsAsciiL(SERVICE_PERSISTENT_COMPONENT_##name.ascii, SERVICE_PERSISTENT_COMPONENT_##name.length)) \
else if (sServiceName.equals(SERVICE_PERSISTENT_COMPONENT_##name)) \
sToWriteServiceName = SERVICE_##name
if (sal_False)
......@@ -206,7 +206,7 @@ namespace xmloff
CHECK_N_TRANSLATE( HIDDENCONTROL );
CHECK_N_TRANSLATE( IMAGECONTROL );
CHECK_N_TRANSLATE( FORMATTEDFIELD );
else if (sServiceName.equalsAsciiL(SERVICE_PERSISTENT_COMPONENT_EDIT.ascii, SERVICE_PERSISTENT_COMPONENT_EDIT.length))
else if (sServiceName.equals(SERVICE_PERSISTENT_COMPONENT_EDIT))
{
// special handling for the edit field: we have two controls using this as persistence service name
sToWriteServiceName = SERVICE_EDIT;
......@@ -573,7 +573,7 @@ namespace xmloff
// the names of all properties which are expected to be of type string
static ::rtl::OUString aStringPropertyNames[] =
{
PROPERTY_LABEL, PROPERTY_TITLE
OUString(PROPERTY_LABEL), OUString(PROPERTY_TITLE)
};
OSL_ENSURE( sizeof(aStringPropertyNames)/sizeof(aStringPropertyNames[0]) ==
sizeof(nStringPropertyAttributeIds)/sizeof(nStringPropertyAttributeIds[0]),
......@@ -601,9 +601,12 @@ namespace xmloff
{ // attribute flags
CCA_CURRENT_SELECTED, CCA_DISABLED, CCA_DROPDOWN, CCA_PRINTABLE, CCA_READONLY, CCA_SELECTED, CCA_TAB_STOP, CCA_ENABLEVISIBLE
};
static const ConstAsciiString pBooleanPropertyNames[] =
static const OUString pBooleanPropertyNames[] =
{ // property names
PROPERTY_STATE, PROPERTY_ENABLED, PROPERTY_DROPDOWN, PROPERTY_PRINTABLE, PROPERTY_READONLY, PROPERTY_DEFAULT_STATE, PROPERTY_TABSTOP, PROPERTY_ENABLEVISIBLE
OUString(PROPERTY_STATE), OUString(PROPERTY_ENABLED),
OUString(PROPERTY_DROPDOWN), OUString(PROPERTY_PRINTABLE),
OUString(PROPERTY_READONLY), OUString(PROPERTY_DEFAULT_STATE),
OUString(PROPERTY_TABSTOP), OUString(PROPERTY_ENABLEVISIBLE)
};
static sal_Bool nBooleanPropertyAttrFlags[] =
{ // attribute defaults
......@@ -640,9 +643,9 @@ namespace xmloff
{ // attribute flags
CCA_SIZE, CCA_TAB_INDEX
};
static const ConstAsciiString pIntegerPropertyNames[] =
static const OUString pIntegerPropertyNames[] =
{ // property names
PROPERTY_LINECOUNT, PROPERTY_TABINDEX
OUString(PROPERTY_LINECOUNT), OUString(PROPERTY_TABINDEX)
};
static const sal_Int16 nIntegerPropertyAttrDefaults[] =
{ // attribute defaults
......@@ -990,12 +993,10 @@ namespace xmloff
// be 0 now ...
}
//---------------------------------------------------------------------
void OControlExport::exportSpecialAttributes()
{
sal_Int32 i=0;
// ----------------------
// the boolean properties
{
static const sal_Int32 nBooleanPropertyAttributeIds[] =
......@@ -1003,10 +1004,13 @@ namespace xmloff
SCA_VALIDATION, SCA_MULTI_LINE, SCA_AUTOMATIC_COMPLETION, SCA_MULTIPLE, SCA_DEFAULT_BUTTON, SCA_IS_TRISTATE,
SCA_TOGGLE, SCA_FOCUS_ON_CLICK
};
static const ConstAsciiString pBooleanPropertyNames[] =
static const OUString pBooleanPropertyNames[] =
{ // property names
PROPERTY_STRICTFORMAT, PROPERTY_MULTILINE, PROPERTY_AUTOCOMPLETE, PROPERTY_MULTISELECTION, PROPERTY_DEFAULTBUTTON, PROPERTY_TRISTATE,
PROPERTY_TOGGLE, PROPERTY_FOCUS_ON_CLICK
OUString(PROPERTY_STRICTFORMAT), OUString(PROPERTY_MULTILINE),
OUString(PROPERTY_AUTOCOMPLETE),
OUString(PROPERTY_MULTISELECTION),
OUString(PROPERTY_DEFAULTBUTTON), OUString(PROPERTY_TRISTATE),
OUString(PROPERTY_TOGGLE), OUString(PROPERTY_FOCUS_ON_CLICK)
};
sal_Int32 nIdCount = sizeof(nBooleanPropertyAttributeIds) / sizeof(nBooleanPropertyAttributeIds[0]);
#if OSL_DEBUG_LEVEL > 0
......@@ -1033,16 +1037,15 @@ namespace xmloff
}
}
// ----------------------
// the integer properties
{
static sal_Int32 nIntegerPropertyAttributeIds[] =
{ // attribute flags
SCA_PAGE_STEP_SIZE
};
static const ConstAsciiString pIntegerPropertyNames[] =
static const OUString pIntegerPropertyNames[] =
{ // property names
PROPERTY_BLOCK_INCREMENT
OUString(PROPERTY_BLOCK_INCREMENT)
};
static const sal_Int32 nIntegerPropertyAttrDefaults[] =
{ // attribute defaults (XML defaults, not runtime defaults!)
......@@ -1195,9 +1198,9 @@ namespace xmloff
{ // attribute flags
SCA_GROUP_NAME
};
static const ConstAsciiString pStringPropertyNames[] =
static const OUString pStringPropertyNames[] =
{ // property names
PROPERTY_GROUP_NAME
OUString(PROPERTY_GROUP_NAME)
};
sal_Int32 nIdCount = sizeof( nStringPropertyAttributeIds ) / sizeof( nStringPropertyAttributeIds[0] );
......@@ -2162,7 +2165,7 @@ namespace xmloff
};
static ::rtl::OUString aStringPropertyNames[] =
{
PROPERTY_NAME, /*PROPERTY_TARGETURL,*/ PROPERTY_COMMAND, PROPERTY_FILTER, PROPERTY_ORDER
OUString(PROPERTY_NAME), /*OUString(PROPERTY_TARGETURL),*/ OUString(PROPERTY_COMMAND), OUString(PROPERTY_FILTER), OUString(PROPERTY_ORDER)
};
sal_Int32 nIdCount = sizeof(eStringPropertyIds) / sizeof(eStringPropertyIds[0]);
#if OSL_DEBUG_LEVEL > 0
......@@ -2198,16 +2201,20 @@ namespace xmloff
exportedProperty(PROPERTY_DATASOURCENAME);
}
// ----------------------
// the boolean properties
{
static FormAttributes eBooleanPropertyIds[] =
{
faAllowDeletes, faAllowInserts, faAllowUpdates, faApplyFilter, faEscapeProcessing, faIgnoreResult
};
static const ConstAsciiString pBooleanPropertyNames[] =
{
PROPERTY_ALLOWDELETES, PROPERTY_ALLOWINSERTS, PROPERTY_ALLOWUPDATES, PROPERTY_APPLYFILTER, PROPERTY_ESCAPEPROCESSING, PROPERTY_IGNORERESULT
static const OUString pBooleanPropertyNames[] =
{
OUString(PROPERTY_ALLOWDELETES),
OUString(PROPERTY_ALLOWINSERTS),
OUString(PROPERTY_ALLOWUPDATES),
OUString(PROPERTY_APPLYFILTER),
OUString(PROPERTY_ESCAPEPROCESSING),
OUString(PROPERTY_IGNORERESULT)
};
static sal_Int8 nBooleanPropertyAttrFlags[] =
{
......@@ -2229,16 +2236,15 @@ namespace xmloff
);
}
// -------------------
// the enum properties
{
static FormAttributes eEnumPropertyIds[] =
{
faEnctype, faMethod, faCommandType, faNavigationMode, faTabbingCycle
};
static const ConstAsciiString pEnumPropertyNames[] =
static const OUString pEnumPropertyNames[] =
{
PROPERTY_SUBMIT_ENCODING, PROPERTY_SUBMIT_METHOD, PROPERTY_COMMAND_TYPE, PROPERTY_NAVIGATION, PROPERTY_CYCLE
OUString(PROPERTY_SUBMIT_ENCODING), OUString(PROPERTY_SUBMIT_METHOD), OUString(PROPERTY_COMMAND_TYPE), OUString(PROPERTY_NAVIGATION), OUString(PROPERTY_CYCLE)
};
static OEnumMapper::EnumProperties eEnumPropertyMaps[] =
{
......
......@@ -983,8 +983,8 @@ namespace xmloff
{
// we have exactly 2 properties where this type class is allowed:
OSL_ENSURE(
(0 == _rPropValue.Name.equalsAsciiL(PROPERTY_EFFECTIVE_VALUE.ascii, PROPERTY_EFFECTIVE_VALUE.length))
|| (0 == _rPropValue.Name.equalsAsciiL(PROPERTY_EFFECTIVE_DEFAULT.ascii, PROPERTY_EFFECTIVE_DEFAULT.length)),
(0 == _rPropValue.Name.equals(PROPERTY_EFFECTIVE_VALUE))
|| (0 == _rPropValue.Name.equals(PROPERTY_EFFECTIVE_DEFAULT)),
"OControlImport::implTranslateValueProperty: invalid property type/name combination!");
// Both properties are allowed to have a double or a string value,
......
......@@ -56,7 +56,7 @@ namespace xmloff
sLocalMacroName = pEvents->ScriptCode;
sLibrary = ::rtl::OUString();
if (pEvents->ScriptType.equalsAsciiL(EVENT_STARBASIC.ascii, EVENT_STARBASIC.length))
if (pEvents->ScriptType.equals(EVENT_STARBASIC))
{ // for StarBasic, the library name is part of the ScriptCode
sal_Int32 nPrefixLen = sLocalMacroName.indexOf( ':' );
DBG_ASSERT( 0 <= nPrefixLen, "OEventDescriptorMapper::OEventDescriptorMapper: invalid script code prefix!" );
......@@ -64,7 +64,7 @@ namespace xmloff
{
// the export handler for StarBasic expects "StarOffice", not "application" for application modules ...
sLibrary = sLocalMacroName.copy( 0, nPrefixLen );
if (sLibrary.equalsAsciiL(EVENT_APPLICATION.ascii, EVENT_APPLICATION.length))
if (sLibrary.equals(EVENT_APPLICATION))
sLibrary = EVENT_STAROFFICE;
sLocalMacroName = sLocalMacroName.copy( nPrefixLen + 1 );
......
......@@ -62,7 +62,7 @@ namespace xmloff
nSeparatorPos = aEvent->first.indexOf(EVENT_NAME_SEPARATOR);
OSL_ENSURE(-1 != nSeparatorPos, "OFormEventsImportContext::EndElement: invalid (unrecognized) event name!");
pTranslated->ListenerType = aEvent->first.copy(0, nSeparatorPos);
pTranslated->EventMethod = aEvent->first.copy(nSeparatorPos + EVENT_NAME_SEPARATOR.length);
pTranslated->EventMethod = aEvent->first.copy(nSeparatorPos + sizeof(EVENT_NAME_SEPARATOR) - 1);
::rtl::OUString sLibrary;
......@@ -71,18 +71,18 @@ namespace xmloff
pEventDescriptionEnd = pEventDescription + aEvent->second.getLength();
for (;pEventDescription != pEventDescriptionEnd; ++pEventDescription)
{
if ((pEventDescription->Name.equalsAsciiL(EVENT_LOCALMACRONAME.ascii, EVENT_LOCALMACRONAME.length)) ||
(pEventDescription->Name.equalsAsciiL(EVENT_SCRIPTURL.ascii, EVENT_SCRIPTURL.length)))
if ((pEventDescription->Name.equals(EVENT_LOCALMACRONAME)) ||
(pEventDescription->Name.equals(EVENT_SCRIPTURL)))
pEventDescription->Value >>= pTranslated->ScriptCode;
else if (pEventDescription->Name.equalsAsciiL(EVENT_TYPE.ascii, EVENT_TYPE.length))
else if (pEventDescription->Name.equals(EVENT_TYPE))
pEventDescription->Value >>= pTranslated->ScriptType;
else if (pEventDescription->Name.equalsAsciiL(EVENT_LIBRARY.ascii, EVENT_LIBRARY.length))
else if (pEventDescription->Name.equals(EVENT_LIBRARY))
pEventDescription->Value >>= sLibrary;
}
if (pTranslated->ScriptType.equalsAsciiL(EVENT_STARBASIC.ascii, EVENT_STARBASIC.length))
if (pTranslated->ScriptType.equals(EVENT_STARBASIC))
{
if (sLibrary.equalsAsciiL(EVENT_STAROFFICE.ascii, EVENT_STAROFFICE.length))
if (sLibrary.equals(EVENT_STAROFFICE))
sLibrary = EVENT_APPLICATION;
if ( !sLibrary.isEmpty() )
......
......@@ -166,7 +166,7 @@ Reference< XValueBinding > FormCellBindingHelper::createCellBindingFromStringAdd
return xBinding;
xBinding = xBinding.query( createDocumentDependentInstance(
_bUseIntegerBinding ? SERVICE_LISTINDEXCELLBINDING : SERVICE_CELLVALUEBINDING,
_bUseIntegerBinding ? OUString(SERVICE_LISTINDEXCELLBINDING) : OUString(SERVICE_CELLVALUEBINDING),
PROPERTY_BOUND_CELL,
makeAny( aAddress )
) );
......@@ -451,7 +451,7 @@ bool FormCellBindingHelper::doConvertAddressRepresentations( const ::rtl::OUStri
Reference< XPropertySet > xConverter(
createDocumentDependentInstance(
_bIsRange ? SERVICE_RANGEADDRESS_CONVERSION : SERVICE_ADDRESS_CONVERSION,
_bIsRange ? OUString(SERVICE_RANGEADDRESS_CONVERSION) : OUString(SERVICE_ADDRESS_CONVERSION),
::rtl::OUString(),
Any()
),
......
......@@ -417,7 +417,7 @@ namespace xmloff
}
//---------------------------------------------------------------------
void OPropertyExport::exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty,bool _bAddType)
void OPropertyExport::exportRelativeTargetLocation(const OUString& _sPropertyName,sal_Int32 _nProperty,bool _bAddType)
{
DBG_CHECK_PROPERTY( _sPropertyName, ::rtl::OUString );
......
......@@ -62,7 +62,7 @@ namespace xmloff
StringSet m_aRemainingProps;
// see examinePersistence
void exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty,bool _bAddType);
void exportRelativeTargetLocation(const OUString& _sPropertyName,sal_Int32 _nProperty,bool _bAddType);
protected:
IFormsExportContext& m_rContext;
......
This diff is collapsed.
......@@ -20,6 +20,7 @@
#include "valueproperties.hxx"
#include "strings.hxx"
#include <com/sun/star/form/FormComponentType.hpp>
#include <sal/log.hxx>
//.........................................................................
namespace xmloff
......@@ -43,54 +44,54 @@ namespace xmloff
case FormComponentType::TEXTFIELD:
if (OControlElement::FORMATTED_TEXT == _eType)
{
_rpCurrentValuePropertyName = PROPERTY_EFFECTIVE_VALUE.ascii;
_rpValuePropertyName = PROPERTY_EFFECTIVE_DEFAULT.ascii;
_rpCurrentValuePropertyName = PROPERTY_EFFECTIVE_VALUE;
_rpValuePropertyName = PROPERTY_EFFECTIVE_DEFAULT;
}
else
{
if (OControlElement::PASSWORD != _eType)
// no CurrentValue" for passwords
_rpCurrentValuePropertyName = PROPERTY_TEXT.ascii;
_rpValuePropertyName = PROPERTY_DEFAULT_TEXT.ascii;
_rpCurrentValuePropertyName = PROPERTY_TEXT;
_rpValuePropertyName = PROPERTY_DEFAULT_TEXT;
}
break;
case FormComponentType::NUMERICFIELD:
case FormComponentType::CURRENCYFIELD:
_rpCurrentValuePropertyName = PROPERTY_VALUE.ascii;
_rpValuePropertyName = PROPERTY_DEFAULT_VALUE.ascii;
_rpCurrentValuePropertyName = PROPERTY_VALUE;
_rpValuePropertyName = PROPERTY_DEFAULT_VALUE;
break;
case FormComponentType::PATTERNFIELD:
case FormComponentType::FILECONTROL:
case FormComponentType::COMBOBOX:
_rpValuePropertyName = PROPERTY_DEFAULT_TEXT.ascii;
_rpValuePropertyName = PROPERTY_DEFAULT_TEXT;
// NO BREAK!!
case FormComponentType::COMMANDBUTTON:
_rpCurrentValuePropertyName = PROPERTY_TEXT.ascii;
_rpCurrentValuePropertyName = PROPERTY_TEXT;
break;
case FormComponentType::CHECKBOX:
case FormComponentType::RADIOBUTTON:
_rpValuePropertyName = PROPERTY_REFVALUE.ascii;
_rpValuePropertyName = PROPERTY_REFVALUE;
break;
case FormComponentType::HIDDENCONTROL:
_rpValuePropertyName = PROPERTY_HIDDEN_VALUE.ascii;
_rpValuePropertyName = PROPERTY_HIDDEN_VALUE;
break;
case FormComponentType::SCROLLBAR:
_rpCurrentValuePropertyName = PROPERTY_SCROLLVALUE.ascii;
_rpValuePropertyName = PROPERTY_SCROLLVALUE_DEFAULT.ascii;
_rpCurrentValuePropertyName = PROPERTY_SCROLLVALUE;
_rpValuePropertyName = PROPERTY_SCROLLVALUE_DEFAULT;
break;
case FormComponentType::SPINBUTTON:
_rpCurrentValuePropertyName = PROPERTY_SPINVALUE.ascii;
_rpValuePropertyName = PROPERTY_DEFAULT_SPINVALUE.ascii;
_rpCurrentValuePropertyName = PROPERTY_SPINVALUE;
_rpValuePropertyName = PROPERTY_DEFAULT_SPINVALUE;
break;
default:
OSL_ENSURE( false, "OValuePropertiesMetaData::getValuePropertyNames: unsupported component type!" );
SAL_WARN( "xmloff", "OValuePropertiesMetaData::getValuePropertyNames: unsupported component type!" );
break;
}
}
......@@ -105,27 +106,27 @@ namespace xmloff
{
case FormComponentType::NUMERICFIELD:
case FormComponentType::CURRENCYFIELD:
_rpMinValuePropertyName = PROPERTY_VALUE_MIN.ascii;
_rpMaxValuePropertyName = PROPERTY_VALUE_MAX.ascii;
_rpMinValuePropertyName = PROPERTY_VALUE_MIN;
_rpMaxValuePropertyName = PROPERTY_VALUE_MAX;
break;
case FormComponentType::TEXTFIELD:
_rpMinValuePropertyName = PROPERTY_EFFECTIVE_MIN.ascii;
_rpMaxValuePropertyName = PROPERTY_EFFECTIVE_MAX.ascii;
_rpMinValuePropertyName = PROPERTY_EFFECTIVE_MIN;
_rpMaxValuePropertyName = PROPERTY_EFFECTIVE_MAX;
break;
case FormComponentType::SCROLLBAR:
_rpMinValuePropertyName = PROPERTY_SCROLLVALUE_MIN.ascii;
_rpMaxValuePropertyName = PROPERTY_SCROLLVALUE_MAX.ascii;
_rpMinValuePropertyName = PROPERTY_SCROLLVALUE_MIN;
_rpMaxValuePropertyName = PROPERTY_SCROLLVALUE_MAX;
break;
case FormComponentType::SPINBUTTON:
_rpMinValuePropertyName = PROPERTY_SPINVALUE_MIN.ascii;
_rpMaxValuePropertyName = PROPERTY_SPINVALUE_MAX.ascii;
_rpMinValuePropertyName = PROPERTY_SPINVALUE_MIN;
_rpMaxValuePropertyName = PROPERTY_SPINVALUE_MAX;
break;
default:
OSL_ENSURE( false, "OValuePropertiesMetaData::getValueLimitPropertyNames: unsupported component type!" );
SAL_WARN("xmloff", "OValuePropertiesMetaData::getValueLimitPropertyNames: unsupported component type!" );
break;
}
}
......@@ -142,24 +143,24 @@ namespace xmloff
case FormComponentType::TEXTFIELD:
if (OControlElement::FORMATTED_TEXT == _eType)
{
_rpValuePropertyName = PROPERTY_EFFECTIVE_VALUE.ascii;
_rpDefaultValuePropertyName = PROPERTY_EFFECTIVE_DEFAULT.ascii;
_rpValuePropertyName = PROPERTY_EFFECTIVE_VALUE;
_rpDefaultValuePropertyName = PROPERTY_EFFECTIVE_DEFAULT;
}
else
{
_rpValuePropertyName = PROPERTY_TEXT.ascii;
_rpDefaultValuePropertyName = PROPERTY_DEFAULT_TEXT.ascii;
_rpValuePropertyName = PROPERTY_TEXT;
_rpDefaultValuePropertyName = PROPERTY_DEFAULT_TEXT;
}
break;
case FormComponentType::DATEFIELD:
_rpValuePropertyName = PROPERTY_DATE.ascii;
_rpDefaultValuePropertyName = PROPERTY_DEFAULT_DATE.ascii;
_rpValuePropertyName = PROPERTY_DATE;
_rpDefaultValuePropertyName = PROPERTY_DEFAULT_DATE;
break;
case FormComponentType::TIMEFIELD:
_rpValuePropertyName = PROPERTY_TIME.ascii;
_rpDefaultValuePropertyName = PROPERTY_DEFAULT_TIME.ascii;
_rpValuePropertyName = PROPERTY_TIME;
_rpDefaultValuePropertyName = PROPERTY_DEFAULT_TIME;
break;
case FormComponentType::NUMERICFIELD:
......@@ -176,8 +177,8 @@ namespace xmloff
case FormComponentType::CHECKBOX:
case FormComponentType::RADIOBUTTON:
_rpValuePropertyName = PROPERTY_STATE.ascii;
_rpDefaultValuePropertyName = PROPERTY_DEFAULT_STATE.ascii;
_rpValuePropertyName = PROPERTY_STATE;
_rpDefaultValuePropertyName = PROPERTY_DEFAULT_STATE;
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment