Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75620 - in branches/quickbook-dev/tools/quickbook: src test
From: dnljms_at_[hidden]
Date: 2011-11-22 18:47:20


Author: danieljames
Date: 2011-11-22 18:47:19 EST (Tue, 22 Nov 2011)
New Revision: 75620
URL: http://svn.boost.org/trac/boost/changeset/75620

Log:
Quickbook: Only use explicit alt text.
Text files modified:
   branches/quickbook-dev/tools/quickbook/src/actions.cpp | 17 +++++++--------
   branches/quickbook-dev/tools/quickbook/test/image-1_5.gold | 37 ++++++--------------------------
   branches/quickbook-dev/tools/quickbook/test/image-1_6.gold | 37 ++++++--------------------------
   branches/quickbook-dev/tools/quickbook/test/quickbook_manual-1_4.gold | 45 ++++++++++-----------------------------
   branches/quickbook-dev/tools/quickbook/test/svg-1_1.gold | 13 ++--------
   5 files changed, 37 insertions(+), 112 deletions(-)

Modified: branches/quickbook-dev/tools/quickbook/src/actions.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/actions.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/actions.cpp 2011-11-22 18:47:19 EST (Tue, 22 Nov 2011)
@@ -748,13 +748,8 @@
 
         // Extract the alt tag, to use as a text description.
         // Or if there isn't one, use the stem of the file name.
- // TODO: IMO if there isn't an alt tag, then the description should
- // be empty or missing.
 
- attribute_map::iterator alt_pos = attributes.find("alt");
- std::string alt_text = alt_pos == attributes.end() ? stem :
- alt_pos->second.is_encoded() ? alt_pos->second.get_encoded() :
- alt_pos->second.get_quickbook();
+ quickbook::value alt_text = attributes["alt"];
         attributes.erase("alt");
 
         if(extension == "svg")
@@ -855,9 +850,13 @@
 
         // Add a textobject containing the alt tag from earlier.
         // This will be used for the alt tag in html.
- actions.phrase << "<textobject><phrase>";
- detail::print_string(alt_text, actions.phrase.get());
- actions.phrase << "</phrase></textobject>";
+ if (alt_text.check()) {
+ actions.phrase << "<textobject><phrase>";
+ detail::print_string(alt_text.is_encoded() ?
+ alt_text.get_encoded() : alt_text.get_quickbook(),
+ actions.phrase.get());
+ actions.phrase << "</phrase></textobject>";
+ }
 
         actions.phrase << "</inlinemediaobject>";
     }

Modified: branches/quickbook-dev/tools/quickbook/test/image-1_5.gold
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/image-1_5.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/image-1_5.gold 2011-11-22 18:47:19 EST (Tue, 22 Nov 2011)
@@ -3,25 +3,12 @@
 <article id="images_1_5" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>Images 1.5</title>
   <para>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject></inlinemediaobject>
+ <inlinemediaobject><imageobject><imagedata fileref="test this.gif"></imagedata></imageobject></inlinemediaobject>
+ <inlinemediaobject><imageobject><imagedata fileref="test&amp;this.gif"></imagedata></imageobject></inlinemediaobject>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif" height="10cm" width="10cm"></imagedata></imageobject></inlinemediaobject>
     <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
     <textobject>
- <phrase>test</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test this.gif"></imagedata></imageobject>
- <textobject>
- <phrase>test this</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test&amp;this.gif"></imagedata></imageobject>
- <textobject>
- <phrase>test&amp;this</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"
- height="10cm" width="10cm"></imagedata></imageobject>
- <textobject>
- <phrase>test</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
- <textobject>
       <phrase>Foo</phrase>
     </textobject>
     </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
@@ -40,25 +27,15 @@
     </inlinemediaobject>
   </para>
   <para>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject></inlinemediaobject>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject></inlinemediaobject>
     <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
     <textobject>
- <phrase>test</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
- <textobject>
- <phrase>test</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
- <textobject>
       <phrase>comment</phrase>
     </textobject>
     </inlinemediaobject>
   </para>
   <para>
- <inlinemediaobject><imageobject><imagedata fileref="test.gif" height="10cm" width="10cm"></imagedata></imageobject>
- <textobject>
- <phrase>test</phrase>
- </textobject>
- </inlinemediaobject>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif" height="10cm" width="10cm"></imagedata></imageobject></inlinemediaobject>
   </para>
 </article>

Modified: branches/quickbook-dev/tools/quickbook/test/image-1_6.gold
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/image-1_6.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/image-1_6.gold 2011-11-22 18:47:19 EST (Tue, 22 Nov 2011)
@@ -3,25 +3,12 @@
 <article id="images_1_6" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>Images 1.6</title>
   <para>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject></inlinemediaobject>
+ <inlinemediaobject><imageobject><imagedata fileref="test this.gif"></imagedata></imageobject></inlinemediaobject>
+ <inlinemediaobject><imageobject><imagedata fileref="test&amp;this.gif"></imagedata></imageobject></inlinemediaobject>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif" height="10cm" width="10cm"></imagedata></imageobject></inlinemediaobject>
     <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
     <textobject>
- <phrase>test</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test this.gif"></imagedata></imageobject>
- <textobject>
- <phrase>test this</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test&amp;this.gif"></imagedata></imageobject>
- <textobject>
- <phrase>test&amp;this</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"
- height="10cm" width="10cm"></imagedata></imageobject>
- <textobject>
- <phrase>test</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
- <textobject>
       <phrase>Foo</phrase>
     </textobject>
     </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
@@ -45,25 +32,15 @@
     </inlinemediaobject>
   </para>
   <para>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject></inlinemediaobject>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject></inlinemediaobject>
     <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
     <textobject>
- <phrase>test</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
- <textobject>
- <phrase>test</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
- <textobject>
       <phrase>comment</phrase>
     </textobject>
     </inlinemediaobject>
   </para>
   <para>
- <inlinemediaobject><imageobject><imagedata fileref="test.gif" height="10cm" width="10cm"></imagedata></imageobject>
- <textobject>
- <phrase>test</phrase>
- </textobject>
- </inlinemediaobject>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif" height="10cm" width="10cm"></imagedata></imageobject></inlinemediaobject>
   </para>
 </article>

Modified: branches/quickbook-dev/tools/quickbook/test/quickbook_manual-1_4.gold
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/quickbook_manual-1_4.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/quickbook_manual-1_4.gold 2011-11-22 18:47:19 EST (Tue, 22 Nov 2011)
@@ -1762,11 +1762,7 @@
           Now everywhere the sf_logo is placed, the picture will be inlined.
         </para>
         <para>
- <inlinemediaobject><imageobject><imagedata fileref="http://sourceforge.net/sflogo.php?group_id=28447&amp;type=1"></imagedata></imageobject>
- <textobject>
- <phrase>sflogo</phrase>
- </textobject>
- </inlinemediaobject>
+ <inlinemediaobject><imageobject><imagedata fileref="http://sourceforge.net/sflogo.php?group_id=28447&amp;type=1"></imagedata></imageobject></inlinemediaobject>
         </para>
         <tip>
           <para>
@@ -1803,11 +1799,7 @@
         </para>
         <para>
           Hi <ulink url="http://spirit.sourceforge.net">Spirit</ulink> <inlinemediaobject><imageobject><imagedata
- fileref="images/smiley.png"></imagedata></imageobject>
- <textobject>
- <phrase>smiley</phrase>
- </textobject>
- </inlinemediaobject>
+ fileref="images/smiley.png"></imagedata></imageobject></inlinemediaobject>
         </para>
       </section>
       <section id="quickbook.syntax.block.predefined_macros">
@@ -2218,12 +2210,8 @@
         </para>
         <sidebar role="blurb">
         <para>
- <inlinemediaobject><imageobject><imagedata fileref="images/smiley.png"></imagedata></imageobject>
- <textobject>
- <phrase>smiley</phrase>
- </textobject>
- </inlinemediaobject> <emphasis role="bold">An eye catching advertisement
- or note...</emphasis>
+ <inlinemediaobject><imageobject><imagedata fileref="images/smiley.png"></imagedata></imageobject></inlinemediaobject>
+ <emphasis role="bold">An eye catching advertisement or note...</emphasis>
         </para>
         <para>
           <ulink url="http://spirit.sourceforge.net">Spirit</ulink> is an object-oriented
@@ -2980,13 +2968,10 @@
     </para>
     <sidebar role="blurb">
     <para>
- <inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject>
- <textobject>
- <phrase>note</phrase>
- </textobject>
- </inlinemediaobject> You may submit your settings, tips, and suggestions to
- the authors, or through the <ulink url="https://lists.sourceforge.net/lists/listinfo/boost-">docs
- Boost Docs mailing list</ulink>.
+ <inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject></inlinemediaobject>
+ You may submit your settings, tips, and suggestions to the authors, or through
+ the <ulink url="https://lists.sourceforge.net/lists/listinfo/boost-">docs Boost
+ Docs mailing list</ulink>.
     </para>
     </sidebar>
     <section id="quickbook.editors.scite">
@@ -3002,11 +2987,8 @@
       </para>
       <sidebar role="blurb">
       <para>
- <inlinemediaobject><imageobject><imagedata fileref="images/tip.png"></imagedata></imageobject>
- <textobject>
- <phrase>tip</phrase>
- </textobject>
- </inlinemediaobject> SciTE can be downloaded from <ulink url="http://www.scintilla.org/SciTE.html">http://www.scintilla.org/SciTE.html>
+ <inlinemediaobject><imageobject><imagedata fileref="images/tip.png"></imagedata></imageobject></inlinemediaobject>
+ SciTE can be downloaded from <ulink url="
http://www.scintilla.org/SciTE.html">http://www.scintilla.org/SciTE.html>
       </para>
       </sidebar>
       <para>
@@ -3027,11 +3009,8 @@
 <!--quickbook-escape-postfix--></programlisting>
       <sidebar role="blurb">
       <para>
- <inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject>
- <textobject>
- <phrase>note</phrase>
- </textobject>
- </inlinemediaobject> Thanks to Rene Rivera for the above SciTE settings.
+ <inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject></inlinemediaobject>
+ Thanks to Rene Rivera for the above SciTE settings.
       </para>
       </sidebar>
     </section>

Modified: branches/quickbook-dev/tools/quickbook/test/svg-1_1.gold
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/svg-1_1.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/svg-1_1.gold 2011-11-22 18:47:19 EST (Tue, 22 Nov 2011)
@@ -4,15 +4,8 @@
   <title>SVG test</title>
   <para>
     <inlinemediaobject><imageobject><imagedata contentdepth="513.25690" contentwidth="745.60706"
- fileref="images/open_clipart_library_logo.svg" format="SVG"></imagedata></imageobject>
- <textobject>
- <phrase>open_clipart_library_logo</phrase>
- </textobject>
- </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="images/missing_image.svg"
- format="SVG"></imagedata></imageobject>
- <textobject>
- <phrase>missing_image</phrase>
- </textobject>
- </inlinemediaobject>
+ fileref="images/open_clipart_library_logo.svg" format="SVG"></imagedata></imageobject></inlinemediaobject>
+ <inlinemediaobject><imageobject><imagedata fileref="images/missing_image.svg"
+ format="SVG"></imagedata></imageobject></inlinemediaobject>
   </para>
 </article>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk