[Libreoffice-commits] .: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 28 09:39:12 PDT 2012


 sc/source/filter/excel/xestyle.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 78a102e2060a1a8fc003d91fa3193b2bfa841d26
Author: Noel Power <noel.power at suse.com>
Date:   Fri Sep 28 16:59:02 2012 +0100

    fix xlsx export missing alignment attributes with cellstyle fdo#55417
    
    Change-Id: I510d0f399c58b5a9b192f3566e093c636cae2c0a

diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index ebbe256..a904831 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -2025,7 +2025,6 @@ void XclExpXF::Init( const SfxItemSet& rItemSet, sal_Int16 nScript,
         GETITEMVALUE( rItemSet, SfxUInt32Item, ATTR_VALUE_FORMAT, sal_uLong ) : nForceScNumFmt;
     mnXclNumFmt = GetNumFmtBuffer().Insert( mnScNumFmt );
     mbFmtUsed = ScfTools::CheckItem( rItemSet, ATTR_VALUE_FORMAT, IsStyleXF() );
-
     // alignment
     mbAlignUsed = maAlignment.FillFromItemSet( rItemSet, bForceLineBreak, GetBiff(), IsStyleXF() );
 
@@ -2112,10 +2111,12 @@ void XclExpXF::SaveXml( XclExpXmlStream& rStrm )
     sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream();
 
     sal_Int32 nXfId = 0;
+    const XclExpXF* pStyleXF = NULL;
     if( IsCellXF() )
     {
         sal_uInt16 nXFIndex = rStrm.GetRoot().GetXFBuffer().GetXFIndex( mnParentXFId );
         nXfId = rStrm.GetRoot().GetXFBuffer().GetXmlStyleIndex( nXFIndex );
+        pStyleXF = rStrm.GetRoot().GetXFBuffer().GetXFById( mnParentXFId );
     }
 
     rStyleSheet->startElement( XML_xf,
@@ -2135,8 +2136,13 @@ void XclExpXF::SaveXml( XclExpXmlStream& rStrm )
             FSEND );
     if( mbAlignUsed )
         maAlignment.SaveXml( rStrm );
+    else if ( pStyleXF )
+        pStyleXF->GetAlignmentData().SaveXml( rStrm );
     if( mbProtUsed )
         maProtection.SaveXml( rStrm );
+    else if ( pStyleXF )
+        pStyleXF->GetProtectionData().SaveXml( rStrm );
+
     // OOXTODO: XML_extLst
     rStyleSheet->endElement( XML_xf );
 }


More information about the Libreoffice-commits mailing list