[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 10 commits - sc/qa sc/source

Tor Lillqvist tml at collabora.com
Sun Mar 26 19:54:59 UTC 2017


 sc/qa/unit/data/ods/comment.ods       |binary
 sc/qa/unit/subsequent_export-test.cxx |   21 +++++++++++++++++++++
 sc/source/filter/excel/excdoc.cxx     |    8 +++++---
 sc/source/filter/excel/xecontent.cxx  |   18 ++++++++++++++----
 sc/source/filter/excel/xeescher.cxx   |    9 +++++++++
 sc/source/filter/excel/xestyle.cxx    |    2 ++
 sc/source/filter/inc/biffhelper.hxx   |   12 +++++-------
 sc/source/filter/inc/xecontent.hxx    |    3 ++-
 sc/source/filter/inc/xestream.hxx     |    4 ++--
 sc/source/filter/inc/xltable.hxx      |    2 +-
 sc/source/filter/xcl97/xcl97rec.cxx   |   21 ++++++++++++++++++++-
 11 files changed, 81 insertions(+), 19 deletions(-)

New commits:
commit 37482cba41c49e9168387acfb470d4bb0a0eef7d
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Mar 8 09:50:46 2017 +0200

    Re-introduce a check I dropped in 7ceda09f6780c954fedc49764d5457aa2616b39a
    
    Without fully understanding the code, best to let the condition be
    there. Use the same function to check for validity as before.
    (IsValid() which was renamed to IsValidForXml().)
    
    Change-Id: If50df539737352f12cb0178706cbc38512a99366
    (cherry picked from commit a77908a2d82986ad9d2d9597536d1e22ce2cafd2)

diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 8d8fb874ca70..fa5f336329e2 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -1485,7 +1485,8 @@ XclExpCondFormatBuffer::XclExpCondFormatBuffer( const XclExpRoot& rRoot, XclExtL
                         itr != pCondFmtList->end(); ++itr)
         {
             XclExpCondfmtList::RecordRefType xCondfmtRec( new XclExpCondfmt( GetRoot(), **itr, xExtLst, nIndex ));
-            maCondfmtList.AppendRecord( xCondfmtRec );
+            if( xCondfmtRec->IsValidForXml() )
+                maCondfmtList.AppendRecord( xCondfmtRec );
         }
     }
 }
commit 0dd6c9160f49faf352eff9abf5b64fb57a44ac1c
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Mar 7 22:40:55 2017 +0200

    A 'CondFmt' record can have a maximum of three CF records following (eek)
    
    What an odd restriction. Oh well. Don't export the conditional formats
    for the cell(s) in that case then.
    
    See https://msdn.microsoft.com/en-us/library/03AE6098-BDC2-475B-BA2C-B8AEF7882174
    
    Change-Id: I4eeec8d33f9fbc572a02f727f38564d6c43b4f10
    (cherry picked from commit 7ceda09f6780c954fedc49764d5457aa2616b39a)

diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 7771e92203c6..8d8fb874ca70 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -1277,14 +1277,24 @@ XclExpCondfmt::~XclExpCondfmt()
 {
 }
 
-bool XclExpCondfmt::IsValid() const
+bool XclExpCondfmt::IsValidForBinary() const
+{
+    // ccf (2 bytes): An unsigned integer that specifies the count of CF records that follow this
+    // record. MUST be greater than or equal to 0x0001, and less than or equal to 0x0003.
+
+    SAL_WARN_IF( maCFList.GetSize() > 3, "sc.filter", "More than 3 conditional filters for cell(s), won't export");
+
+    return !maCFList.IsEmpty() && maCFList.GetSize() <= 3 && !maXclRanges.empty();
+}
+
+bool XclExpCondfmt::IsValidForXml() const
 {
     return !maCFList.IsEmpty() && !maXclRanges.empty();
 }
 
 void XclExpCondfmt::Save( XclExpStream& rStrm )
 {
-    if( IsValid() )
+    if( IsValidForBinary() )
     {
         XclExpRecord::Save( rStrm );
         maCFList.Save( rStrm );
@@ -1304,7 +1314,7 @@ void XclExpCondfmt::WriteBody( XclExpStream& rStrm )
 
 void XclExpCondfmt::SaveXml( XclExpXmlStream& rStrm )
 {
-    if( !IsValid() )
+    if( !IsValidForXml() )
         return;
 
     sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
@@ -1475,8 +1485,7 @@ XclExpCondFormatBuffer::XclExpCondFormatBuffer( const XclExpRoot& rRoot, XclExtL
                         itr != pCondFmtList->end(); ++itr)
         {
             XclExpCondfmtList::RecordRefType xCondfmtRec( new XclExpCondfmt( GetRoot(), **itr, xExtLst, nIndex ));
-            if( xCondfmtRec->IsValid() )
-                maCondfmtList.AppendRecord( xCondfmtRec );
+            maCondfmtList.AppendRecord( xCondfmtRec );
         }
     }
 }
diff --git a/sc/source/filter/inc/xecontent.hxx b/sc/source/filter/inc/xecontent.hxx
index d8e9de5fd0c5..cbf41a377290 100644
--- a/sc/source/filter/inc/xecontent.hxx
+++ b/sc/source/filter/inc/xecontent.hxx
@@ -231,7 +231,8 @@ public:
     virtual             ~XclExpCondfmt() override;
 
     /** Returns true, if this conditional format contains at least one cell range and CF record. */
-    bool                IsValid() const;
+    bool                IsValidForBinary() const;
+    bool                IsValidForXml() const;
 
     /** Writes the CONDFMT record with following CF records, if there is valid data. */
     virtual void        Save( XclExpStream& rStrm ) override;
commit fb4ab759650e08089c2753a80d8e6ba8266d7970
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Mar 7 21:53:34 2017 +0200

    Make sure that the 'stAuthor' field of a 'NoteSh' structure filfills the spec
    
    Its length must be greater than or equal to 1 and less than or equal
    to 54, so if the author is empty, use a single space, and otherwise
    truncate to max 54 characters.
    
    See https://msdn.microsoft.com/en-us/library/dd945371
    
    Change-Id: I7604ae9e1d8eea336b42116ea7d305e183e6ca51
    (cherry picked from commit 27e34a7dbb9aa2ce52ca529ec835d54c6a5508fc)

diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 1681aabdef08..e0eb7775549b 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1203,7 +1203,13 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos,
                     mbRowHidden = (rRoot.GetDoc().RowHidden(maScPos.Row(),maScPos.Tab()));
                     mbColHidden = (rRoot.GetDoc().ColHidden(maScPos.Col(),maScPos.Tab()));
                 }
-                maAuthor = XclExpString( pScNote->GetAuthor() );
+                // stAuthor (variable): An XLUnicodeString that specifies the name of the comment
+                // author. String length MUST be greater than or equal to 1 and less than or equal
+                // to 54.
+                if( pScNote->GetAuthor().isEmpty() )
+                    maAuthor = XclExpString( " " );
+                else
+                    maAuthor = XclExpString( pScNote->GetAuthor(), EXC_STR_DEFAULT, 54 );
             }
 
             SetRecSize( 9 + maAuthor.GetSize() );
commit c44e25d3c0536c7b963e9102941d42abf1e154b6
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
Date:   Sat Dec 17 10:53:12 2016 +0100

    tdf#104729 FILESAVE Save author name in comment during export to .xlsx
    
    Change-Id: I59d46f6a713e4f252844cda0f631ace239d73cdb
    Reviewed-on: https://gerrit.libreoffice.org/32115
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit 36cdf3c35459df63ce137e550a6840a61865c0ca)
    (cherry picked from commit b61abf2d3d8638ace8abd08911b06a3ab1478799)

diff --git a/sc/qa/unit/data/ods/comment.ods b/sc/qa/unit/data/ods/comment.ods
new file mode 100644
index 000000000000..b772a6f00395
Binary files /dev/null and b/sc/qa/unit/data/ods/comment.ods differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 7060520294d8..b5c2cd2f83dd 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -108,6 +108,8 @@ public:
     void testCellNoteExportXLS();
     void testFormatExportODS();
 
+
+    void testCommentExportXLSX();
     void testCustomColumnWidthExportXLSX();
     void testXfDefaultValuesXLSX();
     void testColumnWidthResaveXLSX();
@@ -209,6 +211,7 @@ public:
     CPPUNIT_TEST(testCellNoteExportXLS);
     CPPUNIT_TEST(testFormatExportODS);
 
+    CPPUNIT_TEST(testCommentExportXLSX);
     CPPUNIT_TEST(testCustomColumnWidthExportXLSX);
     CPPUNIT_TEST(testXfDefaultValuesXLSX);
     CPPUNIT_TEST(testColumnWidthResaveXLSX);
@@ -499,6 +502,24 @@ void ScExportTest::testFormatExportODS()
     xDocSh->DoClose();
 }
 
+
+void ScExportTest::testCommentExportXLSX()
+{
+    //tdf#104729 FILESAVE OpenOffice do not save author of the comment during export to .xlsx
+    ScDocShellRef xShell = loadDoc("comment.", FORMAT_ODS);
+    CPPUNIT_ASSERT(xShell.Is());
+
+    std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX);
+    xmlDocPtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/comments1.xml");
+    CPPUNIT_ASSERT(pSheet);
+
+    assertXPath(pSheet, "/x:comments/x:authors/x:author[1]", "BAKO");
+    assertXPath(pSheet, "/x:comments/x:authors/x:author", 1);
+
+    assertXPath(pSheet, "/x:comments/x:commentList/x:comment/x:text/x:r/x:t", "Komentarz");
+
+}
+
 void ScExportTest::testCustomColumnWidthExportXLSX()
 {
     //tdf#100946 FILESAVE Excel on OS X ignored column widths in XLSX last saved by LO
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index c5a66a5a2e5b..1681aabdef08 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1184,6 +1184,7 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos,
         {
             // TODO: additional text
             if( pScNote )
+            {
                 if( SdrCaptionObj* pCaption = pScNote->GetOrCreateCaption( maScPos ) )
                 {
                     lcl_GetFromTo( rRoot, pCaption->GetLogicRect(), maScPos.Tab(), maCommentFrom, maCommentTo );
@@ -1202,6 +1203,8 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos,
                     mbRowHidden = (rRoot.GetDoc().RowHidden(maScPos.Row(),maScPos.Tab()));
                     mbColHidden = (rRoot.GetDoc().ColHidden(maScPos.Col(),maScPos.Tab()));
                 }
+                maAuthor = XclExpString( pScNote->GetAuthor() );
+            }
 
             SetRecSize( 9 + maAuthor.GetSize() );
         }
commit 0d8837b7d03dd4d82ca28919c4b106bf5724214a
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Mar 7 20:38:34 2017 +0200

    Write the 'FtNts' subrecord of 'Obj' when necessary
    
    See https://msdn.microsoft.com/en-us/library/dd952807 :
    
    nts (26 bytes): An optional FtNts structure that specifies the
    properties of this comment object. This field MUST exist if and only
    if cmo.ot is equal to 0x19.
    
    Change-Id: Ib4a007940c29a4f8eac1087601cfc7d242cfebd3
    (cherry picked from commit 20a7d4b16d600101f4073ad4ce669a7566bf14c1)

diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 85f80676ab8a..5944ccee98de 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -33,6 +33,7 @@
 #include <tools/urlobj.hxx>
 
 #include <rtl/math.hxx>
+#include <rtl/uuid.h>
 #include <svl/zformat.hxx>
 #include "formulacell.hxx"
 #include "drwlayer.hxx"
@@ -458,8 +459,26 @@ void XclObj::Save( XclExpStream& rStrm )
     SaveTextRecs( rStrm );
 }
 
-void XclObj::WriteSubRecs( XclExpStream& /*rStrm*/ )
+void XclObj::WriteSubRecs( XclExpStream& rStrm )
 {
+    if( mnObjType == EXC_OBJTYPE_NOTE )
+    {
+        // FtNts subrecord
+        AddRecSize( 26 );
+        // ft, cb
+        rStrm << EXC_ID_OBJNTS << sal_uInt16(0x0016);
+        sal_uInt8 aGUID[16];
+        rtl_createUuid( aGUID, nullptr, false );
+        // guid
+        rStrm.SetSliceSize( 16 );
+        for( int i = 0; i < 16; i++ )
+            rStrm << aGUID[i];
+        rStrm.SetSliceSize( 0 );
+        // fSharedNote
+        rStrm << sal_uInt16(0);
+        // unused
+        rStrm.WriteZeroBytes( 4 );
+    }
 }
 
 void XclObj::SaveTextRecs( XclExpStream& rStrm )
commit 1a286725fbb92e1b64057897351ed65bc888ac21
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Mar 7 18:20:55 2017 +0200

    It's SetSliceSize, not SetSliceLen
    
    Change-Id: Ife4449f5afa7321c18e8eb963878d9c037f6d623
    (cherry picked from commit 93a53e0ebba62873c768d887c6aa1125967aa9e4)

diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx
index 600b1442903a..aaefe66e6dcc 100644
--- a/sc/source/filter/inc/xestream.hxx
+++ b/sc/source/filter/inc/xestream.hxx
@@ -61,9 +61,9 @@ typedef std::shared_ptr< XclExpBiff8Encrypter > XclExpEncrypterRef;
     If some data exceeds the record size limit, a CONTINUE record is started automatically
     and the new data will be written to this record.
 
-    If specific data pieces must not be splitted, use SetSliceLen(). For instance:
+    If specific data pieces must not be splitted, use SetSliceSize(). For instance:
     To write a sequence of 16-bit values, where 4 values form a unit and cannot be
-    split, call SetSliceLen( 8 ) first (4*2 bytes == 8).
+    split, call SetSliceSize( 8 ) first (4*2 bytes == 8).
 
     To write unicode character arrays, call WriteUnicodeBuffer(). It creates CONTINUE
     records and repeats the unicode string flag byte automatically. This function is used
commit 4a483ae7aa5fd3c74ef4db5b71816ba64cd85981
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Mar 7 13:55:53 2017 +0200

    Use symbolic constants instead of hardcoded numbers
    
    The constants were commented out, so uncomment them.
    
    Probably lots of the same left.
    
    Change-Id: Iac87bef3bc331ae126741efbb4d58cc539e5a42a
    (cherry picked from commit 74df76d6ac91fae02ef0d20ce863cb753ba953cb)

diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index 6bbbdbb45f3c..70e4d4e68b28 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -56,6 +56,7 @@
 #include "excdoc.hxx"
 #include "namebuff.hxx"
 #include "xeextlst.hxx"
+#include "biffhelper.hxx"
 
 #include "xcl97rec.hxx"
 #include "xcl97esc.hxx"
@@ -105,7 +106,7 @@ static void lcl_AddCalcPr( XclExpRecordList<>& aRecList, ExcTable& self )
     aRecList.AppendNewRecord( new XclRefmode( rDoc ) );
     aRecList.AppendNewRecord( new XclIteration( rDoc ) );
     aRecList.AppendNewRecord( new XclDelta( rDoc ) );
-    aRecList.AppendNewRecord( new XclExpBoolRecord(0x005F, true) ); // SAVERECALC
+    aRecList.AppendNewRecord( new XclExpBoolRecord(oox::xls::BIFF_ID_SAVERECALC, true) );
     aRecList.AppendNewRecord( new XclExpXmlEndSingleElementRecord() );  // XML_calcPr
 }
 
@@ -510,9 +511,9 @@ void ExcTable::FillAsTableBinary( SCTAB nCodeNameIdx )
     if (pTabProtect && pTabProtect->isProtected())
     {
         Add( new XclExpProtection(true) );
-        Add( new XclExpBoolRecord(0x00DD, pTabProtect->isOptionEnabled(ScTableProtection::SCENARIOS)) );
+        Add( new XclExpBoolRecord(oox::xls::BIFF_ID_SCENPROTECT, pTabProtect->isOptionEnabled(ScTableProtection::SCENARIOS)) );
         if (pTabProtect->isOptionEnabled(ScTableProtection::OBJECTS))
-            Add( new XclExpBoolRecord(0x0063, true ));
+            Add( new XclExpBoolRecord(oox::xls::BIFF_ID_OBJECTPROTECT, true ));
         Add( new XclExpPassHash(pTabProtect->getPasswordHash(PASSHASH_XL)) );
     }
 
diff --git a/sc/source/filter/inc/biffhelper.hxx b/sc/source/filter/inc/biffhelper.hxx
index c0d959078d35..f988598c4888 100644
--- a/sc/source/filter/inc/biffhelper.hxx
+++ b/sc/source/filter/inc/biffhelper.hxx
@@ -253,7 +253,6 @@ const sal_Int32 BIFF12_ID_XF                = 0x002F;
     BIFF_UNKNOWN               /// Unknown BIFF version.
 */
 
-/** unused -- keep for documentation */
 //const sal_uInt16 BIFF2_MAXRECSIZE           = 2080;
 //const sal_uInt16 BIFF8_MAXRECSIZE           = 8224;
 
@@ -282,7 +281,10 @@ const sal_uInt16 BIFF_ID_PCITEM_STRING      = 0x00CD;
 
 const sal_uInt16 BIFF_ID_UNKNOWN            = SAL_MAX_UINT16;
 
-/** unused -- keep for documentation
+/* Many of thse constants might be unused, but please keep for documentation. If you notice
+ * hardcoded numbers in the code that actually correspond in meaning in the context (not just value)
+ * to one of the named constants, feel free to change it to use the constant instead, of course.
+ */
 const sal_uInt16 BIFF2_ID_ARRAY             = 0x0021;
 const sal_uInt16 BIFF3_ID_ARRAY             = 0x0221;
 const sal_uInt16 BIFF_ID_AUTOFILTER         = 0x009D;
@@ -532,10 +534,8 @@ const sal_uInt16 BIFF4_ID_XF                = 0x0443;
 const sal_uInt16 BIFF5_ID_XF                = 0x00E0;
 const sal_uInt16 BIFF_ID_XFCRC              = 0x087C;
 const sal_uInt16 BIFF_ID_XFEXT              = 0x087D;
-*/
 
 // OBJ subrecord identifiers --------------------------------------------------
-/**  unused -- keep for documentation
 const sal_uInt16 BIFF_ID_OBJEND             = 0x0000;   /// End of OBJ.
 const sal_uInt16 BIFF_ID_OBJMACRO           = 0x0004;   /// Macro link.
 const sal_uInt16 BIFF_ID_OBJBUTTON          = 0x0005;   /// Button data.
@@ -555,7 +555,7 @@ const sal_uInt16 BIFF_ID_OBJCBLSDATA        = 0x0012;   /// Check box/radio butt
 const sal_uInt16 BIFF_ID_OBJLBSDATA         = 0x0013;   /// List box/combo box data.
 const sal_uInt16 BIFF_ID_OBJCBLSFMLA        = 0x0014;   /// Check box/radio button cell link.
 const sal_uInt16 BIFF_ID_OBJCMO             = 0x0015;   /// Common object settings.
-*/
+
 // record constants -----------------------------------------------------------
 
 const sal_uInt8 BIFF_ERR_NULL               = 0x00;
@@ -566,7 +566,6 @@ const sal_uInt8 BIFF_ERR_NAME               = 0x1D;
 const sal_uInt8 BIFF_ERR_NUM                = 0x24;
 const sal_uInt8 BIFF_ERR_NA                 = 0x2A;
 
-/**  unused -- keep for documentation
 const sal_uInt16 BIFF_BOF_BIFF2             = 0x0200;
 const sal_uInt16 BIFF_BOF_BIFF3             = 0x0300;
 const sal_uInt16 BIFF_BOF_BIFF4             = 0x0400;
@@ -588,7 +587,6 @@ const sal_uInt8 BIFF_STRF_16BIT             = 0x01;
 const sal_uInt8 BIFF_STRF_PHONETIC          = 0x04;
 const sal_uInt8 BIFF_STRF_RICH              = 0x08;
 const sal_uInt8 BIFF_STRF_UNKNOWN           = 0xF2;
-*/
 
 /** Static helper functions for BIFF filters. */
 class BiffHelper
commit ca7dccdea4c6c22fe7e9c651a50e5466e26f3ce2
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Mar 6 20:42:46 2017 +0200

    The 'fLockObj' field of an 'ObjProtect' MUST be 0x0001 says the spec
    
    So generate such a record only when the protection state is on.
    
    See https://msdn.microsoft.com/en-us/library/dd922139(v=office.12).aspx
    
    Change-Id: I710395527cd53dc47018806e51fcc699e11fb461
    (cherry picked from commit 4a332d54b80bbc502ccc98bf924a269e00c10070)

diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index a1a2a75443d4..6bbbdbb45f3c 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -511,7 +511,8 @@ void ExcTable::FillAsTableBinary( SCTAB nCodeNameIdx )
     {
         Add( new XclExpProtection(true) );
         Add( new XclExpBoolRecord(0x00DD, pTabProtect->isOptionEnabled(ScTableProtection::SCENARIOS)) );
-        Add( new XclExpBoolRecord(0x0063, pTabProtect->isOptionEnabled(ScTableProtection::OBJECTS)) );
+        if (pTabProtect->isOptionEnabled(ScTableProtection::OBJECTS))
+            Add( new XclExpBoolRecord(0x0063, true ));
         Add( new XclExpPassHash(pTabProtect->getPasswordHash(PASSHASH_XL)) );
     }
 
commit bb10cc531e3b6590f8951968be94733f1690a0b8
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Mar 6 20:28:02 2017 +0200

    The 'reserved1' bit of a 'Formula' MUST be zero according to current spec
    
    See https://msdn.microsoft.com/en-us/library/dd908919(v=office.12).aspx .
    
    This means we will never set the EXC_FORMULA_RECALC_ONLOAD flag, hmm?
    
    Change-Id: Ic081caa7f98426394cbc7b0b320fa1a5a9a34f6c
    (cherry picked from commit 727ee3f92a8882914ac3f68eaf53ac519ace5f38)

diff --git a/sc/source/filter/inc/xltable.hxx b/sc/source/filter/inc/xltable.hxx
index 4d06dd250abb..44aea94b63ae 100644
--- a/sc/source/filter/inc/xltable.hxx
+++ b/sc/source/filter/inc/xltable.hxx
@@ -65,7 +65,7 @@ const sal_uInt16 EXC_ID4_FORMULA            = 0x0406;
 const sal_uInt16 EXC_FORMULA_RECALC_ALWAYS  = 0x0001;
 const sal_uInt16 EXC_FORMULA_RECALC_ONLOAD  = 0x0002;
 const sal_uInt16 EXC_FORMULA_SHARED         = 0x0008;
-const sal_uInt16 EXC_FORMULA_DEFAULTFLAGS   = EXC_FORMULA_RECALC_ONLOAD;
+const sal_uInt16 EXC_FORMULA_DEFAULTFLAGS   = 0x0000;
 
 const sal_uInt8 EXC_FORMULA_RES_STRING      = 0x00;     /// Result is a string.
 const sal_uInt8 EXC_FORMULA_RES_BOOL        = 0x01;     /// Result is Boolean value.
commit 31e20ceadd614f3d568c28da7797b812985c54e9
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Mar 6 20:11:24 2017 +0200

    Set the 'unused2' bit of 'Font' to 1 iff 'uls' is greater than 0 per spec
    
    See https://msdn.microsoft.com/en-us/library/dd906117(v=office.12).aspx .
    
    Change-Id: I4ff278f4cdd388947bbe81b88b6c39ff2b208b1a
    (cherry picked from commit 970f8dc7847967719652590f71f0f19e46ba7268)

diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index f5944d581626..cf8e2209ba0b 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -992,6 +992,8 @@ void XclExpFont::WriteBody( XclExpStream& rStrm )
 {
     sal_uInt16 nAttr = EXC_FONTATTR_NONE;
     ::set_flag( nAttr, EXC_FONTATTR_ITALIC, maData.mbItalic );
+    if( maData.mnUnderline > 0 )
+        ::set_flag( nAttr, EXC_FONTATTR_UNDERLINE, true );
     ::set_flag( nAttr, EXC_FONTATTR_STRIKEOUT, maData.mbStrikeout );
     ::set_flag( nAttr, EXC_FONTATTR_OUTLINE, maData.mbOutline );
     ::set_flag( nAttr, EXC_FONTATTR_SHADOW, maData.mbShadow );


More information about the Libreoffice-commits mailing list