[ooo-build-commit] .: oox/inc oox/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Oct 5 08:32:35 PDT 2010


 oox/inc/oox/xls/stylesbuffer.hxx |    5 +++--
 oox/source/token/properties.txt  |    2 ++
 oox/source/xls/stylesbuffer.cxx  |   30 ++++++++++++++++++++++--------
 3 files changed, 27 insertions(+), 10 deletions(-)

New commits:
commit 890da80fbc09b2d260a6fa8639f3fe014ac1c950
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Oct 5 11:19:52 2010 -0400

    Ported calc-distributed-cell-text-*.diff from ooo-build.
    
    This feature enables horizontal 'distributed' alignment and vertical
    'justified' and 'distributed' alignments for cell contents in Calc.
    Note that this feature relies on ODF 1.2 extended in order for the
    relevant cell attributes to be saved in ODS.

diff --git a/oox/inc/oox/xls/stylesbuffer.hxx b/oox/inc/oox/xls/stylesbuffer.hxx
index 5a8ebb0..e49df00 100644
--- a/oox/inc/oox/xls/stylesbuffer.hxx
+++ b/oox/inc/oox/xls/stylesbuffer.hxx
@@ -360,11 +360,12 @@ struct AlignmentModel
 struct ApiAlignmentData
 {
     typedef ::com::sun::star::table::CellHoriJustify ApiCellHoriJustify;
-    typedef ::com::sun::star::table::CellVertJustify ApiCellVertJustify;
     typedef ::com::sun::star::table::CellOrientation ApiCellOrientation;
 
     ApiCellHoriJustify  meHorJustify;       /// Horizontal alignment.
-    ApiCellVertJustify  meVerJustify;       /// Vertical alignment.
+    sal_Int32           mnHorJustifyMethod;
+    sal_Int32           mnVerJustify;       /// Vertical alignment.
+    sal_Int32           mnVerJustifyMethod;
     ApiCellOrientation  meOrientation;      /// Normal or stacked text.
     sal_Int32           mnRotation;         /// Text rotation angle.
     sal_Int16           mnWritingMode;      /// CTL text direction.
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index da1aeb2..46894b0 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -195,6 +195,7 @@ Height
 HelpText
 HideInactiveSelection
 HoriJustify
+HoriJustifyMethod
 HorizontalSplitMode
 HorizontalSplitPositionTwips
 IgnoreBlankCells
@@ -445,6 +446,7 @@ VScroll
 Validation
 VaryColorsByPoint
 VertJustify
+VertJustifyMethod
 VerticalAlign
 VerticalSplitMode
 VerticalSplitPositionTwips
diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx
index b0b9df2..91966c2 100644
--- a/oox/source/xls/stylesbuffer.cxx
+++ b/oox/source/xls/stylesbuffer.cxx
@@ -41,6 +41,8 @@
 #include <com/sun/star/style/XStyle.hpp>
 #include <com/sun/star/text/WritingMode2.hpp>
 #include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/table/CellVertJustify2.hpp>
+#include <com/sun/star/table/CellJustifyMethod.hpp>
 #include <rtl/tencinfo.h>
 #include <rtl/ustrbuf.hxx>
 #include "properties.hxx"
@@ -1253,7 +1255,9 @@ void AlignmentModel::setBinTextOrient( sal_uInt8 nTextOrient )
 
 ApiAlignmentData::ApiAlignmentData() :
     meHorJustify( ::com::sun::star::table::CellHoriJustify_STANDARD ),
-    meVerJustify( ::com::sun::star::table::CellVertJustify_STANDARD ),
+    mnHorJustifyMethod( ::com::sun::star::table::CellJustifyMethod::AUTO ),
+    mnVerJustify( ::com::sun::star::table::CellVertJustify2::STANDARD ),
+    mnVerJustifyMethod( ::com::sun::star::table::CellJustifyMethod::AUTO ),
     meOrientation( ::com::sun::star::table::CellOrientation_STANDARD ),
     mnRotation( 0 ),
     mnWritingMode( ::com::sun::star::text::WritingMode2::PAGE ),
@@ -1267,7 +1271,9 @@ bool operator==( const ApiAlignmentData& rLeft, const ApiAlignmentData& rRight )
 {
     return
         (rLeft.meHorJustify  == rRight.meHorJustify) &&
-        (rLeft.meVerJustify  == rRight.meVerJustify) &&
+        (rLeft.mnHorJustifyMethod == rRight.mnHorJustifyMethod) &&
+        (rLeft.mnVerJustify  == rRight.mnVerJustify) &&
+        (rLeft.mnVerJustifyMethod == rRight.mnVerJustifyMethod) &&
         (rLeft.meOrientation == rRight.meOrientation) &&
         (rLeft.mnRotation    == rRight.mnRotation) &&
         (rLeft.mnWritingMode == rRight.mnWritingMode) &&
@@ -1364,16 +1370,22 @@ void Alignment::finalizeImport()
         case XML_right:             maApiData.meHorJustify = csstab::CellHoriJustify_RIGHT;     break;
     }
 
+    if (maModel.mnHorAlign == XML_distributed)
+        maApiData.mnHorJustifyMethod = csstab::CellJustifyMethod::DISTRIBUTE;
+
     // vertical alignment
     switch( maModel.mnVerAlign )
     {
-        case XML_bottom:        maApiData.meVerJustify = csstab::CellVertJustify_BOTTOM;    break;
-        case XML_center:        maApiData.meVerJustify = csstab::CellVertJustify_CENTER;    break;
-        case XML_distributed:   maApiData.meVerJustify = csstab::CellVertJustify_TOP;       break;
-        case XML_justify:       maApiData.meVerJustify = csstab::CellVertJustify_TOP;       break;
-        case XML_top:           maApiData.meVerJustify = csstab::CellVertJustify_TOP;       break;
+        case XML_bottom:        maApiData.mnVerJustify = csstab::CellVertJustify2::BOTTOM;    break;
+        case XML_center:        maApiData.mnVerJustify = csstab::CellVertJustify2::CENTER;    break;
+        case XML_distributed:   maApiData.mnVerJustify = csstab::CellVertJustify2::BLOCK;     break;
+        case XML_justify:       maApiData.mnVerJustify = csstab::CellVertJustify2::BLOCK;     break;
+        case XML_top:           maApiData.mnVerJustify = csstab::CellVertJustify2::TOP;       break;
     }
 
+    if (maModel.mnVerAlign == XML_distributed)
+        maApiData.mnVerJustifyMethod = csstab::CellJustifyMethod::DISTRIBUTE;
+
     /*  indentation: expressed as number of blocks of 3 space characters in
         OOX, and as multiple of 10 points in BIFF. */
     sal_Int32 nIndent = 0;
@@ -1413,7 +1425,9 @@ void Alignment::finalizeImport()
 void Alignment::writeToPropertyMap( PropertyMap& rPropMap ) const
 {
     rPropMap[ PROP_HoriJustify ]     <<= maApiData.meHorJustify;
-    rPropMap[ PROP_VertJustify ]     <<= maApiData.meVerJustify;
+    rPropMap[ PROP_HoriJustifyMethod ] <<= maApiData.mnHorJustifyMethod;
+    rPropMap[ PROP_VertJustify ]     <<= maApiData.mnVerJustify;
+    rPropMap[ PROP_VertJustifyMethod ] <<= maApiData.mnVerJustifyMethod;
     rPropMap[ PROP_WritingMode ]     <<= maApiData.mnWritingMode;
     rPropMap[ PROP_RotateAngle ]     <<= maApiData.mnRotation;
     rPropMap[ PROP_Orientation ]     <<= maApiData.meOrientation;


More information about the ooo-build-commit mailing list