⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 baseodfclass4.pas

📁 Advanced.Export.Component.v4.01.rar,delphi 第三方控件
💻 PAS
📖 第 1 页 / 共 4 页
字号:
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Configurations2/images/Bitmaps/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Configurations2/images/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['application/vnd.sun.xml.ui.configuration', 'Configurations2/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['text/xml', 'content.xml']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['text/xml', 'styles.xml']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['text/xml', 'meta.xml']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Thumbnails/thumbnail.png']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Thumbnails/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Thumbnails/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['text/xml', 'settings.xml']);
         FExportWriter.EndNode('manifest:manifest');
       end;
  //Manifest file text
  204: begin
         FExportWriter.BeginNode('manifest:manifest', '',
           ['xmlns:manifest'],
           ['urn:oasis:names:tc:opendocument:xmlns:manifest:1.0']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['application/vnd.oasis.opendocument.text', '/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Configurations2/statusbar/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Configurations2/accelerator/current.xml']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Configurations2/accelerator/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Configurations2/floater/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Configurations2/popupmenu/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Configurations2/progressbar/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Configurations2/menubar/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Configurations2/toolbar/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Configurations2/images/Bitmaps/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Configurations2/images/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['application/vnd.sun.xml.ui.configuration', 'Configurations2/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['text/xml', 'content.xml']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['text/xml', 'styles.xml']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['text/xml', 'meta.xml']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Thumbnails/thumbnail.png']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Thumbnails/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['', 'Thumbnails/']);
         FExportWriter.CreateFullNode('manifest:file-entry', '',
           ['manifest:media-type', 'manifest:full-path'],
           ['text/xml', 'settings.xml']);
         FExportWriter.EndNode('manifest:manifest');
       end;
  //5, 6 and 7 properties aren't used for back compatibility
  //Main Header for content.xml
  8: begin
       FExportWriter.BeginNode('office:document-content', '',
         ['xmlns:office', 'xmlns:style', 'xmlns:text', 'xmlns:table',
         'xmlns:draw', 'xmlns:fo', 'xmlns:xlink', 'xmlns:dc', 'xmlns:meta',
         'xmlns:number', 'xmlns:svg', 'xmlns:chart', 'xmlns:dr3d', 'xmlns:math',
         'xmlns:form', 'xmlns:script', 'xmlns:ooo', 'xmlns:ooow', 'xmlns:oooc',
         'xmlns:dom', 'xmlns:xforms', 'xmlns:xsd', 'xmlns:xsi', 'office:version'],
         ['urn:oasis:names:tc:opendocument:xmlns:office:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:style:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:text:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:table:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0',
         'http://www.w3.org/1999/xlink', 'http://purl.org/dc/elements/1.1/',
         'urn:oasis:names:tc:opendocument:xmlns:meta:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:chart:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0',
         'http://www.w3.org/1998/Math/MathML',
         'urn:oasis:names:tc:opendocument:xmlns:form:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:script:1.0',
         'http://openoffice.org/2004/office', 'http://openoffice.org/2004/writer',
         'http://openoffice.org/2004/calc', 'http://www.w3.org/2001/xml-events',
         'http://www.w3.org/2002/xforms', 'http://www.w3.org/2001/XMLSchema',
         'http://www.w3.org/2001/XMLSchema-instance', '1.0']);
     end;
  //Office-scripts tag - definition only
  9: begin
       FExportWriter.CreateFullNode('office:scripts', '', [], []);
     end;
  //Office-face fonts declaration
  10: begin
        FExportWriter.BeginNode('office:font-face-decls', '', [], []);
     end;
  //Office automatic styles
  11: begin
        FExportWriter.BeginNode('office:automatic-styles', '', [], []);
      end;
  211: begin
         FExportWriter.CreateFullNode('office:automatic-styles', '', [], []);
       end;
  //Tag only
  12: begin
        FExportWriter.BeginNode('office:body', '', [], []);
      end;
  //root for spreadsheet document
  13: begin
        FExportWriter.BeginNode('office:spreadsheet', '', [], []);
      end;
  //root for text document
  14: begin
        FExportWriter.BeginNode('office:text', '', [], []);
      end;
  //Common element for all tables
  15: begin
        FExportWriter.BeginNode('table:table', '', AttNames, AttValues);
      end;
  //Common element for all tables
  16: begin
        FExportWriter.BeginNode('table:table-row', '', AttNames, AttValues);
      end;
  //Common element for all tables
  17: begin
        FExportWriter.BeginNode('table:table-cell', '', AttNames, AttValues);
      end;
  //Common element for all tables
  18: begin
        FExportWriter.CreateFullNode('text:p', Text, AttNames, AttValues);
      end;
  //Column tag - very important for text document tables
  19: begin
        FExportWriter.CreateFullNode('table:table-column', '', AttNames, AttValues);
      end;
  //Common style-font-face
  20: begin
        FExportWriter.CreateFullNode('style:font-face', '', AttNames, AttValues);
      end;
  //main style-style tag
  21: begin
        FExportWriter.BeginNode('style:style', '', AttNames, AttValues);
      end;
  //For whole table
  22: begin
        FExportWriter.CreateFullNode('style:table-properties', '',
          AttNames, AttValues);
      end;
  //For column
  23: begin
        FExportWriter.CreateFullNode('style:table-column-properties', '',
          AttNames, AttValues);
      end;
  //For row
  24: begin
        FExportWriter.CreateFullNode('style:table-row-properties', '',
          AttNames, AttValues);
      end;
  //For cell
  25: begin
        FExportWriter.CreateFullNode('style:table-cell-properties', '',
          AttNames, AttValues);
      end;
  //For text
  26: begin
        FExportWriter.CreateFullNode('style:text-properties', '',
          AttNames, AttValues);
      end;
  //Base style node
  27: begin
        FExportWriter.BeginNode('office:styles', '', [], []);
      end;
  //Common header for styles.xml
  28: begin
       FExportWriter.BeginNode('office:document-styles', '',
         ['xmlns:office', 'xmlns:style', 'xmlns:text', 'xmlns:table',
         'xmlns:draw', 'xmlns:fo', 'xmlns:xlink', 'xmlns:dc', 'xmlns:meta',
         'xmlns:number', 'xmlns:svg', 'xmlns:chart', 'xmlns:dr3d', 'xmlns:math',
         'xmlns:form', 'xmlns:script', 'xmlns:ooo', 'xmlns:ooow', 'xmlns:oooc',
         'xmlns:dom', 'xmlns:xforms', 'xmlns:xsd', 'xmlns:xsi', 'office:version'],
         ['urn:oasis:names:tc:opendocument:xmlns:office:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:style:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:text:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:table:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0',
         'http://www.w3.org/1999/xlink', 'http://purl.org/dc/elements/1.1/',
         'urn:oasis:names:tc:opendocument:xmlns:meta:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:chart:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0',
         'http://www.w3.org/1998/Math/MathML',
         'urn:oasis:names:tc:opendocument:xmlns:form:1.0',
         'urn:oasis:names:tc:opendocument:xmlns:script:1.0',
         'http://openoffice.org/2004/office', 'http://openoffice.org/2004/writer',
         'http://openoffice.org/2004/calc', 'http://www.w3.org/2001/xml-events',
         'http://www.w3.org/2002/xforms', 'http://www.w3.org/2001/XMLSchema',
         'http://www.w3.org/2001/XMLSchema-instance', '1.0']);
      end;
  //Paragraph property node
  29: begin
        FExportWriter.CreateFullNode('style:paragraph-properties', '',
          AttNames, AttValues);
      end;
  //Header-Row tag
  30: begin
        FExportWriter.BeginNode('table:table-header-rows', '', [], []);
      end;
  //End tag for root header    
  108: begin
       FExportWriter.EndNode('office:document-content');
     end;
  //Office-face fonts declaration end tag
  1010: begin
        FExportWriter.EndNode('office:font-face-decls');
     end;
  //Office automatic styles end tag
  1011: begin
        FExportWriter.EndNode('office:automatic-styles');
      end;
  //end tag for body
  1012: begin
        FExportWriter.EndNode('office:body');
      end;
  //end tag for spreadsheet document
  1013: begin
        FExportWriter.EndNode('office:spreadsheet');
      end;
  //end tag for text document
  1014: begin
        FExportWriter.EndNode('office:text');
      end;
  //end tag for all tables
  1015: begin
        FExportWriter.EndNode('table:table');
      end;
  //end tag for all tables
  1016: begin
        FExportWriter.EndNode('table:table-row');
      end;
  //end tag for all tables
  1017: begin
        FExportWriter.EndNode('table:table-cell');
      end;
  //main style-style end tag
  1021: begin
        FExportWriter.EndNode('style:style');
      end;
  //Base style node
  1027: begin
        FExportWriter.EndNode('office:styles');
      end;
  //Common end tag header for styles.xml
  1028: begin
       FExportWriter.EndNode('office:document-styles');
      end;
  //Header-Row end tag
  1030: begin
        FExportWriter.EndNode('table:table-header-rows');
      end;
  end;
end;

destructor TBaseODFFile.Destroy;
begin
//
end;

procedure TBaseODFFile.EndFormingContent;
begin
//first common part of content file
  try
    FExportStream := TFileStream.Create(TempPath + '\first.xml', fmCreate);
      try
        FExportWriter := TQXMLWriter.Create(FExportStream);
        WriteSpecificNode(1, '', [], []);
        WriteSpecificNode(8, '', [], []);
        WriteSpecificNode(9, '', [], []);
        WriteSpecificNode(10, '', [], []);
      finally
        FExportWriter.Free;
      end;
  finally
    FExportStream.Free;
  end;
  try
    FExportStream := TFileStream.Create(TempPath + '\firstSt.xml', fmCreate);
      try
        FExportWriter := TQXMLWriter.Create(FExportStream);
        WriteSpecificNode(1, '', [], []);
        WriteSpecificNode(28, '', [], []);
        WriteSpecificNode(10, '', [], []);
      finally
        FExportWriter.Free;
      end;
  finally
    FExportStream.Free;
  end;

//last common part of content file
  try
    FExportStream := TFileStream.Create(TempPath + '\last.xml', fmCreate);
      try
        FExportWriter := TQXMLWriter.Create(FExportStream);
        if TypeConvert = 0 then
          WriteSpecificNode(1014, '', [], [])
        else

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -