<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 - calc: database-range definition broken on save-load cycle, (tag / attribute table:orientation="column" inserted)"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=136363">136363</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>calc: database-range definition broken on save-load cycle, (tag / attribute table:orientation="column" inserted)
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.5.1 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>Calc
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>newbie-02@gmx.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description:
create - save - re-load - re-save of a file breaks the definition of
'database-range' into it, violating tdf standards 1.2 and 1.3, 

this is a short description of the general fault producing autofilter problems
and conflicts between filter and sort as described in <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - calc: fileopen: filter: irregular reading and saving of filter definitions in ods format affecting all filters"
   href="show_bug.cgi?id=133336">tdf#133336</a> and <a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - calc: ui: filesave: conflict between sort and filter, unclear use of tag 'table:orientation'"
   href="show_bug.cgi?id=133529">tdf#133529</a>
and others, 

acc. to tdf standards e.g. 

<a href="https://docs.oasis-open.org/office/OpenDocument/v1.3/cs01/part3-schema/OpenDocument-v1.3-cs01-part3-schema.html#__RefHeading__1418556_253892949">https://docs.oasis-open.org/office/OpenDocument/v1.3/cs01/part3-schema/OpenDocument-v1.3-cs01-part3-schema.html#__RefHeading__1418556_253892949</a> 

see 19.690.3 there, 

a database-range object has an attribute 'table:orientation' describing in
which order the data in that range is organized, and the default for this
attribute is row! 

cited: 'For a <table:database-range> 9.4.15 element the default value for this
attribute is row.' 

with the - quite common - use cycle of a file as desribed below calc
unauthorized and invisible for the user inserts a wrong attribute 'column'
between first and second save of the file, 

breaking user data integrity and producing errors and irritations in
functionalities relying on this attribute, e.g. filter and sort, 

please excuse me for pointing out this error so persistently, imho it is very
basic and plays into many other errors, its sequel errors occur irregularly
depending on the state of the file you are working with, causing irritations
that are difficult to resolve ... 

pls. don't wash away this bug as duplicate, it is about wrong insertion of an
attribute, while other bugs reported are about filter and sort conflicting
about this attribute and about autofilter definitions messed up by this fault, 

of course it offers itself to treat these problems together since they are
interwoven

Steps to Reproduce:
1. create a new calc document, 
2. define a database-range with [data - define range], 
3. save the file, 
4. close the file, 
5. re-load the file, 
6. save the file with another name, 
7. close the file, 
8. inspect both files by opening with a zip manager - e.g. 7-zip, 
9. open the files 'content.xml' found inside the archives, 
10. in the first one you'll find a definition like: 

<table:database-range table:name="data1"
table:target-range-address="Sheet1.B3:Sheet1.D6"
table:on-update-keep-styles="true" table:on-update-keep-size="false"/>

11. in the second one the definition is like:  

<table:database-range table:name="data1"
table:target-range-address="Sheet1.B3:Sheet1.D6"
table:on-update-keep-styles="true" table:on-update-keep-size="false"
table:orientation="column"/>

12. observe the added tag / attribute - table:orientation="column" - which is
an error regarding not! intended by the user, different to the first save and
deviating from the default, 

Actual Results:
attribute table:orientation="column" in second save, 

Expected Results:
either no attribute - staying with default - or table:orientation="row" -
matching the default from loaded file, 


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: <buildversion>
CPU threads: 8; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: default;
VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL</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>