Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-279

Support GraphViz label orientation control-characters \l, \n and \r

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 0.9.840
    • Fix Version/s: 5.4-rc-1
    • Component/s: Other
    • Labels:
      None
    • Environment:
      Tomcat 4.1.30, Windows2003
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      I can't get the label orientation characters for GraphViz (\l, \r, \n) to work - so I changed the source of GraphVizPlugin

      <diff>
      112c112
      < fwriter.write(content);

      > fwriter.write(preserveGraphVizControls(content)); //
      > restore control commands
      219a220,253
      >
      >
      > /**
      > * Try to preserve/restore the GraphViz label formatting characters
      > * \l, \r, \n, \<blank> and \N.
      > *
      > * @param content body of the

      {graphviz}

      -tag
      > * @return a string, where the mentioned characters are restored
      > */
      > private String preserveGraphVizControls(String content) {
      > if (content != null) {
      > StringBuffer result = new StringBuffer(content);
      > int pos;
      > while ((pos = result.indexOf(" ")) >= 0)

      { > result.replace(pos, (pos+5), "\\ "); > }

      > while ((pos = result.indexOf("N")) >= 0)

      { > result.replace(pos, (pos+5), "\\N"); > }

      > while ((pos = result.indexOf("l")) >= 0)

      { > result.replace(pos, (pos+6), "\\l"); > }

      > while ((pos = result.indexOf("n")) >= 0)

      { > result.replace(pos, (pos+6), "\\n"); > }

      > while ((pos = result.indexOf("r")) >= 0)

      { > result.replace(pos, (pos+6), "\\r"); > }

      > return result.toString();
      > } else

      { > return null; > }

      > }
      >
      </diff>

      after that, my label justifiying worked.
      Mabye it's possible to promote this change to the codebase ...

        Attachments

          Activity

            People

            • Assignee:
              sdumitriu Sergiu Dumitriu
              Reporter:
              baloo66 Alexander Eller
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: