diff options
Diffstat (limited to 'starmath/source/smdetect.cxx')
-rw-r--r-- | starmath/source/smdetect.cxx | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx index 7da3838557b3..dfab23448a09 100644 --- a/starmath/source/smdetect.cxx +++ b/starmath/source/smdetect.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,7 +37,6 @@ #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <comphelper/processfactory.hxx> -#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> @@ -44,7 +44,6 @@ #include <com/sun/star/ucb/InteractiveAppException.hpp> #include <com/sun/star/ucb/XContent.hpp> #include <com/sun/star/packages/zip/ZipIOException.hpp> -#include <framework/interaction.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <ucbhelper/simpleinteractionrequest.hxx> #include <rtl/ustring.h> @@ -54,7 +53,7 @@ #include <svl/eitem.hxx> #include <svl/stritem.hxx> #include <tools/urlobj.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> #include <sot/storinfo.hxx> @@ -113,7 +112,6 @@ SmFilterDetect::~SmFilterDetect() // now some parameters that can already be in the array, but may be overwritten or new inserted here // remember their indices in the case new values must be added to the array sal_Int32 nPropertyCount = lDescriptor.getLength(); - sal_Int32 nIndexOfFilterName = -1; sal_Int32 nIndexOfInputStream = -1; sal_Int32 nIndexOfContent = -1; sal_Int32 nIndexOfReadOnlyFlag = -1; @@ -142,10 +140,6 @@ SmFilterDetect::~SmFilterDetect() { lDescriptor[nProperty].Value >>= sTemp; aPreselectedFilterName = sTemp; - - // if the preselected filter name is not correct, it must be erased after detection - // remember index of property to get access to it later - nIndexOfFilterName = nProperty; } else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("InputStream")) ) nIndexOfInputStream = nProperty; @@ -167,8 +161,7 @@ SmFilterDetect::~SmFilterDetect() } // can't check the type for external filters, so set the "dont" flag accordingly - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - //SfxFilterFlags nMust = SFX_FILTER_IMPORT, nDont = SFX_FILTER_NOTINSTALLED; + SolarMutexGuard aGuard; SfxApplication* pApp = SFX_APP(); SfxAllItemSet *pSet = new SfxAllItemSet( pApp->GetPool() ); @@ -195,9 +188,9 @@ SmFilterDetect::~SmFilterDetect() { // ctor of SfxMedium uses owner transition of ItemSet SfxMedium aMedium( aURL, bWasReadOnly ? STREAM_STD_READ : STREAM_STD_READWRITE, sal_False, NULL, pSet ); - aMedium.UseInteractionHandler( sal_True ); + aMedium.UseInteractionHandler( true ); - sal_Bool bIsStorage = aMedium.IsStorage(); + bool bIsStorage = aMedium.IsStorage(); if ( aMedium.GetErrorCode() == ERRCODE_NONE ) { // remember input stream and content and put them into the descriptor later @@ -354,7 +347,7 @@ SmFilterDetect::~SmFilterDetect() { // if input stream wasn't part of the descriptor, now it should be, otherwise the content would be opend twice lDescriptor.realloc( nPropertyCount + 1 ); - lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("InputStream"); + lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InputStream")); lDescriptor[nPropertyCount].Value <<= xStream; nPropertyCount++; } @@ -363,7 +356,7 @@ SmFilterDetect::~SmFilterDetect() { // if input stream wasn't part of the descriptor, now it should be, otherwise the content would be opend twice lDescriptor.realloc( nPropertyCount + 1 ); - lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("UCBContent"); + lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UCBContent")); lDescriptor[nPropertyCount].Value <<= xContent; nPropertyCount++; } @@ -373,7 +366,7 @@ SmFilterDetect::~SmFilterDetect() if ( nIndexOfReadOnlyFlag == -1 ) { lDescriptor.realloc( nPropertyCount + 1 ); - lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("ReadOnly"); + lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); lDescriptor[nPropertyCount].Value <<= bReadOnly; nPropertyCount++; } @@ -384,7 +377,7 @@ SmFilterDetect::~SmFilterDetect() if ( !bRepairPackage && bRepairAllowed ) { lDescriptor.realloc( nPropertyCount + 1 ); - lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("RepairPackage"); + lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage")); lDescriptor[nPropertyCount].Value <<= bRepairAllowed; nPropertyCount++; @@ -398,7 +391,7 @@ SmFilterDetect::~SmFilterDetect() if ( nIndexOfTemplateFlag == -1 ) { lDescriptor.realloc( nPropertyCount + 1 ); - lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("AsTemplate"); + lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AsTemplate")); lDescriptor[nPropertyCount].Value <<= bOpenAsTemplate; nPropertyCount++; } @@ -412,7 +405,7 @@ SmFilterDetect::~SmFilterDetect() if ( nIndexOfDocumentTitle == -1 ) { lDescriptor.realloc( nPropertyCount + 1 ); - lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("DocumentTitle"); + lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle")); lDescriptor[nPropertyCount].Value <<= aDocumentTitle; nPropertyCount++; } @@ -458,16 +451,15 @@ UNOSEQUENCE< UNOOUSTRING > SAL_CALL SmFilterDetect::getSupportedServiceNames() t /* Helper for XServiceInfo */ UNOSEQUENCE< UNOOUSTRING > SmFilterDetect::impl_getStaticSupportedServiceNames() { - UNOMUTEXGUARD aGuard( UNOMUTEX::getGlobalMutex() ); UNOSEQUENCE< UNOOUSTRING > seqServiceNames( 1 ); - seqServiceNames.getArray() [0] = UNOOUSTRING::createFromAscii( "com.sun.star.frame.ExtendedTypeDetection" ); + seqServiceNames.getArray() [0] = UNOOUSTRING(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ExtendedTypeDetection" )); return seqServiceNames ; } /* Helper for XServiceInfo */ UNOOUSTRING SmFilterDetect::impl_getStaticImplementationName() { - return UNOOUSTRING::createFromAscii( "com.sun.star.comp.math.FormatDetector" ); + return UNOOUSTRING(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.math.FormatDetector" )); } /* Helper for registry */ @@ -476,3 +468,4 @@ UNOREFERENCE< UNOXINTERFACE > SAL_CALL SmFilterDetect::impl_createInstance( cons return UNOREFERENCE< UNOXINTERFACE >( *new SmFilterDetect( xServiceManager ) ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |