Changeset 5833


Ignore:
Timestamp:
03/27/14 11:59:33 (6 years ago)
Author:
avneesh-singh
Message:

always ignore indentation property also works in DAISY 3 export. Erlier it was only in DAISY 2.02 export

Location:
trunk/Obi/Obi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Obi/Obi/ImportExport/DAISY3_ObiExport.cs

    r5820 r5833  
    3333            m_AudioFileSectionLevel = audioFileSectionLevel; 
    3434            GeneratorName = "Obi"; 
     35        } 
     36 
     37 
     38        private bool m_AlwaysIgnoreIndentation = false; 
     39        public bool AlwaysIgnoreIndentation 
     40        { 
     41            get { return m_AlwaysIgnoreIndentation; } 
     42            set { m_AlwaysIgnoreIndentation = value; } 
    3543        } 
    3644 
     
    842850                    XmlDocumentHelper.CreateAppendXmlAttribute(smilDocument, mainSeqNode, "fill", "remove"); 
    843851                    AddMetadata_Smil(smilDocument, FormatTimeString(smilElapseTime), currentSmilCustomTestList); 
    844  
    845                     XmlReaderWriterHelper.WriteXmlDocument(smilDocument, Path.Combine(m_OutputDirectory, smilFileName), null); 
     852                     
     853                    XmlReaderWriterHelper.WriteXmlDocument(smilDocument, Path.Combine(m_OutputDirectory, smilFileName),AlwaysIgnoreIndentation? GetXmlWriterSettings (false): null); 
    846854 
    847855                    smilElapseTime.Add(durationOfCurrentSmil); 
     
    886894            foreach (XmlDocument sd in m_AnchorSmilDoc_SmileFileNameMap.Keys) 
    887895            { 
    888                 XmlReaderWriterHelper.WriteXmlDocument(sd, Path.Combine(m_OutputDirectory, m_AnchorSmilDoc_SmileFileNameMap[sd] ), null); 
     896                XmlReaderWriterHelper.WriteXmlDocument(sd, Path.Combine(m_OutputDirectory, m_AnchorSmilDoc_SmileFileNameMap[sd]),  
     897                    (AlwaysIgnoreIndentation ? GetXmlWriterSettings(false): null )); 
    889898            } 
    890899            m_AnchorSmilDoc_SmileFileNameMap = null; 
     
    906915            m_TotalTime = new Time(smilElapseTime); 
    907916            AddMetadata_Ncx(ncxDocument, totalPageCount.ToString(), maxNormalPageNumber.ToString(), maxDepth.ToString(), ncxCustomTestList); 
    908             XmlReaderWriterHelper.WriteXmlDocument(ncxDocument, Path.Combine(m_OutputDirectory, m_Filename_Ncx),null); 
     917            XmlReaderWriterHelper.WriteXmlDocument(ncxDocument, Path.Combine(m_OutputDirectory, m_Filename_Ncx),AlwaysIgnoreIndentation? GetXmlWriterSettings(false): null); 
    909918        } 
    910919 
     
    936945        } 
    937946 
     947        public XmlWriterSettings GetXmlWriterSettings (bool indentation) 
     948        { 
     949            XmlWriterSettings settings = new XmlWriterSettings(); 
     950            settings.Encoding = Encoding.UTF8; 
     951            if (indentation) 
     952            { 
     953                settings.Indent = true; 
     954                settings.IndentChars = "\t"; 
     955            } 
     956            else 
     957            { 
     958                settings.Indent = false; 
     959            } 
     960            return settings;             
     961        } 
     962 
     963 
    938964 
    939965    } 
  • trunk/Obi/Obi/ObiForm.cs

    r5787 r5833  
    24652465                                DAISY3Export.AudioFileNameCharsLimit = ExportDialogDAISY3.AudioFileNameCharsLimit; 
    24662466                                if(ExportDialogDAISY3.EnabledAdvancedParameters)  DAISY3Export.SetAdditionalMp3EncodingParameters(ExportDialogDAISY3.Mp3ChannelMode, ExportDialogDAISY3.Mp3ReSample, ExportDialogDAISY3.Mp3RePlayGain); 
     2467                                ((Obi.ImportExport.DAISY3_ObiExport)DAISY3Export).AlwaysIgnoreIndentation = mSettings.Export_AlwaysIgnoreIndentation; 
    24672468                            } 
    24682469                            if (ExportDialogDAISY202 != null) 
Note: See TracChangeset for help on using the changeset viewer.