<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Optimize OutputDevice to only call ImplRefreshAllFontData once after reading all embedded fonts"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=114697">114697</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Optimize OutputDevice to only call ImplRefreshAllFontData once after reading all embedded fonts
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mikekaganski@hotmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When opening documents with multiple embedded fonts, the operation takes much
time (at least on Windows), the more fonts are installed on system - the
longer.

To test, open <span class=""><a href="http://bugs.documentfoundation.org/attachment.cgi?id=117368" name="attach_117368" title="second doc">attachment 117368</a> <a href="http://bugs.documentfoundation.org/attachment.cgi?id=117368&action=edit" title="second doc">[details]</a></span>. It contains multiple fonts, and its opening
may take several minutes (>2 minutes on my system).

The problem is repeated call to OutputDevice::ImplRefreshAllFontData, that ends
each OutputDevice::AddTempDevFont. The call executes
OutputDevice::ImplRefreshFontData for all windows in application. It may take
several seconds (I see 6 s on my system) each.

The proposal is to implement a way to avoid doing the expensive operations
until all the fonts had been read. I see at least two ways to approach this:

1. Add a flag to ImplGetSVData()->maGDIData, that would tell
OutputDevice::ImplRefreshAllFontData not to do anything; set in at the
beginning of SaxExpatParser::parseStream (or another suitable function), and
reset at the end (with refresh).

2. Reimplement the logic, so that invalidation would set a flag, and then any
function that needs access to the data, would trigger the refresh and reset the
flag.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>