Kaydet (Commit) eb08ea4f authored tarafından Fridrich Štrba's avatar Fridrich Štrba

A little tiny insignificant cleanup

Change-Id: I285da1f12711e9e96b666a3ce1560c203870cac3
üst fd652cf5
...@@ -136,42 +136,31 @@ T602ImportFilter::~T602ImportFilter() ...@@ -136,42 +136,31 @@ T602ImportFilter::~T602ImportFilter()
} }
// XExtendedTypeDetection // XExtendedTypeDetection
::rtl::OUString T602ImportFilter::detect( Sequence<PropertyValue>& Descriptor) OUString T602ImportFilter::detect( Sequence<PropertyValue>& Descriptor)
throw(RuntimeException) throw(RuntimeException)
{ {
// checks for filter or type name would be necessary in case we want to use the filter also for "602" files
// without the magic bytes at the beginning; I leave the code as comment in case of
// ::rtl::OUString aFilterName, aTypeName;
sal_Int32 nLength = Descriptor.getLength(); sal_Int32 nLength = Descriptor.getLength();
const PropertyValue * pValue = Descriptor.getConstArray(); const PropertyValue * pValue = Descriptor.getConstArray();
for ( sal_Int32 i = 0 ; i < nLength; i++) for ( sal_Int32 i = 0 ; i < nLength; i++)
{ {
if ( pValue[i].Name == "InputStream" ) if ( pValue[i].Name == "InputStream" )
pValue[i].Value >>= mxInputStream; pValue[i].Value >>= mxInputStream;
/* else if ( pValue[i].Name == "FilterName" )
pValue[i].Value >>= aFilterName;
else if ( pValue[i].Name == "TypeName" )
pValue[i].Value >>= aTypeName; */
} }
if (!mxInputStream.is()) if (!mxInputStream.is())
return ::rtl::OUString(); return OUString();
/* if ( aFilterName == "T602Document" || aTypeName == "writer_T602_Document" )
// preselection by type (extension) or filter name: no reason to check type
return rtl::OUString( "writer_T602_Document" ); */
::com::sun::star::uno::Sequence< sal_Int8 > aData; ::com::sun::star::uno::Sequence< sal_Int8 > aData;
size_t numBytes = 4; const size_t numBytes = 4;
size_t numBytesRead = 0; size_t numBytesRead = 0;
numBytesRead = mxInputStream->readSomeBytes (aData, numBytes); numBytesRead = mxInputStream->readSomeBytes (aData, numBytes);
if ((numBytesRead != numBytes) || (aData[0] != '@') || if ((numBytesRead != numBytes) || (aData[0] != '@') ||
(aData[1] != 'C') || (aData[2] != 'T') || (aData[3] != ' ')) (aData[1] != 'C') || (aData[2] != 'T') || (aData[3] != ' '))
return ::rtl::OUString(); return OUString();
return rtl::OUString( "writer_T602_Document" ); return OUString( "writer_T602_Document" );
} }
// XFilter // XFilter
...@@ -1144,7 +1133,7 @@ ResMgr* T602ImportFilterDialog::getResMgr() ...@@ -1144,7 +1133,7 @@ ResMgr* T602ImportFilterDialog::getResMgr()
return mpResMgr; return mpResMgr;
} }
void SAL_CALL T602ImportFilterDialog::setTitle( const ::rtl::OUString& ) void SAL_CALL T602ImportFilterDialog::setTitle( const OUString& )
throw (::com::sun::star::uno::RuntimeException) throw (::com::sun::star::uno::RuntimeException)
{ {
} }
...@@ -1158,9 +1147,9 @@ sal_Int16 SAL_CALL T602ImportFilterDialog::execute() ...@@ -1158,9 +1147,9 @@ sal_Int16 SAL_CALL T602ImportFilterDialog::execute()
return com::sun::star::ui::dialogs::ExecutableDialogResults::CANCEL; return com::sun::star::ui::dialogs::ExecutableDialogResults::CANCEL;
} }
rtl::OUString T602ImportFilterDialog::getResStr( sal_Int16 resid ) OUString T602ImportFilterDialog::getResStr( sal_Int16 resid )
{ {
rtl::OUString sStr = String( ResId( resid, *getResMgr() ) ); OUString sStr( ResId( resid, *getResMgr() ) );
return sStr; return sStr;
} }
......
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