diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-07-25 10:48:15 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-07-25 15:02:35 -0400 |
commit | 1e355662242a73406547625dd1f0aa3ca5968118 (patch) | |
tree | 8317be9a9c056ece8377265c70935d37f3027fe6 | |
parent | 3faf775c4808a552f00f7ae61544b61340bcc8de (diff) |
Move bInputStreamIsReadOnly flag to Impl & properly initialize it.
Change-Id: I8243aa8a98a636cf8afadcf070e4c83477126660
-rw-r--r-- | sfx2/inc/sfx2/docfile.hxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 11 |
2 files changed, 12 insertions, 5 deletions
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index 577226dc2b58..b11c4d7960ae 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -83,7 +83,6 @@ class SFX2_DLLPUBLIC SfxMedium : public SvRefBase com::sun::star::uno::Reference<com::sun::star::io::XInputStream> m_xInputStreamToLoadFrom; - bool m_bInputStreamIsReadOnly; #if _SOLAR__PRIVATE SAL_DLLPRIVATE void SetIsRemote_Impl(); @@ -131,8 +130,9 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > GetInteractionHandler(); - void setStreamToLoadFrom(const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream,sal_Bool bIsReadOnly ) - { m_xInputStreamToLoadFrom = xInputStream; m_bInputStreamIsReadOnly = bIsReadOnly; } + void setStreamToLoadFrom( + const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream, + sal_Bool bIsReadOnly); void SetLoadTargetFrame(SfxFrame* pFrame ); SfxFrame* GetLoadTargetFrame() const; diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 4139bf05a76d..309e94d7db94 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -263,6 +263,7 @@ public: bool m_bRoot:1; bool m_bTriedStorage:1; bool m_bRemote:1; + bool m_bInputStreamIsReadOnly:1; uno::Reference < embed::XStorage > xStorage; @@ -332,6 +333,7 @@ SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP ) m_bRoot(false), m_bTriedStorage(false), m_bRemote(false), + m_bInputStreamIsReadOnly(false), pAntiImpl( pAntiImplP ), nFileVersion( 0 ), pOrigFilter( 0 ), @@ -2284,7 +2286,7 @@ void SfxMedium::GetMedium_Impl() { pImp->xInputStream = m_xInputStreamToLoadFrom; pImp->xInputStream->skipBytes(0); - if(m_bInputStreamIsReadOnly) + if (pImp->m_m_bInputStreamIsReadOnly) GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, true ) ); } else @@ -3037,7 +3039,12 @@ SfxFrame* SfxMedium::GetLoadTargetFrame() const { return pImp->wLoadTargetFrame; } -//---------------------------------------------------------------- + +void SfxMedium::setStreamToLoadFrom(const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream,sal_Bool bIsReadOnly ) +{ + m_xInputStreamToLoadFrom = xInputStream; + pImp->m_bInputStreamIsReadOnly = bIsReadOnly; +} void SfxMedium::SetLoadTargetFrame(SfxFrame* pFrame ) { |