[Libreoffice-commits] core.git: Branch 'feature/orcus-update' - 8 commits - sfx2/inc sfx2/source
Kohei Yoshida
kohei.yoshida at gmail.com
Tue Apr 9 08:42:53 PDT 2013
sfx2/inc/sfx2/sfxsids.hrc | 1
sfx2/source/appl/appuno.cxx | 2131 +++++++++++++++++++-------------------
sfx2/source/bastyp/fltfnc.cxx | 98 -
sfx2/source/doc/docfile.cxx | 29
sfx2/source/inc/eventsupplier.hxx | 2
5 files changed, 1145 insertions(+), 1116 deletions(-)
New commits:
commit 8785e25bc8e243ae5365aebdbabd81253203a812
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Apr 9 11:44:55 2013 -0400
com::sun::star cleanup.
Change-Id: I279441c1e1a271c76a2fec92711765134da90cac
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 53e3c26..83181be 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -79,10 +79,6 @@
#include <rtl/logfile.hxx>
#include <rtl/instance.hxx>
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::beans;
#include <svl/ctypeitm.hxx>
#include <svtools/sfxecode.hxx>
#include <unotools/syslocale.hxx>
@@ -114,6 +110,8 @@ using namespace ::com::sun::star::beans;
unsigned SfxStack::nLevel = 0;
#endif
+using namespace com::sun::star;
+
namespace
{
class theSfxFilterListener : public rtl::Static<SfxFilterListener, theSfxFilterListener> {};
@@ -380,13 +378,15 @@ sal_uInt32 SfxFilterMatcher::GuessFilterIgnoringContent(
SfxFilterFlags nMust,
SfxFilterFlags nDont ) const
{
- Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(OUString("com.sun.star.document.TypeDetection")), UNO_QUERY );
+ uno::Reference<document::XTypeDetection> xDetection(
+ comphelper::getProcessServiceFactory()->createInstance("com.sun.star.document.TypeDetection"), uno::UNO_QUERY);
+
OUString sTypeName;
try
{
sTypeName = xDetection->queryTypeByURL( rMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) );
}
- catch( Exception& )
+ catch (uno::Exception&)
{
}
@@ -415,7 +415,9 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c
const SfxFilter* pOldFilter = *ppFilter;
// no detection service -> nothing to do !
- Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(OUString("com.sun.star.document.TypeDetection")), UNO_QUERY );
+ uno::Reference<document::XTypeDetection> xDetection(
+ comphelper::getProcessServiceFactory()->createInstance("com.sun.star.document.TypeDetection"), uno::UNO_QUERY);
+
if (!xDetection.is())
return ERRCODE_ABORT;
@@ -426,7 +428,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c
// Otherwhise it will be tried more then once and show the same interaction more then once ...
OUString sURL( rMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) );
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInStream = rMedium.GetInputStream();
+ uno::Reference< io::XInputStream > xInStream = rMedium.GetInputStream();
OUString aFilterName;
// stream exists => deep detection (with preselection ... if possible)
@@ -447,7 +449,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c
aDescriptor[::comphelper::MediaDescriptor::PROP_FILTERNAME()] <<= OUString( pOldFilter->GetFilterName() );
}
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > lDescriptor = aDescriptor.getAsConstPropertyValueList();
+ uno::Sequence< beans::PropertyValue > lDescriptor = aDescriptor.getAsConstPropertyValueList();
sTypeName = xDetection->queryTypeByDescriptor(lDescriptor, sal_True); // lDescriptor is used as In/Out param ... dont use aDescriptor.getAsConstPropertyValueList() directly!
for (sal_Int32 i = 0; i < lDescriptor.getLength(); ++i)
@@ -475,7 +477,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c
// If there is no acceptable type for this document at all, the type detection has possibly returned something else.
// The DocumentService property is only a preselection, and all preselections are considered as optional!
// This "wrong" type will be sorted out now because we match only allowed filters to the detected type
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > lQuery(1);
+ uno::Sequence< beans::NamedValue > lQuery(1);
lQuery[0].Name = OUString("Name");
lQuery[0].Value <<= sTypeName;
@@ -489,7 +491,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c
}
}
}
- catch(const Exception&)
+ catch (const uno::Exception&)
{}
return ERRCODE_ABORT;
@@ -605,16 +607,16 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**
return nErr;
}
-const SfxFilter* SfxFilterMatcher::GetFilterForProps( const com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue >& aSeq, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
+const SfxFilter* SfxFilterMatcher::GetFilterForProps( const com::sun::star::uno::Sequence < beans::NamedValue >& aSeq, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery > xTypeCFG;
+ uno::Reference< lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
+ uno::Reference< container::XContainerQuery > xTypeCFG;
if( xServiceManager.is() == sal_True )
- xTypeCFG = ::com::sun::star::uno::Reference < com::sun::star::container::XContainerQuery >( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), ::com::sun::star::uno::UNO_QUERY );
+ xTypeCFG = uno::Reference < com::sun::star::container::XContainerQuery >( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), uno::UNO_QUERY );
if ( xTypeCFG.is() )
{
// make query for all types matching the properties
- ::com::sun::star::uno::Reference < com::sun::star::container::XEnumeration > xEnum = xTypeCFG->createSubSetEnumerationByProperties( aSeq );
+ uno::Reference < com::sun::star::container::XEnumeration > xEnum = xTypeCFG->createSubSetEnumerationByProperties( aSeq );
while ( xEnum->hasMoreElements() )
{
::comphelper::SequenceAsHashMap aProps( xEnum->nextElement() );
@@ -738,7 +740,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const String& rExt, SfxF
com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1);
aSeq[0].Name = OUString("Extensions");
- ::com::sun::star::uno::Sequence < OUString > aExts(1);
+ uno::Sequence < OUString > aExts(1);
aExts[0] = sExt;
aSeq[0].Value <<= aExts;
return GetFilterForProps( aSeq, nMust, nDont );
@@ -788,13 +790,13 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const String& rName, Sf
if ( bFirstRead )
{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xFilterCFG ;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xTypeCFG ;
+ uno::Reference< lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
+ uno::Reference< container::XNameAccess > xFilterCFG ;
+ uno::Reference< container::XNameAccess > xTypeCFG ;
if( xServiceManager.is() == sal_True )
{
- xFilterCFG = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.FilterFactory" ), ::com::sun::star::uno::UNO_QUERY );
- xTypeCFG = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), ::com::sun::star::uno::UNO_QUERY );
+ xFilterCFG = uno::Reference< container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.FilterFactory" ), uno::UNO_QUERY );
+ xTypeCFG = uno::Reference< container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), uno::UNO_QUERY );
}
if( xFilterCFG.is() && xTypeCFG.is() )
@@ -891,7 +893,7 @@ const SfxFilter* SfxFilterMatcherIter::Next()
helper to build own formated string from given stringlist by
using given seperator
---------------------------------------------------------------*/
-OUString implc_convertStringlistToString( const ::com::sun::star::uno::Sequence< OUString >& lList ,
+OUString implc_convertStringlistToString( const uno::Sequence< OUString >& lList ,
const sal_Unicode& cSeperator,
const OUString& sPrefix )
{
@@ -916,22 +918,22 @@ OUString implc_convertStringlistToString( const ::com::sun::star::uno::Sequence<
void SfxFilterContainer::ReadSingleFilter_Impl(
const OUString& rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xTypeCFG,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xFilterCFG,
+ const uno::Reference< container::XNameAccess >& xTypeCFG,
+ const uno::Reference< container::XNameAccess >& xFilterCFG,
sal_Bool bUpdate
)
{
OUString sFilterName( rName );
SfxFilterList_Impl& rList = *pFilterArr;
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > lFilterProperties;
- ::com::sun::star::uno::Any aResult;
+ uno::Sequence< beans::PropertyValue > lFilterProperties;
+ uno::Any aResult;
try
{
aResult = xFilterCFG->getByName( sFilterName );
}
- catch( ::com::sun::star::container::NoSuchElementException& )
+ catch( container::NoSuchElementException& )
{
- aResult = ::com::sun::star::uno::Any();
+ aResult = uno::Any();
}
if( aResult >>= lFilterProperties )
@@ -975,7 +977,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
}
else if ( lFilterProperties[nFilterProperty].Name == "UserData" )
{
- ::com::sun::star::uno::Sequence< OUString > lUserData;
+ uno::Sequence< OUString > lUserData;
lFilterProperties[nFilterProperty].Value >>= lUserData;
sUserData = implc_convertStringlistToString( lUserData, ',', OUString() );
}
@@ -999,12 +1001,12 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
{
aResult = xTypeCFG->getByName( sType );
}
- catch (const ::com::sun::star::container::NoSuchElementException&)
+ catch (const container::NoSuchElementException&)
{
- aResult = ::com::sun::star::uno::Any();
+ aResult = uno::Any();
}
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > lTypeProperties;
+ uno::Sequence< beans::PropertyValue > lTypeProperties;
if( aResult >>= lTypeProperties )
{
// get indirect available properties then (types)
@@ -1028,14 +1030,14 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
{
if (sExtension.isEmpty())
{
- ::com::sun::star::uno::Sequence< OUString > lExtensions;
+ uno::Sequence< OUString > lExtensions;
lTypeProperties[nTypeProperty].Value >>= lExtensions;
sExtension = implc_convertStringlistToString( lExtensions, ';', "*." );
}
}
else if ( lTypeProperties[nTypeProperty].Name == "URLPattern" )
{
- ::com::sun::star::uno::Sequence< OUString > lPattern;
+ uno::Sequence< OUString > lPattern;
lTypeProperties[nTypeProperty].Value >>= lPattern;
sPattern = implc_convertStringlistToString( lPattern, ';', OUString() );
}
@@ -1123,13 +1125,13 @@ void SfxFilterContainer::ReadFilters_Impl( sal_Bool bUpdate )
try
{
// get the FilterFactory service to access the registered filters ... and types!
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xFilterCFG ;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xTypeCFG ;
+ uno::Reference< lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
+ uno::Reference< container::XNameAccess > xFilterCFG ;
+ uno::Reference< container::XNameAccess > xTypeCFG ;
if( xServiceManager.is() == sal_True )
{
- xFilterCFG = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.FilterFactory" ), ::com::sun::star::uno::UNO_QUERY );
- xTypeCFG = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), ::com::sun::star::uno::UNO_QUERY );
+ xFilterCFG = uno::Reference< container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.FilterFactory" ), uno::UNO_QUERY );
+ xTypeCFG = uno::Reference< container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), uno::UNO_QUERY );
}
if(
@@ -1138,7 +1140,7 @@ void SfxFilterContainer::ReadFilters_Impl( sal_Bool bUpdate )
)
{
// select right query to get right set of filters for search modul
- ::com::sun::star::uno::Sequence< OUString > lFilterNames = xFilterCFG->getElementNames();
+ uno::Sequence< OUString > lFilterNames = xFilterCFG->getElementNames();
if ( lFilterNames.getLength() )
{
// If list of filters already exist ...
@@ -1169,7 +1171,7 @@ void SfxFilterContainer::ReadFilters_Impl( sal_Bool bUpdate )
}
}
}
- catch(const ::com::sun::star::uno::Exception&)
+ catch(const uno::Exception&)
{
DBG_ASSERT( sal_False, "SfxFilterContainer::ReadFilter()\nException detected. Possible not all filters could be cached.\n" );
}
commit 7e6f98cf8a193f4e6c84e578ffa1596c63275d7c
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Apr 9 11:34:45 2013 -0400
Make the member mutable to avoid ugly casting.
Change-Id: I28fd84b89a8d443e502d2c0e76f38cf006a57d4a
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index ff9d51c..53e3c26 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -248,10 +248,10 @@ class SfxFilterMatcher_Impl
{
public:
OUString aName;
- SfxFilterList_Impl* pList; // is created on demand
+ mutable SfxFilterList_Impl* pList; // is created on demand
void InitForIterating() const;
- void Update();
+ void Update() const;
SfxFilterMatcher_Impl(const OUString &rName)
: aName(rName)
, pList(0)
@@ -321,7 +321,7 @@ SfxFilterMatcher::~SfxFilterMatcher()
aImplArr.clear();
}
-void SfxFilterMatcher_Impl::Update()
+void SfxFilterMatcher_Impl::Update() const
{
if ( pList )
{
@@ -348,13 +348,13 @@ void SfxFilterMatcher_Impl::InitForIterating() const
if ( !aName.isEmpty() )
{
// matcher of factory: use only filters of that document type
- ((SfxFilterMatcher_Impl*)this)->pList = new SfxFilterList_Impl;
- ((SfxFilterMatcher_Impl*)this)->Update();
+ pList = new SfxFilterList_Impl;
+ Update();
}
else
{
// global matcher: use global filter array
- ((SfxFilterMatcher_Impl*)this)->pList = pFilterArr;
+ pList = pFilterArr;
}
}
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 5c15239..edd5fed 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2873,11 +2873,28 @@ SfxMedium::SfxMedium( const uno::Sequence<beans::PropertyValue>& aArgs ) :
pImp->m_pSet = pParams;
TransformParameters( SID_OPENDOC, aArgs, *pParams );
- String aFilterName;
- SFX_ITEMSET_ARG( pImp->m_pSet, pFilterNameItem, SfxStringItem, SID_FILTER_NAME, false );
- if( pFilterNameItem )
- aFilterName = pFilterNameItem->GetValue();
- pImp->m_pFilter = SFX_APP()->GetFilterMatcher().GetFilter4FilterName( aFilterName );
+ OUString aFilterProvider;
+ {
+ const SfxPoolItem* pItem = NULL;
+ if (pImp->m_pSet->HasItem(SID_FILTER_PROVIDER, &pItem))
+ aFilterProvider = static_cast<const SfxStringItem*>(pItem)->GetValue();
+ }
+
+ fprintf(stdout, "SfxMedium::SfxMedium: filter provider = '%s'\n", rtl::OUStringToOString(aFilterProvider, RTL_TEXTENCODING_UTF8).getStr());
+ if (aFilterProvider.isEmpty())
+ {
+ // This is a conventional filter type.
+ OUString aFilterName;
+ SFX_ITEMSET_ARG( pImp->m_pSet, pFilterNameItem, SfxStringItem, SID_FILTER_NAME, false );
+ if( pFilterNameItem )
+ aFilterName = pFilterNameItem->GetValue();
+ pImp->m_pFilter = SFX_APP()->GetFilterMatcher().GetFilter4FilterName( aFilterName );
+ }
+ else
+ {
+ // This filter is from an external provider such as orcus.
+
+ }
SFX_ITEMSET_ARG( pImp->m_pSet, pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, false );
if( pSalvageItem )
commit 059c683746b1766457c7a9ca0694a850d47ad234
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Apr 9 10:57:06 2013 -0400
Reduce indentation by early bail-out.
Change-Id: I8430d030fdfce51d3706c801ce8d2cb3fa6eed5d
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 4c07dae..b707761 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -1366,342 +1366,343 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
}
}
}
+
+ rArgs = aSequ;
+ return;
}
- else
+
+ // slot is a method
+ sal_uInt16 nFormalArgs = pSlot->GetFormalArgumentCount();
+ for ( sal_uInt16 nArg=0; nArg<nFormalArgs; ++nArg )
{
- // slot is a method
- sal_uInt16 nFormalArgs = pSlot->GetFormalArgumentCount();
- for ( sal_uInt16 nArg=0; nArg<nFormalArgs; ++nArg )
+ const SfxFormalArgument &rArg = pSlot->GetFormalArgument( nArg );
+ sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId );
+ sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP );
+ SFX_ITEMSET_ARG( &rSet, pItem, SfxPoolItem, nWhich, sal_False );
+ if ( pItem ) //???
{
- const SfxFormalArgument &rArg = pSlot->GetFormalArgument( nArg );
- sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId );
- sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP );
- SFX_ITEMSET_ARG( &rSet, pItem, SfxPoolItem, nWhich, sal_False );
- if ( pItem ) //???
+ sal_uInt16 nSubCount = rArg.pType->nAttribs;
+ if ( !nSubCount )
{
- sal_uInt16 nSubCount = rArg.pType->nAttribs;
- if ( !nSubCount )
+ pValue[nActProp].Name = OUString::createFromAscii( rArg.pName ) ;
+ if ( !pItem->QueryValue( pValue[nActProp++].Value ) )
{
- pValue[nActProp].Name = OUString::createFromAscii( rArg.pName ) ;
- if ( !pItem->QueryValue( pValue[nActProp++].Value ) )
+ OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
+ "Item not convertable: "));
+ aStr.append(static_cast<sal_Int32>(rArg.nSlotId));
+ OSL_FAIL(aStr.getStr());
+ }
+ }
+ else
+ {
+ // complex type, add a property value for every member of the struct
+ for ( sal_uInt16 n = 1; n <= nSubCount; ++n )
+ {
+ sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) rArg.pType->aAttrib[n-1].nAID;
+ if ( bConvertTwips )
+ nSubId |= CONVERT_TWIPS;
+
+ DBG_ASSERT((rArg.pType->aAttrib[n-1].nAID) <= 127, "Member ID out of range" );
+ String aName( OUString::createFromAscii( rArg.pName ) ) ;
+ aName += '.';
+ aName += OUString::createFromAscii( rArg.pType->aAttrib[n-1].pName ) ;
+ pValue[nActProp].Name = aName;
+ if ( !pItem->QueryValue( pValue[nActProp++].Value, nSubId ) )
{
OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
- "Item not convertable: "));
+ "Sub item "));
+ aStr.append(static_cast<sal_Int32>(
+ rArg.pType->aAttrib[n-1].nAID));
+ aStr.append(RTL_CONSTASCII_STRINGPARAM(
+ " not convertable in slot: "));
aStr.append(static_cast<sal_Int32>(rArg.nSlotId));
OSL_FAIL(aStr.getStr());
}
}
- else
- {
- // complex type, add a property value for every member of the struct
- for ( sal_uInt16 n = 1; n <= nSubCount; ++n )
- {
- sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) rArg.pType->aAttrib[n-1].nAID;
- if ( bConvertTwips )
- nSubId |= CONVERT_TWIPS;
-
- DBG_ASSERT((rArg.pType->aAttrib[n-1].nAID) <= 127, "Member ID out of range" );
- String aName( OUString::createFromAscii( rArg.pName ) ) ;
- aName += '.';
- aName += OUString::createFromAscii( rArg.pType->aAttrib[n-1].pName ) ;
- pValue[nActProp].Name = aName;
- if ( !pItem->QueryValue( pValue[nActProp++].Value, nSubId ) )
- {
- OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
- "Sub item "));
- aStr.append(static_cast<sal_Int32>(
- rArg.pType->aAttrib[n-1].nAID));
- aStr.append(RTL_CONSTASCII_STRINGPARAM(
- " not convertable in slot: "));
- aStr.append(static_cast<sal_Int32>(rArg.nSlotId));
- OSL_FAIL(aStr.getStr());
- }
- }
- }
}
}
+ }
- if ( nSlotId == SID_OPENDOC || nSlotId == SID_EXPORTDOC || nSlotId == SID_SAVEASDOC || nSlotId == SID_SAVEDOC ||
- nSlotId == SID_SAVETO || nSlotId == SID_EXPORTDOCASPDF || nSlotId == SID_DIRECTEXPORTDOCASPDF )
+ if ( nSlotId == SID_OPENDOC || nSlotId == SID_EXPORTDOC || nSlotId == SID_SAVEASDOC || nSlotId == SID_SAVEDOC ||
+ nSlotId == SID_SAVETO || nSlotId == SID_EXPORTDOCASPDF || nSlotId == SID_DIRECTEXPORTDOCASPDF )
+ {
+ const SfxPoolItem *pItem=0;
+ if ( rSet.GetItemState( SID_COMPONENTDATA, sal_False, &pItem ) == SFX_ITEM_SET )
{
- const SfxPoolItem *pItem=0;
- if ( rSet.GetItemState( SID_COMPONENTDATA, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sComponentData);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_COMPONENTCONTEXT, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sComponentContext);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_PROGRESS_STATUSBAR_CONTROL, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sStatusInd);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_INTERACTIONHANDLER, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sInteractionHdl);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_VIEW_DATA, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sViewData);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_FILTER_DATA, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sFilterData);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_DOCUMENT, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sModel);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_CONTENT, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sUCBContent);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_INPUTSTREAM, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sInputStream);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_STREAM, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sStream);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_OUTPUTSTREAM, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sOutputStream);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_POSTDATA, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sPostData);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_FILLFRAME, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sFrame);
- if ( pItem->ISA( SfxUsrAnyItem ) )
- {
- OSL_FAIL( "TransformItems: transporting an XFrame via an SfxUsrAnyItem is not deprecated!" );
- pValue[nActProp++].Value = static_cast< const SfxUsrAnyItem* >( pItem )->GetValue();
- }
- else if ( pItem->ISA( SfxUnoFrameItem ) )
- pValue[nActProp++].Value <<= static_cast< const SfxUnoFrameItem* >( pItem )->GetFrame();
- else
- OSL_FAIL( "TransformItems: invalid item type for SID_FILLFRAME!" );
- }
- if ( rSet.GetItemState( SID_TEMPLATE, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sAsTemplate);
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_OPEN_NEW_VIEW, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sOpenNewView);
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_FAIL_ON_WARNING, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(RTL_CONSTASCII_USTRINGPARAM(sFailOnWarning));
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_VIEW_ID, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sViewId);
- pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_PLUGIN_MODE, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sPluginMode);
- pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_DOC_READONLY, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sReadOnly);
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sDdeReconnect);
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sStartPresentation);
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_SELECTION, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sSelectionOnly);
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_HIDDEN, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sHidden);
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_MINIMIZED, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sMinimized);
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_SILENT, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sSilent);
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_PREVIEW, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sPreview);
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_VIEWONLY, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sViewOnly);
- pValue[nActProp++].Value <<= (sal_Bool) (( ((SfxBoolItem*)pItem)->GetValue() ));
- }
- if ( rSet.GetItemState( SID_EDITDOC, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sDontEdit);
- pValue[nActProp++].Value <<= (sal_Bool) (!( ((SfxBoolItem*)pItem)->GetValue() ));
- }
- if ( rSet.GetItemState( SID_FILE_DIALOG, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sUseSystemDialog);
- pValue[nActProp++].Value <<= (sal_Bool) ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_STANDARD_DIR, sal_False, &pItem ) == SFX_ITEM_SET )
+ pValue[nActProp].Name = OUString(sComponentData);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_COMPONENTCONTEXT, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sComponentContext);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_PROGRESS_STATUSBAR_CONTROL, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sStatusInd);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_INTERACTIONHANDLER, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sInteractionHdl);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_VIEW_DATA, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sViewData);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_FILTER_DATA, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sFilterData);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_DOCUMENT, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sModel);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_CONTENT, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sUCBContent);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_INPUTSTREAM, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sInputStream);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_STREAM, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sStream);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_OUTPUTSTREAM, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sOutputStream);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_POSTDATA, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sPostData);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_FILLFRAME, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sFrame);
+ if ( pItem->ISA( SfxUsrAnyItem ) )
{
- pValue[nActProp].Name = OUString(sStandardDir);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ OSL_FAIL( "TransformItems: transporting an XFrame via an SfxUsrAnyItem is not deprecated!" );
+ pValue[nActProp++].Value = static_cast< const SfxUsrAnyItem* >( pItem )->GetValue();
}
- if ( rSet.GetItemState( SID_BLACK_LIST, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sBlackList);
+ else if ( pItem->ISA( SfxUnoFrameItem ) )
+ pValue[nActProp++].Value <<= static_cast< const SfxUnoFrameItem* >( pItem )->GetFrame();
+ else
+ OSL_FAIL( "TransformItems: invalid item type for SID_FILLFRAME!" );
+ }
+ if ( rSet.GetItemState( SID_TEMPLATE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sAsTemplate);
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_OPEN_NEW_VIEW, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sOpenNewView);
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_FAIL_ON_WARNING, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(RTL_CONSTASCII_USTRINGPARAM(sFailOnWarning));
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_VIEW_ID, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sViewId);
+ pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_PLUGIN_MODE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sPluginMode);
+ pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_DOC_READONLY, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sReadOnly);
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sDdeReconnect);
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sStartPresentation);
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_SELECTION, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sSelectionOnly);
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_HIDDEN, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sHidden);
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_MINIMIZED, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sMinimized);
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_SILENT, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sSilent);
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_PREVIEW, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sPreview);
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_VIEWONLY, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sViewOnly);
+ pValue[nActProp++].Value <<= (sal_Bool) (( ((SfxBoolItem*)pItem)->GetValue() ));
+ }
+ if ( rSet.GetItemState( SID_EDITDOC, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sDontEdit);
+ pValue[nActProp++].Value <<= (sal_Bool) (!( ((SfxBoolItem*)pItem)->GetValue() ));
+ }
+ if ( rSet.GetItemState( SID_FILE_DIALOG, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sUseSystemDialog);
+ pValue[nActProp++].Value <<= (sal_Bool) ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_STANDARD_DIR, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sStandardDir);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_BLACK_LIST, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sBlackList);
- com::sun::star::uno::Sequence< OUString > aList;
- ((SfxStringListItem*)pItem)->GetStringList( aList );
- pValue[nActProp++].Value <<= aList ;
- }
- if ( rSet.GetItemState( SID_TARGETNAME, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sFrameName);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_DOC_SALVAGE, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sSalvagedFile);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_PATH, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sFolderName);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_CONTENTTYPE, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sMediaType);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_TEMPLATE_NAME, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sTemplateName);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_TEMPLATE_REGIONNAME, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sTemplateRegionName);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_JUMPMARK, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sJumpMark);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
+ com::sun::star::uno::Sequence< OUString > aList;
+ ((SfxStringListItem*)pItem)->GetStringList( aList );
+ pValue[nActProp++].Value <<= aList ;
+ }
+ if ( rSet.GetItemState( SID_TARGETNAME, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sFrameName);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_DOC_SALVAGE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sSalvagedFile);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_PATH, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sFolderName);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_CONTENTTYPE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sMediaType);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_TEMPLATE_NAME, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sTemplateName);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_TEMPLATE_REGIONNAME, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sTemplateRegionName);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_JUMPMARK, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sJumpMark);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
- if ( rSet.GetItemState( SID_CHARSET, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sCharacterSet);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_MACROEXECMODE, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sMacroExecMode);
- pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_UPDATEDOCMODE, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sUpdateDocMode);
- pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_REPAIRPACKAGE, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sRepairPackage);
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_DOCINFO_TITLE, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sDocumentTitle);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_DOC_BASEURL, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sDocumentBaseURL);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_DOC_HIERARCHICALNAME, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sHierarchicalDocumentName);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_COPY_STREAM_IF_POSSIBLE, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sCopyStreamIfPossible);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_NOAUTOSAVE, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sNoAutoSave);
- pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_MODIFYPASSWORDINFO, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sModifyPasswordInfo);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_ENCRYPTIONDATA, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sEncryptionData);
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
- }
- if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sSuggestedSaveAsDir);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sSuggestedSaveAsName);
- pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_DOC_SERVICE, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = OUString(sDocumentService);
- pValue[nActProp++].Value <<= OUString(static_cast<const SfxStringItem*>(pItem)->GetValue());
- }
- if (rSet.HasItem(SID_FILTER_PROVIDER, &pItem))
- {
- pValue[nActProp].Name = sFilterProvider;
- pValue[nActProp++].Value <<= OUString(static_cast<const SfxStringItem*>(pItem)->GetValue());
- }
+ if ( rSet.GetItemState( SID_CHARSET, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sCharacterSet);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_MACROEXECMODE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sMacroExecMode);
+ pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_UPDATEDOCMODE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sUpdateDocMode);
+ pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_REPAIRPACKAGE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sRepairPackage);
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_DOCINFO_TITLE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sDocumentTitle);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_DOC_BASEURL, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sDocumentBaseURL);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_DOC_HIERARCHICALNAME, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sHierarchicalDocumentName);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_COPY_STREAM_IF_POSSIBLE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sCopyStreamIfPossible);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_NOAUTOSAVE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sNoAutoSave);
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_MODIFYPASSWORDINFO, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sModifyPasswordInfo);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_ENCRYPTIONDATA, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sEncryptionData);
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sSuggestedSaveAsDir);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sSuggestedSaveAsName);
+ pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_DOC_SERVICE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = OUString(sDocumentService);
+ pValue[nActProp++].Value <<= OUString(static_cast<const SfxStringItem*>(pItem)->GetValue());
+ }
+ if (rSet.HasItem(SID_FILTER_PROVIDER, &pItem))
+ {
+ pValue[nActProp].Name = sFilterProvider;
+ pValue[nActProp++].Value <<= OUString(static_cast<const SfxStringItem*>(pItem)->GetValue());
}
}
commit a1513694293256e8efcb7340d59bb3d092e82991
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Apr 9 10:31:51 2013 -0400
Store filter provider property with SfxMedium.
Change-Id: I4ee6eed94cdfd8a8a514a79a33a1ccb4ff586ce5
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 12198b6..7130f06 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -148,6 +148,7 @@
#define SID_CHECKOUT (SID_SFX_START + 512)
#define SID_CANCELCHECKOUT (SID_SFX_START + 513)
#define SID_CHECKIN (SID_SFX_START + 514)
+#define SID_FILTER_PROVIDER (SID_SFX_START + 515)
#define SID_FORCERELOAD (SID_SFX_START + 1502)
#define SID_FILE_DIALOG (SID_SFX_START + 304)
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 340bd94..4c07dae 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -203,6 +203,7 @@ static char const sSuggestedSaveAsName[] = "SuggestedSaveAsName";
static char const sEncryptionData[] = "EncryptionData";
static char const sFailOnWarning[] = "FailOnWarning";
static char const sDocumentService[] = "DocumentService";
+static char const sFilterProvider[] = "FilterProvider";
static bool isMediaDescriptor( sal_uInt16 nSlotId )
{
@@ -509,7 +510,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
++nFoundArgs;
#endif
const beans::PropertyValue& rProp = pPropsVal[n];
- OUString aName = rProp.Name;
+ const OUString& aName = rProp.Name;
if ( aName == sModel )
rSet.Put( SfxUnoAnyItem( SID_DOCUMENT, rProp.Value ) );
else if ( aName == sComponentData )
@@ -912,6 +913,13 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
if (bOK)
rSet.Put(SfxStringItem(SID_DOC_SERVICE, aVal));
}
+ else if (aName == sFilterProvider)
+ {
+ OUString aVal;
+ bool bOK = ((rProp.Value >>= aVal) && !aVal.isEmpty());
+ if (bOK)
+ rSet.Put(SfxStringItem(SID_FILTER_PROVIDER, aVal));
+ }
#ifdef DBG_UTIL
else
--nFoundArgs;
@@ -1138,6 +1146,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
nAdditional++;
if ( rSet.GetItemState( SID_DOC_SERVICE ) == SFX_ITEM_SET )
nAdditional++;
+ if (rSet.HasItem(SID_FILTER_PROVIDER))
+ ++nAdditional;
// consider additional arguments
nProps += nAdditional;
@@ -1277,6 +1287,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
continue;
if ( nId == SID_DOC_SERVICE )
continue;
+ if (nId == SID_FILTER_PROVIDER)
+ continue;
// used only internally
if ( nId == SID_SAVETO )
@@ -1685,6 +1697,11 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
pValue[nActProp].Name = OUString(sDocumentService);
pValue[nActProp++].Value <<= OUString(static_cast<const SfxStringItem*>(pItem)->GetValue());
}
+ if (rSet.HasItem(SID_FILTER_PROVIDER, &pItem))
+ {
+ pValue[nActProp].Name = sFilterProvider;
+ pValue[nActProp++].Value <<= OUString(static_cast<const SfxStringItem*>(pItem)->GetValue());
+ }
}
}
commit 5c09c2d7edc693cff006fa4fe475c520bb21fc0c
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Apr 9 09:38:12 2013 -0400
Use scoped_ptr for this for better exception safety.
Change-Id: I7f14972e562845eb260b3d567c3fbabda2524d41
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 5f39baa..340bd94 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -110,6 +110,8 @@
#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
#include <com/sun/star/ucb/XContent.hpp>
+#include <boost/scoped_ptr.hpp>
+
#define PROTOCOLHANDLER_SERVICENAME "com.sun.star.frame.ProtocolHandler"
using namespace ::com::sun::star;
@@ -232,7 +234,8 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
{
// slot is a property
const SfxType* pType = pSlot->GetType();
- SfxPoolItem* pItem = pType->CreateItem();
+ boost::scoped_ptr<SfxPoolItem> pItem(pType->CreateItem());
+
if ( !pItem )
{
#ifdef DBG_UTIL
@@ -338,8 +341,6 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
rSet.Put( *pItem );
}
- delete pItem;
-
return;
}
@@ -355,7 +356,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
for ( sal_uInt16 nArgs=0; nArgs<nMaxArgs; nArgs++ )
{
const SfxFormalArgument &rArg = bIsMediaDescriptor ? aFormalArgs[nArgs] : pSlot->GetFormalArgument( nArgs );
- SfxPoolItem* pItem = rArg.CreateItem();
+ boost::scoped_ptr<SfxPoolItem> pItem(rArg.CreateItem());
if ( !pItem )
{
#ifdef DBG_UTIL
@@ -472,8 +473,6 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
}
}
-
- delete pItem;
}
// special additional parameters for some slots not seen in the slot definitions
commit 9b54398ffd0c34dd4653820b1d864425c99634bf
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Apr 9 09:35:24 2013 -0400
Sort the header includes and get it to build.
Change-Id: Iaef855c4829f5b6fc6a0016fd2697c761ed1ea9a
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 096d578..5f39baa 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -20,70 +20,97 @@
#ifdef _MSC_VER
#pragma warning( disable : 4290 )
#endif
-#include <com/sun/star/document/UpdateDocMode.hpp>
-#include "sal/config.h"
+#include "sfx2/appuno.hxx"
-#include <sfx2/appuno.hxx>
+#include "SfxDocumentMetaData.hxx"
#include "appbaslib.hxx"
-
+#include "doctemplates.hxx"
+#include "eventsupplier.hxx"
+#include "fltoptint.hxx"
+#include "frmload.hxx"
+#include "iframe.hxx"
+#include "objshimp.hxx"
+#include "plugin.hxx"
+#include "sfx2/app.hxx"
+#include "sfx2/brokenpackageint.hxx"
+#include "sfx2/dispatch.hxx"
#include "sfx2/dllapi.h"
+#include "sfx2/docfile.hxx"
+#include "sfx2/fcontnr.hxx"
+#include "sfx2/frame.hxx"
+#include "sfx2/module.hxx"
+#include "sfx2/msg.hxx"
+#include "sfx2/msgpool.hxx"
+#include "sfx2/objsh.hxx"
+#include "sfx2/request.hxx"
+#include "sfx2/sfxbasecontroller.hxx"
+#include "sfx2/sfxsids.hrc"
+#include "sfx2/sfxuno.hxx"
+#include "sfx2/unoctitm.hxx"
+#include "sfxslots.hxx"
+#include "sfxtypes.hxx"
+#include "shutdownicon.hxx"
+#include "xpackcreator.hxx"
+#include "sal/config.h"
+#include <basic/basmgr.hxx>
+#include <basic/sberrors.hxx>
+#include <basic/sbmeth.hxx>
+#include <basic/sbuno.hxx>
#include <basic/sbx.hxx>
+#include <basic/sbxcore.hxx>
+#include <basic/sbxmeth.hxx>
+#include <basic/sbxobj.hxx>
+#include <comphelper/interaction.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/sequence.hxx>
+#include <framework/documentundoguard.hxx>
+#include <osl/mutex.hxx>
+#include <ownsubfilterservice.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <svl/eitem.hxx>
+#include <svl/intitem.hxx>
#include <svl/itempool.hxx>
+#include <svl/lckbitem.hxx>
+#include <svl/ownlist.hxx>
#include <svl/rectitem.hxx>
+#include <svl/slstitm.hxx>
+#include <svl/stritem.hxx>
+#include <tools/config.hxx>
#include <tools/debug.hxx>
-
#include <tools/urlobj.hxx>
-#include <tools/config.hxx>
-#include <basic/sbxmeth.hxx>
-#include <basic/sbmeth.hxx>
-#include <basic/sbxobj.hxx>
-#include <basic/sberrors.hxx>
-#include <basic/basmgr.hxx>
-#include <basic/sbuno.hxx>
-#include <basic/sbxcore.hxx>
-#include <svl/ownlist.hxx>
-#include <svl/lckbitem.hxx>
-#include <svl/stritem.hxx>
-#include <svl/slstitm.hxx>
-#include <svl/intitem.hxx>
-#include <svl/eitem.hxx>
-#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
-#include <com/sun/star/task/XInteractionHandler.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/awt/XButton.hpp>
+#include <com/sun/star/awt/XTopWindow.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/frame/XFrameActionListener.hpp>
-#include <com/sun/star/frame/XComponentLoader.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/FrameActionEvent.hpp>
-#include <com/sun/star/frame/FrameAction.hpp>
+#include <com/sun/star/container/ContainerEvent.hpp>
#include <com/sun/star/container/XContainer.hpp>
-#include <com/sun/star/container/XIndexContainer.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/container/XContainerListener.hpp>
-#include <com/sun/star/container/XSet.hpp>
-#include <com/sun/star/container/ContainerEvent.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/container/XIndexReplace.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/awt/XTopWindow.hpp>
-#include <com/sun/star/awt/XWindow.hpp>
-#include <com/sun/star/awt/PosSize.hpp>
-#include <com/sun/star/registry/RegistryValueType.hpp>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/awt/XButton.hpp>
+#include <com/sun/star/container/XNameReplace.hpp>
+#include <com/sun/star/container/XSet.hpp>
+#include <com/sun/star/document/MacroExecMode.hpp>
+#include <com/sun/star/document/UpdateDocMode.hpp>
#include <com/sun/star/frame/DispatchResultEvent.hpp>
#include <com/sun/star/frame/DispatchResultState.hpp>
+#include <com/sun/star/frame/FrameAction.hpp>
+#include <com/sun/star/frame/FrameActionEvent.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XFrameActionListener.hpp>
#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/document/MacroExecMode.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/registry/RegistryValueType.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
#include <com/sun/star/ucb/XContent.hpp>
-#include <osl/mutex.hxx>
-#include <comphelper/sequence.hxx>
-#include <framework/documentundoguard.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <comphelper/interaction.hxx>
+#define PROTOCOLHANDLER_SERVICENAME "com.sun.star.frame.ProtocolHandler"
using namespace ::com::sun::star;
using namespace ::com::sun::star::ucb;
@@ -93,38 +120,6 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::io;
-#include "sfxtypes.hxx"
-#include <sfx2/sfxuno.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/sfxsids.hrc>
-#include <sfx2/msg.hxx>
-#include <sfx2/msgpool.hxx>
-#include <sfx2/request.hxx>
-#include <sfx2/module.hxx>
-#include <sfx2/fcontnr.hxx>
-#include "frmload.hxx"
-#include <sfx2/frame.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/unoctitm.hxx>
-#include <sfx2/dispatch.hxx>
-#include "doctemplates.hxx"
-#include "shutdownicon.hxx"
-#include "objshimp.hxx"
-#include "fltoptint.hxx"
-#include <sfx2/docfile.hxx>
-#include <sfx2/sfxbasecontroller.hxx>
-#include <sfx2/brokenpackageint.hxx>
-#include "eventsupplier.hxx"
-#include "xpackcreator.hxx"
-#include "plugin.hxx"
-#include "iframe.hxx"
-#include <ownsubfilterservice.hxx>
-#include "SfxDocumentMetaData.hxx"
-
-#define PROTOCOLHANDLER_SERVICENAME "com.sun.star.frame.ProtocolHandler"
-
-#include <sfxslots.hxx>
-
// needs to be converted to a better data structure
SfxFormalArgument aFormalArgs[] = {
SFX_ARGUMENT(SID_DEFAULTFILENAME,"SuggestedSaveAsName",SfxStringItem),
diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx
index 8420918..56d4774 100644
--- a/sfx2/source/inc/eventsupplier.hxx
+++ b/sfx2/source/inc/eventsupplier.hxx
@@ -63,8 +63,6 @@ class SfxEvents_Impl : public ::cppu::WeakImplHelper2< css::container::XNameRepl
::osl::Mutex maMutex;
SfxObjectShell *mpObjShell;
- sal_Bool Warn_Impl( const String& );
-
public:
SfxEvents_Impl( SfxObjectShell* pShell,
css::uno::Reference< css::document::XEventBroadcaster > xBroadcaster );
commit d54fc07095f175f9c063393936f96369e5653e5b
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Apr 9 09:28:37 2013 -0400
The 'else if (nCount)' check is not necessary; remove it for less indentation.
We check for nCount != 0 earlier.
Change-Id: Ibdb099fc651210263b8f23182796a8d56a531591
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 02e80b7..096d578 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -344,615 +344,617 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
}
delete pItem;
+
+ return;
}
- else if ( nCount )
- {
+
+ OSL_ASSERT(nCount > 0);
+
#ifdef DBG_UTIL
- // detect parameters that don't match to any formal argument or one of its members
- sal_Int32 nFoundArgs = 0;
+ // detect parameters that don't match to any formal argument or one of its members
+ sal_Int32 nFoundArgs = 0;
#endif
- // slot is a method
- bool bIsMediaDescriptor = isMediaDescriptor( nSlotId );
- sal_uInt16 nMaxArgs = bIsMediaDescriptor ? nMediaArgsCount : pSlot->nArgDefCount;
- for ( sal_uInt16 nArgs=0; nArgs<nMaxArgs; nArgs++ )
+ // slot is a method
+ bool bIsMediaDescriptor = isMediaDescriptor( nSlotId );
+ sal_uInt16 nMaxArgs = bIsMediaDescriptor ? nMediaArgsCount : pSlot->nArgDefCount;
+ for ( sal_uInt16 nArgs=0; nArgs<nMaxArgs; nArgs++ )
+ {
+ const SfxFormalArgument &rArg = bIsMediaDescriptor ? aFormalArgs[nArgs] : pSlot->GetFormalArgument( nArgs );
+ SfxPoolItem* pItem = rArg.CreateItem();
+ if ( !pItem )
{
- const SfxFormalArgument &rArg = bIsMediaDescriptor ? aFormalArgs[nArgs] : pSlot->GetFormalArgument( nArgs );
- SfxPoolItem* pItem = rArg.CreateItem();
- if ( !pItem )
- {
#ifdef DBG_UTIL
- OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("No creator method for argument: "));
- aStr.append(rArg.pName);
- OSL_FAIL( aStr.getStr() );
+ OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("No creator method for argument: "));
+ aStr.append(rArg.pName);
+ OSL_FAIL( aStr.getStr() );
#endif
- return;
- }
+ return;
+ }
- sal_uInt16 nWhich = rSet.GetPool()->GetWhich(rArg.nSlotId);
- sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP );
- pItem->SetWhich( nWhich );
- const SfxType* pType = rArg.pType;
- sal_uInt16 nSubCount = pType->nAttribs;
- if ( nSubCount == 0 )
+ sal_uInt16 nWhich = rSet.GetPool()->GetWhich(rArg.nSlotId);
+ sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP );
+ pItem->SetWhich( nWhich );
+ const SfxType* pType = rArg.pType;
+ sal_uInt16 nSubCount = pType->nAttribs;
+ if ( nSubCount == 0 )
+ {
+ // "simple" (base type) argument
+ for ( sal_uInt16 n=0; n<nCount; n++ )
{
- // "simple" (base type) argument
- for ( sal_uInt16 n=0; n<nCount; n++ )
+ const beans::PropertyValue& rProp = pPropsVal[n];
+ String aName = rProp.Name;
+ if ( aName.CompareToAscii(rArg.pName) == COMPARE_EQUAL )
{
- const beans::PropertyValue& rProp = pPropsVal[n];
- String aName = rProp.Name;
- if ( aName.CompareToAscii(rArg.pName) == COMPARE_EQUAL )
- {
#ifdef DBG_UTIL
- ++nFoundArgs;
+ ++nFoundArgs;
#endif
- if( pItem->PutValue( rProp.Value ) )
- // only use successfully converted items
- rSet.Put( *pItem );
+ if( pItem->PutValue( rProp.Value ) )
+ // only use successfully converted items
+ rSet.Put( *pItem );
#ifdef DBG_UTIL
- else
- {
- OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Property not convertable: "));
- aStr.append(rArg.pName);
- OSL_FAIL( aStr.getStr() );
- }
-#endif
- break;
+ else
+ {
+ OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Property not convertable: "));
+ aStr.append(rArg.pName);
+ OSL_FAIL( aStr.getStr() );
}
+#endif
+ break;
}
}
- else
+ }
+ else
+ {
+ // complex argument, could be passed in one struct
+ sal_Bool bAsWholeItem = sal_False;
+ for ( sal_uInt16 n=0; n<nCount; n++ )
{
- // complex argument, could be passed in one struct
- sal_Bool bAsWholeItem = sal_False;
- for ( sal_uInt16 n=0; n<nCount; n++ )
+ const beans::PropertyValue& rProp = pPropsVal[n];
+ String aName = rProp.Name;
+ if ( aName.CompareToAscii(rArg.pName) == COMPARE_EQUAL )
{
- const beans::PropertyValue& rProp = pPropsVal[n];
- String aName = rProp.Name;
- if ( aName.CompareToAscii(rArg.pName) == COMPARE_EQUAL )
- {
- bAsWholeItem = sal_True;
+ bAsWholeItem = sal_True;
#ifdef DBG_UTIL
- ++nFoundArgs;
+ ++nFoundArgs;
#endif
- if( pItem->PutValue( rProp.Value ) )
- // only use successfully converted items
- rSet.Put( *pItem );
+ if( pItem->PutValue( rProp.Value ) )
+ // only use successfully converted items
+ rSet.Put( *pItem );
#ifdef DBG_UTIL
- else
- {
- OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Property not convertable: "));
- aStr.append(rArg.pName);
- OSL_FAIL( aStr.getStr() );
- }
-#endif
+ else
+ {
+ OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Property not convertable: "));
+ aStr.append(rArg.pName);
+ OSL_FAIL( aStr.getStr() );
}
+#endif
}
+ }
- if ( !bAsWholeItem )
+ if ( !bAsWholeItem )
+ {
+ // complex argument; collect sub items from argument array and reconstruct complex item
+ // only put item if at least one member was found and had the correct type
+ // (is this a good idea?! Should we ask for *all* members?)
+ sal_Bool bRet = sal_False;
+ for ( sal_uInt16 n=0; n<nCount; n++ )
{
- // complex argument; collect sub items from argument array and reconstruct complex item
- // only put item if at least one member was found and had the correct type
- // (is this a good idea?! Should we ask for *all* members?)
- sal_Bool bRet = sal_False;
- for ( sal_uInt16 n=0; n<nCount; n++ )
+ const beans::PropertyValue& rProp = pPropsVal[n];
+ for ( sal_uInt16 nSub=0; nSub<nSubCount; nSub++ )
{
- const beans::PropertyValue& rProp = pPropsVal[n];
- for ( sal_uInt16 nSub=0; nSub<nSubCount; nSub++ )
+ // search sub item by name
+ OStringBuffer aStr;
+ aStr.append(rArg.pName).append('.').append(pType->aAttrib[nSub].pName);
+ if ( rProp.Name.equalsAsciiL(aStr.getStr(), aStr.getLength()) )
{
- // search sub item by name
- OStringBuffer aStr;
- aStr.append(rArg.pName).append('.').append(pType->aAttrib[nSub].pName);
- if ( rProp.Name.equalsAsciiL(aStr.getStr(), aStr.getLength()) )
- {
- // at least one member found ...
- bRet = sal_True;
+ // at least one member found ...
+ bRet = sal_True;
#ifdef DBG_UTIL
- ++nFoundArgs;
+ ++nFoundArgs;
#endif
- sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) pType->aAttrib[nSub].nAID;
- if ( bConvertTwips )
- nSubId |= CONVERT_TWIPS;
- if (!pItem->PutValue( rProp.Value, nSubId ) )
- {
- // ... but it was not convertible
- bRet = sal_False;
+ sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) pType->aAttrib[nSub].nAID;
+ if ( bConvertTwips )
+ nSubId |= CONVERT_TWIPS;
+ if (!pItem->PutValue( rProp.Value, nSubId ) )
+ {
+ // ... but it was not convertible
+ bRet = sal_False;
#ifdef DBG_UTIL
- OStringBuffer aDbgStr(RTL_CONSTASCII_STRINGPARAM("Property not convertable: "));
- aDbgStr.append(rArg.pName);
- OSL_FAIL( aDbgStr.getStr() );
+ OStringBuffer aDbgStr(RTL_CONSTASCII_STRINGPARAM("Property not convertable: "));
+ aDbgStr.append(rArg.pName);
+ OSL_FAIL( aDbgStr.getStr() );
#endif
- }
-
- break;
}
+
+ break;
}
}
+ }
- if ( bRet )
- // only use successfully converted items
- rSet.Put( *pItem );
+ if ( bRet )
+ // only use successfully converted items
+ rSet.Put( *pItem );
- }
}
-
- delete pItem;
}
- // special additional parameters for some slots not seen in the slot definitions
- // Some of these slots are not considered to be used for macro recording, because they shouldn't be recorded as slots,
- // but as dispatching or factory or arbitrary URLs to the frame
- // Some also can use additional arguments that are not recordable (will be changed later,
- // f.e. "SaveAs" shouldn't support parameters not in the slot definition!)
- if ( nSlotId == SID_NEWWINDOW )
+ delete pItem;
+ }
+
+ // special additional parameters for some slots not seen in the slot definitions
+ // Some of these slots are not considered to be used for macro recording, because they shouldn't be recorded as slots,
+ // but as dispatching or factory or arbitrary URLs to the frame
+ // Some also can use additional arguments that are not recordable (will be changed later,
+ // f.e. "SaveAs" shouldn't support parameters not in the slot definition!)
+ if ( nSlotId == SID_NEWWINDOW )
+ {
+ for ( sal_uInt16 n=0; n<nCount; n++ )
{
- for ( sal_uInt16 n=0; n<nCount; n++ )
+ const beans::PropertyValue& rProp = pPropsVal[n];
+ OUString aName = rProp.Name;
+ if ( aName == sFrame )
{
- const beans::PropertyValue& rProp = pPropsVal[n];
- OUString aName = rProp.Name;
- if ( aName == sFrame )
- {
- Reference< XFrame > xFrame;
- OSL_VERIFY( rProp.Value >>= xFrame );
- rSet.Put( SfxUnoFrameItem( SID_FILLFRAME, xFrame ) );
- }
- else
- if ( aName == sHidden )
- {
- sal_Bool bVal = sal_False;
- if (rProp.Value >>= bVal)
- rSet.Put( SfxBoolItem( SID_HIDDEN, bVal ) );
- }
+ Reference< XFrame > xFrame;
+ OSL_VERIFY( rProp.Value >>= xFrame );
+ rSet.Put( SfxUnoFrameItem( SID_FILLFRAME, xFrame ) );
+ }
+ else
+ if ( aName == sHidden )
+ {
+ sal_Bool bVal = sal_False;
+ if (rProp.Value >>= bVal)
+ rSet.Put( SfxBoolItem( SID_HIDDEN, bVal ) );
}
}
- else if ( bIsMediaDescriptor )
+ }
+ else if ( bIsMediaDescriptor )
+ {
+ for ( sal_uInt16 n=0; n<nCount; n++ )
{
- for ( sal_uInt16 n=0; n<nCount; n++ )
- {
#ifdef DBG_UTIL
- ++nFoundArgs;
+ ++nFoundArgs;
#endif
- const beans::PropertyValue& rProp = pPropsVal[n];
- OUString aName = rProp.Name;
- if ( aName == sModel )
- rSet.Put( SfxUnoAnyItem( SID_DOCUMENT, rProp.Value ) );
- else if ( aName == sComponentData )
- {
- rSet.Put( SfxUnoAnyItem( SID_COMPONENTDATA, rProp.Value ) );
- }
- else if ( aName == sComponentContext )
- {
- rSet.Put( SfxUnoAnyItem( SID_COMPONENTCONTEXT, rProp.Value ) );
- }
- else if ( aName == sStatusInd )
- {
- Reference<task::XStatusIndicator> xVal;
- sal_Bool bOK = (rProp.Value >>= xVal);
- DBG_ASSERT( bOK, "invalid type for StatusIndicator" );
- if (bOK && xVal.is())
- rSet.Put( SfxUnoAnyItem( SID_PROGRESS_STATUSBAR_CONTROL, rProp.Value ) );
- }
- else if ( aName == sInteractionHdl )
- {
- Reference<task::XInteractionHandler> xVal;
- sal_Bool bOK = (rProp.Value >>= xVal);
- DBG_ASSERT( bOK, "invalid type for InteractionHandler" );
- if (bOK && xVal.is())
- rSet.Put( SfxUnoAnyItem( SID_INTERACTIONHANDLER, rProp.Value ) );
- }
- else if ( aName == sViewData )
- rSet.Put( SfxUnoAnyItem( SID_VIEW_DATA, rProp.Value ) );
- else if ( aName == sFilterData )
- rSet.Put( SfxUnoAnyItem( SID_FILTER_DATA, rProp.Value ) );
- else if ( aName == sInputStream )
- {
- Reference< XInputStream > xVal;
- sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
- DBG_ASSERT( bOK, "invalid type for InputStream" );
- if (bOK)
- rSet.Put( SfxUnoAnyItem( SID_INPUTSTREAM, rProp.Value ) );
- }
- else if ( aName == sStream )
- {
- Reference< XInputStream > xVal;
- sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
- DBG_ASSERT( bOK, "invalid type for Stream" );
- if (bOK)
- rSet.Put( SfxUnoAnyItem( SID_STREAM, rProp.Value ) );
- }
- else if ( aName == sUCBContent )
- {
- Reference< XContent > xVal;
- sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
- DBG_ASSERT( bOK, "invalid type for UCBContent" );
- if (bOK)
- rSet.Put( SfxUnoAnyItem( SID_CONTENT, rProp.Value ) );
- }
- else if ( aName == sOutputStream )
- {
- Reference< XOutputStream > xVal;
- sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
- DBG_ASSERT( bOK, "invalid type for OutputStream" );
- if (bOK)
- rSet.Put( SfxUnoAnyItem( SID_OUTPUTSTREAM, rProp.Value ) );
- }
- else if ( aName == sPostData )
- {
- Reference< XInputStream > xVal;
- sal_Bool bOK = (rProp.Value >>= xVal);
- DBG_ASSERT( bOK, "invalid type for PostData" );
- if (bOK)
- rSet.Put( SfxUnoAnyItem( SID_POSTDATA, rProp.Value ) );
- }
- else if ( aName == sFrame )
- {
- Reference< XFrame > xFrame;
- sal_Bool bOK = (rProp.Value >>= xFrame);
- DBG_ASSERT( bOK, "invalid type for Frame" );
- if (bOK)
- rSet.Put( SfxUnoFrameItem( SID_FILLFRAME, xFrame ) );
- }
- else if ( aName == sAsTemplate )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for AsTemplate" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_TEMPLATE, bVal ) );
- }
- else if ( aName == sOpenNewView )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for OpenNewView" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_OPEN_NEW_VIEW, bVal ) );
- }
- else if ( aName == sFailOnWarning )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for FailOnWarning" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_FAIL_ON_WARNING, bVal ) );
- }
- else if ( aName == sViewId )
- {
- sal_Int16 nVal = -1;
- sal_Bool bOK = ((rProp.Value >>= nVal) && (nVal != -1));
- DBG_ASSERT( bOK, "invalid type for ViewId" );
- if (bOK)
- rSet.Put( SfxUInt16Item( SID_VIEW_ID, nVal ) );
- }
- else if ( aName == sPluginMode )
- {
- sal_Int16 nVal = -1;
- sal_Bool bOK = ((rProp.Value >>= nVal) && (nVal != -1));
- DBG_ASSERT( bOK, "invalid type for PluginMode" );
- if (bOK)
- rSet.Put( SfxUInt16Item( SID_PLUGIN_MODE, nVal ) );
- }
- else if ( aName == sReadOnly )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for ReadOnly" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_DOC_READONLY, bVal ) );
- }
- else if ( aName == sDdeReconnect )
- {
- sal_Bool bVal = sal_True;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for DDEReconnect" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_DDE_RECONNECT_ONLOAD, bVal ) );
- }
- else if ( aName == sStartPresentation )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for StartPresentation" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_DOC_STARTPRESENTATION, bVal ) );
- }
- else if ( aName == sSelectionOnly )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for SelectionOnly" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_SELECTION, bVal ) );
- }
- else if ( aName == sHidden )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for Hidden" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_HIDDEN, bVal ) );
- }
- else if ( aName == sMinimized )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for Minimized" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_MINIMIZED, bVal ) );
- }
- else if ( aName == sSilent )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for Silent" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_SILENT, bVal ) );
- }
- else if ( aName == sPreview )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for Preview" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_PREVIEW, bVal ) );
- }
- else if ( aName == sViewOnly )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for ViewOnly" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_VIEWONLY, bVal ) );
- }
- else if ( aName == sDontEdit )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for ViewOnly" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_EDITDOC, !bVal ) );
- }
- else if ( aName == sUseSystemDialog )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for ViewOnly" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_FILE_DIALOG, bVal ) );
- }
- else if ( aName == sStandardDir )
- {
- OUString sVal;
- sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
- DBG_ASSERT( bOK, "invalid type or value for StandardDir" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_STANDARD_DIR, sVal ) );
- }
- else if ( aName == sBlackList )
- {
- uno::Sequence<OUString> xVal;
- sal_Bool bOK = (rProp.Value >>= xVal);
- DBG_ASSERT( bOK, "invalid type or value for BlackList" );
- if (bOK)
- {
- SfxStringListItem stringList(SID_BLACK_LIST);
- stringList.SetStringList( xVal );
- rSet.Put( stringList );
- }
- }
- else if ( aName == sFileName )
- {
- OUString sVal;
- sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
- DBG_ASSERT( bOK, "invalid type or value for FileName" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_FILE_NAME, sVal ) );
- }
- else if ( aName == sSalvagedFile )
- {
- OUString sVal;
- sal_Bool bOK = (rProp.Value >>= sVal);
- DBG_ASSERT( bOK, "invalid type or value for SalvagedFile" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_DOC_SALVAGE, sVal ) );
- }
- else if ( aName == sFolderName )
- {
- OUString sVal;
- sal_Bool bOK = (rProp.Value >>= sVal);
- DBG_ASSERT( bOK, "invalid type or value for FolderName" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_PATH, sVal ) );
- }
- else if ( aName == sFrameName )
- {
- OUString sVal;
- sal_Bool bOK = (rProp.Value >>= sVal);
- DBG_ASSERT( bOK, "invalid type for FrameName" );
- if (bOK && !sVal.isEmpty())
- rSet.Put( SfxStringItem( SID_TARGETNAME, sVal ) );
- }
- else if ( aName == sMediaType )
- {
- OUString sVal;
- sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
- DBG_ASSERT( bOK, "invalid type or value for MediaType" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_CONTENTTYPE, sVal ) );
- }
- else if ( aName == sTemplateName )
- {
- OUString sVal;
- sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
- DBG_ASSERT( bOK, "invalid type or value for TemplateName" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_TEMPLATE_NAME, sVal ) );
- }
- else if ( aName == sTemplateRegionName )
- {
- OUString sVal;
- sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
- DBG_ASSERT( bOK, "invalid type or value for TemplateRegionName" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_TEMPLATE_REGIONNAME, sVal ) );
- }
- else if ( aName == sJumpMark )
- {
- OUString sVal;
- sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
- DBG_ASSERT( bOK, "invalid type or value for JumpMark" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_JUMPMARK, sVal ) );
- }
- else if ( aName == sCharacterSet )
- {
- OUString sVal;
- sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
- DBG_ASSERT( bOK, "invalid type or value for CharacterSet" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_CHARSET, sVal ) );
- }
- else if ( aName == sFilterFlags )
- {
- OUString sVal;
- sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
- DBG_ASSERT( bOK, "invalid type or value for FilterFlags" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_FILE_FILTEROPTIONS, sVal ) );
- }
- else if ( aName == sMacroExecMode )
- {
- sal_Int16 nVal =-1;
- sal_Bool bOK = ((rProp.Value >>= nVal) && (nVal != -1));
- DBG_ASSERT( bOK, "invalid type for MacroExecMode" );
- if (bOK)
- rSet.Put( SfxUInt16Item( SID_MACROEXECMODE, nVal ) );
- }
- else if ( aName == sUpdateDocMode )
- {
- sal_Int16 nVal =-1;
- sal_Bool bOK = ((rProp.Value >>= nVal) && (nVal != -1));
- DBG_ASSERT( bOK, "invalid type for UpdateDocMode" );
- if (bOK)
- rSet.Put( SfxUInt16Item( SID_UPDATEDOCMODE, nVal ) );
- }
- else if ( aName == sRepairPackage )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for RepairPackage" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_REPAIRPACKAGE, bVal ) );
- }
- else if ( aName == sDocumentTitle )
- {
- OUString sVal;
- sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
- DBG_ASSERT( bOK, "invalid type or value for DocumentTitle" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_DOCINFO_TITLE, sVal ) );
- }
- else if ( aName == sDocumentBaseURL )
- {
- OUString sVal;
- // the base url can be set to empty ( for embedded objects for example )
- sal_Bool bOK = (rProp.Value >>= sVal);
- DBG_ASSERT( bOK, "invalid type or value for DocumentBaseURL" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_DOC_BASEURL, sVal ) );
- }
- else if ( aName == sHierarchicalDocumentName )
- {
- OUString sVal;
- sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
- DBG_ASSERT( bOK, "invalid type or value for HierarchicalDocumentName" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_DOC_HIERARCHICALNAME, sVal ) );
- }
- else if ( aName == sCopyStreamIfPossible )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for CopyStreamIfPossible" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_COPY_STREAM_IF_POSSIBLE, bVal ) );
- }
- else if ( aName == sNoAutoSave )
- {
- sal_Bool bVal = sal_False;
- sal_Bool bOK = (rProp.Value >>= bVal);
- DBG_ASSERT( bOK, "invalid type for NoAutoSave" );
- if (bOK)
- rSet.Put( SfxBoolItem( SID_NOAUTOSAVE, bVal ) );
- }
- else if ( aName == sModifyPasswordInfo )
- {
- rSet.Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, rProp.Value ) );
- }
- else if ( aName == sEncryptionData )
- {
- rSet.Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, rProp.Value ) );
- }
- else if ( aName == sSuggestedSaveAsDir )
- {
- OUString sVal;
- sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
- DBG_ASSERT( bOK, "invalid type or value for SuggestedSaveAsDir" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_SUGGESTEDSAVEASDIR, sVal ) );
- }
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list