Kaydet (Commit) 746f8a08 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Make the member mutable to avoid ugly casting.

Change-Id: I28fd84b89a8d443e502d2c0e76f38cf006a57d4a
üst aa6e3a1d
......@@ -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;
}
}
......
......@@ -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 )
......
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