summaryrefslogtreecommitdiff
path: root/sc/source/filter/excel/impop.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter/excel/impop.cxx')
-rw-r--r--sc/source/filter/excel/impop.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index 5a0ae1f9a972..9b868f4d3268 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -136,7 +136,6 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ):
pExcRoot->pIR = this; // ExcRoot -> XclImpRoot
pExcRoot->eDateiTyp = BiffX;
pExcRoot->pExtSheetBuff = new ExtSheetBuffer( pExcRoot ); //&aExtSheetBuff;
- pExcRoot->pTabNameBuff = new NameBuffer( pExcRoot ); //&aTabNameBuff;
pExcRoot->pShrfmlaBuff = new ShrfmlaBuffer( pExcRoot ); //&aShrfrmlaBuff;
pExcRoot->pExtNameBuff = new ExtNameBuff ( *this );
@@ -180,9 +179,19 @@ void ImportExcel::ReadFileSharing()
{
sal_uInt16 nRecommendReadOnly, nPasswordHash;
maStrm >> nRecommendReadOnly >> nPasswordHash;
+
if( (nRecommendReadOnly != 0) || (nPasswordHash != 0) )
if( SfxItemSet* pItemSet = GetMedium().GetItemSet() )
pItemSet->Put( SfxBoolItem( SID_DOC_READONLY, TRUE ) );
+
+ if( nPasswordHash != 0 )
+ {
+ if( SfxObjectShell* pDocShell = GetDocShell() )
+ {
+ ScfPropertySet aPropSet( pDocShell->GetModel() );
+ aPropSet.SetProperty( CREATE_OUSTRING( "WriteProtectionPassword" ), static_cast< sal_Int32 >( nPasswordHash ) );
+ }
+ }
}
sal_uInt16 ImportExcel::ReadXFIndex( bool bBiff2 )
@@ -688,14 +697,14 @@ void ImportExcel::Boundsheet( void )
if( GetBiff() == EXC_BIFF5 )
{
- aIn.Ignore( 4 );
+ aIn.DisableDecryption();
+ maSheetOffsets.push_back( aIn.ReaduInt32() );
+ aIn.EnableDecryption();
aIn >> nGrbit;
}
String aName( aIn.ReadByteString( FALSE ) );
- *pExcRoot->pTabNameBuff << aName;
-
SCTAB nScTab = static_cast< SCTAB >( nBdshtTab );
if( nScTab > 0 )
{