Kaydet (Commit) c566814e authored tarafından Matúš Kukan's avatar Matúš Kukan

Remove TokenMap::getUnicodeTokenName()

Change-Id: I778dc43085b6afbb6456cbf53fe8c95b624b75b3
üst 9703cc63
...@@ -35,9 +35,6 @@ public: ...@@ -35,9 +35,6 @@ public:
explicit TokenMap(); explicit TokenMap();
~TokenMap(); ~TokenMap();
/** Returns the Unicode name of the passed token identifier. */
OUString getUnicodeTokenName( sal_Int32 nToken ) const;
/** Returns the token identifier for the passed Unicode token name. */ /** Returns the token identifier for the passed Unicode token name. */
sal_Int32 getTokenFromUnicode( const OUString& rUnicodeName ) const; sal_Int32 getTokenFromUnicode( const OUString& rUnicodeName ) const;
......
...@@ -116,7 +116,7 @@ public: ...@@ -116,7 +116,7 @@ public:
const ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > & xShape, const ::com::sun::star::awt::Size &aSize ); const ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > & xShape, const ::com::sun::star::awt::Size &aSize );
sal_Int32 getShapePresetType() const { return mnShapePresetType; } sal_Int32 getShapePresetType() const { return mnShapePresetType; }
OUString getShapePresetTypeName() const; css::uno::Sequence< sal_Int8 > getShapePresetTypeName() const;
void setShapePresetType( sal_Int32 nShapePresetType ){ mnShapePresetType = nShapePresetType; }; void setShapePresetType( sal_Int32 nShapePresetType ){ mnShapePresetType = nShapePresetType; };
bool getShapeTypeOverride(){ return mbShapeTypeOverride; }; bool getShapeTypeOverride(){ return mbShapeTypeOverride; };
void setShapeTypeOverride( bool bShapeTypeOverride ) { mbShapeTypeOverride = bShapeTypeOverride; }; void setShapeTypeOverride( bool bShapeTypeOverride ) { mbShapeTypeOverride = bShapeTypeOverride; };
......
...@@ -56,9 +56,9 @@ CustomShapeProperties::~CustomShapeProperties() ...@@ -56,9 +56,9 @@ CustomShapeProperties::~CustomShapeProperties()
{ {
} }
OUString CustomShapeProperties::getShapePresetTypeName() const uno::Sequence< sal_Int8 > CustomShapeProperties::getShapePresetTypeName() const
{ {
return StaticTokenMap::get().getUnicodeTokenName( mnShapePresetType ); return StaticTokenMap::get().getUtf8TokenName( mnShapePresetType );
} }
sal_Int32 CustomShapeProperties::SetCustomShapeGuideValue( std::vector< CustomShapeGuide >& rGuideList, const CustomShapeGuide& rGuide ) sal_Int32 CustomShapeProperties::SetCustomShapeGuideValue( std::vector< CustomShapeGuide >& rGuideList, const CustomShapeGuide& rGuide )
...@@ -136,7 +136,7 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi ...@@ -136,7 +136,7 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
} }
else if (maPresetDataMap.find(mnShapePresetType) != maPresetDataMap.end()) else if (maPresetDataMap.find(mnShapePresetType) != maPresetDataMap.end())
{ {
OSL_TRACE("found property map for preset: %s (%d)", USS(getShapePresetTypeName()), mnShapePresetType); OSL_TRACE("found property map for preset: %d", mnShapePresetType);
aPropertyMap = maPresetDataMap[mnShapePresetType]; aPropertyMap = maPresetDataMap[mnShapePresetType];
#ifdef DEBUG #ifdef DEBUG
......
...@@ -678,7 +678,11 @@ Reference< XShape > Shape::createAndInsert( ...@@ -678,7 +678,11 @@ Reference< XShape > Shape::createAndInsert(
sal_Int32 length = aGrabBag.getLength(); sal_Int32 length = aGrabBag.getLength();
aGrabBag.realloc( length+1); aGrabBag.realloc( length+1);
aGrabBag[length].Name = "mso-orig-shape-type"; aGrabBag[length].Name = "mso-orig-shape-type";
aGrabBag[length].Value = uno::makeAny(mpCustomShapePropertiesPtr->getShapePresetTypeName()); const uno::Sequence< sal_Int8 > aNameSeq =
mpCustomShapePropertiesPtr->getShapePresetTypeName();
OUString sShapePresetTypeName(reinterpret_cast< const char* >(
aNameSeq.getConstArray()), aNameSeq.getLength(), RTL_TEXTENCODING_UTF8);
aGrabBag[length].Value = uno::makeAny(sShapePresetTypeName);
propertySet->setPropertyValue("FrameInteropGrabBag",uno::makeAny(aGrabBag)); propertySet->setPropertyValue("FrameInteropGrabBag",uno::makeAny(aGrabBag));
} }
//If the text box has links then save the link information so that //If the text box has links then save the link information so that
......
...@@ -55,17 +55,18 @@ AttributeListBuilder::AttributeListBuilder( const uno::Reference< xml::sax::XFas ...@@ -55,17 +55,18 @@ AttributeListBuilder::AttributeListBuilder( const uno::Reference< xml::sax::XFas
} }
} }
static OUString tokenToString( int token ) static OString tokenToString( int token )
{ {
OUString tokenname = StaticTokenMap::get().getUnicodeTokenName( token & TOKEN_MASK ); const uno::Sequence< sal_Int8 > aTokenNameSeq = StaticTokenMap::get().getUtf8TokenName( token & TOKEN_MASK );
OString tokenname( reinterpret_cast< const char* >( aTokenNameSeq.getConstArray() ), aTokenNameSeq.getLength() );
if( tokenname.isEmpty()) if( tokenname.isEmpty())
tokenname = "???"; tokenname = "???";
int nmsp = ( token & NMSP_MASK & ~( TAG_OPENING | TAG_CLOSING )); int nmsp = ( token & NMSP_MASK & ~( TAG_OPENING | TAG_CLOSING ));
#if 0 // this is awfully long #if 0 // this is awfully long
OUString namespacename = StaticNamespaceMap::get().count( nmsp ) != 0 OString namespacename = StaticNamespaceMap::get().count( nmsp ) != 0
? StaticNamespaceMap::get()[ nmsp ] : OUString( "???" ); ? StaticNamespaceMap::get()[ nmsp ] : OString( "???" );
#else #else
OUString namespacename; OString namespacename;
// only few are needed actually // only few are needed actually
switch( nmsp ) switch( nmsp )
{ {
......
...@@ -73,18 +73,6 @@ TokenMap::~TokenMap() ...@@ -73,18 +73,6 @@ TokenMap::~TokenMap()
{ {
} }
OUString TokenMap::getUnicodeTokenName( sal_Int32 nToken ) const
{
Sequence< sal_Int8 > rUtf8Name = getUtf8TokenName(nToken);
if (rUtf8Name.getLength() == 0)
return OUString();
return OUString(reinterpret_cast< const char * >(
rUtf8Name.getConstArray() ),
rUtf8Name.getLength(),
RTL_TEXTENCODING_UTF8);
}
sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const
{ {
OString aUtf8Name = OUStringToOString( rUnicodeName, RTL_TEXTENCODING_UTF8 ); OString aUtf8Name = OUStringToOString( rUnicodeName, RTL_TEXTENCODING_UTF8 );
......
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