SCUtil.java (e6e6073d) SCUtil.java (9fdcf9fd)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 512 unchanged lines hidden (view full) ---

521
522 String filePath = Testspace.getPath(scTempDir + fullFileName);
523 XSpreadsheetDocument xScDocument = UnoRuntime.queryInterface(XSpreadsheetDocument.class, unoApp.loadDocument(filePath));
524
525 return xScDocument;
526 }
527
528 /**
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 512 unchanged lines hidden (view full) ---

521
522 String filePath = Testspace.getPath(scTempDir + fullFileName);
523 XSpreadsheetDocument xScDocument = UnoRuntime.queryInterface(XSpreadsheetDocument.class, unoApp.loadDocument(filePath));
524
525 return xScDocument;
526 }
527
528 /**
529 * open file in Spreadsheet.
530 * @param unoApp
531 * @param filtpath File path with the extension name. (e.g. "testcase/uno/sc/data/sample.xls")
532 * @return
533 * @throws Exception
534 */
535 public static XSpreadsheetDocument openFile(String filePath, UnoApp app) throws Exception {
536 return (XSpreadsheetDocument) UnoRuntime.queryInterface(XSpreadsheetDocument.class, app.loadDocument(filePath));
537 }
538
539 /**
529 * Initial the filter name list
530 * @throws Exception
531 */
532 private static void initFilterName() throws Exception {
533 if (filterName.size() > 0) {
534 return;
535 }
536
537 filterName.put("ods", "calc8");
538 filterName.put("ots", "calc8_template");
539 filterName.put("xls", "MS Excel 97");
540 filterName.put("xlt", "MS Excel 97 Vorlage/Template");
541 filterName.put("csv", "Text - txt - csv (StarCalc)");
542 }
543
544}
540 * Initial the filter name list
541 * @throws Exception
542 */
543 private static void initFilterName() throws Exception {
544 if (filterName.size() > 0) {
545 return;
546 }
547
548 filterName.put("ods", "calc8");
549 filterName.put("ots", "calc8_template");
550 filterName.put("xls", "MS Excel 97");
551 filterName.put("xlt", "MS Excel 97 Vorlage/Template");
552 filterName.put("csv", "Text - txt - csv (StarCalc)");
553 }
554
555}