[latex3-commits] [git/LaTeX3-latex3-pdfresources] splitting: improve error handling if management is not active (cada9c0)
Ulrike Fischer
fischer at troubleshooting-tex.de
Thu Sep 3 00:45:20 CEST 2020
Repository : https://github.com/latex3/pdfresources
On branch : splitting
Link : https://github.com/latex3/pdfresources/commit/cada9c002b15f6e79c99fe50a8994940e315ed3d
>---------------------------------------------------------------
commit cada9c002b15f6e79c99fe50a8994940e315ed3d
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sun Aug 9 23:07:52 2020 +0200
improve error handling if management is not active
>---------------------------------------------------------------
cada9c002b15f6e79c99fe50a8994940e315ed3d
l3backend-pdf-extra.dtx | 5 -----
l3pdfcoredict.dtx | 29 ++++++++++++++++++++++++++---
2 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/l3backend-pdf-extra.dtx b/l3backend-pdf-extra.dtx
index 4807032..c3fc290 100644
--- a/l3backend-pdf-extra.dtx
+++ b/l3backend-pdf-extra.dtx
@@ -511,11 +511,6 @@
Pattern,
Shading,
}
-
-\clist_map_inline:Nn \c_@@_backend_PageResources_clist
- {
- \pdfdict_new:nn { g } {Core/Page/Resources/#1}
- }
%</drivers>
% pdftex and luatex
%<*pdfmode>
diff --git a/l3pdfcoredict.dtx b/l3pdfcoredict.dtx
index d7bd7fb..50a81a3 100644
--- a/l3pdfcoredict.dtx
+++ b/l3pdfcoredict.dtx
@@ -482,6 +482,11 @@
{
The~dictionary~'#1'~is~already~defined.
}
+\msg_new:nnn { pdfcoredict } { inactive }
+ {
+ The~pdfresources~managment~is~not~active\\
+ command~'#1'~ignored.
+ }
% \end{macrocode}
% A predicate to test if the core code should be active
% \begin{macrocode}
@@ -498,12 +503,18 @@
% \begin{macrocode}
\cs_new_protected:Npn \pdfcoredict_gput:nnn #1 #2 #3
{
- \pdfdict_if_exist:nnTF { g }{ Core/#1 }
+ \@@_if_active:TF
{
- \@@_handler_gput:nnn { #1 }{ #2 }{ #3 }
+ \pdfdict_if_exist:nnTF { g }{ Core/#1 }
+ {
+ \@@_handler_gput:nnn { #1 }{ #2 }{ #3 }
+ }
+ {
+ \msg_error:nnn{pdfcoredict}{unknown-dict}{#1}
+ }
}
{
- \msg_error:nnn{pdfcoredict}{unknown-dict}{#1}
+ \msg_warning:nnx {pdfcoredict}{inactive}{\tl_to_str:n {\pdfcoredict_gput:nnn}}
}
}
@@ -801,6 +812,18 @@
% \end{macrocode}
% \subsubsection{\enquote{Page/Resources}: ExtGState, ColorSpace, Shading, Pattern}
% \begin{macrocode}
+\clist_const:Nn \c_@@_PageResources_clist
+ {
+ ExtGState,
+ ColorSpace,
+ Pattern,
+ Shading,
+ }
+
+\clist_map_inline:Nn \c_@@_PageResources_clist
+ {
+ \pdfdict_new:nn { g } {Core/Page/Resources/#1}
+ }
%
% setter: #1 is the name of the resource
\cs_new_protected:cpn { @@_handler/Page/Resources/ExtGState/?_gput:nn } #1 #2
More information about the latex3-commits
mailing list.