<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 - Formula bar and insert formula field behave differently when in a table, to when not in a table"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=109301">109301</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Formula bar and insert formula field behave differently when in a table, to when not in a table
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>5.3.4.2 release
          </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>Writer
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>libreoffice@troy.rollo.name
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When inserting a Formula Field (Insert...Field...More
Fields...Variables...Insert Formula), Writer behaves differently depending on
whether the current insertion point is or is not inside the table. When in a
table, Writer treats the action as inserting a table formula. Outside a table,
they insert a formula field.

See the "TYP_FORMELFLD" case in SwFieldMgr::InsertField in fldmgr.cxx

These two formula types is different. As an example, in the Formula field,
variables are available - not so in the table formulas. If the field is
inserted outside the table, it can be copied into the table, where it works
correctly. However if the field is inserted directly into the table, it is
likely to be invalid because it is using the wrong formula type.

Additionally, table formulas that are not the only content in their cells
appear not to generate any results. Because of this, when inserting a formula
field in a table cell, other than as the only thing in the table, it appears
that nothing has happened at all.

The current behaviour is confusing and inconsistent.

Suggested behaviour:

1. Inserting the field from the Insert field dialog should always insert the
field, even if in a table.
2. If it is preferred to keep the current (different) behaviour with the
formula bar, the UI should make it clear what is going on.

I have not looked at whether the syntax for the two formula types is compatible
at a high level, so that the table ones could be merged into the formula field.</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>