summaryrefslogtreecommitdiff
path: root/xmloff/source/forms
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff/source/forms')
-rw-r--r--xmloff/source/forms/controlpropertyhdl.cxx145
-rw-r--r--xmloff/source/forms/controlpropertymap.cxx6
-rw-r--r--xmloff/source/forms/controlpropertymap.hxx6
-rw-r--r--xmloff/source/forms/elementexport.cxx97
-rw-r--r--xmloff/source/forms/elementimport.cxx15
-rw-r--r--xmloff/source/forms/formattributes.cxx1
-rw-r--r--xmloff/source/forms/formattributes.hxx1
-rw-r--r--xmloff/source/forms/formenums.cxx16
-rw-r--r--xmloff/source/forms/formenums.hxx1
-rw-r--r--xmloff/source/forms/layerexport.cxx10
-rw-r--r--xmloff/source/forms/layerexport.hxx4
-rw-r--r--xmloff/source/forms/layerimport.cxx2
-rw-r--r--xmloff/source/forms/propertyexport.cxx4
-rw-r--r--xmloff/source/forms/propertyimport.hxx19
-rw-r--r--xmloff/source/forms/strings.hxx2
15 files changed, 171 insertions, 158 deletions
diff --git a/xmloff/source/forms/controlpropertyhdl.cxx b/xmloff/source/forms/controlpropertyhdl.cxx
index 0f21663455..390e50a105 100644
--- a/xmloff/source/forms/controlpropertyhdl.cxx
+++ b/xmloff/source/forms/controlpropertyhdl.cxx
@@ -96,13 +96,13 @@ namespace xmloff
case XML_TYPE_CONTROL_BORDER:
if (!m_pControlBorderStyleHandler)
- m_pControlBorderStyleHandler = new OControlBorderStyleHandler;
+ m_pControlBorderStyleHandler = new OControlBorderHandler( OControlBorderHandler::STYLE );
pHandler = m_pControlBorderStyleHandler;
break;
case XML_TYPE_CONTROL_BORDER_COLOR:
if ( !m_pControlBorderColorHandler )
- m_pControlBorderColorHandler = new OControlBorderColorHandler;
+ m_pControlBorderColorHandler = new OControlBorderHandler( OControlBorderHandler::COLOR );
pHandler = m_pControlBorderColorHandler;
break;
@@ -225,30 +225,16 @@ namespace xmloff
}
//=====================================================================
- //= OControlBorderHandlerFactory
- //=====================================================================
- //---------------------------------------------------------------------
- const XMLPropertyHandler* OControlBorderHandlerFactory::createBorderHandler()
- {
- return new OControlBorderStyleHandler;
- }
-
- //---------------------------------------------------------------------
- const XMLPropertyHandler* OControlBorderHandlerFactory::createBorderColorHandler()
- {
- return new OControlBorderColorHandler;
- }
-
- //=====================================================================
//= OControlBorderHandlerBase
//=====================================================================
//---------------------------------------------------------------------
- OControlBorderHandlerBase::OControlBorderHandlerBase()
+ OControlBorderHandler::OControlBorderHandler( const OControlBorderHandler::BorderFacet _eFacet )
+ :m_eFacet( _eFacet )
{
}
//---------------------------------------------------------------------
- sal_Bool OControlBorderHandlerBase::importXML( const ::rtl::OUString& _rStrImpValue, Any& _rValue, const SvXMLUnitConverter& ) const
+ sal_Bool OControlBorderHandler::importXML( const ::rtl::OUString& _rStrImpValue, Any& _rValue, const SvXMLUnitConverter& ) const
{
::rtl::OUString sToken;
SvXMLTokenEnumerator aTokens(_rStrImpValue);
@@ -256,92 +242,70 @@ namespace xmloff
sal_uInt16 nStyle = 1;
Color aColor;
- sal_Bool bFoundStyle = sal_False;
- sal_Bool bFoundColor = sal_False;
-
- while ( !( bFoundStyle && bFoundColor ) // did not yet find both aspects
- && aTokens.getNextToken(sToken) // have a new token
+ while ( aTokens.getNextToken(sToken) // have a new token
&& (0 != sToken.getLength()) // really have a new token
)
{
- // is it a valid enum value?
- if ( !bFoundStyle )
- bFoundStyle = SvXMLUnitConverter::convertEnum(nStyle, sToken, OEnumMapper::getEnumMap(OEnumMapper::epBorderWidth));
- // is it a color value?
- if ( !bFoundColor )
- bFoundColor = SvXMLUnitConverter::convertColor( aColor, sToken );
- }
-
- if ( !bFoundStyle && !bFoundColor )
- return sal_False;
-
- // if we're here, the string could have had more or less than the requested 3 tokens, but we ignore this.
- // At least we have a valid style or a valid, which is everything we're interested in.
- pickOne( aColor, (sal_Int16)nStyle, _rValue );
- return sal_True;
- }
-
- //=====================================================================
- //= OControlBorderStyleHandler
- //=====================================================================
- //---------------------------------------------------------------------
- OControlBorderStyleHandler::OControlBorderStyleHandler()
- {
- }
-
- //---------------------------------------------------------------------
- sal_Bool OControlBorderStyleHandler::exportXML( ::rtl::OUString& _rStrExpValue, const Any& _rValue, const SvXMLUnitConverter& ) const
- {
- sal_Bool bSuccess = sal_False;
- sal_Int16 nBorder = 0;
-
- ::rtl::OUStringBuffer aOut;
- bSuccess = (_rValue >>= nBorder)
- && SvXMLUnitConverter::convertEnum(aOut, nBorder, OEnumMapper::getEnumMap(OEnumMapper::epBorderWidth));
-
- if ( _rStrExpValue.getLength() )
- _rStrExpValue += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ) );
- _rStrExpValue += aOut.makeStringAndClear();
- return bSuccess;
- }
+ // try interpreting the token as border style
+ if ( m_eFacet == STYLE )
+ {
+ // is it a valid enum value?
+ if ( SvXMLUnitConverter::convertEnum( nStyle, sToken, OEnumMapper::getEnumMap( OEnumMapper::epBorderWidth ) ) )
+ {
+ _rValue <<= nStyle;
+ return sal_True;
+ }
+ }
- //---------------------------------------------------------------------
- void OControlBorderStyleHandler::pickOne( const Color&, sal_Int16 _nStyle, Any& _rValue ) const
- {
- _rValue <<= _nStyle;
- }
+ // try interpreting it as color value
+ if ( m_eFacet == COLOR )
+ {
+ if ( SvXMLUnitConverter::convertColor( aColor, sToken ) )
+ {
+ _rValue <<= (sal_Int32)aColor.GetColor();
+ return sal_True;
+ }
+ }
+ }
- //=====================================================================
- //= OControlBorderColorHandler
- //=====================================================================
- //---------------------------------------------------------------------
- OControlBorderColorHandler::OControlBorderColorHandler()
- {
+ return sal_False;
}
//---------------------------------------------------------------------
- sal_Bool OControlBorderColorHandler::exportXML( ::rtl::OUString& _rStrExpValue, const Any& _rValue, const SvXMLUnitConverter& ) const
+ sal_Bool OControlBorderHandler::exportXML( ::rtl::OUString& _rStrExpValue, const Any& _rValue, const SvXMLUnitConverter& ) const
{
sal_Bool bSuccess = sal_False;
- sal_Int32 nBorderColor = 0;
::rtl::OUStringBuffer aOut;
- if ( _rValue >>= nBorderColor )
+ switch ( m_eFacet )
+ {
+ case STYLE:
{
- SvXMLUnitConverter::convertColor( aOut, Color( nBorderColor ) );
- bSuccess = sal_True;
+ sal_Int16 nBorder = 0;
+ bSuccess = (_rValue >>= nBorder)
+ && SvXMLUnitConverter::convertEnum( aOut, nBorder, OEnumMapper::getEnumMap( OEnumMapper::epBorderWidth ) );
}
+ break;
+ case COLOR:
+ {
+ sal_Int32 nBorderColor = 0;
+ if ( _rValue >>= nBorderColor )
+ {
+ SvXMLUnitConverter::convertColor( aOut, Color( nBorderColor ) );
+ bSuccess = sal_True;
+ }
+ }
+ break;
+ } // switch ( m_eFacet )
+
+ if ( !bSuccess )
+ return sal_False;
if ( _rStrExpValue.getLength() )
_rStrExpValue += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ) );
_rStrExpValue += aOut.makeStringAndClear();
- return bSuccess;
- }
- //---------------------------------------------------------------------
- void OControlBorderColorHandler::pickOne( const Color& _rColor, sal_Int16 /*_nStyle*/, Any& _rValue ) const
- {
- _rValue <<= (sal_Int32)_rColor.GetColor();
+ return sal_True;
}
//=====================================================================
@@ -414,6 +378,15 @@ namespace xmloff
return bSuccess;
}
+ //=====================================================================
+ //= ImageScaleModeHandler
+ //=====================================================================
+ //---------------------------------------------------------------------
+ ImageScaleModeHandler::ImageScaleModeHandler()
+ :XMLConstantsPropertyHandler( OEnumMapper::getEnumMap( OEnumMapper::epImageScaleMode ), XML_STRETCH )
+ {
+ }
+
//.........................................................................
} // namespace xmloff
//.........................................................................
diff --git a/xmloff/source/forms/controlpropertymap.cxx b/xmloff/source/forms/controlpropertymap.cxx
index 9046a6a55c..a40421864c 100644
--- a/xmloff/source/forms/controlpropertymap.cxx
+++ b/xmloff/source/forms/controlpropertymap.cxx
@@ -134,16 +134,16 @@ namespace xmloff
}
//=====================================================================
- //= OFormExportPropertyMapper
+ //= OFormComponentStyleExportMapper
//=====================================================================
//---------------------------------------------------------------------
- OFormExportPropertyMapper::OFormExportPropertyMapper( const UniReference< XMLPropertySetMapper >& _rMapper )
+ OFormComponentStyleExportMapper::OFormComponentStyleExportMapper( const UniReference< XMLPropertySetMapper >& _rMapper )
:SvXMLExportPropertyMapper( _rMapper )
{
}
//---------------------------------------------------------------------
- void OFormExportPropertyMapper::handleSpecialItem( SvXMLAttributeList& _rAttrList, const XMLPropertyState& _rProperty, const SvXMLUnitConverter& _rUnitConverter,
+ void OFormComponentStyleExportMapper::handleSpecialItem( SvXMLAttributeList& _rAttrList, const XMLPropertyState& _rProperty, const SvXMLUnitConverter& _rUnitConverter,
const SvXMLNamespaceMap& _rNamespaceMap, const ::std::vector< XMLPropertyState >* _pProperties,
sal_uInt32 _nIdx ) const
{
diff --git a/xmloff/source/forms/controlpropertymap.hxx b/xmloff/source/forms/controlpropertymap.hxx
index 0f2502e492..d6302c74f5 100644
--- a/xmloff/source/forms/controlpropertymap.hxx
+++ b/xmloff/source/forms/controlpropertymap.hxx
@@ -45,12 +45,12 @@ namespace xmloff
void initializePropertyMaps();
//=====================================================================
- //= OFormExportPropertyMapper
+ //= OFormComponentStyleExportMapper
//=====================================================================
- class OFormExportPropertyMapper : public SvXMLExportPropertyMapper
+ class OFormComponentStyleExportMapper : public SvXMLExportPropertyMapper
{
public:
- OFormExportPropertyMapper( const UniReference< XMLPropertySetMapper >& _rMapper );
+ OFormComponentStyleExportMapper( const UniReference< XMLPropertySetMapper >& _rMapper );
void handleSpecialItem(
SvXMLAttributeList& _rAttrList,
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index a8c8ac922f..546bd6802a 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -31,24 +31,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
-#include <stdio.h>
#include "elementexport.hxx"
#include "strings.hxx"
-#include <xmloff/xmlexp.hxx>
-#include <xmloff/nmspmap.hxx>
#include "xmlnmspe.hxx"
-#include <xmloff/xmluconv.hxx>
-#include <xmloff/xmltoken.hxx>
-#include <tools/time.hxx>
-#include <tools/diagnose_ex.h>
-#include <comphelper/extract.hxx>
#include "eventexport.hxx"
#include "formenums.hxx"
-#include <vcl/wintypes.hxx> // for check states
-#include <xmloff/XMLEventExport.hxx>
#include "formcellbinding.hxx"
-
-#include <algorithm>
+#include "formcellbinding.hxx"
+#include "xformsexport.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/text/XText.hpp>
@@ -67,21 +57,37 @@
#include <com/sun/star/form/ListSourceType.hpp>
#include <com/sun/star/awt/ImagePosition.hpp>
/** === end UNO includes === **/
+
#include <vcl/wintypes.hxx> // for check states
#include <xmloff/txtprmap.hxx>
-#include "formcellbinding.hxx"
-#include "xformsexport.hxx"
#include <com/sun/star/form/binding/XBindableValue.hpp>
#include <com/sun/star/form/binding/XListEntrySink.hpp>
#include <tools/urlobj.hxx>
-#include <algorithm>
+#include <xmloff/xmlexp.hxx>
+#include <xmloff/nmspmap.hxx>
+#include <vcl/wintypes.hxx> // for check states
+#include <xmloff/XMLEventExport.hxx>
+#include <xmloff/xmluconv.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <tools/time.hxx>
+#include <tools/diagnose_ex.h>
+#include <comphelper/extract.hxx>
+#include <stdio.h>
+#include <algorithm>
//.........................................................................
namespace xmloff
{
//.........................................................................
+ #if OSL_DEBUG_LEVEL > 0
+ #define RESET_BIT( bitfield, bit ) \
+ bitfield = bitfield & ~bit
+ #else
+ #define RESET_BIT( bitfield, bit )
+ #endif
+
using namespace ::xmloff::token;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdb;
@@ -310,7 +316,7 @@ namespace xmloff
// the control id
if (CCA_CONTROL_ID & m_nIncludeCommon)
{
- OSL_ENSURE(m_sControlId.getLength(), "OControlExport::exportOuterAttributes: have no control id for the control!");
+ OSL_ENSURE(m_sControlId.getLength(), "OControlExport::exportInnerAttributes: have no control id for the control!");
AddAttribute(
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_CONTROL_ID),
OAttributeMetaData::getCommonControlAttributeName(CCA_CONTROL_ID),
@@ -789,10 +795,19 @@ namespace xmloff
OAttributeMetaData::getDatabaseAttributeNamespace(DA_DATA_FIELD),
OAttributeMetaData::getDatabaseAttributeName(DA_DATA_FIELD),
PROPERTY_DATAFIELD);
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- nIncludeDatabase = nIncludeDatabase & ~DA_DATA_FIELD;
- #endif
+ RESET_BIT( nIncludeDatabase, DA_DATA_FIELD );
+ }
+
+ // InputRequired
+ if ( DA_INPUT_REQUIRED & m_nIncludeDatabase )
+ {
+ exportBooleanPropertyAttribute(
+ OAttributeMetaData::getDatabaseAttributeNamespace( DA_INPUT_REQUIRED ),
+ OAttributeMetaData::getDatabaseAttributeName( DA_INPUT_REQUIRED ),
+ PROPERTY_INPUT_REQUIRED,
+ BOOLATTR_DEFAULT_TRUE
+ );
+ RESET_BIT( nIncludeDatabase, DA_INPUT_REQUIRED );
}
// the only int16 property: BoundColumn
@@ -803,13 +818,10 @@ namespace xmloff
OAttributeMetaData::getDatabaseAttributeName(DA_BOUND_COLUMN),
PROPERTY_BOUNDCOLUMN,
0);
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- nIncludeDatabase = nIncludeDatabase & ~DA_BOUND_COLUMN;
- #endif
+ RESET_BIT( nIncludeDatabase, DA_BOUND_COLUMN );
}
- // the only boolean property: ConvertEmptyToNull
+ // ConvertEmptyToNull
if (DA_CONVERT_EMPTY & m_nIncludeDatabase)
{
exportBooleanPropertyAttribute(
@@ -818,10 +830,7 @@ namespace xmloff
PROPERTY_EMPTY_IS_NULL,
BOOLATTR_DEFAULT_FALSE
);
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- nIncludeDatabase = nIncludeDatabase & ~DA_CONVERT_EMPTY;
- #endif
+ RESET_BIT( nIncludeDatabase, DA_CONVERT_EMPTY );
}
// the only enum property: ListSourceType
@@ -834,19 +843,13 @@ namespace xmloff
OEnumMapper::getEnumMap(OEnumMapper::epListSourceType),
ListSourceType_VALUELIST
);
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- nIncludeDatabase = nIncludeDatabase & ~DA_LIST_SOURCE_TYPE;
- #endif
+ RESET_BIT( nIncludeDatabase, DA_LIST_SOURCE_TYPE );
}
if (m_nIncludeDatabase & DA_LIST_SOURCE)
{
exportListSourceAsAttribute();
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- nIncludeDatabase = nIncludeDatabase & ~DA_LIST_SOURCE;
- #endif
+ RESET_BIT( nIncludeDatabase, DA_LIST_SOURCE );
}
#if OSL_DEBUG_LEVEL > 0
@@ -1151,11 +1154,7 @@ namespace xmloff
if ( SCA_IMAGE_POSITION & m_nIncludeSpecial )
{
exportImagePositionAttributes();
-
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_IMAGE_POSITION;
- #endif
+ RESET_BIT( m_nIncludeSpecial, SCA_IMAGE_POSITION );
}
OSL_ENSURE(0 == m_nIncludeSpecial,
@@ -1446,7 +1445,7 @@ namespace xmloff
CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE;
// database attributes
- m_nIncludeDatabase = DA_DATA_FIELD;
+ m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
// event attributes
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_SELECT;
@@ -1508,7 +1507,7 @@ namespace xmloff
CCA_DISABLED | CCA_DROPDOWN | CCA_MAX_LENGTH | CCA_PRINTABLE | CCA_READONLY | CCA_SIZE |
CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE | CCA_VALUE;
m_nIncludeSpecial = SCA_AUTOMATIC_COMPLETION;
- m_nIncludeDatabase = DA_CONVERT_EMPTY | DA_DATA_FIELD | DA_LIST_SOURCE | DA_LIST_SOURCE_TYPE;
+ m_nIncludeDatabase = DA_CONVERT_EMPTY | DA_DATA_FIELD | DA_INPUT_REQUIRED | DA_LIST_SOURCE | DA_LIST_SOURCE_TYPE;
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_SELECT;
break;
@@ -1518,7 +1517,7 @@ namespace xmloff
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_DROPDOWN |
CCA_PRINTABLE | CCA_SIZE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE;
m_nIncludeSpecial = SCA_MULTIPLE;
- m_nIncludeDatabase = DA_BOUND_COLUMN | DA_DATA_FIELD | DA_LIST_SOURCE_TYPE;
+ m_nIncludeDatabase = DA_BOUND_COLUMN | DA_DATA_FIELD | DA_INPUT_REQUIRED | DA_LIST_SOURCE_TYPE;
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_CLICK | EA_ON_DBLCLICK;
// check if we need to export the ListSource as attribute
{
@@ -1545,8 +1544,10 @@ namespace xmloff
// NO BREAK !
case FormComponentType::IMAGEBUTTON:
if (BUTTON != m_eType)
+ {
// not coming from the previous case
m_eType = IMAGE;
+ }
m_nIncludeCommon |=
CCA_NAME | CCA_SERVICE_NAME | CCA_BUTTON_TYPE | CCA_DISABLED |
CCA_IMAGE_DATA | CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TARGET_FRAME |
@@ -1569,7 +1570,7 @@ namespace xmloff
}
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) )
m_nIncludeSpecial |= SCA_IMAGE_POSITION;
- m_nIncludeDatabase = DA_DATA_FIELD;
+ m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE;
break;
@@ -1586,7 +1587,7 @@ namespace xmloff
m_nIncludeCommon =
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_IMAGE_DATA |
CCA_PRINTABLE | CCA_READONLY | CCA_TITLE;
- m_nIncludeDatabase = DA_DATA_FIELD;
+ m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
m_nIncludeEvents = EA_CONTROL_EVENTS;
break;
@@ -1955,7 +1956,7 @@ namespace xmloff
// grid columns miss some properties of the controls they're representing
m_nIncludeCommon &= ~(CCA_FOR | CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_LABEL);
- m_nIncludeSpecial &= ~(SCA_ECHO_CHAR | SCA_AUTOMATIC_COMPLETION | SCA_MULTIPLE | SCA_MULTI_LINE | SCA_IS_TRISTATE);
+ m_nIncludeSpecial &= ~(SCA_ECHO_CHAR | SCA_AUTOMATIC_COMPLETION | SCA_MULTIPLE | SCA_MULTI_LINE);
if (FormComponentType::DATEFIELD != m_nClassId)
// except date fields, no column has the DropDown property
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 3726a92966..d41435168f 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -331,7 +331,12 @@ namespace xmloff
{
if ( !xDynamicProperties.is() )
{
- OSL_ENSURE( false, "OElementImport::implImportGenericProperties: encountered an unknown property, but component is no PropertyBag!" );
+ #if OSL_DEBUG_LEVEL > 0
+ ::rtl::OString aMessage( "OElementImport::implImportGenericProperties: encountered an unknown property (" );
+ aMessage += ::rtl::OUStringToOString( aPropValues->Name, RTL_TEXTENCODING_ASCII_US );
+ aMessage += "), but component is no PropertyBag!";
+ OSL_ENSURE( false, aMessage.getStr() );
+ #endif
continue;
}
@@ -1133,10 +1138,10 @@ namespace xmloff
)
);
- if ( bMakeAbsolute )
+ if ( bMakeAbsolute && ( _rValue.getLength() > 0 ) )
{
// make a global URL out of the local one
- ::rtl::OUString sAdjustedValue = m_rContext.getGlobalContext().GetAbsoluteReference( _rValue );
+ ::rtl::OUString sAdjustedValue = m_rContext.getGlobalContext().ResolveGraphicObjectURL( _rValue, FALSE );
OImagePositionImport::handleAttribute( _nNamespaceKey, _rLocalName, sAdjustedValue );
}
else
@@ -1989,10 +1994,8 @@ namespace xmloff
case OControlElement::BUTTON:
case OControlElement::IMAGE:
- return new OButtonImport(m_rFormImport, *this, _nPrefix, _rLocalName, m_xMeAsContainer, _eType);
-
case OControlElement::IMAGE_FRAME:
- return new OURLReferenceImport( m_rFormImport, *this, _nPrefix, _rLocalName, m_xMeAsContainer, _eType );
+ return new OButtonImport( m_rFormImport, *this, _nPrefix, _rLocalName, m_xMeAsContainer, _eType );
case OControlElement::COMBOBOX:
case OControlElement::LISTBOX:
diff --git a/xmloff/source/forms/formattributes.cxx b/xmloff/source/forms/formattributes.cxx
index 015eda3edb..9cb70d95dd 100644
--- a/xmloff/source/forms/formattributes.cxx
+++ b/xmloff/source/forms/formattributes.cxx
@@ -150,6 +150,7 @@ namespace xmloff
case DA_DATA_FIELD: return "data-field";
case DA_LIST_SOURCE: return "list-source";
case DA_LIST_SOURCE_TYPE: return "list-source-type";
+ case DA_INPUT_REQUIRED: return "input-required";
default:
OSL_ENSURE(sal_False, "OAttributeMetaData::getDatabaseAttributeName: invalid id (maybe you or-ed two flags?)!");
}
diff --git a/xmloff/source/forms/formattributes.hxx b/xmloff/source/forms/formattributes.hxx
index 478f1d7342..69eff4c95e 100644
--- a/xmloff/source/forms/formattributes.hxx
+++ b/xmloff/source/forms/formattributes.hxx
@@ -76,6 +76,7 @@ namespace xmloff
#define DA_DATA_FIELD 0x00000004
#define DA_LIST_SOURCE 0x00000008
#define DA_LIST_SOURCE_TYPE 0x00000010
+ #define DA_INPUT_REQUIRED 0x00000020
// flags for binding related control attributes
#define BA_LINKED_CELL 0x00000001
diff --git a/xmloff/source/forms/formenums.cxx b/xmloff/source/forms/formenums.cxx
index 427483b552..90efb4b39c 100644
--- a/xmloff/source/forms/formenums.cxx
+++ b/xmloff/source/forms/formenums.cxx
@@ -45,6 +45,7 @@
#include <com/sun/star/awt/FontRelief.hpp>
#include <com/sun/star/awt/ScrollBarOrientation.hpp>
#include <com/sun/star/awt/VisualEffect.hpp>
+#include <com/sun/star/awt/ImageScaleMode.hpp>
#include <vcl/wintypes.hxx> // for check states
#include <xmloff/xmltoken.hxx>
@@ -321,6 +322,21 @@ namespace xmloff
rReturn = aImageAlignMap;
}
break;
+
+ case epImageScaleMode:
+ {
+ static const SvXMLEnumMapEntry aScaleModeMap[] =
+ {
+ { XML_BACKGROUND_NO_REPEAT, ImageScaleMode::None },
+ { XML_REPEAT, ImageScaleMode::None }, // repeating the image is not supported
+ { XML_STRETCH, ImageScaleMode::Anisotropic },
+ { XML_SCALE, ImageScaleMode::Isotropic },
+ { XML_TOKEN_INVALID, ImageScaleMode::None }
+ };
+ rReturn = aScaleModeMap;
+ }
+ break;
+
case KNOWN_ENUM_PROPERTIES:
break;
}
diff --git a/xmloff/source/forms/formenums.hxx b/xmloff/source/forms/formenums.hxx
index 3fe4e5bc2b..2d798bcf6e 100644
--- a/xmloff/source/forms/formenums.hxx
+++ b/xmloff/source/forms/formenums.hxx
@@ -63,6 +63,7 @@ namespace xmloff
epVisualEffect,
epImagePosition,
epImageAlign,
+ epImageScaleMode,
KNOWN_ENUM_PROPERTIES
};
diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx
index 309d177319..29641727f5 100644
--- a/xmloff/source/forms/layerexport.cxx
+++ b/xmloff/source/forms/layerexport.cxx
@@ -103,12 +103,12 @@ namespace xmloff
// add our style family to the export context's style pool
m_xPropertyHandlerFactory = new OControlPropertyHandlerFactory();
::vos::ORef< XMLPropertySetMapper > xStylePropertiesMapper = new XMLPropertySetMapper( getControlStylePropertyMap(), m_xPropertyHandlerFactory.getBodyPtr() );
- m_xExportMapper = new OFormExportPropertyMapper( xStylePropertiesMapper.getBodyPtr() );
+ m_xStyleExportMapper = new OFormComponentStyleExportMapper( xStylePropertiesMapper.getBodyPtr() );
// our style family
m_rContext.GetAutoStylePool()->AddFamily(
XML_STYLE_FAMILY_CONTROL_ID, token::GetXMLToken(token::XML_PARAGRAPH),
- m_xExportMapper.getBodyPtr(),
+ m_xStyleExportMapper.getBodyPtr(),
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_CONTROL_PREFIX) )
);
@@ -188,7 +188,7 @@ namespace xmloff
//---------------------------------------------------------------------
::vos::ORef< SvXMLExportPropertyMapper > OFormLayerXMLExport_Impl::getStylePropertyMapper()
{
- return m_xExportMapper;
+ return m_xStyleExportMapper;
}
//---------------------------------------------------------------------
@@ -641,7 +641,7 @@ namespace xmloff
// determine a number style, if needed
xColumnPropertiesMeta = xColumnProperties->getPropertySetInfo();
// get the styles of the column
- ::std::vector< XMLPropertyState > aPropertyStates = m_xExportMapper->Filter( xColumnProperties );
+ ::std::vector< XMLPropertyState > aPropertyStates = m_xStyleExportMapper->Filter( xColumnProperties );
// care for the number format, additionally
::rtl::OUString sColumnNumberStyle;
@@ -650,7 +650,7 @@ namespace xmloff
if ( sColumnNumberStyle.getLength() )
{ // the column indeed has a formatting
- sal_Int32 nStyleMapIndex = m_xExportMapper->getPropertySetMapper()->FindEntryIndex( CTF_FORMS_DATA_STYLE );
+ sal_Int32 nStyleMapIndex = m_xStyleExportMapper->getPropertySetMapper()->FindEntryIndex( CTF_FORMS_DATA_STYLE );
// TODO: move this to the ctor
OSL_ENSURE ( -1 != nStyleMapIndex, "XMLShapeExport::collectShapeAutoStyles: could not obtain the index for our context id!");
diff --git a/xmloff/source/forms/layerexport.hxx b/xmloff/source/forms/layerexport.hxx
index 00b8deb26b..6d3a318bfd 100644
--- a/xmloff/source/forms/layerexport.hxx
+++ b/xmloff/source/forms/layerexport.hxx
@@ -84,7 +84,7 @@ namespace xmloff
// style handling
::vos::ORef< XMLPropertyHandlerFactory > m_xPropertyHandlerFactory;
- ::vos::ORef< SvXMLExportPropertyMapper > m_xExportMapper;
+ ::vos::ORef< SvXMLExportPropertyMapper > m_xStyleExportMapper;
// we need our own number formats supplier:
// Controls which have a number formats do not work with the formats supplier of the document they reside
@@ -100,7 +100,7 @@ namespace xmloff
// add this format to the global (document) formats supplier.
// In case of an export we could do some cleanup afterwards, but in case of an import, there is no such
// chance, as (if other user-defined formats exist in the document as well) we can't distinguish
- // between user-defined formats really beeded for the doc (i.e. in a calc cell) and formats only added
+ // between user-defined formats really needed for the doc (i.e. in a calc cell) and formats only added
// to the supplier because the controls needed it.
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats >
m_xControlNumberFormats;
diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx
index eb0a47a14b..bb152eb8ad 100644
--- a/xmloff/source/forms/layerimport.cxx
+++ b/xmloff/source/forms/layerimport.cxx
@@ -177,6 +177,8 @@ namespace xmloff
OAttributeMetaData::getSpecialAttributeName( SCA_TOGGLE ), PROPERTY_TOGGLE, sal_False );
m_aAttributeMetaData.addBooleanProperty(
OAttributeMetaData::getSpecialAttributeName( SCA_FOCUS_ON_CLICK ), PROPERTY_FOCUS_ON_CLICK, sal_True );
+ m_aAttributeMetaData.addBooleanProperty(
+ OAttributeMetaData::getDatabaseAttributeName( DA_INPUT_REQUIRED ), PROPERTY_INPUT_REQUIRED, sal_False );
// the int16 attributes
m_aAttributeMetaData.addInt16Property(
diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx
index f9971f11b1..4cbb5f939c 100644
--- a/xmloff/source/forms/propertyexport.cxx
+++ b/xmloff/source/forms/propertyexport.cxx
@@ -429,7 +429,9 @@ namespace xmloff
::rtl::OUString sTargetLocation = comphelper::getString(m_xProps->getPropertyValue(_sPropertyName));
if ( sTargetLocation.getLength() )
- sTargetLocation = m_rContext.getGlobalContext().GetRelativeReference(sTargetLocation);
+ // If this isn't a GraphicObject then GetRelativeReference
+ // will be called anyway ( in AddEmbeddedGraphic )
+ sTargetLocation = m_rContext.getGlobalContext().AddEmbeddedGraphicObject(sTargetLocation);
AddAttribute(OAttributeMetaData::getCommonControlAttributeNamespace(_nProperty)
,OAttributeMetaData::getCommonControlAttributeName(_nProperty)
, sTargetLocation);
diff --git a/xmloff/source/forms/propertyimport.hxx b/xmloff/source/forms/propertyimport.hxx
index 32d75392a5..01741dfdfa 100644
--- a/xmloff/source/forms/propertyimport.hxx
+++ b/xmloff/source/forms/propertyimport.hxx
@@ -143,10 +143,21 @@ namespace xmloff
*/
void enableTrackAttributes() { m_bTrackAttributes = sal_True; }
- void implPushBackPropertyValue(const ::com::sun::star::beans::PropertyValue& _rProp)
- { m_aValues.push_back(_rProp); }
- void implPushBackGenericPropertyValue(const ::com::sun::star::beans::PropertyValue& _rProp)
- { m_aGenericValues.push_back(_rProp); }
+ inline void implPushBackPropertyValue(const ::com::sun::star::beans::PropertyValue& _rProp)
+ {
+ m_aValues.push_back(_rProp);
+ }
+
+ inline void implPushBackPropertyValue( const ::rtl::OUString& _rName, const ::com::sun::star::uno::Any& _rValue )
+ {
+ m_aValues.push_back( ::com::sun::star::beans::PropertyValue(
+ _rName, -1, _rValue, ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) );
+ }
+
+ inline void implPushBackGenericPropertyValue(const ::com::sun::star::beans::PropertyValue& _rProp)
+ {
+ m_aGenericValues.push_back(_rProp);
+ }
};
SV_DECL_IMPL_REF( OPropertyImport )
diff --git a/xmloff/source/forms/strings.hxx b/xmloff/source/forms/strings.hxx
index cd20bc720e..870f2285e5 100644
--- a/xmloff/source/forms/strings.hxx
+++ b/xmloff/source/forms/strings.hxx
@@ -136,6 +136,7 @@ namespace xmloff
XMLFORM_CONSTASCII_STRING( PROPERTY_DATAFIELD, "DataField" );
XMLFORM_CONSTASCII_STRING( PROPERTY_BOUNDCOLUMN, "BoundColumn");
XMLFORM_CONSTASCII_STRING( PROPERTY_EMPTY_IS_NULL, "ConvertEmptyToNull");
+ XMLFORM_CONSTASCII_STRING( PROPERTY_INPUT_REQUIRED, "InputRequired");
XMLFORM_CONSTASCII_STRING( PROPERTY_LISTSOURCE, "ListSource");
XMLFORM_CONSTASCII_STRING( PROPERTY_LISTSOURCETYPE, "ListSourceType");
XMLFORM_CONSTASCII_STRING( PROPERTY_ECHO_CHAR, "EchoChar");
@@ -204,6 +205,7 @@ namespace xmloff
XMLFORM_CONSTASCII_STRING( PROPERTY_VISUAL_EFFECT, "VisualEffect");
XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_POSITION, "ImagePosition");
XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_ALIGN, "ImageAlign");
+ XMLFORM_CONSTASCII_STRING( PROPERTY_SCALE_IMAGE, "ScaleImage");
XMLFORM_CONSTASCII_STRING( PROPERTY_BOUND_CELL, "BoundCell");
XMLFORM_CONSTASCII_STRING( PROPERTY_LIST_CELL_RANGE, "CellRange");