diff options
author | Michael Stahl <mst@openoffice.org> | 2011-10-11 14:19:00 +0200 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2011-10-11 17:57:00 +0200 |
commit | 3ca2bef76886450058d1667703aeafe4c2e456c3 (patch) | |
tree | b18d70f79bfcfd2b2e34790e86edafb4c4337a80 /xmloff/inc | |
parent | 02c32e0f0e75a9df80888051d1ec189fa14129bd (diff) |
#i108468#: clean up xmluconv code duplication, part 1:
move convertNumber64 from SvXMLUnitConverter to sax::converter.
remove duplicate methods from SvXMLUnitConverter:
convertBool, convertPercent, convertColor, convertNumber, convertDouble,
indexOfComma, encodeBase64, decodeBase64, decodeBase64SomeChars,
clearUndefinedChars
Diffstat (limited to 'xmloff/inc')
-rw-r--r-- | xmloff/inc/xmloff/shapeimport.hxx | 6 | ||||
-rw-r--r-- | xmloff/inc/xmloff/xmlnumfi.hxx | 2 | ||||
-rw-r--r-- | xmloff/inc/xmloff/xmluconv.hxx | 79 |
3 files changed, 5 insertions, 82 deletions
diff --git a/xmloff/inc/xmloff/shapeimport.hxx b/xmloff/inc/xmloff/shapeimport.hxx index 564abd460b87..5de8adf632ff 100644 --- a/xmloff/inc/xmloff/shapeimport.hxx +++ b/xmloff/inc/xmloff/shapeimport.hxx @@ -189,7 +189,7 @@ enum SdXML3DLightAttrTokenMap class SdXML3DLightContext: public SvXMLImportContext { // local parameters which need to be read - Color maDiffuseColor; + sal_Int32 maDiffuseColor; ::basegfx::B3DVector maDirection; bool mbEnabled; bool mbSpecular; @@ -202,7 +202,7 @@ public: const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList); virtual ~SdXML3DLightContext(); - const Color& GetDiffuseColor() { return maDiffuseColor; } + sal_Int32 GetDiffuseColor() { return maDiffuseColor; } const ::basegfx::B3DVector& GetDirection() { return maDirection; } sal_Bool GetEnabled() { return mbEnabled; } sal_Bool GetSpecular() { return mbSpecular; } @@ -229,7 +229,7 @@ protected: sal_Int32 mnFocalLength; sal_Int32 mnShadowSlant; com::sun::star::drawing::ShadeMode mxShadeMode; - Color maAmbientColor; + sal_Int32 maAmbientColor; bool mbLightingMode; ::basegfx::B3DVector maVRP; diff --git a/xmloff/inc/xmloff/xmlnumfi.hxx b/xmloff/inc/xmloff/xmlnumfi.hxx index d5ccc45354ff..d00169641f9f 100644 --- a/xmloff/inc/xmloff/xmlnumfi.hxx +++ b/xmloff/inc/xmloff/xmlnumfi.hxx @@ -215,7 +215,7 @@ public: void AddCondition( const sal_Int32 nIndex ); void AddCondition( const sal_Int32 nIndex, const rtl::OUString& rFormat, const LocaleDataWrapper& rData ); void AddCondition( const rtl::OUString& rCondition, const rtl::OUString& rApplyName ); - void AddColor( const Color& rColor ); + void AddColor( sal_uInt32 const nColor ); /// determine whether number format uses the system language sal_Bool IsSystemLanguage(); diff --git a/xmloff/inc/xmloff/xmluconv.hxx b/xmloff/inc/xmloff/xmluconv.hxx index f73641c78c71..1ca051b888bd 100644 --- a/xmloff/inc/xmloff/xmluconv.hxx +++ b/xmloff/inc/xmloff/xmluconv.hxx @@ -35,7 +35,6 @@ #include <limits.h> #include <tools/solar.h> -#include <tools/color.hxx> #include <tools/mapunit.hxx> #include <xmloff/xmlement.hxx> #include <xmloff/xmltoken.hxx> @@ -168,22 +167,6 @@ public: MapUnit eSrcUnit, MapUnit eDstUnit ); - /** convert string to boolean */ - static sal_Bool convertBool( bool& rBool, - const ::rtl::OUString& rString ); - - /** convert boolean to string */ - static void convertBool( ::rtl::OUStringBuffer& rBuffer, - sal_Bool bValue ); - - /** convert string to percent */ - static sal_Bool convertPercent( sal_Int32& rValue, - const ::rtl::OUString& rString ); - - /** convert percent to string */ - static void convertPercent( ::rtl::OUStringBuffer& rBuffer, - sal_Int32 nValue ); - /** convert string to pixel measure unite */ static sal_Bool convertMeasurePx( sal_Int32& rValue, const ::rtl::OUString& rString ); @@ -223,58 +206,15 @@ public: const SvXMLEnumStringMapEntry *pMap, sal_Char* pDefault = NULL ); - /** convert string to color */ - static sal_Bool convertColor( Color& rColor, - const ::rtl::OUString&rValue ); - - /** convert color to string */ - static void convertColor( ::rtl::OUStringBuffer &rBuffer, - const Color& rCol ); - - /** convert number to string */ - static void convertNumber( ::rtl::OUStringBuffer& rBuffer, - sal_Int32 nNumber ); - - /** convert string to number with optional min and max values */ - static sal_Bool convertNumber( sal_Int32& rValue, - const ::rtl::OUString& rString, - sal_Int32 nMin = SAL_MIN_INT32, - sal_Int32 nMax = SAL_MAX_INT32); - - /** convert number to string */ - static void convertNumber64( ::rtl::OUStringBuffer& rBuffer, - sal_Int64 nNumber ); - - /** convert string to number with optional min and max values */ - static sal_Bool convertNumber64( sal_Int64& rValue, - const ::rtl::OUString& rString, - sal_Int64 nMin = SAL_MIN_INT64, - sal_Int64 nMax = SAL_MAX_INT64); /** convert double number to string (using ::rtl::math) and DO - convert to export MapUnit */ + convert to export MapUnit using meCoreMeasureUnit/meXMLMeasureUnit */ void convertDouble(::rtl::OUStringBuffer& rBuffer, double fNumber, sal_Bool bWriteUnits) const; - /** convert double number to string (using ::rtl::math) and - DO convert from eSrcUnit to export MapUnit */ - static void convertDouble( ::rtl::OUStringBuffer& rBuffer, - double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit); - - /** convert double number to string (using ::rtl::math) without unit conversion */ - static void convertDouble( ::rtl::OUStringBuffer& rBuffer, double fNumber); - /** convert string to double number (using ::rtl::math) and DO convert. */ sal_Bool convertDouble(double& rValue, const ::rtl::OUString& rString, sal_Bool bLookForUnits) const; - /** convert string to double number (using ::rtl::math) and DO convert from - SrcUnit to DstUnit. */ - static sal_Bool convertDouble(double& rValue, - const ::rtl::OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit); - - /** convert string to double number (using ::rtl::math) without unit conversion */ - static sal_Bool convertDouble(double& rValue, const ::rtl::OUString& rString); - /** get the Null Date of the XModel and set it to the UnitConverter */ sal_Bool setNullDate ( const com::sun::star::uno::Reference <com::sun::star::frame::XModel>& xModel); @@ -369,21 +309,6 @@ public: static sal_Bool convertDateTime( com::sun::star::util::DateTime& rDateTime, const ::rtl::OUString& rString ); - /** gets the position of the first comma after npos in the string - rStr. Commas inside '"' pairs are not matched */ - static sal_Int32 indexOfComma( const ::rtl::OUString& rStr, - sal_Int32 nPos ); - - static void encodeBase64(rtl::OUStringBuffer& aStrBuffer, const com::sun::star::uno::Sequence<sal_Int8>& aPass); - - // Decode a base 64 encoded string into a sequence of bytes. The first - // version can be used for attribute values only, bacause it does not - // return any chars left from conversion. - // For text submitted throgh the SAX characters call, the later method - // must be used! - static void decodeBase64(com::sun::star::uno::Sequence<sal_Int8>& aPass, const rtl::OUString& sBuffer); - - static sal_Int32 decodeBase64SomeChars(com::sun::star::uno::Sequence<sal_Int8>& aPass, const rtl::OUString& sBuffer); /** convert num-forat and num-letter-sync values to NumberingType */ sal_Bool convertNumFormat( sal_Int16& rType, @@ -402,8 +327,6 @@ public: static void convertPropertySet(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& rProperties, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps); - static void clearUndefinedChars(rtl::OUString& rTarget, const rtl::OUString& rSource); - ::rtl::OUString encodeStyleName( const ::rtl::OUString& rName, sal_Bool *pEncoded=0 ) const; |