1. mst
  2. ooo340

Commits

Oliver-Rainer Wittmann  committed 1f50dcf

textalignment01: #i105270# - first adjustments of sc text alignment UNO-API

  • Participants
  • Parent commits 76aaac7
  • Branches default

Comments (0)

Files changed (6)

File sc/inc/unonames.hxx

View file
 #define SC_UNONAME_CELLTRAN			"IsCellBackgroundTransparent"
 #define SC_UNONAME_CELLPRO			"CellProtection"
 #define SC_UNONAME_CELLHJUS			"HoriJustify"
-#define SC_UNONAME_CELLVJUS			"VertJustify"
+// --> OD #i105270#
+#define SC_UNONAME_CELLTEXTALIGN    "CellTextAlign"
+// <--
+#define SC_UNONAME_CELLVJUS         "VertJustify"
 #define SC_UNONAME_CELLORI			"Orientation"
 #define SC_UNONAME_NUMFMT			"NumberFormat"
 #define SC_UNONAME_SHADOW			"ShadowFormat"

File sc/source/filter/xml/xmlstyle.cxx

View file
 #include <com/sun/star/table/CellOrientation.hpp>
 #include <com/sun/star/table/CellVertJustify.hpp>
 #include <com/sun/star/table/CellHoriJustify.hpp>
+// --> OD #i105270#
+#include <com/sun/star/table/CellTextAlignment.hpp>
+// <--
 #include <com/sun/star/table/TableBorder.hpp>
 #include <com/sun/star/sheet/XSheetConditionalEntries.hpp>
 #include <com/sun/star/sheet/XSheetConditionalEntry.hpp>
     MAP( "DiagonalTLBR", XML_NAMESPACE_STYLE, XML_DIAGONAL_TL_BR, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER, CTF_SC_DIAGONALTLBR ),
     MAP( "DiagonalTLBR", XML_NAMESPACE_STYLE, XML_DIAGONAL_TL_BR_WIDTH, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, CTF_SC_DIAGONALTLBRWIDTH ), // #i102690# for old files
     MAP( "DiagonalTLBR", XML_NAMESPACE_STYLE, XML_DIAGONAL_TL_BR_WIDTHS, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER_WIDTH, CTF_SC_DIAGONALTLBRWIDTHS ),
-	MAP( "HoriJustify", XML_NAMESPACE_FO, XML_TEXT_ALIGN, XML_TYPE_PROP_PARAGRAPH|XML_SC_TYPE_HORIJUSTIFY|MID_FLAG_MERGE_PROPERTY, 0 ),
-	MAP( "HoriJustify", XML_NAMESPACE_STYLE, XML_TEXT_ALIGN_SOURCE, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_HORIJUSTIFYSOURCE|MID_FLAG_MERGE_PROPERTY, 0 ),
-	MAP( "HoriJustify", XML_NAMESPACE_STYLE, XML_REPEAT_CONTENT, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_HORIJUSTIFYREPEAT|MID_FLAG_MERGE_PROPERTY, 0 ),
+    // --> OD #i105270#
+    MAP( "CellTextAlign", XML_NAMESPACE_FO, XML_TEXT_ALIGN, XML_TYPE_PROP_PARAGRAPH|XML_SC_TYPE_CELLTEXTALIGN|MID_FLAG_MERGE_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_SC_CELLTEXTALIGN ),
+    MAP( "HoriJustify", XML_NAMESPACE_FO, XML_TEXT_ALIGN, XML_TYPE_PROP_PARAGRAPH|XML_SC_TYPE_HORIJUSTIFY|MID_FLAG_MERGE_PROPERTY|MID_FLAG_NO_PROPERTY_EXPORT, CTF_SC_HORIJUSTIFY ),
+    MAP( "CellTextAlign", XML_NAMESPACE_STYLE, XML_TEXT_ALIGN_SOURCE, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_CELLTEXTALIGNSOURCE|MID_FLAG_MERGE_PROPERTY|MID_FLAG_MULTI_PROPERTY, 0 ),
+    MAP( "HoriJustify", XML_NAMESPACE_STYLE, XML_TEXT_ALIGN_SOURCE, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_HORIJUSTIFYSOURCE|MID_FLAG_MERGE_PROPERTY|MID_FLAG_NO_PROPERTY_EXPORT, 0 ),
+    MAP( "CellTextAlign", XML_NAMESPACE_STYLE, XML_REPEAT_CONTENT, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_CELLTEXTALIGNREPEAT|MID_FLAG_MERGE_PROPERTY|MID_FLAG_MULTI_PROPERTY, 0 ),
+    MAP( "HoriJustify", XML_NAMESPACE_STYLE, XML_REPEAT_CONTENT, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_HORIJUSTIFYREPEAT|MID_FLAG_MERGE_PROPERTY|MID_FLAG_NO_PROPERTY_EXPORT, 0 ),
+    // <--
 	MAP( "IsCellBackgroundTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_ISTRANSPARENT|MID_FLAG_MULTI_PROPERTY|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
 	MAP( "IsTextWrapped", XML_NAMESPACE_FO, XML_WRAP_OPTION, XML_TYPE_PROP_TABLE_CELL|XML_SC_ISTEXTWRAPPED, 0 ),
 	MAP( "LeftBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER, CTF_SC_ALLBORDER ),
 {
 }
 
+// --> OD #i105270#
+static SvXMLEnumMapEntry pXML_Cell_Text_Alignment_Enum[] =
+{
+    { XML_START,        table::CellTextAlignment_START },
+    { XML_END,          table::CellTextAlignment_END },
+    { XML_CENTER,       table::CellTextAlignment_CENTER },
+    { XML_JUSTIFY,      table::CellTextAlignment_BLOCK },
+    { XML_JUSTIFIED,    table::CellTextAlignment_BLOCK }, // obsolete
+    { XML_LEFT,         table::CellTextAlignment_START },
+    { XML_RIGHT,        table::CellTextAlignment_END },
+    { XML_TOKEN_INVALID, 0 }
+};
+
+class XmlScPropHdl_CellTextAlignment : public XMLPropertyHandler
+{
+public:
+    XmlScPropHdl_CellTextAlignment()
+    {
+    };
+                
+    virtual bool equals( const uno::Any& r1, 
+                         const uno::Any& r2 ) const
+    {
+        table::CellTextAlignment aTextAlign1;
+        table::CellTextAlignment aTextAlign2;
+
+        if ( (r1 >>= aTextAlign1) && 
+             (r2 >>= aTextAlign2) )
+        {
+            return (aTextAlign1 == aTextAlign2);
+        }
+
+        return false;
+    };
+    
+
+    virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, 
+                                ::com::sun::star::uno::Any& rValue, 
+                                const SvXMLUnitConverter& /*rUnitConverter*/ ) const
+    {
+        sal_Bool bRet( sal_False );
+
+        table::CellTextAlignment nValue = table::CellTextAlignment_START;
+        rValue >>= nValue;
+        if ( nValue == table::CellTextAlignment_REPEAT )
+        {
+            bRet = sal_True;
+        }
+        else
+        {
+            sal_uInt16 eCellTextAlign;
+            bRet = SvXMLUnitConverter::convertEnum( eCellTextAlign, rStrImpValue, pXML_Cell_Text_Alignment_Enum );
+            if ( bRet )
+            {        
+                rValue <<= (table::CellTextAlignment)eCellTextAlign;
+            }
+        }
+
+        return bRet; 
+    };
+        
+    virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, 
+                                const ::com::sun::star::uno::Any& rValue, 
+                                const SvXMLUnitConverter& /*rUnitConverter*/ ) const
+    {
+        if ( !rValue.hasValue() )
+        {        
+            return sal_False;
+        }
+
+        table::CellTextAlignment eUnoVal( table::CellTextAlignment_START );
+        if ( !(rValue >>= eUnoVal) )
+        {
+            sal_Int32 nVal = 0;
+            if ( !(rValue >>= nVal) )
+            {
+                return sal_False;
+            }
+            eUnoVal = static_cast<table::CellTextAlignment>(nVal);
+        }
+        // nothing to export for attribute value <table::CellTextAlignment_STANDARD>
+        if ( eUnoVal == table::CellTextAlignment_STANDARD )
+        {
+            return sal_False;
+        }
+
+        sal_Bool bRet( sal_False );
+        
+        // export <table::CellTextAlignment_REPEAT> as <table::CellTextAlignment_START>
+        if ( eUnoVal == table::CellTextAlignment_REPEAT )
+        {
+            eUnoVal = table::CellTextAlignment_START;
+        }
+        
+        ::rtl::OUStringBuffer aOut;
+        bRet = SvXMLUnitConverter::convertEnum( aOut, eUnoVal, pXML_Cell_Text_Alignment_Enum, XML_START ); 
+
+        rStrExpValue = aOut.makeStringAndClear();
+
+        return bRet;
+    };                                
+};
+
+class XmlScPropHdl_CellTextAlignmentSource : public XMLPropertyHandler
+{
+public:
+    XmlScPropHdl_CellTextAlignmentSource()
+    {
+    };
+                
+    virtual bool equals( const uno::Any& r1, 
+                         const uno::Any& r2 ) const
+    {
+        table::CellTextAlignment aTextAlign1;
+        table::CellTextAlignment aTextAlign2;
+
+        if ( (r1 >>= aTextAlign1) && 
+             (r2 >>= aTextAlign2) )
+        {
+            return (aTextAlign1 == aTextAlign2);
+        }
+
+        return false;
+    };
+    
+
+    virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, 
+                                ::com::sun::star::uno::Any& rValue, 
+                                const SvXMLUnitConverter& /*rUnitConverter*/ ) const
+    {
+        sal_Bool bRetval(sal_False);
+
+        if (IsXMLToken(rStrImpValue, XML_FIX))
+        {
+            bRetval = sal_True;
+        }
+        else if (IsXMLToken(rStrImpValue, XML_VALUE_TYPE))
+        {
+            table::CellHoriJustify nValue(table::CellHoriJustify_STANDARD);
+            rValue <<= table::CellTextAlignment_STANDARD;
+            bRetval = sal_True;
+        }
+
+        return bRetval;
+    };
+        
+    virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, 
+                                const ::com::sun::star::uno::Any& rValue, 
+                                const SvXMLUnitConverter& /*rUnitConverter*/ ) const
+    {
+        sal_Bool bRetval(sal_False);
+
+        table::CellTextAlignment nVal;
+        if ( rValue >>= nVal )
+        {
+            if ( nVal == table::CellTextAlignment_STANDARD )
+            {
+                rStrExpValue = GetXMLToken(XML_VALUE_TYPE);
+                bRetval = sal_True;
+            }
+            else
+            {
+                rStrExpValue = GetXMLToken(XML_FIX);
+                bRetval = sal_True;
+            }
+        }
+
+        return bRetval;
+    };                                
+};
+
+class XmlScPropHdl_CellTextAlignmentRepeat : public XMLPropertyHandler
+{
+public:
+    XmlScPropHdl_CellTextAlignmentRepeat()
+    {
+    };
+                
+    virtual bool equals( const uno::Any& r1, 
+                         const uno::Any& r2 ) const
+    {
+        table::CellTextAlignment aTextAlign1;
+        table::CellTextAlignment aTextAlign2;
+
+        if ( (r1 >>= aTextAlign1) && 
+             (r2 >>= aTextAlign2) )
+        {
+            return (aTextAlign1 == aTextAlign2);
+        }
+
+        return false;
+    };
+    
+
+    virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, 
+                                ::com::sun::star::uno::Any& rValue, 
+                                const SvXMLUnitConverter& /*rUnitConverter*/ ) const
+    {
+        sal_Bool bRetval(sal_False);
+
+        if ( IsXMLToken(rStrImpValue, XML_FALSE) )
+        {
+            bRetval = sal_True;
+        }
+        else if ( IsXMLToken(rStrImpValue, XML_TRUE) )
+        {
+            rValue <<= table::CellTextAlignment_REPEAT;
+            bRetval = sal_True;
+        }
+
+        return bRetval;
+    };
+        
+    virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, 
+                                const ::com::sun::star::uno::Any& rValue, 
+                                const SvXMLUnitConverter& /*rUnitConverter*/ ) const
+    {
+        sal_Bool bRetval(sal_False);
+
+        table::CellTextAlignment nVal;
+        if ( rValue >>= nVal )
+        {
+            if (nVal == table::CellTextAlignment_REPEAT)
+            {
+                rStrExpValue = GetXMLToken(XML_TRUE);
+                bRetval = sal_True;
+            }
+            else
+            {
+                rStrExpValue = GetXMLToken(XML_FALSE);
+                bRetval = sal_True;
+            }
+        }
+
+        return bRetval;
+    };                                
+};
+// <--
+
 XMLScPropHdlFactory::XMLScPropHdlFactory()
 	: XMLPropertyHandlerFactory()
 {
 				pHdl = new XmlScPropHdl_HoriJustify;
 			}
 			break;
+            // --> OD #i105270#
+            case XML_SC_TYPE_CELLTEXTALIGN :
+            {
+                pHdl = new XmlScPropHdl_CellTextAlignment;
+            }
+            break;
+            // <--
 			case XML_SC_TYPE_HORIJUSTIFYSOURCE :
 			{
 				pHdl = new XmlScPropHdl_HoriJustifySource;
 			}
 			break;
-			case XML_SC_TYPE_HORIJUSTIFYREPEAT :
+            // --> OD #i105270#
+            case XML_SC_TYPE_CELLTEXTALIGNSOURCE :
+            {
+                pHdl = new XmlScPropHdl_CellTextAlignmentSource;
+            }
+            break;
+            // <--
+            case XML_SC_TYPE_HORIJUSTIFYREPEAT :
 			{
 				pHdl = new XmlScPropHdl_HoriJustifyRepeat;
 			}
 			break;
-			case XML_SC_TYPE_ORIENTATION :
+            // --> OD #i105270#
+            case XML_SC_TYPE_CELLTEXTALIGNREPEAT :
+            {
+                pHdl = new XmlScPropHdl_CellTextAlignmentRepeat;
+            }
+            break;
+            // <--
+            case XML_SC_TYPE_ORIENTATION :
 			{
 				pHdl = new XmlScPropHdl_Orientation;
 			}

File sc/source/filter/xml/xmlstyle.hxx

View file
 #define XML_SC_ISTEXTWRAPPED						(XML_SC_TYPES_START + 14)
 #define XML_SC_TYPE_EQUAL							(XML_SC_TYPES_START + 15)
 #define XML_SC_TYPE_VERTICAL						(XML_SC_TYPES_START + 16)
+// --> OD #i105270#
+#define XML_SC_TYPE_CELLTEXTALIGN                   (XML_SC_TYPES_START + 17)
+#define XML_SC_TYPE_CELLTEXTALIGNSOURCE             (XML_SC_TYPES_START + 18)
+#define XML_SC_TYPE_CELLTEXTALIGNREPEAT             (XML_SC_TYPES_START + 19)
+// <--
 
 #define CTF_SC_HORIJUSTIFY							(XML_SC_CTF_START +  1)
 #define CTF_SC_HORIJUSTIFY_SOURCE					(XML_SC_CTF_START +  2)
 #define CTF_SC_DIAGONALBLTRWIDTH					(XML_SC_CTF_START + 28)
 #define CTF_SC_DIAGONALTLBRWIDTHS                   (XML_SC_CTF_START + 29)
 #define CTF_SC_DIAGONALBLTRWIDTHS                   (XML_SC_CTF_START + 30)
+// --> OD #i105270#
+#define CTF_SC_CELLTEXTALIGN                        (XML_SC_CTF_START + 31)
+#define CTF_SC_HORIJUSTIFY_REPEAT                   (XML_SC_CTF_START + 32)
+// <--
 
 #define CTF_SC_ROWHEIGHT							(XML_SC_CTF_START + 50)
 #define CTF_SC_ROWOPTIMALHEIGHT						(XML_SC_CTF_START + 51)

File sc/source/filter/xml/xmlstyli.cxx

View file
 #include <com/sun/star/table/BorderLine.hpp>
 // --> OD #i105270#
 #include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/table/CellHoriJustify.hpp>
 // <--
 #include <comphelper/extract.hxx>
 #include <xmloff/xmlprcon.hxx>
     XMLPropertyState* pDiagBorders[2] = { 0 };
     XMLPropertyState* pOldDiagBorderWidths[2] = { 0 };      // old attribute names without "s"
     XMLPropertyState* pDiagBorderWidths[2] = { 0 };
+    // --> OD #i105270#
+    // cell text alignment attribute - replaces horizontal justify attribute
+    XMLPropertyState* pCellTextAlign = 0;
+    // horizontal justify attribute - kept for the import of legacy documents
+    XMLPropertyState* pHorJust = 0;
+//    // legacy horizontal source attribute
+//    XMLPropertyState* pHorJustSource = 0;
+//    // legacy horizontal repeat attribute
+//    XMLPropertyState* pHorJustRepeat = 0;
+    // <--
 
 	::std::vector< XMLPropertyState >::iterator endproperty(rProperties.end());
 	for (::std::vector< XMLPropertyState >::iterator aIter =  rProperties.begin();
                 case CTF_SC_DIAGONALTLBRWIDTHS          : pDiagBorderWidths[XML_LINE_TLBR] = &*property; break;
                 case CTF_SC_DIAGONALBLTRWIDTH           : pOldDiagBorderWidths[XML_LINE_BLTR] = &*property; break;
                 case CTF_SC_DIAGONALBLTRWIDTHS          : pDiagBorderWidths[XML_LINE_BLTR] = &*property; break;
+                // --> OD #i105270#
+                case CTF_SC_CELLTEXTALIGN               : pCellTextAlign = &*property; break;
+                case CTF_SC_HORIJUSTIFY                 : pHorJust = &*property; break;
+//                case CTF_SC_HORIJUSTIFY_SOURCE          : pHorJustSource = &*property; break;
+//                case CTF_SC_HORIJUSTIFY_REPEAT          : pHorJustRepeat = &*property; break;
+                // <--
 		    }
         }
 	}
 	sal_uInt16 i;
 
+    // --> OD #i105270#
+    if ( pCellTextAlign || pHorJust )
+    {
+        if ( GetImport().getGeneratorVersion() <= SvXMLImport::OOo_33x )
+        {
+            // use horizontal justify attribute to import fo:text-align
+            // for legacy documents.
+            if ( pCellTextAlign )
+            {
+                pCellTextAlign->mnIndex = -1;
+            }
+        }    
+        else
+        {
+            if ( pHorJust )
+            {
+                pHorJust->mnIndex = -1;
+            }
+        }            
+    }
+
+//    if ( pHorJustSource )
+//    {
+//        pHorJustSource->mnIndex = -1;
+//    }
+
+//    if ( pHorJustRepeat )
+//    {
+//        pHorJustRepeat->mnIndex = -1;
+//    }
+    // <--
+
     // #i27594#; copy Value, but don't insert
     if (pAllBorderWidthProperty)
         pAllBorderWidthProperty->mnIndex = -1;

File sc/source/ui/unoobj/styleuno.cxx

View file
 #include <com/sun/star/table/TableBorder.hpp>
 #include <com/sun/star/table/ShadowFormat.hpp>
 #include <com/sun/star/table/CellHoriJustify.hpp>
+// --> OD #i105270#
+#include <com/sun/star/table/CellTextAlignment.hpp>
+// <--
 #include <com/sun/star/table/CellOrientation.hpp>
 #include <com/sun/star/style/PageStyleLayout.hpp>
 #include <com/sun/star/style/GraphicLocation.hpp>
 		{MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER,		&::getCppuType((const table::BorderLine*)0),		0, BOTTOM_BORDER | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLBACK),	ATTR_BACKGROUND,	&::getCppuType((const sal_Int32*)0),			0, MID_BACK_COLOR },
 		{MAP_CHAR_LEN(SC_UNONAME_CELLPRO),	ATTR_PROTECTION,	&::getCppuType((const util::CellProtection*)0),	0, 0 },
+        // --> OD #i105270#
+        {MAP_CHAR_LEN(SC_UNONAME_CELLTEXTALIGN), ATTR_HOR_JUSTIFY, &::getCppuType((const table::CellTextAlignment*)0), 0, MID_HORJUST_TEXT_ALIGN },
+        // <--
 		{MAP_CHAR_LEN(SC_UNONAME_CCOLOR),	ATTR_FONT_COLOR,	&::getCppuType((const sal_Int32*)0),			0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_COUTL),	ATTR_FONT_CONTOUR,	&::getBooleanCppuType(),			0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_CCROSS),	ATTR_FONT_CROSSEDOUT,&::getBooleanCppuType(),			0, MID_CROSSED_OUT },
 		{MAP_CHAR_LEN(SC_UNONAME_NUMFMT),	ATTR_VALUE_FORMAT,	&::getCppuType((const sal_Int32*)0),			0, 0 },
 //		{MAP_CHAR_LEN(SC_UNONAME_NUMRULES),	SC_WID_UNO_NUMRULES,&getCppuType((const uno::Reference<container::XIndexReplace>*)0), 0, 0 },
         {MAP_CHAR_LEN(SC_UNONAME_CELLORI),  ATTR_STACKED,       &::getCppuType((const table::CellOrientation*)0),   0, 0 },
-		{MAP_CHAR_LEN(SC_UNONAME_PADJUST),	ATTR_HOR_JUSTIFY,	&::getCppuType((const sal_Int16*)0),	0, MID_HORJUST_ADJUST },
+        {MAP_CHAR_LEN(SC_UNONAME_PADJUST),  ATTR_HOR_JUSTIFY,   &::getCppuType((const sal_Int16*)0),    0, MID_HORJUST_ADJUST },
 		{MAP_CHAR_LEN(SC_UNONAME_PBMARGIN),	ATTR_MARGIN,		&::getCppuType((const sal_Int32*)0),			0, MID_MARGIN_LO_MARGIN | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_PINDENT),	ATTR_INDENT,		&::getCppuType((const sal_Int16*)0),			0, 0 }, //! CONVERT_TWIPS
 		{MAP_CHAR_LEN(SC_UNONAME_PISCHDIST),ATTR_SCRIPTSPACE,	&::getBooleanCppuType(),					0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_PISFORBID),ATTR_FORBIDDEN_RULES,&::getBooleanCppuType(),					0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_PISHANG),	ATTR_HANGPUNCTUATION,&::getBooleanCppuType(),					0, 0 },
 		{MAP_CHAR_LEN(SC_UNONAME_PISHYPHEN),ATTR_HYPHENATE,		&getBooleanCppuType(),					0, 0 },
-		{MAP_CHAR_LEN(SC_UNONAME_PLASTADJ),	ATTR_HOR_JUSTIFY,	&::getCppuType((const sal_Int16*)0),	0, MID_HORJUST_ADJUST },
+        {MAP_CHAR_LEN(SC_UNONAME_PLASTADJ), ATTR_HOR_JUSTIFY,   &::getCppuType((const sal_Int16*)0),    0, MID_HORJUST_ADJUST },
 		{MAP_CHAR_LEN(SC_UNONAME_PLMARGIN),	ATTR_MARGIN,		&::getCppuType((const sal_Int32*)0),			0, MID_MARGIN_L_MARGIN  | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_PRMARGIN),	ATTR_MARGIN,		&::getCppuType((const sal_Int32*)0),			0, MID_MARGIN_R_MARGIN  | CONVERT_TWIPS },
 		{MAP_CHAR_LEN(SC_UNONAME_PTMARGIN),	ATTR_MARGIN,		&::getCppuType((const sal_Int32*)0),			0, MID_MARGIN_UP_MARGIN | CONVERT_TWIPS },

File svx/source/items/algitem.cxx

View file
 					case SVX_HOR_JUSTIFY_CENTER: nAdjust = style::ParagraphAdjust_CENTER; break;
 					case SVX_HOR_JUSTIFY_RIGHT:	 nAdjust = style::ParagraphAdjust_RIGHT;  break;
 					case SVX_HOR_JUSTIFY_BLOCK:	 nAdjust = style::ParagraphAdjust_BLOCK;  break;
-                    default: ; // prevent warning
+                    default: 
+                        {
+                            DBG_ASSERT( false, 
+                                        "<SvxHorJustifyItem::QueryValue( MID_HORJUST_ADJUST ) - item contains unsupported value - conversion needed" );
+                            bSuccess = sal_False;
+                        }
                 }
 				rVal <<= nAdjust;		// as sal_Int16
 			}
 					case style::ParagraphAdjust_STRETCH:
 					case style::ParagraphAdjust_BLOCK:   eSvx = SVX_HOR_JUSTIFY_BLOCK;  break;
 					case style::ParagraphAdjust_CENTER:  eSvx = SVX_HOR_JUSTIFY_CENTER; break;
+                    default:
+                        {
+                            DBG_ASSERT( false, 
+                                        "<SvxHorJustifyItem::PutValue( MID_HORJUST_ADJUST ) - value contains unsupported value - conversion needed" );
+                            bSuccess = sal_False;
+                        }
 				}
 				SetValue( (sal_uInt16)eSvx );
 			}