OmegaT のメニューバーにフォルダーツリー参照用のメニューを追加します。
プレビュー:MS-Word のインストール判定を元に戻した
.docx のクラス名が "Word.Document." で始まっていないのに Word で開くのは、環境異常扱い
| @@ -111,21 +111,20 @@ | ||
| 111 | 111 | // 他のパターンとして、AOO/LO 環境で以下のようなケースもあり。 |
| 112 | 112 | //.docx=OpenOffice.Docx |
| 113 | 113 | //.docx=LibreOffice.WriterDocument.1 |
| 114 | - // 微妙なのは、クラス名称が変わっているからといって、最終的に | |
| 115 | - // MS-Word に関連付けられていないとは言い切れないので、結局 | |
| 116 | - // shell\open の値は確認する必要がある。 | |
| 117 | - String classString = s.substring(".docx=".length()).replaceAll("\\r\\n", ""); | |
| 118 | - if (RET_OK == command.exec("reg", "query", "HKCR\\" + classString + "\\shell\\open\\command", "/ve")) { | |
| 119 | - s = command.getStdout(); | |
| 120 | - // s's data example) | |
| 121 | - // ----------------------------------------------------- | |
| 122 | - //<-(\r\n) | |
| 123 | - //HKEY_CLASSES_ROOT\Word.document.12\shell\open\command | |
| 124 | - //(既定) REG_SZ "C:\PROGRA~2\MICROS~4\OFFICE11\WINWORD.EXE" /n /dde | |
| 125 | - //<-(\r\n) | |
| 126 | - // ----------------------------------------------------- | |
| 127 | - // 前後に空行が入るので注意。 | |
| 128 | - return s.toUpperCase().indexOf("\\WINWORD.EXE") > -1; | |
| 114 | + if (s.toLowerCase().startsWith(".docx=word.document.")) { | |
| 115 | + String classString = s.substring(".docx=".length()).replaceAll("\\r\\n", ""); | |
| 116 | + if (RET_OK == command.exec("reg", "query", "HKCR\\" + classString + "\\shell\\open\\command", "/ve")) { | |
| 117 | + s = command.getStdout(); | |
| 118 | + // s's data example) | |
| 119 | + // ----------------------------------------------------- | |
| 120 | + //<-(\r\n) | |
| 121 | + //HKEY_CLASSES_ROOT\Word.document.12\shell\open\command | |
| 122 | + //(既定) REG_SZ "C:\PROGRA~2\MICROS~4\OFFICE11\WINWORD.EXE" /n /dde | |
| 123 | + //<-(\r\n) | |
| 124 | + // ----------------------------------------------------- | |
| 125 | + // 前後に空行が入るので注意。 | |
| 126 | + return s.toUpperCase().indexOf("\\WINWORD.EXE") > -1; | |
| 127 | + } | |
| 129 | 128 | } |
| 130 | 129 | } |
| 131 | 130 | } catch (Exception ex) { |