summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-11-12 16:09:42 +0100
committerLuboš Luňák <l.lunak@collabora.com>2014-11-12 18:10:25 +0100
commitb6aedde6d499f658218deb4f0106c141f819f450 (patch)
tree40549554e4c8abb4bcc68716e074048e93d18137
parent7c19553a30335f746e0967af1a346a7b6c8bd44f (diff)
make FastAttributeList's unknown attribute value be passed as OString
Since that's how it's internally stored anyway, and I have a use case where it's useful to limit the length by passing it to OString ctor. Change-Id: I5903ea4f1b2cdb48c1bbceac6b8e21eb5882d377
-rw-r--r--include/sax/fastattribs.hxx9
-rw-r--r--sax/source/tools/fastattribs.cxx16
2 files changed, 12 insertions, 13 deletions
diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx
index 39f5a5f814a2..a2fe1b9c77ba 100644
--- a/include/sax/fastattribs.hxx
+++ b/include/sax/fastattribs.hxx
@@ -40,9 +40,8 @@ struct UnknownAttribute
OString maName;
OString maValue;
- UnknownAttribute( const OUString& rNamespaceURL, const OString& rName, const sal_Char* pValue );
-
- UnknownAttribute( const OString& rName, const sal_Char* pValue );
+ UnknownAttribute( const OUString& rNamespaceURL, const OString& rName, const OString& value );
+ UnknownAttribute( const OString& rName, const OString& value );
void FillAttribute( ::com::sun::star::xml::Attribute* pAttrib ) const;
};
@@ -84,8 +83,8 @@ public:
void add( sal_Int32 nToken, const sal_Char* pValue, size_t nValueLength );
void add( sal_Int32 nToken, const OString& rValue );
void addNS( sal_Int32 nNamespaceToken, sal_Int32 nToken, const OString& rValue );
- void addUnknown( const OUString& rNamespaceURL, const OString& rName, const sal_Char* pValue );
- void addUnknown( const OString& rName, const sal_Char* pValue );
+ void addUnknown( const OUString& rNamespaceURL, const OString& rName, const OString& value );
+ void addUnknown( const OString& rName, const OString& value );
const std::vector< sal_Int32 >& getFastAttributeTokens() const { return maAttributeTokens; }
const char* getFastAttributeValue(size_t nIndex) const { return mpChunk + maAttributeValues[nIndex]; }
sal_Int32 AttributeValueLength(size_t i) const { return maAttributeValues[i + 1] - maAttributeValues[i] - 1; }
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx
index 36277cf3a236..d32f484632aa 100644
--- a/sax/source/tools/fastattribs.cxx
+++ b/sax/source/tools/fastattribs.cxx
@@ -32,13 +32,13 @@ FastTokenHandlerBase::~FastTokenHandlerBase()
{
}
-UnknownAttribute::UnknownAttribute( const OUString& rNamespaceURL, const OString& rName, const sal_Char* pValue )
- : maNamespaceURL( rNamespaceURL ), maName( rName ), maValue( pValue )
+UnknownAttribute::UnknownAttribute( const OUString& rNamespaceURL, const OString& rName, const OString& value )
+ : maNamespaceURL( rNamespaceURL ), maName( rName ), maValue( value )
{
}
-UnknownAttribute::UnknownAttribute( const OString& rName, const sal_Char* pValue )
- : maName( rName ), maValue( pValue )
+UnknownAttribute::UnknownAttribute( const OString& rName, const OString& value )
+ : maName( rName ), maValue( value )
{
}
@@ -106,14 +106,14 @@ void FastAttributeList::addNS( sal_Int32 nNamespaceToken, sal_Int32 nToken, cons
add( nCombinedToken, rValue );
}
-void FastAttributeList::addUnknown( const OUString& rNamespaceURL, const OString& rName, const sal_Char* pValue )
+void FastAttributeList::addUnknown( const OUString& rNamespaceURL, const OString& rName, const OString& value )
{
- maUnknownAttributes.push_back( UnknownAttribute( rNamespaceURL, rName, pValue ) );
+ maUnknownAttributes.push_back( UnknownAttribute( rNamespaceURL, rName, value ) );
}
-void FastAttributeList::addUnknown( const OString& rName, const sal_Char* pValue )
+void FastAttributeList::addUnknown( const OString& rName, const OString& value )
{
- maUnknownAttributes.push_back( UnknownAttribute( rName, pValue ) );
+ maUnknownAttributes.push_back( UnknownAttribute( rName, value ) );
}
// XFastAttributeList