• R/O
  • SSH
  • HTTPS

コミット

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

OmegaT のメニューバーにフォルダーツリー参照用のメニューを追加します。


コミットメタ情報

リビジョン50 (tree)
日時2014-04-26 20:30:26
作者yu-tang

ログメッセージ

プレビュー:MS-Word のインストール判定を元に戻した
.docx のクラス名が "Word.Document." で始まっていないのに Word で開くのは、環境異常扱い

変更サマリ

差分

--- trunk/src/jp/sourceforge/users/yutang/omegat/plugin/foldermenu/filepreview/WordPreview.java (revision 49)
+++ trunk/src/jp/sourceforge/users/yutang/omegat/plugin/foldermenu/filepreview/WordPreview.java (revision 50)
@@ -111,21 +111,20 @@
111111 // 他のパターンとして、AOO/LO 環境で以下のようなケースもあり。
112112 //.docx=OpenOffice.Docx
113113 //.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+ }
129128 }
130129 }
131130 } catch (Exception ex) {