Esempio n. 1
0
 internal TXlsxCryptoStreamWriter(Stream aTargetStream, TProtection aProtection)
 {
     WorkingStream     = new MemoryStream(); // we could use a TOle2File directly here, and then TOle2File.GetStreamForWriting(), but as we need to switch the stream at the end anyway to write the DataValidation info, we would have the tream in mem twice anyway.
     WorkStreamZeroPos = 8;
     Protection        = aProtection;
     TargetStream      = aTargetStream;
 }
Esempio n. 2
0
 internal void LoadFromStream(TXlsxRecordLoader RecordLoader, TProtection Protection, out bool MacroEnabled)
 {
     InitLoading(null, Protection);
     LoadXlsxWorkbook(RecordLoader, out MacroEnabled);
     Globals.Patterns.EnsureRequiredFills(); //after loading... some files might not have style 1.
     EndLoading(Protection, RecordLoader.Encryption, RecordLoader.SST);
 }
Esempio n. 3
0
 internal void LoadFromStream(TBinRecordLoader RecordLoader, TProtection Protection)
 {
     InitLoading(RecordLoader, Protection);
     Globals.Patterns.EnsureRequiredFills();
     LoadBinWorkbook(RecordLoader);
     EndLoading(Protection, RecordLoader.Encryption, RecordLoader.SST);
 }
Esempio n. 4
0
        private static TEncryptionParameters GetEncryptionParams(TProtection Protection)
        {
            TEncryptionParameters Result = new TEncryptionParameters();

            Result.Algorithm    = Protection.EncryptionAlgorithmXlsx;
            Result.ChainingMode = CipherMode.CBC;
            Result.Padding      = PaddingMode.Zeros;
            return(Result);
        }
Esempio n. 5
0
        private void EndLoading(TProtection Protection, TEncryptionData Encryption, TSST SST)
        {
            // References from LABELSST to SST have been loaded, we can sort
            // Globals.SST.Sort(); Not needed here, we are using a hash and entries are automatically sorted.
            SST.ClearIndexData(); //All labelSST records have been loaded. We can go on...

            //now we can safely sort, all BSEs are pointers, no integers
            if (Globals.DrawingGroup.RecordCache.BStore != null)
            {
                Globals.DrawingGroup.RecordCache.BStore.ContainedRecords.Sort();
            }

            FixRows();
            if (Encryption != null)
            {
                Protection.OpenPassword = Encryption.ReadPassword;                     //The read password might have been modified if the event was used.
            }
            Loaded = true;
        }
Esempio n. 6
0
 private void InitLoading(TBaseRecordLoader RecordLoader, TProtection Protection)
 {
     Loaded = false;
     Sheets.Clear();
     Globals.Clear();
 }