[Libreoffice-commits] .: Branch 'libreoffice-3-6' - 2 commits - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 4 08:45:39 PDT 2012


 sc/source/filter/excel/xetable.cxx     |   14 +++-----------
 sc/source/filter/inc/xetable.hxx       |    3 +--
 sc/source/filter/oox/unitconverter.cxx |    5 +++--
 3 files changed, 7 insertions(+), 15 deletions(-)

New commits:
commit 743e9b1b63574fa79aff934369454868895d510c
Author: Noel Power <noel.power at suse.com>
Date:   Thu Oct 4 16:44:54 2012 +0100

    Revert "really export default row heights for xlsx fdo#55621" wrong branch
    
    This reverts commit 6b686a18539b384d032358879bd06d2def280842.

diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 793155a..e3967f2 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -2434,13 +2434,6 @@ void XclExpCellTable::Save( XclExpStream& rStrm )
 
 void XclExpCellTable::SaveXml( XclExpXmlStream& rStrm )
 {
-    // DEFAULT row height
-    XclExpDefaultRowData& rDefData = mxDefrowheight->GetDefaultData();
-    sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
-    rWorksheet->startElement( XML_sheetFormatPr,
-        XML_defaultRowHeight, OString::valueOf( (double) rDefData.mnHeight / 20.0 ).getStr(), FSEND );
-    rWorksheet->endElement( XML_sheetFormatPr );
-
     maColInfoBfr.SaveXml( rStrm );
     maRowBfr.SaveXml( rStrm );
 }
diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx
index 291c37f..33b7b2c 100644
--- a/sc/source/filter/inc/xetable.hxx
+++ b/sc/source/filter/inc/xetable.hxx
@@ -851,7 +851,7 @@ public:
 
     /** Sets the passed default data as current record contents. */
     void                SetDefaultData( const XclExpDefaultRowData& rDefData );
-    XclExpDefaultRowData& GetDefaultData() { return maDefData; }
+
 private:
     /** Writes the contents of the record. */
     virtual void        WriteBody( XclExpStream& rStrm );
commit b8e55d021ff3100818f6160cfb6dd2685eb08c26
Author: Noel Power <noel.power at suse.com>
Date:   Thu Oct 4 16:44:35 2012 +0100

    Revert "xlsx fix import/export of column widths fdo#55623" wrong branch
    
    This reverts commit f08e1ac6c0998e36359cc08e590ee6e8dfab3599.

diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 98f8cb5..793155a 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -1482,9 +1482,8 @@ XclExpColinfo::XclExpColinfo( const XclExpRoot& rRoot,
         SCCOL nScCol, SCROW nLastScRow, XclExpColOutlineBuffer& rOutlineBfr ) :
     XclExpRecord( EXC_ID_COLINFO, 12 ),
     XclExpRoot( rRoot ),
-    mnFlags( 0 ),
     mnWidth( 0 ),
-    mnScWidth( 0 ),
+    mnFlags( 0 ),
     mnFirstXclCol( static_cast< sal_uInt16 >( nScCol ) ),
     mnLastXclCol( static_cast< sal_uInt16 >( nScCol ) )
 {
@@ -1498,7 +1497,7 @@ XclExpColinfo::XclExpColinfo( const XclExpRoot& rRoot,
     // column width
     sal_uInt16 nScWidth = rDoc.GetColWidth( nScCol, nScTab );
     mnWidth = XclTools::GetXclColumnWidth( nScWidth, GetCharWidth() );
-    mnScWidth =  sc::TwipsToHMM( nScWidth );
+
     // column flags
     ::set_flag( mnFlags, EXC_COLINFO_HIDDEN, rDoc.ColHidden(nScCol, nScTab) );
 
@@ -1564,7 +1563,7 @@ void XclExpColinfo::SaveXml( XclExpXmlStream& rStrm )
             // OOXTODO: XML_outlineLevel,
             // OOXTODO: XML_phonetic,
             XML_style,          lcl_GetStyleId( rStrm, maXFId.mnXFIndex ).getStr(),
-            XML_width,          OString::valueOf( (double) (mnScWidth / (double)sc::TwipsToHMM( GetCharWidth() )) ).getStr(),
+            XML_width,          OString::valueOf( (double) (mnWidth / 255.0) ).getStr(),
             FSEND );
 }
 
diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx
index d9ce5ea..291c37f 100644
--- a/sc/source/filter/inc/xetable.hxx
+++ b/sc/source/filter/inc/xetable.hxx
@@ -783,7 +783,6 @@ private:
 private:
     XclExpXFId          maXFId;             /// The XF identifier for column default format.
     sal_uInt16          mnWidth;            /// Excel width of the column.
-    sal_uInt16          mnScWidth;          /// Calc width of the column.
     sal_uInt16          mnFlags;            /// Additional column flags.
     sal_uInt16          mnFirstXclCol;      /// Index to first column.
     sal_uInt16          mnLastXclCol;       /// Index to last column.
diff --git a/sc/source/filter/oox/unitconverter.cxx b/sc/source/filter/oox/unitconverter.cxx
index 2d0431b..e2feb87 100644
--- a/sc/source/filter/oox/unitconverter.cxx
+++ b/sc/source/filter/oox/unitconverter.cxx
@@ -149,17 +149,18 @@ void UnitConverter::finalizeImport()
         {
             // XDevice expects pixels in font descriptor, but font contains twips
             FontDescriptor aDesc = pDefFont->getFontDescriptor();
+            aDesc.Height = static_cast< sal_Int16 >( scaleValue( aDesc.Height, UNIT_TWIP, UNIT_REFDEVX ) + 0.5 );
             Reference< XFont > xFont = xDevice->getFont( aDesc );
             if( xFont.is() )
             {
                 // get maximum width of all digits
                 sal_Int32 nDigitWidth = 0;
                 for( sal_Unicode cChar = '0'; cChar <= '9'; ++cChar )
-                    nDigitWidth = ::std::max( nDigitWidth, scaleToMm100( xFont->getCharWidth( cChar ), UNIT_TWIP ) );
+                    nDigitWidth = ::std::max( nDigitWidth, scaleToMm100( xFont->getCharWidth( cChar ), UNIT_REFDEVX ) );
                 if( nDigitWidth > 0 )
                     maCoeffs[ UNIT_DIGIT ] = nDigitWidth;
                 // get width of space character
-                sal_Int32 nSpaceWidth = scaleToMm100( xFont->getCharWidth( ' ' ), UNIT_TWIP );
+                sal_Int32 nSpaceWidth = scaleToMm100( xFont->getCharWidth( ' ' ), UNIT_REFDEVX );
                 if( nSpaceWidth > 0 )
                     maCoeffs[ UNIT_SPACE ] = nSpaceWidth;
             }


More information about the Libreoffice-commits mailing list