Kaydet (Commit) 633ca742 authored tarafından Eike Rathke's avatar Eike Rathke

use LanguageTag instead of mouth-painted implementation

Change-Id: Idd84ce9740de179c399702f896b7d39ab321f6f7
üst 7191ff96
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/lang/Locale.hpp>
#include <osl/time.h> #include <osl/time.h>
#include <i18nlangtag/languagetag.hxx>
#include <vector> #include <vector>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
...@@ -178,21 +179,6 @@ uno::Sequence< OUString > OOXMLDocPropHandler::GetKeywordsSet( const OUString& a ...@@ -178,21 +179,6 @@ uno::Sequence< OUString > OOXMLDocPropHandler::GetKeywordsSet( const OUString& a
} }
return uno::Sequence< OUString >(); return uno::Sequence< OUString >();
} }
// ------------------------------------------------
lang::Locale OOXMLDocPropHandler::GetLanguage( const OUString& aChars )
{
lang::Locale aResult;
if ( aChars.getLength() >= 2 )
{
aResult.Language = aChars.copy( 0, 2 );
if ( aChars.getLength() >= 5 && aChars.getStr()[2] == (sal_Unicode)'-' )
aResult.Country = aChars.copy( 3, 2 );
// TODO/LATER: the variant could be also detected
}
return aResult;
}
// ------------------------------------------------ // ------------------------------------------------
void OOXMLDocPropHandler::UpdateDocStatistic( const OUString& aChars ) void OOXMLDocPropHandler::UpdateDocStatistic( const OUString& aChars )
...@@ -423,7 +409,7 @@ void SAL_CALL OOXMLDocPropHandler::characters( const OUString& aChars ) ...@@ -423,7 +409,7 @@ void SAL_CALL OOXMLDocPropHandler::characters( const OUString& aChars )
case DC_TOKEN( language ): case DC_TOKEN( language ):
if ( aChars.getLength() >= 2 ) if ( aChars.getLength() >= 2 )
m_xDocProp->setLanguage( GetLanguage( aChars ) ); m_xDocProp->setLanguage( LanguageTag( aChars).getLocale() );
break; break;
case COREPR_TOKEN( lastModifiedBy ): case COREPR_TOKEN( lastModifiedBy ):
......
...@@ -62,7 +62,6 @@ public: ...@@ -62,7 +62,6 @@ public:
::com::sun::star::util::DateTime GetDateTimeFromW3CDTF( const OUString& aChars ); ::com::sun::star::util::DateTime GetDateTimeFromW3CDTF( const OUString& aChars );
::com::sun::star::uno::Sequence< OUString > GetKeywordsSet( const OUString& aChars ); ::com::sun::star::uno::Sequence< OUString > GetKeywordsSet( const OUString& aChars );
::com::sun::star::lang::Locale GetLanguage( const OUString& aChars );
void UpdateDocStatistic( const OUString& aChars ); void UpdateDocStatistic( const OUString& aChars );
// com.sun.star.xml.sax.XFastDocumentHandler // com.sun.star.xml.sax.XFastDocumentHandler
......
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