From 18c85ced132ad148f981205f76f18aac1792be5e Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Mon, 20 Jul 2015 22:09:02 +0000
Subject: ocgx2 (20jul15)

git-svn-id: svn://tug.org/texlive/trunk@37910 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty')

diff --git a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty
index 1e19692d5b3..f7c6e12b26b 100644
--- a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty
+++ b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty
@@ -47,7 +47,7 @@
   }
 }
 
-\ProvidesExplPackage{ocgx2}{2015/06/19}{0.6a}
+\ProvidesExplPackage{ocgx2}{2015/07/20}{0.7}
 {ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx}
 
 %re-implement ocg-p's `ocg' environment
@@ -58,10 +58,10 @@
   \group_begin:
     \ocgxii_reset_cmd_opts:  % ... to the user-set package options
     \tl_if_exist:cTF{ocgxii@#3}{ %re-open existing layer
-      \tl_set:Nx\l_tempa_tl{\use:c{ocgxii@#3.opts},#1}
+      \tl_set:Nx\l_tempa_tl{\tl_use:c{ocgxii@#3.opts},#1}
       \keys_set:nV{ocgxii/user}\l_tempa_tl
       \int_compare:nT{\l_ocgxii_listno_tl=\c_zero}{
-        \tl_gput_right:Nx\@ocgbase@ocgorder{~\use:c{ocgxii@#3}}
+        \tl_gput_right:Nx\@ocgbase@ocgorder{~\tl_use:c{ocgxii@#3}}
       }
     }{
       \tl_gset:cn{ocgxii@#3.opts}{#1}
@@ -84,18 +84,23 @@
       }
     }
     \bool_if:nT{
-      !\cs_if_exist_p:c{OCGpdfobj#3} ||
-      !\str_if_eq_x_p:nn{\use:c{OCGpdfobj#3}}{\use:c{ocgxii@#3}}
+%      !\cs_if_exist_p:c{OCGpdfobj#3} ||  %lazy evaluation may cease to work
+%      !\str_if_eq_x_p:nn{\use:c{OCGpdfobj#3}}{\tl_use:c{ocgxii@#3}}
+      !\cs_if_exist:cTF{OCGpdfobj#3}{
+        \str_if_eq_x_p:nn{\tl_use:c{OCGpdfobj#3}}{\tl_use:c{ocgxii@#3}}
+      }{
+        \c_false_bool
+      }
     }{
       \cs_if_exist:NF\g_ocgxii_rerunwarned_tl{
         \tl_new:N\g_ocgxii_rerunwarned_tl
         \AtEndDocument{\msg_warning:nn{ocgx2}{rerun}}
       }
     }
-    \tl_gset:cx{OCGpdfobj#3}{\use:c{ocgxii@#3}}
-    \seq_gput_left:Nx\g_fixocg_ocgstack_seq{\use:c{ocgxii@#3}}
+    \tl_gset:cx{OCGpdfobj#3}{\tl_use:c{ocgxii@#3}}
+    \seq_gput_left:Nx\g_fixocg_ocgstack_seq{\tl_use:c{ocgxii@#3}}
   \group_end:
-  \mix_pdfbdc:nn{/OC}{\use:c{ocgxii@#3}}
+  \mix_pdfbdc:nn{/OC}{\tl_use:c{ocgxii@#3}}
   \ignorespaces
 }{
   \unskip
@@ -208,7 +213,7 @@
 
 \cs_new:Nn\ocgxii_process_ocgref:NN{
   \str_if_eq_x:nnF{#2}{}{
-    \tl_if_exist:cTF{OCGpdfobj#2}{\tl_put_right:Nx#1{~\use:c{OCGpdfobj#2}}}{
+    \tl_if_exist:cTF{OCGpdfobj#2}{\tl_put_right:Nx#1{~\tl_use:c{OCGpdfobj#2}}}{
       \msg_warning:nnx{ocgx2}{undefined~OCG}{#2}
       \cs_if_exist:NF\g_ocgxii_refundefwarned_tl{
         \tl_new:N\g_ocgxii_refundefwarned_tl
-- 
cgit v1.2.3

