summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-07-25 12:17:43 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-07-25 15:02:36 -0400
commite8853ab77b0a3b57848f0b0283d3c3ccef0837d5 (patch)
treecd7fa2f931f78563702924150227531bab8c3f22
parentc598be10c637d93d23c65b369261b88bc4e1429e (diff)
Move pFilter to Impl.
Change-Id: Ie01649da353a170de67be43d2111a0cc3b3039a2
-rw-r--r--sfx2/inc/sfx2/docfile.hxx3
-rw-r--r--sfx2/source/doc/docfile.cxx31
2 files changed, 18 insertions, 16 deletions
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index bd2a28dc3214..aca768c556f9 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -73,7 +73,6 @@ class SFX2_DLLPUBLIC SfxMedium : public SvRefBase
SvGlobalName aFilterClass;
SvStream* pInStream;
SvStream* pOutStream;
- const SfxFilter* pFilter;
SfxMedium_Impl* pImp;
com::sun::star::uno::Reference<com::sun::star::io::XInputStream>
@@ -134,7 +133,7 @@ public:
void SetReferer( const String& rRefer );
void SetFilter(const SfxFilter *pFlt, sal_Bool bResetOrig = sal_False);
- const SfxFilter * GetFilter() const { return pFilter; }
+ const SfxFilter* GetFilter() const;
const SfxFilter * GetOrigFilter( sal_Bool bNotCurrent = sal_False ) const;
const rtl::OUString& GetOrigURL() const;
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index b5eed5d1ba98..e3969c98a11b 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -274,6 +274,7 @@ public:
uno::Reference < embed::XStorage > xStorage;
mutable SfxItemSet* m_pSet;
+ const SfxFilter* m_pFilter;
SfxMedium* pAntiImpl;
long nFileVersion;
@@ -343,6 +344,7 @@ SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP ) :
m_bRemote(false),
m_bInputStreamIsReadOnly(false),
m_pSet(NULL),
+ m_pFilter(NULL),
pAntiImpl( pAntiImplP ),
nFileVersion( 0 ),
pOrigFilter( 0 ),
@@ -2510,7 +2512,6 @@ SfxMedium::SfxMedium() :
pURLObj(0),
pInStream(0),
pOutStream(0),
- pFilter(0),
pImp(new SfxMedium_Impl( this ))
{
Init_Impl();
@@ -2564,15 +2565,20 @@ SfxMedium::GetInteractionHandler()
void SfxMedium::SetFilter( const SfxFilter* pFilterP, sal_Bool /*bResetOrig*/ )
{
- pFilter = pFilterP;
+ pImp->m_pFilter = pFilterP;
pImp->nFileVersion = 0;
}
+const SfxFilter* SfxMedium::GetFilter() const
+{
+ return pImp->m_pFilter;
+}
+
//----------------------------------------------------------------
const SfxFilter* SfxMedium::GetOrigFilter( sal_Bool bNotCurrent ) const
{
- return ( pImp->pOrigFilter || bNotCurrent ) ? pImp->pOrigFilter : pFilter;
+ return ( pImp->pOrigFilter || bNotCurrent ) ? pImp->pOrigFilter : pImp->m_pFilter;
}
//----------------------------------------------------------------
@@ -2856,10 +2862,10 @@ SfxMedium::SfxMedium(const String &rName, StreamMode nOpenMode, const SfxFilter
pURLObj(0),
pInStream(0),
pOutStream(0),
- pFilter(pFlt),
pImp(new SfxMedium_Impl( this ))
{
pImp->m_pSet = pInSet;
+ pImp->m_pFilter = pFlt;
pImp->m_aLogicName = rName;
nStorOpenMode = nOpenMode;
Init_Impl();
@@ -2871,7 +2877,6 @@ SfxMedium::SfxMedium( const ::com::sun::star::uno::Sequence< ::com::sun::star::b
pURLObj(0),
pInStream(0),
pOutStream(0),
- pFilter(0),
pImp(new SfxMedium_Impl( this ))
{
SfxAllItemSet *pParams = new SfxAllItemSet( SFX_APP()->GetPool() );
@@ -2882,7 +2887,7 @@ SfxMedium::SfxMedium( const ::com::sun::star::uno::Sequence< ::com::sun::star::b
SFX_ITEMSET_ARG( pImp->m_pSet, pFilterNameItem, SfxStringItem, SID_FILTER_NAME, false );
if( pFilterNameItem )
aFilterName = pFilterNameItem->GetValue();
- pFilter = SFX_APP()->GetFilterMatcher().GetFilter4FilterName( aFilterName );
+ pImp->m_pFilter = SFX_APP()->GetFilterMatcher().GetFilter4FilterName( aFilterName );
SFX_ITEMSET_ARG( pImp->m_pSet, pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, false );
if( pSalvageItem )
@@ -2934,8 +2939,8 @@ SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const Str
pImp->m_bRoot = bRootP;
String aType = SfxFilter::GetTypeFromStorage( rStor );
- pFilter = SFX_APP()->GetFilterMatcher().GetFilter4EA( aType );
- DBG_ASSERT( pFilter, "No Filter for storage found!" );
+ pImp->m_pFilter = SFX_APP()->GetFilterMatcher().GetFilter4EA( aType );
+ DBG_ASSERT( pImp->m_pFilter, "No Filter for storage found!" );
Init_Impl();
pImp->xStorage = rStor;
@@ -2956,8 +2961,8 @@ SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const Str
{
pImp->m_bRoot = bRootP;
- pFilter = SFX_APP()->GetFilterMatcher().GetFilter4EA( rTypeName );
- DBG_ASSERT( pFilter, "No Filter for storage found!" );
+ pImp->m_pFilter = SFX_APP()->GetFilterMatcher().GetFilter4EA( rTypeName );
+ DBG_ASSERT( pImp->m_pFilter, "No Filter for storage found!" );
Init_Impl();
pImp->xStorage = rStor;
@@ -2992,8 +2997,6 @@ SfxMedium::~SfxMedium()
}
}
- pFilter = 0;
-
delete pURLObj;
delete pImp;
}
@@ -3256,8 +3259,8 @@ sal_Bool SfxMedium::IsReadOnly()
// a) ReadOnly filter cant produce read/write contents!
bReadOnly = (
- (pFilter ) &&
- ((pFilter->GetFilterFlags() & SFX_FILTER_OPENREADONLY) == SFX_FILTER_OPENREADONLY)
+ (pImp->m_pFilter ) &&
+ ((pImp->m_pFilter->GetFilterFlags() & SFX_FILTER_OPENREADONLY) == SFX_FILTER_OPENREADONLY)
);
// b) if filter allow read/write contents .. check open mode of the storage