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

New commits:
commit 0678304aa69bc5f7bbbd0b6a79e12e875a6b0788
Author: Noel Power <noel.po...@suse.com>
Date:   Fri Sep 28 16:59:02 2012 +0100

    fix xlsx export missing alignment attributes with cellstyle fdo#55417
    
    Change-Id: I510d0f399c58b5a9b192f3566e093c636cae2c0a
    Reviewed-on: https://gerrit.libreoffice.org/959
    Reviewed-by: Kohei Yoshida <kohei.yosh...@gmail.com>
    Tested-by: Kohei Yoshida <kohei.yosh...@gmail.com>

diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index 13b7d40..626baa5 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 );
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to