diff options
Diffstat (limited to 'xmloff/source/style')
118 files changed, 772 insertions, 997 deletions
diff --git a/xmloff/source/style/AttributeContainerHandler.cxx b/xmloff/source/style/AttributeContainerHandler.cxx index cc542b25675a..94c0f2e25ef2 100644 --- a/xmloff/source/style/AttributeContainerHandler.cxx +++ b/xmloff/source/style/AttributeContainerHandler.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,3 +103,5 @@ sal_Bool XMLAttributeContainerHandler::exportXML( OUString& /*rStrExpValue*/, co { return sal_True; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/DashStyle.cxx b/xmloff/source/style/DashStyle.cxx index 9ac798381e0c..97f187b5178e 100644 --- a/xmloff/source/style/DashStyle.cxx +++ b/xmloff/source/style/DashStyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,7 +62,7 @@ enum SvXMLTokenMapAttrs XML_TOK_DASH_END=XML_TOK_UNKNOWN }; -static __FAR_DATA SvXMLTokenMapEntry aDashStyleAttrTokenMap[] = +static SvXMLTokenMapEntry aDashStyleAttrTokenMap[] = { { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_DASH_NAME }, { XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, XML_TOK_DASH_DISPLAY_NAME }, @@ -74,7 +75,7 @@ static __FAR_DATA SvXMLTokenMapEntry aDashStyleAttrTokenMap[] = XML_TOKEN_MAP_END }; -SvXMLEnumMapEntry __READONLY_DATA pXML_DashStyle_Enum[] = +SvXMLEnumMapEntry const pXML_DashStyle_Enum[] = { { XML_RECT, drawing::DashStyle_RECT }, { XML_ROUND, drawing::DashStyle_ROUND }, @@ -220,8 +221,6 @@ sal_Bool XMLDashStyleImport::importXML( // Export //------------------------------------------------------------- -#ifndef SVX_LIGHT - XMLDashStyleExport::XMLDashStyleExport( SvXMLExport& rExp ) : rExport(rExp) { @@ -329,4 +328,4 @@ sal_Bool XMLDashStyleExport::exportXML( return bRet; } -#endif // #ifndef SVX_LIGHT +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/DrawAspectHdl.cxx b/xmloff/source/style/DrawAspectHdl.cxx index acf49bbab471..754e22b27d47 100644 --- a/xmloff/source/style/DrawAspectHdl.cxx +++ b/xmloff/source/style/DrawAspectHdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,7 +45,7 @@ using namespace ::xmloff::token; // class XMLMeasurePropHdl // -SvXMLEnumMapEntry __READONLY_DATA pXML_DrawAspect_Enum[] = +SvXMLEnumMapEntry const pXML_DrawAspect_Enum[] = { { XML_CONTENT, 1 }, { XML_THUMBNAIL, 2 }, @@ -87,3 +88,4 @@ sal_Bool DrawAspectHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValu return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/DrawAspectHdl.hxx b/xmloff/source/style/DrawAspectHdl.hxx index 52b14d5af2dd..c644c0dc85fb 100644 --- a/xmloff/source/style/DrawAspectHdl.hxx +++ b/xmloff/source/style/DrawAspectHdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,5 @@ public: }; #endif // _XMLOFF_DRAWASPECTHDL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/EnumPropertyHdl.cxx b/xmloff/source/style/EnumPropertyHdl.cxx index 0c01ba9e6db9..55c3a60491ad 100644 --- a/xmloff/source/style/EnumPropertyHdl.cxx +++ b/xmloff/source/style/EnumPropertyHdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -71,7 +72,7 @@ sal_Bool XMLEnumPropertyHdl::importXML( const OUString& rStrImpValue, Any& rValu rValue <<= (sal_Int8) nValue; break; default: - DBG_ERROR( "Wrong type for enum property handler!" ); + OSL_FAIL( "Wrong type for enum property handler!" ); return sal_False; } return sal_True; @@ -96,3 +97,4 @@ sal_Bool XMLEnumPropertyHdl::exportXML( OUString& rStrExpValue, const Any& rValu return sal_True; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/FillStyleContext.cxx b/xmloff/source/style/FillStyleContext.cxx index 7038f1b74495..305b4932a2db 100644 --- a/xmloff/source/style/FillStyleContext.cxx +++ b/xmloff/source/style/FillStyleContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,8 +57,6 @@ XMLGradientStyleContext::XMLGradientStyleContext( SvXMLImport& rImport, sal_uInt const uno::Reference< xml::sax::XAttributeList >& xAttrList) : SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList) { - // set Family -// SetFamily( XML_STYLE_FAMILY_FILLSTYLE_GRADIENT_ID ); // start import XMLGradientStyleImport aGradientStyle( GetImport() ); @@ -359,3 +358,5 @@ sal_Bool XMLDashStyleContext::IsTransient() const { return sal_True; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/FillStyleContext.hxx b/xmloff/source/style/FillStyleContext.hxx index 32d448cbb0b1..b047ea42b5ef 100644 --- a/xmloff/source/style/FillStyleContext.hxx +++ b/xmloff/source/style/FillStyleContext.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -165,3 +166,5 @@ public: }; #endif // _XMLOFF_FILLSTYLECONTEXTS_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx index 6e3921593644..c468f2907d1e 100644 --- a/xmloff/source/style/GradientStyle.cxx +++ b/xmloff/source/style/GradientStyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -66,7 +67,7 @@ enum SvXMLTokenMapAttrs }; -SvXMLEnumMapEntry __READONLY_DATA pXML_GradientStyle_Enum[] = +SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] = { { XML_GRADIENTSTYLE_LINEAR, awt::GradientStyle_LINEAR }, { XML_GRADIENTSTYLE_AXIAL, awt::GradientStyle_AXIAL }, @@ -111,7 +112,7 @@ sal_Bool XMLGradientStyleImport::importXML( aGradient.Border = 0; { - static __FAR_DATA SvXMLTokenMapEntry aGradientAttrTokenMap[] = + static SvXMLTokenMapEntry aGradientAttrTokenMap[] = { { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_GRADIENT_NAME }, { XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, XML_TOK_GRADIENT_DISPLAY_NAME }, @@ -234,8 +235,6 @@ sal_Bool XMLGradientStyleImport::importXML( // Export //------------------------------------------------------------- -#ifndef SVX_LIGHT - XMLGradientStyleExport::XMLGradientStyleExport( SvXMLExport& rExp ) : rExport(rExp) @@ -341,4 +340,4 @@ sal_Bool XMLGradientStyleExport::exportXML( return bRet; } -#endif // #ifndef SVX_LIGHT +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/HatchStyle.cxx b/xmloff/source/style/HatchStyle.cxx index 7785d70f2596..ded1ad105cb7 100644 --- a/xmloff/source/style/HatchStyle.cxx +++ b/xmloff/source/style/HatchStyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -58,7 +59,7 @@ enum SvXMLTokenMapAttrs }; -SvXMLEnumMapEntry __READONLY_DATA pXML_HatchStyle_Enum[] = +SvXMLEnumMapEntry const pXML_HatchStyle_Enum[] = { { XML_HATCHSTYLE_SINGLE, drawing::HatchStyle_SINGLE }, { XML_HATCHSTYLE_DOUBLE, drawing::HatchStyle_DOUBLE }, @@ -100,7 +101,7 @@ sal_Bool XMLHatchStyleImport::importXML( aHatch.Angle = 0; { - static __FAR_DATA SvXMLTokenMapEntry aHatchAttrTokenMap[] = + static SvXMLTokenMapEntry aHatchAttrTokenMap[] = { { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_HATCH_NAME }, { XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, XML_TOK_HATCH_DISPLAY_NAME }, @@ -188,8 +189,6 @@ sal_Bool XMLHatchStyleImport::importXML( // Export //------------------------------------------------------------- -#ifndef SVX_LIGHT - XMLHatchStyleExport::XMLHatchStyleExport( SvXMLExport& rExp ) : rExport(rExp) { @@ -260,4 +259,4 @@ sal_Bool XMLHatchStyleExport::exportXML( return bRet; } -#endif // #ifndef SVX_LIGHT +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/ImageStyle.cxx b/xmloff/source/style/ImageStyle.cxx index f6716bfbcfd4..f306ede9eaa3 100644 --- a/xmloff/source/style/ImageStyle.cxx +++ b/xmloff/source/style/ImageStyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,8 +56,6 @@ enum SvXMLTokenMapAttrs XML_TOK_IMAGE_TYPE, XML_TOK_IMAGE_SHOW, XML_TOK_IMAGE_ACTUATE, - /* XML_TOK_IMAGE_SIZEW, - XML_TOK_IMAGE_SIZEH,*/ XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN }; @@ -69,8 +68,6 @@ XMLImageStyle::~XMLImageStyle() { } -#ifndef SVX_LIGHT - sal_Bool XMLImageStyle::exportXML( const OUString& rStrName, const ::com::sun::star::uno::Any& rValue, SvXMLExport& rExport ) { return ImpExportXML( rStrName, rValue, rExport ); @@ -107,18 +104,7 @@ sal_Bool XMLImageStyle::ImpExportXML( const OUString& rStrName, const uno::Any& rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED ); rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD ); } -/* - // size - awt::Size aSize = xBitmap->getSize(); - - rUnitConverter.convertNumber( aOut, aSize.Width ); - aStrValue = aOut.makeStringAndClear(); - AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH, aStrValue ); - - rUnitConverter.convertNumber( aOut, aSize.Height ); - aStrValue = aOut.makeStringAndClear(); - AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, aStrValue ); -*/ + // Do Write SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_FILL_IMAGE, sal_True, sal_True ); @@ -133,8 +119,6 @@ sal_Bool XMLImageStyle::ImpExportXML( const OUString& rStrName, const uno::Any& return bRet; } -#endif // #ifndef SVX_LIGHT - sal_Bool XMLImageStyle::importXML( const uno::Reference< xml::sax::XAttributeList >& xAttrList, uno::Any& rValue, OUString& rStrName, SvXMLImport& rImport ) { return ImpImportXML( xAttrList, rValue, rStrName, rImport ); @@ -151,7 +135,7 @@ sal_Bool XMLImageStyle::ImpImportXML( const uno::Reference< xml::sax::XAttribute OUString aDisplayName; { - static __FAR_DATA SvXMLTokenMapEntry aHatchAttrTokenMap[] = + static SvXMLTokenMapEntry aHatchAttrTokenMap[] = { { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_IMAGE_NAME }, { XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, XML_TOK_IMAGE_DISPLAY_NAME }, @@ -159,8 +143,6 @@ sal_Bool XMLImageStyle::ImpImportXML( const uno::Reference< xml::sax::XAttribute { XML_NAMESPACE_XLINK, XML_TYPE, XML_TOK_IMAGE_TYPE }, { XML_NAMESPACE_XLINK, XML_SHOW, XML_TOK_IMAGE_SHOW }, { XML_NAMESPACE_XLINK, XML_ACTUATE, XML_TOK_IMAGE_ACTUATE }, - /*{ XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_IMAGE_URL }, - { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_IMAGE_URL },*/ XML_TOKEN_MAP_END }; @@ -223,3 +205,5 @@ sal_Bool XMLImageStyle::ImpImportXML( const uno::Reference< xml::sax::XAttribute return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/MarkerStyle.cxx b/xmloff/source/style/MarkerStyle.cxx index f0f32bb18c25..5cacaf44b08b 100644 --- a/xmloff/source/style/MarkerStyle.cxx +++ b/xmloff/source/style/MarkerStyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -164,8 +165,6 @@ sal_Bool XMLMarkerStyleImport::importXML( // Export //------------------------------------------------------------- -#ifndef SVX_LIGHT - XMLMarkerStyleExport::XMLMarkerStyleExport( SvXMLExport& rExp ) : rExport( rExp ) { @@ -283,4 +282,4 @@ sal_Bool XMLMarkerStyleExport::exportXML( return bRet; } -#endif // #ifndef SVX_LIGHT +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/MultiPropertySetHelper.cxx b/xmloff/source/style/MultiPropertySetHelper.cxx index 301d1668505f..dc5e2eee6cc7 100644 --- a/xmloff/source/style/MultiPropertySetHelper.cxx +++ b/xmloff/source/style/MultiPropertySetHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" -#ifndef _XMLOFF_MULTIPROPERTYSETHELPER_HXX #include "MultiPropertySetHelper.hxx" -#endif #include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XMultiPropertySet.hpp> @@ -214,3 +213,5 @@ const Any& MultiPropertySetHelper::getValue( sal_Int16 nIndex, // inline methods defined in header: // inline Any& MultiPropertySetHelper::getValue( sal_Int16 nIndex ) // inline sal_Bool MultiPropertySetHelper::hasProperty( sal_Int16 nValueNo ) + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/NamedBoolPropertyHdl.cxx b/xmloff/source/style/NamedBoolPropertyHdl.cxx index 1402630ec3db..8f008a65751e 100644 --- a/xmloff/source/style/NamedBoolPropertyHdl.cxx +++ b/xmloff/source/style/NamedBoolPropertyHdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,3 +81,4 @@ sal_Bool XMLNamedBoolPropertyHdl::exportXML( OUString& rStrExpValue, const Any& return sal_True; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageHeaderFooterContext.cxx b/xmloff/source/style/PageHeaderFooterContext.cxx index b8939b4cf889..5661ec44c16a 100644 --- a/xmloff/source/style/PageHeaderFooterContext.cxx +++ b/xmloff/source/style/PageHeaderFooterContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,9 +34,7 @@ // INCLUDE --------------------------------------------------------------- -#ifndef _XMLOFF_PAGEPHEADERFOOTERCONTEXT_HXX #include "PageHeaderFooterContext.hxx" -#endif #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> #include "PagePropertySetContext.hxx" @@ -98,3 +97,4 @@ void PageHeaderFooterContext::EndElement() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageHeaderFooterContext.hxx b/xmloff/source/style/PageHeaderFooterContext.hxx index e5b437f2ce21..b47b99577ccd 100644 --- a/xmloff/source/style/PageHeaderFooterContext.hxx +++ b/xmloff/source/style/PageHeaderFooterContext.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,3 +62,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageMasterExportPropMapper.cxx b/xmloff/source/style/PageMasterExportPropMapper.cxx index d803b79b50a1..ff6c46cc466f 100644 --- a/xmloff/source/style/PageMasterExportPropMapper.cxx +++ b/xmloff/source/style/PageMasterExportPropMapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +31,7 @@ #include "PageMasterExportPropMapper.hxx" #include <xmloff/xmltoken.hxx> #include <comphelper/types.hxx> -#include <com/sun/star/table/BorderLine.hpp> +#include <com/sun/star/table/BorderLine2.hpp> #include <xmloff/PageMasterStyleMap.hxx> #include <tools/debug.hxx> #include <rtl/ustrbuf.hxx> @@ -45,17 +46,19 @@ using namespace ::xmloff::token; //______________________________________________________________________________ -inline sal_Bool lcl_HasSameLineWidth( const table::BorderLine& rLine1, const table::BorderLine& rLine2 ) +inline sal_Bool lcl_HasSameLineWidth( const table::BorderLine2& rLine1, const table::BorderLine2& rLine2 ) { return (rLine1.InnerLineWidth == rLine2.InnerLineWidth) && (rLine1.OuterLineWidth == rLine2.OuterLineWidth) && - (rLine1.LineDistance == rLine2.LineDistance); + (rLine1.LineDistance == rLine2.LineDistance) && + (rLine1.LineWidth == rLine2.LineWidth); } -inline sal_Bool operator==( const table::BorderLine& rLine1, const table::BorderLine& rLine2 ) +inline sal_Bool operator==( const table::BorderLine2& rLine1, const table::BorderLine2& rLine2 ) { return (rLine1.Color == rLine2.Color) && - lcl_HasSameLineWidth( rLine1, rLine2 ); + lcl_HasSameLineWidth( rLine1, rLine2 ) && + ( rLine1.LineStyle == rLine2.LineStyle ); } inline void lcl_RemoveState( XMLPropertyState* pState ) @@ -168,7 +171,7 @@ void XMLPropertyStateBuffer::ContextFilter( ::std::vector< XMLPropertyState >& ) { if( pPMBorderTop && pPMBorderBottom && pPMBorderLeft && pPMBorderRight ) { - table::BorderLine aLineTop, aLineBottom, aLineLeft, aLineRight; + table::BorderLine2 aLineTop, aLineBottom, aLineLeft, aLineRight; pPMBorderTop->maValue >>= aLineTop; pPMBorderBottom->maValue >>= aLineBottom; @@ -193,7 +196,7 @@ void XMLPropertyStateBuffer::ContextFilter( ::std::vector< XMLPropertyState >& ) { if( pPMBorderWidthTop && pPMBorderWidthBottom && pPMBorderWidthLeft && pPMBorderWidthRight ) { - table::BorderLine aLineTop, aLineBottom, aLineLeft, aLineRight; + table::BorderLine2 aLineTop, aLineBottom, aLineLeft, aLineRight; pPMBorderWidthTop->maValue >>= aLineTop; pPMBorderWidthBottom->maValue >>= aLineBottom; @@ -482,3 +485,4 @@ void XMLPageMasterExportPropMapper::ContextFilter( SvXMLExportPropertyMapper::ContextFilter(rPropState,rPropSet); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageMasterExportPropMapper.hxx b/xmloff/source/style/PageMasterExportPropMapper.hxx index da098ea15de2..20617b0726de 100644 --- a/xmloff/source/style/PageMasterExportPropMapper.hxx +++ b/xmloff/source/style/PageMasterExportPropMapper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,3 +78,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageMasterImportContext.cxx b/xmloff/source/style/PageMasterImportContext.cxx index bcbb05012fec..fbaff859da3f 100644 --- a/xmloff/source/style/PageMasterImportContext.cxx +++ b/xmloff/source/style/PageMasterImportContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,16 +35,10 @@ #include <xmloff/xmltoken.hxx> #include "PageMasterPropHdl.hxx" #include "PagePropertySetContext.hxx" -#ifndef _XMLOFF_PAGEPHEADERFOOTERCONTEXT_HXX #include "PageHeaderFooterContext.hxx" -#endif -#ifndef _XMLOFF_PAGEMASTERPROPMAPPER_HXX #include "PageMasterPropMapper.hxx" -#endif #include "PageMasterImportPropMapper.hxx" -#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX #include <xmloff/PageMasterStyleMap.hxx> -#endif #include <com/sun/star/lang/XMultiServiceFactory.hpp> using namespace ::com::sun::star; @@ -199,3 +194,4 @@ void PageStyleContext::SetDefaults( ) } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageMasterImportPropMapper.cxx b/xmloff/source/style/PageMasterImportPropMapper.cxx index 4af6e1ce16e1..f920425e0d8e 100644 --- a/xmloff/source/style/PageMasterImportPropMapper.cxx +++ b/xmloff/source/style/PageMasterImportPropMapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,7 +33,7 @@ #include "PageMasterPropMapper.hxx" #include <xmloff/PageMasterStyleMap.hxx> #include <xmloff/maptype.hxx> -#include <com/sun/star/table/BorderLine.hpp> +#include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <xmloff/xmlimp.hxx> @@ -57,7 +58,7 @@ PageMasterImportPropertyMapper::~PageMasterImportPropertyMapper() { } -sal_Bool PageMasterImportPropertyMapper::handleSpecialItem( +bool PageMasterImportPropertyMapper::handleSpecialItem( XMLPropertyState& rProperty, ::std::vector< XMLPropertyState >& rProperties, const ::rtl::OUString& rValue, @@ -259,15 +260,16 @@ void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >& pBorderWidths[i]->mnIndex = -1; if( pBorders[i] ) { - table::BorderLine aBorderLine; + table::BorderLine2 aBorderLine; pBorders[i]->maValue >>= aBorderLine; if( pBorderWidths[i] ) { - table::BorderLine aBorderLineWidth; + table::BorderLine2 aBorderLineWidth; pBorderWidths[i]->maValue >>= aBorderLineWidth; aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth; aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth; aBorderLine.LineDistance = aBorderLineWidth.LineDistance; + aBorderLine.LineWidth = aBorderLineWidth.LineWidth; pBorders[i]->maValue <<= aBorderLine; } } @@ -281,15 +283,16 @@ void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >& pHeaderBorderWidths[i]->mnIndex = -1; if( pHeaderBorders[i] ) { - table::BorderLine aBorderLine; + table::BorderLine2 aBorderLine; pHeaderBorders[i]->maValue >>= aBorderLine; if( pHeaderBorderWidths[i] ) { - table::BorderLine aBorderLineWidth; + table::BorderLine2 aBorderLineWidth; pHeaderBorderWidths[i]->maValue >>= aBorderLineWidth; aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth; aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth; aBorderLine.LineDistance = aBorderLineWidth.LineDistance; + aBorderLine.LineWidth = aBorderLineWidth.LineWidth; pHeaderBorders[i]->maValue <<= aBorderLine; } } @@ -303,15 +306,16 @@ void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >& pFooterBorderWidths[i]->mnIndex = -1; if( pFooterBorders[i] ) { - table::BorderLine aBorderLine; + table::BorderLine2 aBorderLine; pFooterBorders[i]->maValue >>= aBorderLine; if( pFooterBorderWidths[i] ) { - table::BorderLine aBorderLineWidth; + table::BorderLine2 aBorderLineWidth; pFooterBorderWidths[i]->maValue >>= aBorderLineWidth; aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth; aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth; aBorderLine.LineDistance = aBorderLineWidth.LineDistance; + aBorderLine.LineWidth = aBorderLineWidth.LineWidth; pFooterBorders[i]->maValue <<= aBorderLine; } } @@ -402,3 +406,4 @@ void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >& } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageMasterImportPropMapper.hxx b/xmloff/source/style/PageMasterImportPropMapper.hxx index 56a5014e8ef6..e386104ed8c9 100644 --- a/xmloff/source/style/PageMasterImportPropMapper.hxx +++ b/xmloff/source/style/PageMasterImportPropMapper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,7 +47,7 @@ public: virtual ~PageMasterImportPropertyMapper(); /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_IMPORT flag set */ - virtual sal_Bool handleSpecialItem( + virtual bool handleSpecialItem( XMLPropertyState& rProperty, ::std::vector< XMLPropertyState >& rProperties, const ::rtl::OUString& rValue, @@ -60,3 +61,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageMasterPropHdl.cxx b/xmloff/source/style/PageMasterPropHdl.cxx index 755272db92a7..4fb090f32662 100644 --- a/xmloff/source/style/PageMasterPropHdl.cxx +++ b/xmloff/source/style/PageMasterPropHdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -424,3 +425,4 @@ sal_Bool XMLPMPropHdl_CenterVertical::exportXML( return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageMasterPropHdl.hxx b/xmloff/source/style/PageMasterPropHdl.hxx index 23a124dd6e3d..b2e1b6ade887 100644 --- a/xmloff/source/style/PageMasterPropHdl.hxx +++ b/xmloff/source/style/PageMasterPropHdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -178,3 +179,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageMasterPropHdlFactory.cxx b/xmloff/source/style/PageMasterPropHdlFactory.cxx index 2888f87e8f7e..3ff8a9c1a75d 100644 --- a/xmloff/source/style/PageMasterPropHdlFactory.cxx +++ b/xmloff/source/style/PageMasterPropHdlFactory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,14 +33,10 @@ #include <xmloff/xmltoken.hxx> #include "xmlbahdl.hxx" #include <xmloff/NamedBoolPropertyHdl.hxx> -#ifndef _XMLOFF_XMLTEXTCOLUMNSPPROPERTYHANDLER_HXX #include "XMLTextColumnsPropertyHandler.hxx" -#endif #include <xmloff/XMLConstantsPropertyHandler.hxx> #include "PageMasterPropHdl.hxx" -#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX #include <xmloff/PageMasterStyleMap.hxx> -#endif #include <com/sun/star/text/TextGridMode.hpp> @@ -148,3 +145,4 @@ const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_I } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageMasterPropHdlFactory.hxx b/xmloff/source/style/PageMasterPropHdlFactory.hxx index af558029f4a3..10b796c59640 100644 --- a/xmloff/source/style/PageMasterPropHdlFactory.hxx +++ b/xmloff/source/style/PageMasterPropHdlFactory.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,3 +46,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageMasterPropMapper.cxx b/xmloff/source/style/PageMasterPropMapper.cxx index cf27923288c3..97159c698f9c 100644 --- a/xmloff/source/style/PageMasterPropMapper.cxx +++ b/xmloff/source/style/PageMasterPropMapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,14 +29,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" -#ifndef _XMLOFF_PAGEMASTERPROPMAPPER_HXX #include "PageMasterPropMapper.hxx" -#endif -#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX #include <xmloff/PageMasterStyleMap.hxx> -#endif #include "PageMasterPropHdlFactory.hxx" using namespace ::com::sun::star; @@ -61,3 +58,4 @@ XMLPageMasterPropSetMapper::~XMLPageMasterPropSetMapper() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageMasterPropMapper.hxx b/xmloff/source/style/PageMasterPropMapper.hxx index 90ddabdd082d..2b48501b75d7 100644 --- a/xmloff/source/style/PageMasterPropMapper.hxx +++ b/xmloff/source/style/PageMasterPropMapper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,3 +45,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx index 41d2172ab4fa..f207f7d7f43a 100644 --- a/xmloff/source/style/PageMasterStyleMap.cxx +++ b/xmloff/source/style/PageMasterStyleMap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +30,6 @@ #include "precompiled_xmloff.hxx" #include <xmloff/PageMasterStyleMap.hxx> - #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmltoken.hxx> @@ -111,6 +111,7 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] = //text grid enhancement for better CJK support PLMAP( "GridBaseWidth", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_BASE_WIDTH, XML_TYPE_MEASURE, CTP_PM_GRID_BASE_WIDTH ), + PLMAP( "GridSnapToChars", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_SNAP_TO, XML_TYPE_BOOL, CTP_PM_GRID_SNAP_TO_CHARS ), PLMAP( "GridSnapToChars", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_SNAP_TO_CHARS, XML_TYPE_BOOL, CTP_PM_GRID_SNAP_TO_CHARS ), //export as a default attribute PLMAP( "StandardPageMode", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_STANDARD_MODE, XML_TYPE_BOOL|MID_FLAG_DEFAULT_ITEM_EXPORT, CTF_PM_STANDARD_MODE ), @@ -125,6 +126,7 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] = PLMAP( "FootnoteLineRelativeWidth", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_PERCENT8|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_WIDTH ), PLMAP( "FootnoteLineTextDistance", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_MEASURE|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_DISTANCE ), PLMAP( "FootnoteLineWeight", XML_NAMESPACE_STYLE, XML_FOOTNOTE_SEP, XML_TYPE_MEASURE16|MID_FLAG_ELEMENT_ITEM, CTF_PM_FTN_LINE_WEIGTH ), + PLMAP( "FootnoteLineStyle", XML_NAMESPACE_STYLE, XML_EMPTY, XML_TYPE_STRING|MID_FLAG_ELEMENT_ITEM, CTF_PM_FTN_LINE_STYLE ), // header HFMAP( "HeaderHeight", XML_NAMESPACE_SVG, XML_HEIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERHEIGHT ), @@ -191,3 +193,4 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] = { 0L, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010 } }; +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PagePropertySetContext.cxx b/xmloff/source/style/PagePropertySetContext.cxx index f65cc7689dc0..21c2c09ec31a 100644 --- a/xmloff/source/style/PagePropertySetContext.cxx +++ b/xmloff/source/style/PagePropertySetContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include "PagePropertySetContext.hxx" #include "XMLBackgroundImageContext.hxx" #include "XMLTextColumnsContext.hxx" -#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX #include <xmloff/PageMasterStyleMap.hxx> -#endif #include "XMLFootnoteSeparatorImport.hxx" using ::rtl::OUString; @@ -100,6 +99,8 @@ SvXMLImportContext *PagePropertySetContext::CreateChildContext( nFil == mxMapper->getPropertySetMapper() ->GetEntryContextId( rProp.mnIndex-1 ), "invalid property map!"); + (void)nPos; + (void)nFil; pContext = new XMLBackgroundImageContext( GetImport(), nPrefix, rLocalName, xAttrList, @@ -111,25 +112,15 @@ SvXMLImportContext *PagePropertySetContext::CreateChildContext( break; case CTF_PM_TEXTCOLUMNS: -#ifndef SVX_LIGHT pContext = new XMLTextColumnsContext( GetImport(), nPrefix, rLocalName, xAttrList, rProp, rProperties ); -#else - // create default context to skip content - pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); -#endif // #ifndef SVX_LIGHT break; case CTF_PM_FTN_LINE_WEIGTH: -#ifndef SVX_LIGHT pContext = new XMLFootnoteSeparatorImport( GetImport(), nPrefix, rLocalName, rProperties, mxMapper->getPropertySetMapper(), rProp.mnIndex); -#else - // create default context to skip content - pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName); -#endif // #ifndef SVX_LIGHT break; } @@ -142,3 +133,4 @@ SvXMLImportContext *PagePropertySetContext::CreateChildContext( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/PagePropertySetContext.hxx b/xmloff/source/style/PagePropertySetContext.hxx index 3bb0f2e84d04..cfa2e554f77b 100644 --- a/xmloff/source/style/PagePropertySetContext.hxx +++ b/xmloff/source/style/PagePropertySetContext.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,3 +65,5 @@ public: #endif // _XMLOFF_XMLTEXTPROPERTYSETCONTEXT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/SinglePropertySetInfoCache.cxx b/xmloff/source/style/SinglePropertySetInfoCache.cxx index 896c4e9fecef..6282828e162f 100644 --- a/xmloff/source/style/SinglePropertySetInfoCache.cxx +++ b/xmloff/source/style/SinglePropertySetInfoCache.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <com/sun/star/lang/XTypeProvider.hpp> #include <cppuhelper/weakref.hxx> -#ifndef _XMLOFF_SINGLEPROPERTYSETINFOCACHE_HXX #include <xmloff/SinglePropertySetInfoCache.hxx> -#endif using namespace ::com::sun::star::uno; using ::com::sun::star::lang::XTypeProvider; @@ -87,3 +86,5 @@ sal_Bool SinglePropertySetInfoCache::hasProperty( return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/StyleMap.cxx b/xmloff/source/style/StyleMap.cxx index 07f1bc440d8c..1fc3863ee551 100644 --- a/xmloff/source/style/StyleMap.cxx +++ b/xmloff/source/style/StyleMap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,8 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" #include <osl/mutex.hxx> -#include <rtl/uuid.h> #include <rtl/memory.h> +#include <comphelper/servicehelper.hxx> #include "StyleMap.hxx" @@ -48,23 +49,15 @@ StyleMap::~StyleMap() { } +namespace +{ + class theStyleMapUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theStyleMapUnoTunnelId> {}; +} // XUnoTunnel & co const Sequence< sal_Int8 > & StyleMap::getUnoTunnelId() throw() { - static Sequence< sal_Int8 > * pSeq = 0; - if( !pSeq ) - { - Guard< Mutex > aGuard( Mutex::getGlobalMutex() ); - if( !pSeq ) - { - static Sequence< sal_Int8 > aSeq( 16 ); - rtl_createUuid( reinterpret_cast<sal_uInt8*>( aSeq.getArray() ), - 0, sal_True ); - pSeq = &aSeq; - } - } - return *pSeq; + return theStyleMapUnoTunnelId::get().getSeq(); } StyleMap* StyleMap::getImplementation( Reference< XInterface > xInt ) throw() @@ -92,3 +85,4 @@ sal_Int64 SAL_CALL StyleMap::getSomething( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx index 073315761076..cf0ab56d0225 100644 --- a/xmloff/source/style/TransGradientStyle.cxx +++ b/xmloff/source/style/TransGradientStyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,7 +63,7 @@ enum SvXMLTokenMapAttrs }; -SvXMLEnumMapEntry __READONLY_DATA pXML_GradientStyle_Enum[] = +SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] = { { XML_GRADIENTSTYLE_LINEAR, awt::GradientStyle_LINEAR }, { XML_GRADIENTSTYLE_AXIAL, awt::GradientStyle_AXIAL }, @@ -106,7 +107,7 @@ sal_Bool XMLTransGradientStyleImport::importXML( aGradient.Border = 0; { - static __FAR_DATA SvXMLTokenMapEntry aTrGradientAttrTokenMap[] = + static SvXMLTokenMapEntry aTrGradientAttrTokenMap[] = { { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_GRADIENT_NAME }, { XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, XML_TOK_GRADIENT_DISPLAY_NAME }, @@ -227,8 +228,6 @@ sal_Bool XMLTransGradientStyleImport::importXML( // Export //------------------------------------------------------------- -#ifndef SVX_LIGHT - XMLTransGradientStyleExport::XMLTransGradientStyleExport( SvXMLExport& rExp ) : rExport(rExp) { @@ -326,4 +325,4 @@ sal_Bool XMLTransGradientStyleExport::exportXML( return bRet; } -#endif // #ifndef SVX_LIGHT +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/VisAreaContext.cxx b/xmloff/source/style/VisAreaContext.cxx index 795d9905243e..727d09293025 100644 --- a/xmloff/source/style/VisAreaContext.cxx +++ b/xmloff/source/style/VisAreaContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -132,3 +133,5 @@ SvXMLImportContext *XMLVisAreaContext::CreateChildContext( sal_uInt16 nPrefix, void XMLVisAreaContext::EndElement() { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/VisAreaExport.cxx b/xmloff/source/style/VisAreaExport.cxx index 6bdcb18c7f43..5ed8dbb2a801 100644 --- a/xmloff/source/style/VisAreaExport.cxx +++ b/xmloff/source/style/VisAreaExport.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,3 +83,4 @@ XMLVisAreaExport::~XMLVisAreaExport() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/WordWrapPropertyHdl.cxx b/xmloff/source/style/WordWrapPropertyHdl.cxx index f3717b95c9cd..c7fc2b26c8b0 100644 --- a/xmloff/source/style/WordWrapPropertyHdl.cxx +++ b/xmloff/source/style/WordWrapPropertyHdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -100,3 +101,4 @@ sal_Bool XMLWordWrapPropertyHdl::exportXML( OUString& rStrExpValue, const Any& r return sal_True; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLBackgroundImageContext.cxx b/xmloff/source/style/XMLBackgroundImageContext.cxx index d8f84b1d9840..4f3bd37d8a21 100644 --- a/xmloff/source/style/XMLBackgroundImageContext.cxx +++ b/xmloff/source/style/XMLBackgroundImageContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,7 +62,7 @@ enum SvXMLTokenMapAttrs }; const SvXMLTokenMapEntry* lcl_getBGImgAttributesAttrTokenMap() { - static __FAR_DATA SvXMLTokenMapEntry aBGImgAttributesAttrTokenMap[] = + static SvXMLTokenMapEntry aBGImgAttributesAttrTokenMap[] = { { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_BGIMG_HREF }, { XML_NAMESPACE_XLINK, XML_TYPE, XML_TOK_BGIMG_TYPE }, @@ -412,3 +413,5 @@ void XMLBackgroundImageContext::EndElement() if( -1 != aTransparencyProp.mnIndex ) rProperties.push_back( aTransparencyProp ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLBackgroundImageExport.cxx b/xmloff/source/style/XMLBackgroundImageExport.cxx index 45039f348603..adeb55009ea4 100644 --- a/xmloff/source/style/XMLBackgroundImageExport.cxx +++ b/xmloff/source/style/XMLBackgroundImageExport.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -172,3 +173,5 @@ void XMLBackgroundImageExport::exportXML( const Any& rURL, } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLBitmapLogicalSizePropertyHandler.cxx b/xmloff/source/style/XMLBitmapLogicalSizePropertyHandler.cxx index 547edb1e5a68..72fedc3c2081 100644 --- a/xmloff/source/style/XMLBitmapLogicalSizePropertyHandler.cxx +++ b/xmloff/source/style/XMLBitmapLogicalSizePropertyHandler.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,3 +65,4 @@ sal_Bool XMLBitmapLogicalSizePropertyHandler::exportXML( return sal_False; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLBitmapRepeatOffsetPropertyHandler.cxx b/xmloff/source/style/XMLBitmapRepeatOffsetPropertyHandler.cxx index 32be17ab8fee..6f7143d62da3 100644 --- a/xmloff/source/style/XMLBitmapRepeatOffsetPropertyHandler.cxx +++ b/xmloff/source/style/XMLBitmapRepeatOffsetPropertyHandler.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -103,3 +104,4 @@ sal_Bool XMLBitmapRepeatOffsetPropertyHandler::exportXML( return sal_False; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLClipPropertyHandler.cxx b/xmloff/source/style/XMLClipPropertyHandler.cxx index f90e3346c1ba..af36556370ec 100644 --- a/xmloff/source/style/XMLClipPropertyHandler.cxx +++ b/xmloff/source/style/XMLClipPropertyHandler.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -144,3 +145,5 @@ sal_Bool XMLClipPropertyHandler::exportXML( OUString& rStrExpValue, const uno::A return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLConstantsPropertyHandler.cxx b/xmloff/source/style/XMLConstantsPropertyHandler.cxx index 5988dd616a9a..55c62fc8d810 100644 --- a/xmloff/source/style/XMLConstantsPropertyHandler.cxx +++ b/xmloff/source/style/XMLConstantsPropertyHandler.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -100,14 +101,15 @@ sal_Bool XMLConstantsPropertyHandler::exportXML( } else { - DBG_ERROR("XMLConstantsPropertyHandler::exportXML() constant is out of range for implementation using sal_uInt16"); + OSL_FAIL("XMLConstantsPropertyHandler::exportXML() constant is out of range for implementation using sal_uInt16"); } } else { - DBG_ERROR("XMLConstantsPropertyHandler::exportXML() could not convert any to sal_Int32"); + OSL_FAIL("XMLConstantsPropertyHandler::exportXML() could not convert any to sal_Int32"); } return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLElementPropertyContext.cxx b/xmloff/source/style/XMLElementPropertyContext.cxx index 6985d72cf196..1a9bf554a8e5 100644 --- a/xmloff/source/style/XMLElementPropertyContext.cxx +++ b/xmloff/source/style/XMLElementPropertyContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -58,3 +59,4 @@ void XMLElementPropertyContext::EndElement( ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLFillBitmapSizePropertyHandler.cxx b/xmloff/source/style/XMLFillBitmapSizePropertyHandler.cxx index 90c35f849c12..ac23035e9683 100644 --- a/xmloff/source/style/XMLFillBitmapSizePropertyHandler.cxx +++ b/xmloff/source/style/XMLFillBitmapSizePropertyHandler.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -97,3 +98,4 @@ sal_Bool XMLFillBitmapSizePropertyHandler::exportXML( return sal_False; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index 0337ff32136f..fb749e6f4edc 100644 --- a/xmloff/source/style/XMLFontAutoStylePool.cxx +++ b/xmloff/source/style/XMLFontAutoStylePool.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -290,3 +291,4 @@ void XMLFontAutoStylePool::exportXML() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx index c36fd4c55fab..d4823ccf03ee 100644 --- a/xmloff/source/style/XMLFontStylesContext.cxx +++ b/xmloff/source/style/XMLFontStylesContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,7 +71,7 @@ enum XMLFontStyleAttrTokens const SvXMLTokenMapEntry* lcl_getFontStyleAttrTokenMap() { - static __FAR_DATA SvXMLTokenMapEntry aFontStyleAttrTokenMap[] = + static SvXMLTokenMapEntry aFontStyleAttrTokenMap[] = { { XML_NAMESPACE_SVG, XML_FONT_FAMILY, XML_TOK_FONT_STYLE_ATTR_FAMILY }, @@ -283,3 +284,5 @@ sal_Bool XMLFontStylesContext::FillProperties( const OUString& rName, nFamilyIdx, nPitchIdx, nCharsetIdx ); return 0 != pFontStyle; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx index b576c697732c..a7f5e0c1bf3a 100644 --- a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx +++ b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,9 +36,7 @@ #include <xmloff/xmltoken.hxx> #include <xmloff/xmlprmap.hxx> -#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX #include <xmloff/PageMasterStyleMap.hxx> -#endif #include <com/sun/star/text/HorizontalAdjust.hpp> #include <rtl/ustrbuf.hxx> @@ -75,6 +74,7 @@ void XMLFootnoteSeparatorExport::exportXML( sal_Int8 nLineRelWidth = 0; sal_Int32 nLineTextDistance = 0; sal_Int16 nLineWeight = 0; + sal_Int8 nLineStyle = 0; // find indices into property map and get values sal_uInt32 nCount = pProperties->size(); @@ -107,6 +107,9 @@ void XMLFootnoteSeparatorExport::exportXML( "received wrong property state index" ); rState.maValue >>= nLineWeight; break; + case CTF_PM_FTN_LINE_STYLE: + rState.maValue >>= nLineStyle; + break; } } @@ -136,6 +139,22 @@ void XMLFootnoteSeparatorExport::exportXML( sBuf.makeStringAndClear()); } + // line style + static const SvXMLEnumMapEntry aXML_LineStyle_Enum[] = + { + { XML_NONE, 0 }, + { XML_SOLID, 1 }, + { XML_DOTTED, 2 }, + { XML_DASH, 3 }, + { XML_TOKEN_INVALID, 0 } + }; + if (rExport.GetMM100UnitConverter().convertEnum( + sBuf, nLineStyle, aXML_LineStyle_Enum ) ) + { + rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_LINE_STYLE, + sBuf.makeStringAndClear()); + } + // adjustment static const SvXMLEnumMapEntry aXML_HorizontalAdjust_Enum[] = { @@ -162,6 +181,10 @@ void XMLFootnoteSeparatorExport::exportXML( rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_COLOR, sBuf.makeStringAndClear()); + // line-style + SvXMLElementExport aElem(rExport, XML_NAMESPACE_STYLE, XML_FOOTNOTE_SEP, sal_True, sal_True); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLFootnoteSeparatorExport.hxx b/xmloff/source/style/XMLFootnoteSeparatorExport.hxx index 9b3081c53aa1..6d268e16e40f 100644 --- a/xmloff/source/style/XMLFootnoteSeparatorExport.hxx +++ b/xmloff/source/style/XMLFootnoteSeparatorExport.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -60,3 +61,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx index 7293c1198cea..4c579c78bed5 100644 --- a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx +++ b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,9 +44,7 @@ #include <xmloff/nmspmap.hxx> #include <xmloff/maptype.hxx> -#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX #include <xmloff/PageMasterStyleMap.hxx> -#endif #include <tools/debug.hxx> #include <tools/color.hxx> @@ -93,6 +92,7 @@ void XMLFootnoteSeparatorImport::StartElement( sal_Int16 eLineAdjust = text::HorizontalAdjust_LEFT; // enum text::HorizontalAdjust sal_Int32 nLineTextDistance = 0; sal_Int32 nLineDistance = 0; + sal_Int8 nLineStyle = 0; // iterate over xattribute list and fill values sal_Int16 nLength = xAttrList->getLength(); @@ -153,6 +153,23 @@ void XMLFootnoteSeparatorImport::StartElement( if (SvXMLUnitConverter::convertColor(aColor, sAttrValue)) nLineColor = (sal_Int32)aColor.GetColor(); } + else if (IsXMLToken( sLocalName, XML_LINE_STYLE )) + { + sal_uInt16 nTmpU; + static const SvXMLEnumMapEntry aXML_LineStyle_Enum[] = + { + { XML_NONE, 0 }, + { XML_SOLID, 1 }, + { XML_DOTTED, 2 }, + { XML_DASH, 3 }, + { XML_TOKEN_INVALID, 0 } + }; + + if (SvXMLUnitConverter::convertEnum( + nTmpU, sAttrValue, aXML_LineStyle_Enum)) + nLineStyle = (sal_Int8)nTmpU; + + } } } @@ -170,6 +187,11 @@ void XMLFootnoteSeparatorImport::StartElement( XMLPropertyState aLineColor( nIndex, aAny ); rProperties.push_back(aLineColor); + aAny <<= nLineStyle; + nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_LINE_STYLE); + XMLPropertyState aLineStyle( nIndex, aAny ); + rProperties.push_back(aLineStyle); + aAny <<= nLineDistance; nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_DISTANCE); XMLPropertyState aLineDistance( nIndex, aAny ); @@ -191,3 +213,5 @@ void XMLFootnoteSeparatorImport::StartElement( XMLPropertyState aLineWeight( nPropIndex, aAny ); rProperties.push_back(aLineWeight); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.hxx b/xmloff/source/style/XMLFootnoteSeparatorImport.hxx index debe86701fd1..9c929c15315c 100644 --- a/xmloff/source/style/XMLFootnoteSeparatorImport.hxx +++ b/xmloff/source/style/XMLFootnoteSeparatorImport.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,3 +76,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLIsPercentagePropertyHandler.cxx b/xmloff/source/style/XMLIsPercentagePropertyHandler.cxx index c75dc1ad9858..96836b738d7c 100644 --- a/xmloff/source/style/XMLIsPercentagePropertyHandler.cxx +++ b/xmloff/source/style/XMLIsPercentagePropertyHandler.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,7 +57,8 @@ sal_Bool XMLIsPercentagePropertyHandler::exportXML( const Any&, const SvXMLUnitConverter& ) const { - DBG_ERROR( "XMLIsPercentagePropertyHandler is not for export!" ); + OSL_FAIL( "XMLIsPercentagePropertyHandler is not for export!" ); return sal_False; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index 915b2291461f..7def49621b27 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,12 +40,8 @@ #include <xmloff/families.hxx> #include <xmloff/xmlexp.hxx> #include "PageMasterPropHdlFactory.hxx" -#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX #include <xmloff/PageMasterStyleMap.hxx> -#endif -#ifndef _XMLOFF_PAGEMASTERPROPMAPPER_HXX #include "PageMasterPropMapper.hxx" -#endif #include "PageMasterExportPropMapper.hxx" #include "PageMasterExportPropMapper.hxx" @@ -152,13 +149,6 @@ sal_Bool XMLPageExport::exportStyle( GetExport().EncodeStyleName( sNextName ) ); } } -// OUString sPageMaster = GetExport().GetAutoStylePool()->Find( -// XML_STYLE_FAMILY_PAGE_MASTER, -// xPropSet ); -// if( sPageMaster.getLength() ) -// GetExport().AddAttribute( XML_NAMESPACE_STYLE, -// XML_PAGE_MASTER_NAME, -// sPageMaster ); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, XML_MASTER_PAGE, sal_True, sal_True ); @@ -265,8 +255,6 @@ void XMLPageExport::exportDefaultStyle() } } - // if ( xPropStates.size() != 0 && - // ( xPropStates.size() != 1 || xPropStates[0].mnIndex != -1 ) ) if( bExport ) { //<style:default-page-layout> @@ -280,3 +268,5 @@ void XMLPageExport::exportDefaultStyle() } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLPercentOrMeasurePropertyHandler.cxx b/xmloff/source/style/XMLPercentOrMeasurePropertyHandler.cxx index 7e4ffe5285d2..b3f147cbbdcb 100644 --- a/xmloff/source/style/XMLPercentOrMeasurePropertyHandler.cxx +++ b/xmloff/source/style/XMLPercentOrMeasurePropertyHandler.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -96,3 +97,5 @@ sal_Bool XMLPercentOrMeasurePropertyHandler::exportXML( rStrExpValue = aOut.makeStringAndClear(); return sal_True; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/XMLRectangleMembersHandler.cxx b/xmloff/source/style/XMLRectangleMembersHandler.cxx index acd53e2dfd4e..9e9fef6d9c96 100644 --- a/xmloff/source/style/XMLRectangleMembersHandler.cxx +++ b/xmloff/source/style/XMLRectangleMembersHandler.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include <rtl/ustrbuf.hxx> #include <com/sun/star/uno/Any.hxx> -#ifndef _COM_SUN_STAR_AWT_RECTANGLE_HDL_ #include <com/sun/star/awt/Rectangle.hdl> -#endif #include "XMLRectangleMembersHandler.hxx" #include <xmloff/xmltypes.hxx> @@ -123,3 +122,4 @@ sal_Bool XMLRectangleMembersHdl::exportXML( return sal_True; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/adjushdl.cxx b/xmloff/source/style/adjushdl.cxx index 027bebdb8075..fd050d028111 100644 --- a/xmloff/source/style/adjushdl.cxx +++ b/xmloff/source/style/adjushdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,7 +42,7 @@ using ::rtl::OUStringBuffer; using namespace ::xmloff::token; -SvXMLEnumMapEntry __READONLY_DATA pXML_Para_Adjust_Enum[] = +SvXMLEnumMapEntry const pXML_Para_Adjust_Enum[] = { { XML_START, style::ParagraphAdjust_LEFT }, { XML_END, style::ParagraphAdjust_RIGHT }, @@ -53,7 +54,7 @@ SvXMLEnumMapEntry __READONLY_DATA pXML_Para_Adjust_Enum[] = { XML_TOKEN_INVALID, 0 } }; -SvXMLEnumMapEntry __READONLY_DATA pXML_Para_Align_Last_Enum[] = +SvXMLEnumMapEntry const pXML_Para_Align_Last_Enum[] = { { XML_START, style::ParagraphAdjust_LEFT }, { XML_CENTER, style::ParagraphAdjust_CENTER }, @@ -85,7 +86,7 @@ sal_Bool XMLParaAdjustPropHdl::importXML( const OUString& rStrImpValue, uno::Any sal_Bool XMLParaAdjustPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const { if(!rValue.hasValue()) - return sal_False; //added by BerryJia for fixing Bug102407 2002-11-5 + return sal_False; OUStringBuffer aOut; sal_Int16 nVal = 0; @@ -134,3 +135,4 @@ sal_Bool XMLLastLineAdjustPropHdl::exportXML( OUString& rStrExpValue, const uno: return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/adjushdl.hxx b/xmloff/source/style/adjushdl.hxx index 8b9228b4d8ce..20a5c04207b5 100644 --- a/xmloff/source/style/adjushdl.hxx +++ b/xmloff/source/style/adjushdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_ADJUSTTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/backhdl.cxx b/xmloff/source/style/backhdl.cxx index df02a6504bac..e6743dd9609e 100644 --- a/xmloff/source/style/backhdl.cxx +++ b/xmloff/source/style/backhdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -296,3 +297,4 @@ void XMLBackGraphicPositionPropHdl::MergeXMLHoriPos( style::GraphicLocation& ePo } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/backhdl.hxx b/xmloff/source/style/backhdl.hxx index 09fba3bb85f7..bef4912cb5e9 100644 --- a/xmloff/source/style/backhdl.hxx +++ b/xmloff/source/style/backhdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -51,3 +52,5 @@ private: }; #endif // _XMLOFF_PROPERTYHANDLER_BRUSHTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/bordrhdl.cxx b/xmloff/source/style/bordrhdl.cxx index 5611bbd1f472..230f1082fe2e 100644 --- a/xmloff/source/style/bordrhdl.cxx +++ b/xmloff/source/style/bordrhdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,7 +35,11 @@ #include <xmloff/xmluconv.hxx> #include <rtl/ustrbuf.hxx> #include <com/sun/star/uno/Any.hxx> -#include <com/sun/star/table/BorderLine.hpp> +#include <com/sun/star/table/BorderLine2.hpp> + +#if DEBUG +#include <cstdio> +#endif using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -42,65 +47,25 @@ using ::rtl::OUStringBuffer; using namespace ::com::sun::star; using namespace ::xmloff::token; -// copied from svx/boxitem.hxx +const sal_uInt16 API_LINE_SOLID = 0; +const sal_uInt16 API_LINE_DOTTED = 1; +const sal_uInt16 API_LINE_DASHED = 2; +const sal_uInt16 API_LINE_DOUBLE = 3; +const sal_uInt16 API_LINE_THINTHICK_SMALLGAP = 4; +const sal_uInt16 API_LINE_THINTHICK_MEDIUMGAP = 5; +const sal_uInt16 API_LINE_THINTHICK_LARGEGAP = 6; +const sal_uInt16 API_LINE_THICKTHIN_SMALLGAP = 7; +const sal_uInt16 API_LINE_THICKTHIN_MEDIUMGAP = 8; +const sal_uInt16 API_LINE_THICKTHIN_LARGEGAP = 9; +const sal_uInt16 API_LINE_EMBOSSED = 10; +const sal_uInt16 API_LINE_ENGRAVED = 11; +const sal_uInt16 API_LINE_OUTSET = 12; +const sal_uInt16 API_LINE_INSET = 13; +const sal_uInt16 API_LINE_NONE = USHRT_MAX; + #define DEF_LINE_WIDTH_0 1 #define DEF_LINE_WIDTH_1 35 #define DEF_LINE_WIDTH_2 88 -#define DEF_LINE_WIDTH_3 141 -#define DEF_LINE_WIDTH_4 176 - -#define DEF_MAX_LINE_WIDHT DEF_LINE_WIDTH_4 -#define DEF_MAX_LINE_DIST DEF_LINE_WIDTH_2 - -#define DEF_DOUBLE_LINE0_OUT DEF_LINE_WIDTH_0 -#define DEF_DOUBLE_LINE0_IN DEF_LINE_WIDTH_0 -#define DEF_DOUBLE_LINE0_DIST DEF_LINE_WIDTH_1 - -#define DEF_DOUBLE_LINE1_OUT DEF_LINE_WIDTH_1 -#define DEF_DOUBLE_LINE1_IN DEF_LINE_WIDTH_1 -#define DEF_DOUBLE_LINE1_DIST DEF_LINE_WIDTH_1 - -#define DEF_DOUBLE_LINE2_OUT DEF_LINE_WIDTH_2 -#define DEF_DOUBLE_LINE2_IN DEF_LINE_WIDTH_2 -#define DEF_DOUBLE_LINE2_DIST DEF_LINE_WIDTH_2 - -#define DEF_DOUBLE_LINE3_OUT DEF_LINE_WIDTH_2 -#define DEF_DOUBLE_LINE3_IN DEF_LINE_WIDTH_1 -#define DEF_DOUBLE_LINE3_DIST DEF_LINE_WIDTH_2 - -#define DEF_DOUBLE_LINE4_OUT DEF_LINE_WIDTH_1 -#define DEF_DOUBLE_LINE4_IN DEF_LINE_WIDTH_2 -#define DEF_DOUBLE_LINE4_DIST DEF_LINE_WIDTH_1 - -#define DEF_DOUBLE_LINE5_OUT DEF_LINE_WIDTH_3 -#define DEF_DOUBLE_LINE5_IN DEF_LINE_WIDTH_2 -#define DEF_DOUBLE_LINE5_DIST DEF_LINE_WIDTH_2 - -#define DEF_DOUBLE_LINE6_OUT DEF_LINE_WIDTH_2 -#define DEF_DOUBLE_LINE6_IN DEF_LINE_WIDTH_3 -#define DEF_DOUBLE_LINE6_DIST DEF_LINE_WIDTH_2 - -#define DEF_DOUBLE_LINE7_OUT DEF_LINE_WIDTH_0 -#define DEF_DOUBLE_LINE7_IN DEF_LINE_WIDTH_0 -#define DEF_DOUBLE_LINE7_DIST DEF_LINE_WIDTH_2 - -#define DEF_DOUBLE_LINE8_OUT DEF_LINE_WIDTH_1 -#define DEF_DOUBLE_LINE8_IN DEF_LINE_WIDTH_0 -#define DEF_DOUBLE_LINE8_DIST DEF_LINE_WIDTH_2 - -#define DEF_DOUBLE_LINE9_OUT DEF_LINE_WIDTH_2 -#define DEF_DOUBLE_LINE9_IN DEF_LINE_WIDTH_0 -#define DEF_DOUBLE_LINE9_DIST DEF_LINE_WIDTH_2 - -#define DEF_DOUBLE_LINE10_OUT DEF_LINE_WIDTH_3 -#define DEF_DOUBLE_LINE10_IN DEF_LINE_WIDTH_0 -#define DEF_DOUBLE_LINE10_DIST DEF_LINE_WIDTH_2 - -// finished copy - -#define SVX_XML_BORDER_STYLE_NONE 0 -#define SVX_XML_BORDER_STYLE_SOLID 1 -#define SVX_XML_BORDER_STYLE_DOUBLE 2 #define SVX_XML_BORDER_WIDTH_THIN 0 #define SVX_XML_BORDER_WIDTH_MIDDLE 1 @@ -108,16 +73,16 @@ using namespace ::xmloff::token; SvXMLEnumMapEntry pXML_BorderStyles[] = { - { XML_NONE, SVX_XML_BORDER_STYLE_NONE }, - { XML_HIDDEN, SVX_XML_BORDER_STYLE_NONE }, - { XML_SOLID, SVX_XML_BORDER_STYLE_SOLID }, - { XML_DOUBLE, SVX_XML_BORDER_STYLE_DOUBLE }, - { XML_DOTTED, SVX_XML_BORDER_STYLE_SOLID }, - { XML_DASHED, SVX_XML_BORDER_STYLE_SOLID }, - { XML_GROOVE, SVX_XML_BORDER_STYLE_SOLID }, - { XML_RIDGE, SVX_XML_BORDER_STYLE_SOLID }, - { XML_INSET, SVX_XML_BORDER_STYLE_SOLID }, - { XML_OUTSET, SVX_XML_BORDER_STYLE_SOLID }, + { XML_NONE, API_LINE_NONE }, + { XML_HIDDEN, API_LINE_NONE }, + { XML_SOLID, API_LINE_SOLID }, + { XML_DOUBLE, API_LINE_DOUBLE }, + { XML_DOTTED, API_LINE_DOTTED }, + { XML_DASHED, API_LINE_DASHED }, + { XML_GROOVE, API_LINE_ENGRAVED }, + { XML_RIDGE, API_LINE_EMBOSSED }, + { XML_INSET, API_LINE_INSET }, + { XML_OUTSET, API_LINE_OUTSET }, { XML_TOKEN_INVALID, 0 } }; @@ -130,98 +95,21 @@ SvXMLEnumMapEntry pXML_NamedBorderWidths[] = }; // mapping tables to map external xml input to intarnal box line widths -// Ein Eintrag besteht aus vier USHORTs. Der erste ist die Gesamtbreite, -// die anderen sind die 3 Einzelbreiten - -#define SBORDER_ENTRY( n ) \ - DEF_LINE_WIDTH_##n, DEF_LINE_WIDTH_##n, 0, 0 - -#define DBORDER_ENTRY( n ) \ - DEF_DOUBLE_LINE##n##_OUT + DEF_DOUBLE_LINE##n##_IN + \ - DEF_DOUBLE_LINE##n##_DIST, \ - DEF_DOUBLE_LINE##n##_OUT, \ - DEF_DOUBLE_LINE##n##_IN, \ - DEF_DOUBLE_LINE##n##_DIST - -#define TDBORDER_ENTRY( n ) \ - DEF_DOUBLE_LINE##n##_OUT, \ - DEF_DOUBLE_LINE##n##_OUT, \ - DEF_DOUBLE_LINE##n##_IN, \ - DEF_DOUBLE_LINE##n##_DIST - - -static sal_uInt16 __READONLY_DATA aSBorderWidths[] = -{ - SBORDER_ENTRY( 0 ), SBORDER_ENTRY( 1 ), SBORDER_ENTRY( 2 ), - SBORDER_ENTRY( 3 ), SBORDER_ENTRY( 4 ) -}; -static sal_uInt16 __READONLY_DATA aDBorderWidths[] = +static sal_uInt16 const aBorderWidths[] = { - DBORDER_ENTRY( 0 ), - DBORDER_ENTRY( 7 ), - DBORDER_ENTRY( 1 ), - DBORDER_ENTRY( 8 ), - DBORDER_ENTRY( 4 ), - DBORDER_ENTRY( 9 ), - DBORDER_ENTRY( 3 ), - DBORDER_ENTRY( 10 ), - DBORDER_ENTRY( 2 ), - DBORDER_ENTRY( 6 ), - DBORDER_ENTRY( 5 ) + DEF_LINE_WIDTH_0, + DEF_LINE_WIDTH_1, + DEF_LINE_WIDTH_2 }; -void lcl_frmitems_setXMLBorderWidth( table::BorderLine &rBorderLine, - sal_uInt16 nWidth, sal_Bool bDouble ) +void lcl_frmitems_setXMLBorderStyle( table::BorderLine2 & rBorderLine, sal_uInt16 nStyle ) { -#ifdef XML_CHECK_UI_CONTSTRAINS - const sal_uInt16 *aWidths; - sal_uInt16 nSize; - if( !bDouble ) - { - aWidths = aSBorderWidths; - nSize = sizeof( aSBorderWidths ); - } - else - { - aWidths = aDBorderWidths; - nSize = sizeof( aDBorderWidths ); - } + sal_Int16 eStyle = -1; // None + if ( nStyle != API_LINE_NONE ) + eStyle = sal_Int16( nStyle ); - sal_uInt16 i = (nSize / sizeof(sal_uInt16)) - 4; - while( i>0 && - nWidth <= ((aWidths[i] + aWidths[i-4]) / 2) ) - { - i -= 4; - } - - rBorderLine.OuterLineWidth = aWidths[i+1]; - rBorderLine.InnerLineWidth = aWidths[i+2]; - rBorderLine.LineDistance = aWidths[i+3]; -#else - if( bDouble ) - { - const sal_uInt16 *aWidths = aDBorderWidths; - sal_uInt16 nSize = sizeof( aDBorderWidths ); - sal_uInt16 i = (nSize / sizeof(sal_uInt16)) - 4; - while( i>0 && - nWidth <= ((aWidths[i] + aWidths[i-4]) / 2) ) - { - i -= 4; - } - - rBorderLine.OuterLineWidth = aWidths[i+1]; - rBorderLine.InnerLineWidth = aWidths[i+2]; - rBorderLine.LineDistance = aWidths[i+3]; - } - else - { - rBorderLine.OuterLineWidth = 0 == nWidth ? DEF_LINE_WIDTH_0 : nWidth; - rBorderLine.InnerLineWidth = 0; - rBorderLine.LineDistance = 0; - - } -#endif + rBorderLine.LineStyle = eStyle; } @@ -260,20 +148,7 @@ sal_Bool XMLBorderWidthHdl::importXML( const OUString& rStrImpValue, uno::Any& r if( !rUnitConverter.convertMeasure( nOutWidth, aToken, 0, 500 ) ) return sal_False; -#ifdef XML_CHECK_UI_CONSTRAINS - sal_uInt16 nSize = sizeof( aDBorderWidths ); - for( sal_uInt16 i=0; i < nSize; i += 4 ) - { - if( aDBorderWidths[i+1] == nOutWidth && - aDBorderWidths[i+2] == nInWidth && - aDBorderWidths[i+3] == nDistance ) - break; - } - - sal_uInt16 nWidth = i < nSize ? 0 : nOutWidth + nInWidth + nDistance; -#endif - - table::BorderLine aBorderLine; + table::BorderLine2 aBorderLine; if(!(rValue >>= aBorderLine)) aBorderLine.Color = 0; @@ -289,11 +164,27 @@ sal_Bool XMLBorderWidthHdl::exportXML( OUString& rStrExpValue, const uno::Any& r { OUStringBuffer aOut; - table::BorderLine aBorderLine; + table::BorderLine2 aBorderLine; if(!(rValue >>= aBorderLine)) return sal_False; - if( aBorderLine.LineDistance == 0 && aBorderLine.InnerLineWidth == 0) + bool bDouble = false; + switch ( aBorderLine.LineStyle ) + { + case API_LINE_DOUBLE: + case API_LINE_THINTHICK_SMALLGAP: + case API_LINE_THINTHICK_MEDIUMGAP: + case API_LINE_THINTHICK_LARGEGAP: + case API_LINE_THICKTHIN_SMALLGAP: + case API_LINE_THICKTHIN_MEDIUMGAP: + case API_LINE_THICKTHIN_LARGEGAP: + bDouble = true; + break; + default: + break; + } + + if( ( aBorderLine.LineDistance == 0 && aBorderLine.InnerLineWidth == 0 ) || !bDouble ) return sal_False; rUnitConverter.convertMeasure( aOut, aBorderLine.InnerLineWidth ); @@ -365,46 +256,44 @@ sal_Bool XMLBorderHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue // if there is no style or a different style than none but no width, // then the declaration is not valid. - if( !bHasStyle || (SVX_XML_BORDER_STYLE_NONE != nStyle && !bHasWidth) ) + if( !bHasStyle || (API_LINE_NONE != nStyle && !bHasWidth) ) return sal_False; - table::BorderLine aBorderLine; + table::BorderLine2 aBorderLine; if(!(rValue >>= aBorderLine)) { aBorderLine.Color = 0; aBorderLine.InnerLineWidth = 0; aBorderLine.OuterLineWidth = 0; aBorderLine.LineDistance = 0; + aBorderLine.LineWidth = 0; } // first of all, delete an empty line - sal_Bool bDouble = SVX_XML_BORDER_STYLE_DOUBLE == nStyle; - if( (bHasStyle && SVX_XML_BORDER_STYLE_NONE == nStyle) || + if( (bHasStyle && API_LINE_NONE == nStyle) || (bHasWidth && USHRT_MAX == nNamedWidth && 0 == nWidth) ) { aBorderLine.InnerLineWidth = 0; aBorderLine.OuterLineWidth = 0; aBorderLine.LineDistance = 0; + aBorderLine.LineWidth = 0; } else if( bHasWidth ) { if( USHRT_MAX != nNamedWidth ) { - const sal_uInt16 *aWidths = bDouble ? aDBorderWidths - : aSBorderWidths; - sal_uInt16 nNWidth = nNamedWidth * 4; - aBorderLine.OuterLineWidth = aWidths[nNWidth+1]; - aBorderLine.InnerLineWidth = aWidths[nNWidth+2]; - aBorderLine.LineDistance = aWidths[nNWidth+3]; + aBorderLine.LineWidth = aBorderWidths[nNamedWidth]; } else { - lcl_frmitems_setXMLBorderWidth( aBorderLine, nWidth, bDouble ); + aBorderLine.LineWidth = nWidth; + lcl_frmitems_setXMLBorderStyle( aBorderLine, nStyle ); } } else { - lcl_frmitems_setXMLBorderWidth( aBorderLine, 0, bDouble ); + aBorderLine.LineWidth = 0; + lcl_frmitems_setXMLBorderStyle( aBorderLine, nStyle ); } // set color @@ -419,17 +308,11 @@ sal_Bool XMLBorderHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue { OUStringBuffer aOut; - table::BorderLine aBorderLine; + table::BorderLine2 aBorderLine; if(!(rValue >>= aBorderLine)) return sal_False; - sal_Int32 nWidth = aBorderLine.OuterLineWidth; - const sal_uInt16 nDistance = aBorderLine.LineDistance; - if( 0 != nDistance ) - { - nWidth += nDistance; - nWidth += aBorderLine.InnerLineWidth; - } + sal_Int32 nWidth = aBorderLine.LineWidth; if( nWidth == 0 ) { @@ -437,11 +320,46 @@ sal_Bool XMLBorderHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue } else { - rUnitConverter.convertMeasure( aOut, nWidth ); + rUnitConverter.convertMeasure( aOut, nWidth, + MAP_100TH_MM, MAP_POINT ); aOut.append( sal_Unicode( ' ' ) ); - aOut.append( GetXMLToken((0 == nDistance) ? XML_SOLID : XML_DOUBLE) ); + XMLTokenEnum eStyleToken = XML_SOLID; + switch ( aBorderLine.LineStyle ) + { + case API_LINE_DASHED: + eStyleToken = XML_DASHED; + break; + case API_LINE_DOTTED: + eStyleToken = XML_DOTTED; + break; + case API_LINE_DOUBLE: + case API_LINE_THINTHICK_SMALLGAP: + case API_LINE_THINTHICK_MEDIUMGAP: + case API_LINE_THINTHICK_LARGEGAP: + case API_LINE_THICKTHIN_SMALLGAP: + case API_LINE_THICKTHIN_MEDIUMGAP: + case API_LINE_THICKTHIN_LARGEGAP: + eStyleToken = XML_DOUBLE; + break; + case API_LINE_EMBOSSED: + eStyleToken = XML_RIDGE; + break; + case API_LINE_ENGRAVED: + eStyleToken = XML_GROOVE; + break; + case API_LINE_OUTSET: + eStyleToken = XML_OUTSET; + break; + case API_LINE_INSET: + eStyleToken = XML_INSET; + break; + case API_LINE_SOLID: + default: + break; + } + aOut.append( GetXMLToken( eStyleToken ) ); aOut.append( sal_Unicode( ' ' ) ); @@ -452,3 +370,5 @@ sal_Bool XMLBorderHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue return sal_True; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/bordrhdl.hxx b/xmloff/source/style/bordrhdl.hxx index 769d7a563560..eef72569c715 100644 --- a/xmloff/source/style/bordrhdl.hxx +++ b/xmloff/source/style/bordrhdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,3 +54,4 @@ public: #endif // _XMLOFF_PROPERTYHANDLER_CHARLOCALETYPES_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/breakhdl.cxx b/xmloff/source/style/breakhdl.cxx index d95cd2e5e91a..dacbc0e81be6 100644 --- a/xmloff/source/style/breakhdl.cxx +++ b/xmloff/source/style/breakhdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -191,3 +192,5 @@ sal_Bool XMLFmtBreakAfterPropHdl::exportXML( OUString& rStrExpValue, const uno:: return sal_True; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/breakhdl.hxx b/xmloff/source/style/breakhdl.hxx index 5120d86db0b3..48c9ca12cc08 100644 --- a/xmloff/source/style/breakhdl.hxx +++ b/xmloff/source/style/breakhdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_BREAKTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/cdouthdl.cxx b/xmloff/source/style/cdouthdl.cxx index c5f764cf9ac4..cf1577adceee 100644 --- a/xmloff/source/style/cdouthdl.cxx +++ b/xmloff/source/style/cdouthdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -328,3 +329,4 @@ sal_Bool XMLCrossedOutTextPropHdl::exportXML( OUString& rStrExpValue, const uno: return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/cdouthdl.hxx b/xmloff/source/style/cdouthdl.hxx index 9d27382bae10..46779e10c70c 100644 --- a/xmloff/source/style/cdouthdl.hxx +++ b/xmloff/source/style/cdouthdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,3 +71,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_CROSSEDOUTTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/chrhghdl.cxx b/xmloff/source/style/chrhghdl.cxx index bb27a1378eab..d805d9a1274b 100644 --- a/xmloff/source/style/chrhghdl.cxx +++ b/xmloff/source/style/chrhghdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -165,3 +166,4 @@ sal_Bool XMLCharHeightDiffHdl::exportXML( OUString& rStrExpValue, const uno::Any return rStrExpValue.getLength() != 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/chrhghdl.hxx b/xmloff/source/style/chrhghdl.hxx index befa0a632871..9d39294eb6c7 100644 --- a/xmloff/source/style/chrhghdl.hxx +++ b/xmloff/source/style/chrhghdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,3 +63,4 @@ public: #endif // _XMLOFF_PROPERTYHANDLER_CHARHEIGHTTYPES_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/chrlohdl.cxx b/xmloff/source/style/chrlohdl.cxx index 06778d67576f..a7fedf6456a4 100644 --- a/xmloff/source/style/chrlohdl.cxx +++ b/xmloff/source/style/chrlohdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -142,3 +143,5 @@ sal_Bool XMLCharCountryHdl::exportXML( OUString& rStrExpValue, const uno::Any& r return sal_True; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/chrlohdl.hxx b/xmloff/source/style/chrlohdl.hxx index be5f9d2fef8d..1b1f46b3e08f 100644 --- a/xmloff/source/style/chrlohdl.hxx +++ b/xmloff/source/style/chrlohdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,3 +58,4 @@ public: #endif // _XMLOFF_PROPERTYHANDLER_CHARLOCALETYPES_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/csmaphdl.cxx b/xmloff/source/style/csmaphdl.cxx index 0a29de364bce..6bbd31057319 100644 --- a/xmloff/source/style/csmaphdl.cxx +++ b/xmloff/source/style/csmaphdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -136,3 +137,5 @@ sal_Bool XMLCaseMapVariantHdl::exportXML( OUString& rStrExpValue, const uno::Any rStrExpValue = aOut.makeStringAndClear(); return rStrExpValue.getLength() != 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/csmaphdl.hxx b/xmloff/source/style/csmaphdl.hxx index 64b108bb4338..d437d1a7e559 100644 --- a/xmloff/source/style/csmaphdl.hxx +++ b/xmloff/source/style/csmaphdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,3 +53,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_CASEMAPTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/durationhdl.cxx b/xmloff/source/style/durationhdl.cxx index 453393842897..d25dcb6f911d 100644 --- a/xmloff/source/style/durationhdl.cxx +++ b/xmloff/source/style/durationhdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,3 +80,5 @@ sal_Bool XMLDurationMS16PropHdl_Impl::exportXML( XMLDurationMS16PropHdl_Impl::~XMLDurationMS16PropHdl_Impl() { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/durationhdl.hxx b/xmloff/source/style/durationhdl.hxx index 6a12bb5722d3..356c5ddf5df1 100644 --- a/xmloff/source/style/durationhdl.hxx +++ b/xmloff/source/style/durationhdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_FMTSPLITTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/escphdl.cxx b/xmloff/source/style/escphdl.cxx index 548f867d6606..f0bbd43f793b 100644 --- a/xmloff/source/style/escphdl.cxx +++ b/xmloff/source/style/escphdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -170,3 +171,5 @@ sal_Bool XMLEscapementHeightPropHdl::exportXML( OUString& rStrExpValue, const un rStrExpValue = aOut.makeStringAndClear(); return rStrExpValue.getLength() != 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/escphdl.hxx b/xmloff/source/style/escphdl.hxx index 4844c0ccc41e..e3021e3b26dc 100644 --- a/xmloff/source/style/escphdl.hxx +++ b/xmloff/source/style/escphdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,3 +54,4 @@ public: #endif // _XMLOFF_PROPERTYHANDLER_ESCAPETYPES_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/fonthdl.cxx b/xmloff/source/style/fonthdl.cxx index d7e6bd7d1725..03f0ccfb69ee 100644 --- a/xmloff/source/style/fonthdl.cxx +++ b/xmloff/source/style/fonthdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,7 +46,7 @@ using namespace ::xmloff::token; const SvXMLEnumMapEntry* lcl_getFontFamilyGenericMapping() { - static SvXMLEnumMapEntry __READONLY_DATA aFontFamilyGenericMapping[] = + static SvXMLEnumMapEntry const aFontFamilyGenericMapping[] = { { XML_DECORATIVE, FAMILY_DECORATIVE }, @@ -59,7 +60,7 @@ const SvXMLEnumMapEntry* lcl_getFontFamilyGenericMapping() return aFontFamilyGenericMapping; } -static SvXMLEnumMapEntry __READONLY_DATA aFontPitchMapping[] = +static SvXMLEnumMapEntry const aFontPitchMapping[] = { { XML_FIXED, PITCH_FIXED }, { XML_VARIABLE, PITCH_VARIABLE }, @@ -317,3 +318,5 @@ sal_Bool XMLFontPitchPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/fonthdl.hxx b/xmloff/source/style/fonthdl.hxx index 18ddae73af14..3efb801ae3ac 100644 --- a/xmloff/source/style/fonthdl.hxx +++ b/xmloff/source/style/fonthdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,3 +81,5 @@ public: #endif // XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/impastp1.cxx b/xmloff/source/style/impastp1.cxx index 839ae145d4bf..8cfdcb3d994a 100644 --- a/xmloff/source/style/impastp1.cxx +++ b/xmloff/source/style/impastp1.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +31,7 @@ #include <tools/debug.hxx> #include "impastpl.hxx" -using namespace rtl; +using ::rtl::OUString; //############################################################################# // @@ -60,12 +61,13 @@ XMLFamilyData_Impl::~XMLFamilyData_Impl() { if( mpParentList ) delete mpParentList; if( mpNameList ) delete mpNameList; - DBG_ASSERT( !pCache || !pCache->Count(), - "auto style pool cache is not empty!" ); + DBG_ASSERT( !pCache || !pCache->size(), "auto style pool cache is not empty!" ); if( pCache ) { - while( pCache->Count() ) - delete pCache->Remove( 0UL ); + for ( size_t i = 0, n = pCache->size(); i < n; ++i ) + delete (*pCache)[ i ]; + pCache->clear(); + delete pCache; } } @@ -74,12 +76,12 @@ void XMLFamilyData_Impl::ClearEntries() if( mpParentList ) delete mpParentList; mpParentList = new SvXMLAutoStylePoolParentsP_Impl( 5, 5 ); - DBG_ASSERT( !pCache || !pCache->Count(), - "auto style pool cache is not empty!" ); + DBG_ASSERT( !pCache || !pCache->size(), "auto style pool cache is not empty!" ); if( pCache ) { - while( pCache->Count() ) - delete pCache->Remove( 0UL ); + for ( size_t i = 0, n = pCache->size(); i < n; ++i ) + delete (*pCache)[ i ]; + pCache->clear(); } } @@ -130,3 +132,4 @@ IMPL_CONTAINER_SORT( SvXMLAutoStylePoolNamesP_Impl, OUString, SvXMLAutoStylePoolNamesPCmp_Impl ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/impastp2.cxx b/xmloff/source/style/impastp2.cxx index afa0341c04b3..d152fe0c70bb 100644 --- a/xmloff/source/style/impastp2.cxx +++ b/xmloff/source/style/impastp2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,7 +32,9 @@ #include "impastpl.hxx" using namespace std; -using namespace rtl; + +using ::rtl::OUString; +using ::rtl::OUStringBuffer; //############################################################################# // @@ -59,3 +62,5 @@ SvXMLAutoStylePoolPropertiesP_Impl::SvXMLAutoStylePoolPropertiesP_Impl( XMLFamil } while( pFamilyData->mpNameList->Seek_Entry( &msName, 0 ) ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/impastp3.cxx b/xmloff/source/style/impastp3.cxx index 6e4607ef0b89..0c51db505b17 100644 --- a/xmloff/source/style/impastp3.cxx +++ b/xmloff/source/style/impastp3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,7 +32,8 @@ #include <xmloff/xmlprmap.hxx> using namespace std; -using namespace rtl; + +using ::rtl::OUString; //############################################################################# // @@ -45,8 +47,9 @@ using namespace rtl; SvXMLAutoStylePoolParentP_Impl::~SvXMLAutoStylePoolParentP_Impl() { - while( maPropertiesList.Count() ) - delete maPropertiesList.Remove( maPropertiesList.Count() -1 ); + for( size_t i = maPropertiesList.size(); i > 0; ) + delete maPropertiesList[ --i ]; + maPropertiesList.clear(); } /////////////////////////////////////////////////////////////////////////////// @@ -59,13 +62,13 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c { sal_Bool bAdded = sal_False; SvXMLAutoStylePoolPropertiesP_Impl *pProperties = 0; - sal_uInt32 i = 0; + size_t i = 0; sal_Int32 nProperties = rProperties.size(); - sal_uInt32 nCount = maPropertiesList.Count(); + size_t nCount = maPropertiesList.size(); for( i = 0; i < nCount; i++ ) { - SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList.GetObject( i ); + SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList[ i ]; if( nProperties > (sal_Int32)pIS->GetProperties().size() ) { continue; @@ -84,7 +87,9 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c if( !pProperties ) { pProperties = new SvXMLAutoStylePoolPropertiesP_Impl( pFamilyData, rProperties ); - maPropertiesList.Insert( pProperties, i ); + SvXMLAutoStylePoolPropertiesPList_Impl::iterator it = maPropertiesList.begin(); + ::std::advance( it, i ); + maPropertiesList.insert( it, pProperties ); bAdded = sal_True; } @@ -103,13 +108,13 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl* pFamilyData, const vector< XMLPropertyState >& rProperties, const OUString& rName ) { sal_Bool bAdded = sal_False; - sal_uInt32 i = 0; + size_t i = 0; sal_Int32 nProperties = rProperties.size(); - sal_uInt32 nCount = maPropertiesList.Count(); + size_t nCount = maPropertiesList.size(); for( i = 0; i < nCount; i++ ) { - SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList.GetObject( i ); + SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList[ i ]; if( nProperties > (sal_Int32)pIS->GetProperties().size() ) { continue; @@ -126,7 +131,9 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl* pFamilyDa new SvXMLAutoStylePoolPropertiesP_Impl( pFamilyData, rProperties ); // ignore the generated name pProperties->SetName( rName ); - maPropertiesList.Insert( pProperties, i ); + SvXMLAutoStylePoolPropertiesPList_Impl::iterator it = maPropertiesList.begin(); + ::std::advance( it, i ); + maPropertiesList.insert( it, pProperties ); bAdded = sal_True; } @@ -142,10 +149,10 @@ OUString SvXMLAutoStylePoolParentP_Impl::Find( const XMLFamilyData_Impl* pFamily { OUString sName; vector< XMLPropertyState>::size_type nItems = rProperties.size(); - sal_uInt32 nCount = maPropertiesList.Count(); - for( sal_uInt32 i=0; i < nCount; i++ ) + size_t nCount = maPropertiesList.size(); + for( size_t i = 0; i < nCount; i++ ) { - SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList.GetObject( i ); + SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList[ i ]; if( nItems > pIS->GetProperties().size() ) { continue; @@ -183,3 +190,5 @@ int SvXMLAutoStylePoolParentPCmp_Impl( const SvXMLAutoStylePoolParentP_Impl& r1, IMPL_CONTAINER_SORT( SvXMLAutoStylePoolParentsP_Impl, SvXMLAutoStylePoolParentP_Impl, SvXMLAutoStylePoolParentPCmp_Impl ) + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx index 38d4f8698761..d6032f54b4ce 100644 --- a/xmloff/source/style/impastp4.cxx +++ b/xmloff/source/style/impastp4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,9 +38,7 @@ #include <xmloff/xmlexppr.hxx> #include <xmloff/xmlexp.hxx> #include <xmloff/families.hxx> -#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX #include <xmloff/PageMasterStyleMap.hxx> -#endif using namespace ::std; using ::rtl::OUString; @@ -176,10 +175,6 @@ void SvXMLAutoStylePoolP_Impl::GetRegisteredNames( // if not added, yet. // -/*OUString SvXMLAutoStylePoolP_Impl::Add( sal_Int32 nFamily, - const OUString& rParent, - const vector< XMLPropertyState >& rProperties, - sal_Bool bCache )*/ sal_Bool SvXMLAutoStylePoolP_Impl::Add(OUString& rName, sal_Int32 nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties, @@ -222,10 +217,9 @@ sal_Bool SvXMLAutoStylePoolP_Impl::Add(OUString& rName, sal_Int32 nFamily, if( bCache ) { if( !pFamily->pCache ) - pFamily->pCache = new SvXMLAutoStylePoolCache_Impl( 256, 256 ); - if( pFamily->pCache->Count() < MAX_CACHE_SIZE ) - pFamily->pCache->Insert( new OUString( rName ), - pFamily->pCache->Count() ); + pFamily->pCache = new SvXMLAutoStylePoolCache_Impl(); + if( pFamily->pCache->size() < MAX_CACHE_SIZE ) + pFamily->pCache->push_back( new OUString( rName ) ); } } @@ -289,10 +283,9 @@ OUString SvXMLAutoStylePoolP_Impl::AddToCache( sal_Int32 nFamily, if( pFamily ) { if( !pFamily->pCache ) - pFamily->pCache = new SvXMLAutoStylePoolCache_Impl( 256, 256 ); - if( pFamily->pCache->Count() < MAX_CACHE_SIZE ) - pFamily->pCache->Insert( new OUString( rParent ), - pFamily->pCache->Count() ); + pFamily->pCache = new SvXMLAutoStylePoolCache_Impl(); + if( pFamily->pCache->size() < MAX_CACHE_SIZE ) + pFamily->pCache->push_back( new OUString( rParent ) ); } return rParent; @@ -351,9 +344,10 @@ OUString SvXMLAutoStylePoolP_Impl::FindAndRemoveCached( sal_Int32 nFamily ) cons // The cache may be empty already. This happens if it was filled // completly. - if( pFamily->pCache && pFamily->pCache->Count() ) + if( pFamily->pCache && !pFamily->pCache->empty() ) { - OUString *pName = pFamily->pCache->Remove( 0UL ); + OUString *pName = (*pFamily->pCache)[ 0 ]; + pFamily->pCache->erase( pFamily->pCache->begin() ); sName = *pName; delete pName; } @@ -412,11 +406,11 @@ void SvXMLAutoStylePoolP_Impl::exportXML( { const SvXMLAutoStylePoolParentP_Impl* pParent = pParents->GetObject( i ); - sal_uInt32 nProperties = pParent->GetPropertiesList().Count(); - for( sal_uInt32 j=0; j < nProperties; j++ ) + size_t nProperties = pParent->GetPropertiesList().size(); + for( size_t j = 0; j < nProperties; j++ ) { - const SvXMLAutoStylePoolPropertiesP_Impl *pProperties = - pParent->GetPropertiesList().GetObject( j ); + const SvXMLAutoStylePoolPropertiesP_Impl* pProperties = + pParent->GetPropertiesList()[ j ]; nPos = pProperties->GetPos(); DBG_ASSERT( nPos < nCount, "SvXMLAutoStylePool_Impl::exportXML: wrong position" ); @@ -525,3 +519,5 @@ void SvXMLAutoStylePoolP_Impl::ClearEntries() for(sal_uInt32 a = 0L; a < maFamilyList.Count(); a++) maFamilyList[a]->ClearEntries(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx index d3245290ee9b..77597257803a 100644 --- a/xmloff/source/style/impastpl.hxx +++ b/xmloff/source/style/impastpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +30,6 @@ #define _XMLOFF_XMLASTPL_IMPL_HXX #include <sal/types.h> -#include <tools/list.hxx> #include <svl/cntnrsrt.hxx> #include <rtl/ustring.hxx> #include <vector> @@ -38,6 +38,7 @@ #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <xmloff/maptype.hxx> #include <xmloff/xmlexppr.hxx> +#include <vector> class SvXMLAutoStylePoolP; class SvXMLAutoStylePoolParentsP_Impl; @@ -53,8 +54,8 @@ class SvXMLExport; // Implementationclass for stylefamily-information // -typedef ::rtl::OUString *OUStringPtr; -DECLARE_LIST( SvXMLAutoStylePoolCache_Impl, OUStringPtr ) +typedef ::rtl::OUString* OUStringPtr; +typedef ::std::vector< OUStringPtr > SvXMLAutoStylePoolCache_Impl; class XMLFamilyData_Impl { @@ -125,8 +126,8 @@ public: void SetName( const ::rtl::OUString& rNew ) { msName = rNew; } }; -typedef SvXMLAutoStylePoolPropertiesP_Impl *SvXMLAutoStylePoolPropertiesPPtr; -DECLARE_LIST( SvXMLAutoStylePoolPropertiesPList_Impl, SvXMLAutoStylePoolPropertiesPPtr ) +typedef SvXMLAutoStylePoolPropertiesP_Impl* SvXMLAutoStylePoolPropertiesPPtr; +typedef ::std::vector< SvXMLAutoStylePoolPropertiesPPtr > SvXMLAutoStylePoolPropertiesPList_Impl; /////////////////////////////////////////////////////////////////////////////// // @@ -190,9 +191,6 @@ public: com::sun::star::uno::Sequence<sal_Int32>& aFamilies, com::sun::star::uno::Sequence<rtl::OUString>& aNames ); -// ::rtl::OUString Add( sal_Int32 nFamily, const ::rtl::OUString& rParent, -// const ::std::vector< XMLPropertyState >& rProperties, -// sal_Bool bCache = sal_False ); sal_Bool Add( ::rtl::OUString& rName, sal_Int32 nFamily, const ::rtl::OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties, @@ -225,3 +223,5 @@ struct SvXMLAutoStylePoolPExport_Impl }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/kernihdl.cxx b/xmloff/source/style/kernihdl.cxx index 7dd0b3ab32b4..27ed1a5a318f 100644 --- a/xmloff/source/style/kernihdl.cxx +++ b/xmloff/source/style/kernihdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -87,3 +88,5 @@ sal_Bool XMLKerningPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/kernihdl.hxx b/xmloff/source/style/kernihdl.hxx index 2639eabe8d1f..958aabc3b479 100644 --- a/xmloff/source/style/kernihdl.hxx +++ b/xmloff/source/style/kernihdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_KERNINGTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/lspachdl.cxx b/xmloff/source/style/lspachdl.cxx index 6ea6221a0b27..27fa7582cf46 100644 --- a/xmloff/source/style/lspachdl.cxx +++ b/xmloff/source/style/lspachdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -193,3 +194,5 @@ sal_Bool XMLLineSpacingHdl::exportXML( OUString& rStrExpValue, const uno::Any& r rStrExpValue = aOut.makeStringAndClear(); return rStrExpValue.getLength() != 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/lspachdl.hxx b/xmloff/source/style/lspachdl.hxx index 8475453f928d..ab1fc8f53541 100644 --- a/xmloff/source/style/lspachdl.hxx +++ b/xmloff/source/style/lspachdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,3 +63,4 @@ public: #endif // _XMLOFF_PROPERTYHANDLER_CHARHEIGHTTYPES_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/numehelp.cxx b/xmloff/source/style/numehelp.cxx index be98184a41dc..a5c1680ede53 100644 --- a/xmloff/source/style/numehelp.cxx +++ b/xmloff/source/style/numehelp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -272,7 +273,7 @@ sal_Bool XMLNumberFormatAttributesExportHelper::GetCurrencySymbol(const sal_Int3 } catch ( uno::Exception& ) { - DBG_ERROR("Numberformat not found"); + OSL_FAIL("Numberformat not found"); } } } @@ -300,7 +301,7 @@ sal_Int16 XMLNumberFormatAttributesExportHelper::GetCellType(const sal_Int32 nNu } catch ( uno::Exception& ) { - DBG_ERROR("Numberformat not found"); + OSL_FAIL("Numberformat not found"); } } } @@ -356,7 +357,7 @@ sal_Bool XMLNumberFormatAttributesExportHelper::GetCurrencySymbol(const sal_Int3 } catch ( uno::Exception& ) { - DBG_ERROR("Numberformat not found"); + OSL_FAIL("Numberformat not found"); } } return sal_False; @@ -384,7 +385,7 @@ sal_Int16 XMLNumberFormatAttributesExportHelper::GetCellType(const sal_Int32 nNu } catch ( uno::Exception& ) { - DBG_ERROR("Numberformat not found"); + OSL_FAIL("Numberformat not found"); } } return 0; @@ -537,7 +538,7 @@ void XMLNumberFormatAttributesExportHelper::SetNumberFormatAttributes( WriteAttributes(nTypeKey, rValue, sCurrency, bExportValue); } else { - DBG_ERROR("no SvXMLExport given"); + OSL_FAIL("no SvXMLExport given"); } } @@ -553,6 +554,8 @@ void XMLNumberFormatAttributesExportHelper::SetNumberFormatAttributes( pExport->AddAttribute(sAttrStringValue, rValue); } else { - DBG_ERROR("no SvXMLExport given"); + OSL_FAIL("no SvXMLExport given"); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/opaquhdl.cxx b/xmloff/source/style/opaquhdl.cxx index 41e6ec0d38e8..8ef05d56894d 100644 --- a/xmloff/source/style/opaquhdl.cxx +++ b/xmloff/source/style/opaquhdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,3 +81,5 @@ sal_Bool XMLOpaquePropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/opaquhdl.hxx b/xmloff/source/style/opaquhdl.hxx index cebce4119153..0c013936fda0 100644 --- a/xmloff/source/style/opaquhdl.hxx +++ b/xmloff/source/style/opaquhdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_OPAQUETYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/postuhdl.cxx b/xmloff/source/style/postuhdl.cxx index b0885b539d4b..6a8c104fca3a 100644 --- a/xmloff/source/style/postuhdl.cxx +++ b/xmloff/source/style/postuhdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,7 +42,7 @@ using ::rtl::OUStringBuffer; using namespace ::com::sun::star; using namespace ::xmloff::token; -SvXMLEnumMapEntry __READONLY_DATA aPostureGenericMapping[] = +SvXMLEnumMapEntry const aPostureGenericMapping[] = { { XML_POSTURE_NORMAL, ITALIC_NONE }, { XML_POSTURE_ITALIC, ITALIC_NORMAL }, @@ -91,3 +92,4 @@ sal_Bool XMLPosturePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& r return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/postuhdl.hxx b/xmloff/source/style/postuhdl.hxx index dc09ac1644b1..fffe77ee7f72 100644 --- a/xmloff/source/style/postuhdl.hxx +++ b/xmloff/source/style/postuhdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_POSTURETYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/prhdlfac.cxx b/xmloff/source/style/prhdlfac.cxx index 27af64469daf..b0652788a927 100644 --- a/xmloff/source/style/prhdlfac.cxx +++ b/xmloff/source/style/prhdlfac.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,7 +76,7 @@ SvXMLEnumMapEntry aXML_ColorMode_EnumMap[] = { XML_TOKEN_INVALID, 0 } }; -SvXMLEnumMapEntry __READONLY_DATA aXML_HorizontalAdjust_Enum[] = +SvXMLEnumMapEntry const aXML_HorizontalAdjust_Enum[] = { { XML_LEFT, text::HorizontalAdjust_LEFT }, { XML_CENTER, text::HorizontalAdjust_CENTER }, @@ -86,7 +87,7 @@ SvXMLEnumMapEntry __READONLY_DATA aXML_HorizontalAdjust_Enum[] = // aXML_WritingDirection_Enum is used with and without 'page' // attribute, so you'll find uses of aXML_WritingDirection_Enum // directly, as well as &(aXML_WritingDirection_Enum[1]) -SvXMLEnumMapEntry __READONLY_DATA aXML_WritingDirection_Enum[] = +SvXMLEnumMapEntry const aXML_WritingDirection_Enum[] = { // aXML_WritingDirection_Enum { XML_PAGE, text::WritingMode2::PAGE }, @@ -112,7 +113,7 @@ SvXMLEnumMapEntry __READONLY_DATA aXML_WritingDirection_Enum[] = // XMLPropertyHandlerFactory::~XMLPropertyHandlerFactory() { - for( CacheMap::iterator pPos = maHandlerCache.begin(); pPos != maHandlerCache.end(); pPos++ ) + for( CacheMap::iterator pPos = maHandlerCache.begin(); pPos != maHandlerCache.end(); ++pPos ) delete pPos->second; } @@ -448,3 +449,5 @@ const XMLPropertyHandler* XMLPropertyHandlerFactory::CreatePropertyHandler( sal_ return pPropHdl; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 9c736bf8f226..c0261eb0852c 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <tools/debug.hxx> -#ifndef __SGI_STL_SET #include <set> -#endif #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> #include <xmloff/xmlprcon.hxx> @@ -45,9 +44,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <xmloff/xmlimp.hxx> -#ifndef _XMLOFF_PRSTYLEI_HXX #include <xmloff/prstylei.hxx> -#endif #include <xmloff/attrlist.hxx> #include "xmloff/xmlerror.hxx" @@ -212,15 +209,15 @@ void XMLPropStyleContext::CreateAndInsert( sal_Bool bOverwrite ) { aValues.realloc( nLen + 2 ); PropertyValue *pProps = aValues.getArray() + nLen; - pProps->Name = rtl::OUString::createFromAscii("ParaStyleName"); + pProps->Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaStyleName")); OUString sParent( GetParentName() ); if( sParent.getLength() ) sParent = GetImport().GetStyleDisplayName( GetFamily(), sParent ); else - sParent = rtl::OUString::createFromAscii("Standard"); + sParent = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Standard")); pProps->Value <<= sParent; ++pProps; - pProps->Name = rtl::OUString::createFromAscii("ParaConditionalStyleName"); + pProps->Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaConditionalStyleName")); pProps->Value <<= sParent; } @@ -229,8 +226,8 @@ void XMLPropStyleContext::CreateAndInsert( sal_Bool bOverwrite ) { Sequence< OUString > aPropNames(1); aPropNames[0] = GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH ? - rtl::OUString::createFromAscii("ParaAutoStyleName") : - rtl::OUString::createFromAscii("CharAutoStyleName"); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaAutoStyleName")) : + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharAutoStyleName")); Sequence< Any > aAny = xAutoStyle->getPropertyValues( aPropNames ); if( aAny.hasElements() ) { @@ -420,3 +417,4 @@ void XMLPropStyleContext::Finish( sal_Bool bOverwrite ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/shadwhdl.cxx b/xmloff/source/style/shadwhdl.cxx index 75b9249b6683..03fcb8a4eaf9 100644 --- a/xmloff/source/style/shadwhdl.cxx +++ b/xmloff/source/style/shadwhdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -173,3 +174,5 @@ sal_Bool XMLShadowPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rV return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/shadwhdl.hxx b/xmloff/source/style/shadwhdl.hxx index c2cb8eb536eb..6cb957778f01 100644 --- a/xmloff/source/style/shadwhdl.hxx +++ b/xmloff/source/style/shadwhdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_BASICTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/shdwdhdl.cxx b/xmloff/source/style/shdwdhdl.cxx index b23c18eec043..c6e2279239db 100644 --- a/xmloff/source/style/shdwdhdl.cxx +++ b/xmloff/source/style/shdwdhdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,3 +83,5 @@ sal_Bool XMLShadowedPropHdl::exportXML( OUString& rStrExpValue, const Any& rValu return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/shdwdhdl.hxx b/xmloff/source/style/shdwdhdl.hxx index 4f8b4c9b6eca..aba2f6c2c67a 100644 --- a/xmloff/source/style/shdwdhdl.hxx +++ b/xmloff/source/style/shdwdhdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_SHADOWEDTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index ad26398f911c..81b8dd3409e4 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,9 +36,6 @@ #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> -#ifndef _XMLOFF_XMLITMAP_HXX -//#include "xmlitmap.hxx" -#endif #include <xmloff/xmluconv.hxx> #include <xmloff/attrlist.hxx> #include <xmloff/xmlprmap.hxx> @@ -49,14 +47,10 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> -#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTSSUPPLIER_HPP #include <com/sun/star/document/XEventsSupplier.hpp> -#endif #include <com/sun/star/text/XChapterNumberingSupplier.hpp> #include <xmloff/xmlaustp.hxx> -#ifndef _XMLOFF_STYLEEXP_HXX #include <xmloff/styleexp.hxx> -#endif #include <xmloff/xmlexp.hxx> #include <xmloff/XMLEventExport.hxx> @@ -82,7 +76,7 @@ XMLStyleExport::XMLStyleExport( sIsAutoUpdate( RTL_CONSTASCII_USTRINGPARAM( "IsAutoUpdate" ) ), sFollowStyle( RTL_CONSTASCII_USTRINGPARAM( "FollowStyle" ) ), sNumberingStyleName( RTL_CONSTASCII_USTRINGPARAM( "NumberingStyleName" ) ), - sOutlineLevel( RTL_CONSTASCII_USTRINGPARAM( "OutlineLevel" ) ),//#outline level,add by zhaojianwei + sOutlineLevel( RTL_CONSTASCII_USTRINGPARAM( "OutlineLevel" ) ), sPoolStyleName( rPoolStyleName ), pAutoStylePool( pAutoStyleP ) { @@ -104,7 +98,7 @@ sal_Bool XMLStyleExport::exportStyle( const Reference< XStyle >& rStyle, const OUString& rXMLFamily, const UniReference < SvXMLExportPropertyMapper >& rPropMapper, - const Reference< XNameAccess >& xStyles, //#outline level,add by zhaojianwei + const Reference< XNameAccess >& xStyles, const OUString* pPrefix ) { Reference< XPropertySet > xPropSet( rStyle, UNO_QUERY ); @@ -182,7 +176,7 @@ sal_Bool XMLStyleExport::exportStyle( XML_TRUE ); } - // style:default-outline-level"..." //#outline level, add by zhaojianwei.0802 + // style:default-outline-level"..." sal_Int32 nOutlineLevel = 0; if( xPropSetInfo->hasPropertyByName( sOutlineLevel ) ) { @@ -201,12 +195,11 @@ sal_Bool XMLStyleExport::exportStyle( } else { - // --> OD 2009-12-29 #i104889# - // empty value for style:default-outline-level does exist - // since ODF 1.2. Thus, suppress its export for former versions. + /* Empty value for style:default-outline-level does exist + since ODF 1.2. Thus, suppress its export for former versions. (#i104889#) + */ if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0 && GetExport().getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) - // <-- { GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_DEFAULT_OUTLINE_LEVEL, @@ -214,7 +207,7 @@ sal_Bool XMLStyleExport::exportStyle( } } } - }//<-end,zhaojianwei + } // style:list-style-name="..." (SW paragarph styles only) if( xPropSetInfo->hasPropertyByName( sNumberingStyleName ) ) @@ -229,10 +222,10 @@ sal_Bool XMLStyleExport::exportStyle( OUString sListName; aAny >>= sListName; - // --> OD 2006-09-21 #i69523# - // An direct set empty list style has to be written. Otherwise, - // this information is lost and causes an error, if the parent - // style has a list style set. + /* An direct set empty list style has to be written. Otherwise, + this information is lost and causes an error, if the parent + style has a list style set. (#i69523#) + */ if ( !sListName.getLength() ) { GetExport().AddAttribute( XML_NAMESPACE_STYLE, @@ -241,7 +234,7 @@ sal_Bool XMLStyleExport::exportStyle( } else { - // --> OD 2006-09-27 #i69627# + // Written OpenDocument file format doesn't fit to the created text document (#i69627#) bool bSuppressListStyle( false ); { if ( !GetExport().writeOutlineStyleAsNormalListStyle() ) @@ -270,17 +263,14 @@ sal_Bool XMLStyleExport::exportStyle( } if ( sListName.getLength() && !bSuppressListStyle ) - // <-- { GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_LIST_STYLE_NAME, GetExport().EncodeStyleName( sListName ) ); } } - // <-- } } - //#outline level, add by zhaojianwei.0802 else if( nOutlineLevel > 0 ) { @@ -320,10 +310,8 @@ sal_Bool XMLStyleExport::exportStyle( XML_LIST_STYLE_NAME, OUString( RTL_CONSTASCII_USTRINGPARAM( "" ))); } - //<-end,zhaojianwei } - // style:pool-id="..." is not required any longer since we use // english style names only exportStyleAttributes( rStyle ); @@ -379,43 +367,14 @@ sal_Bool XMLStyleExport::exportDefaultStyle( XML_DEFAULT_STYLE, sal_True, sal_True ); // <style:properties> - //::std::vector< XMLPropertyState > xPropStates = - // rPropMapper->FilterDefaults( xPropSet ); ::std::vector< XMLPropertyState > xPropStates = rPropMapper->FilterDefaults( xPropSet ); rPropMapper->exportXML( GetExport(), xPropStates, XML_EXPORT_FLAG_IGN_WS ); -// exportStyleContent( rStyle ); } return sal_True; } -#if 0 -void XMLStyleExport::exportStyleFamily( - const sal_Char *pFamily, - const OUString& rXMLFamily, - const UniReference < XMLPropertySetMapper >& rPropMapper, - sal_Bool bUsed, sal_uInt16 nFamily, const OUString* pPrefix) -{ - const OUString sFamily(OUString::createFromAscii(pFamily )); - UniReference < SvXMLExportPropertyMapper > xExpPropMapper = - new SvXMLExportPropertyMapper( rPropMapper ); - exportStyleFamily( sFamily, rXMLFamily, xExpPropMapper, bUsed, nFamily, - pPrefix); -} - -void XMLStyleExport::exportStyleFamily( - const OUString& rFamily, const OUString& rXMLFamily, - const UniReference < XMLPropertySetMapper >& rPropMapper, - sal_Bool bUsed, sal_uInt16 nFamily, const OUString* pPrefix) -{ - UniReference < SvXMLExportPropertyMapper > xExpPropMapper = - new SvXMLExportPropertyMapper( rPropMapper ); - exportStyleFamily( rFamily, rXMLFamily, xExpPropMapper, bUsed, nFamily, - pPrefix); -} -#endif - void XMLStyleExport::exportStyleFamily( const sal_Char *pFamily, const OUString& rXMLFamily, @@ -564,3 +523,4 @@ void XMLStyleExport::exportStyleFamily( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/tabsthdl.cxx b/xmloff/source/style/tabsthdl.cxx index 718df9a9c28c..c4e84b88858c 100644 --- a/xmloff/source/style/tabsthdl.cxx +++ b/xmloff/source/style/tabsthdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -90,3 +91,4 @@ sal_Bool XMLTabStopPropHdl::exportXML( ::rtl::OUString&, const ::com::sun::star: return sal_False; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/tabsthdl.hxx b/xmloff/source/style/tabsthdl.hxx index d8a911a88617..008cbcbf2291 100644 --- a/xmloff/source/style/tabsthdl.hxx +++ b/xmloff/source/style/tabsthdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_TABSTOPTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/undlihdl.cxx b/xmloff/source/style/undlihdl.cxx index 226ae3207e50..85f72a06cdc8 100644 --- a/xmloff/source/style/undlihdl.cxx +++ b/xmloff/source/style/undlihdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,7 +44,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::awt; using namespace ::xmloff::token; -SvXMLEnumMapEntry __READONLY_DATA pXML_UnderlineType_Enum[] = +SvXMLEnumMapEntry const pXML_UnderlineType_Enum[] = { { XML_NONE, FontUnderline::NONE }, { XML_SINGLE, FontUnderline::SINGLE }, @@ -66,7 +67,7 @@ SvXMLEnumMapEntry __READONLY_DATA pXML_UnderlineType_Enum[] = { XML_TOKEN_INVALID, 0 } }; -SvXMLEnumMapEntry __READONLY_DATA pXML_UnderlineStyle_Enum[] = +SvXMLEnumMapEntry const pXML_UnderlineStyle_Enum[] = { { XML_NONE, FontUnderline::NONE }, { XML_SOLID, FontUnderline::SINGLE }, @@ -89,7 +90,7 @@ SvXMLEnumMapEntry __READONLY_DATA pXML_UnderlineStyle_Enum[] = { XML_TOKEN_INVALID, 0 } }; -SvXMLEnumMapEntry __READONLY_DATA pXML_UnderlineWidth_Enum[] = +SvXMLEnumMapEntry const pXML_UnderlineWidth_Enum[] = { { XML_AUTO, FontUnderline::NONE }, { XML_AUTO, FontUnderline::SINGLE }, @@ -379,3 +380,4 @@ sal_Bool XMLUnderlineWidthPropHdl::exportXML( OUString& rStrExpValue, const uno: return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/undlihdl.hxx b/xmloff/source/style/undlihdl.hxx index a4d99e625fc7..60818cc35657 100644 --- a/xmloff/source/style/undlihdl.hxx +++ b/xmloff/source/style/undlihdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,3 +62,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_UNDERLINETYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/uniref.cxx b/xmloff/source/style/uniref.cxx index a00eff9e9b25..342df9fa1a51 100644 --- a/xmloff/source/style/uniref.cxx +++ b/xmloff/source/style/uniref.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,3 +39,5 @@ void UniRefBase::release() if( !osl_decrementInterlockedCount( &m_refCount ) ) delete this; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/weighhdl.cxx b/xmloff/source/style/weighhdl.cxx index e9eda292723b..9955d446e66f 100644 --- a/xmloff/source/style/weighhdl.cxx +++ b/xmloff/source/style/weighhdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -173,3 +174,4 @@ sal_Bool XMLFontWeightPropHdl::exportXML( OUString& rStrExpValue, const Any& rVa return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/weighhdl.hxx b/xmloff/source/style/weighhdl.hxx index 7b13cc4ccb3b..5ac66dd18aff 100644 --- a/xmloff/source/style/weighhdl.hxx +++ b/xmloff/source/style/weighhdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,3 +45,5 @@ public: #endif // _XMLOFF_PROPERTYHANDLER_FONTWEIGHTTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx index c9ff7b92dade..669a4a169531 100644 --- a/xmloff/source/style/xmlaustp.cxx +++ b/xmloff/source/style/xmlaustp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,9 +40,7 @@ #include <xmloff/xmlexp.hxx> #include "xmloff/XMLTextListAutoStylePool.hxx" -#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX #include <xmloff/PageMasterStyleMap.hxx> -#endif #include "PageMasterExportPropMapper.hxx" #include "XMLBackgroundImageExport.hxx" @@ -122,8 +121,8 @@ void SvXMLAutoStylePoolP::exportStyleAttributes( if (bFoundControlShapeDataStyle) { - DBG_ERROR("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the ControlShapeDataStyle context id!"); - // already added the attribute for the first occurence + OSL_FAIL("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the ControlShapeDataStyle context id!"); + // already added the attribute for the first occurrence break; } @@ -137,8 +136,8 @@ void SvXMLAutoStylePoolP::exportStyleAttributes( { if (bFoundNumberingRulesName) { - DBG_ERROR("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the numbering rules name context id!"); - // already added the attribute for the first occurence + OSL_FAIL("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the numbering rules name context id!"); + // already added the attribute for the first occurrence break; } @@ -161,7 +160,7 @@ void SvXMLAutoStylePoolP::exportStyleAttributes( if( nFamily == XML_STYLE_FAMILY_PAGE_MASTER ) { - for( vector< XMLPropertyState >::const_iterator pProp = rProperties.begin(); pProp != rProperties.end(); pProp++ ) + for( vector< XMLPropertyState >::const_iterator pProp = rProperties.begin(); pProp != rProperties.end(); ++pProp ) { if (pProp->mnIndex > -1) { @@ -280,7 +279,7 @@ void SvXMLAutoStylePoolP::exportStyleContent( SvXMLAutoStylePoolP::SvXMLAutoStylePoolP() { - DBG_ERROR("This constuctor is obsoleted and should not be used!"); + OSL_FAIL("This constuctor is obsoleted and should not be used!"); pImpl = NULL; } @@ -446,3 +445,5 @@ void SvXMLAutoStylePoolP::ClearEntries() { pImpl->ClearEntries(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx index 4cc76c3f3ff5..af4fcaba8f3c 100644 --- a/xmloff/source/style/xmlbahdl.cxx +++ b/xmloff/source/style/xmlbahdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -247,7 +248,7 @@ sal_Bool XMLBoolPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, c { sal_Bool bRet = sal_False; - sal_Bool bValue; + bool bValue; bRet = SvXMLUnitConverter::convertBool( bValue, rStrImpValue ); rValue <<= sal_Bool(bValue); @@ -285,7 +286,7 @@ sal_Bool XMLNBoolPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, { sal_Bool bRet = sal_False; - sal_Bool bValue; + bool bValue; bRet = SvXMLUnitConverter::convertBool( bValue, rStrImpValue ); rValue <<= sal_Bool(!bValue); @@ -538,13 +539,13 @@ sal_Bool XMLColorPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, Sequence< double > aHSL; if( (rValue >>= aHSL) && (aHSL.getLength() == 3) ) { - aOut.append( OUString::createFromAscii("hsl(") ); + aOut.append( OUString(RTL_CONSTASCII_USTRINGPARAM("hsl(")) ); aOut.append( aHSL[0] ); - aOut.append( OUString::createFromAscii(",") ); + aOut.append( OUString(RTL_CONSTASCII_USTRINGPARAM(",")) ); aOut.append( aHSL[1] * 100.0 ); - aOut.append( OUString::createFromAscii("%,") ); + aOut.append( OUString(RTL_CONSTASCII_USTRINGPARAM("%,")) ); aOut.append( aHSL[2] * 100.0 ); - aOut.append( OUString::createFromAscii("%)") ); + aOut.append( OUString(RTL_CONSTASCII_USTRINGPARAM("%)")) ); rStrExpValue = aOut.makeStringAndClear(); bRet = sal_True; @@ -808,7 +809,7 @@ XMLIsAutoColorPropHdl::~XMLIsAutoColorPropHdl() sal_Bool XMLIsAutoColorPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const { - sal_Bool bValue; + bool bValue; // An auto color overrides any other color set! sal_Bool bRet = SvXMLUnitConverter::convertBool( bValue, rStrImpValue ); @@ -942,3 +943,4 @@ sal_Bool XMLNumberWithAutoInsteadZeroPropHdl::exportXML( OUString& rStrExpValue, return sal_True; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlbahdl.hxx b/xmloff/source/style/xmlbahdl.hxx index 811824e71bf8..80f75b0159c7 100644 --- a/xmloff/source/style/xmlbahdl.hxx +++ b/xmloff/source/style/xmlbahdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -305,3 +306,5 @@ public: }; #endif // _XMLOFF_PROPERTYHANDLER_BASICTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index 23c55cc4ef04..48f383a9a376 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,7 +38,7 @@ #include <com/sun/star/beans/TolerantPropertySetResultType.hpp> #include <rtl/ustrbuf.hxx> #include <list> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <xmloff/xmlexppr.hxx> #include <xmloff/xmltoken.hxx> @@ -233,7 +234,7 @@ public: // ---------------------------------------------------------------------------- -typedef std::hash_map +typedef boost::unordered_map < PropertySetInfoKey, FilterPropertiesInfo_Impl *, @@ -307,7 +308,7 @@ const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames() FilterPropertyInfoList_Impl::iterator aOld = aPropInfos.begin(); FilterPropertyInfoList_Impl::iterator aEnd = aPropInfos.end(); FilterPropertyInfoList_Impl::iterator aCurrent = aOld; - aCurrent++; + ++aCurrent; while ( aCurrent != aEnd ) { @@ -324,7 +325,7 @@ const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames() { // remember old element and continue with next aOld = aCurrent; - aCurrent++; + ++aCurrent; } } } @@ -334,7 +335,7 @@ const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames() OUString *pNames = pApiNames->getArray(); FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin(); FilterPropertyInfoList_Impl::iterator aEnd = aPropInfos.end(); - for ( ; aItr != aEnd; aItr++, pNames++) + for ( ; aItr != aEnd; ++aItr, ++pNames) *pNames = aItr->GetApiName(); } @@ -476,7 +477,7 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray( pPropIter = aPropIters.begin(); XMLPropertyState aNewProperty( -1 ); - for( i = 0; i < nValueCount; i++ ) + for( i = 0; i < nValueCount; ++i ) { aNewProperty.mnIndex = -1; aNewProperty.maValue = *pValues; @@ -502,7 +503,7 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray( const Any *pValues = aValues.getConstArray(); FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin(); - for(sal_uInt32 i = 0; i < nCount; i++ ) + for(sal_uInt32 i = 0; i < nCount; ++i) { // The value is stored in the PropertySet itself, add to list. XMLPropertyState aNewProperty( -1 ); @@ -511,19 +512,19 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray( for( std::list<sal_uInt32>::iterator aIndexItr = aItr->GetIndexes().begin(); aIndexItr != aItr->GetIndexes().end(); - aIndexItr++ ) + ++aIndexItr ) { aNewProperty.mnIndex = *aIndexItr; aPropStates.AddPropertyState( aNewProperty ); } - aItr++; + ++aItr; } } } else { FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin(); - for(sal_uInt32 i = 0; i < nCount; i++ ) + for(sal_uInt32 i = 0; i < nCount; ++i) { sal_Bool bDirectValue = !pStates || *pStates == PropertyState_DIRECT_VALUE; @@ -535,7 +536,7 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray( for( std::list<sal_uInt32>::const_iterator aIndexItr = aItr->GetIndexes().begin(); aIndexItr != aItr->GetIndexes().end(); - aIndexItr++ ) + ++aIndexItr ) { if( bDirectValue || (rPropMapper->GetEntryFlags( *aIndexItr ) & @@ -562,9 +563,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray( } } - aItr++; + ++aItr; if( pStates ) - pStates++; + ++pStates; } } } @@ -701,7 +702,7 @@ vector< XMLPropertyState > SvXMLExportPropertyMapper::_Filter( } else { - OSL_ENSURE(sal_False, "here is no TypeProvider or the ImplId is wrong"); + OSL_FAIL("here is no TypeProvider or the ImplId is wrong"); bDelInfo = sal_True; } } @@ -726,14 +727,6 @@ vector< XMLPropertyState > SvXMLExportPropertyMapper::_Filter( ContextFilter( aPropStateArray, xPropSet ); // Have to do if we change from a vector to a list or something like that - /*vector< XMLPropertyState >::iterator aItr = aPropStateArray.begin(); - while (aItr != aPropStateArray.end()) - { - if (aItr->mnIndex == -1) - aItr = aPropStateArray.erase(aItr); - else - aItr++; - }*/ if( bDelInfo ) delete pFilterInfo; @@ -1105,7 +1098,7 @@ void SvXMLExportPropertyMapper::_exportXML( MID_FLAG_MERGE_ATTRIBUTE ) != 0 ) { aValue = rAttrList.getValueByName( sName ); - bRemove = sal_True; //aValue.getLength() != 0; + bRemove = sal_True; } if( maPropMapper->exportXML( aValue, rProperty, rUnitConverter ) ) @@ -1144,3 +1137,5 @@ void SvXMLExportPropertyMapper::exportElementItems( if( bItemsExported ) rExport.IgnorableWhitespace(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx index 79b2974706e5..cf09b6cdc53c 100644 --- a/xmloff/source/style/xmlimppr.cxx +++ b/xmloff/source/style/xmlimppr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -69,6 +70,8 @@ using ::com::sun::star::lang::WrappedTargetException; using ::com::sun::star::beans::UnknownPropertyException; using ::com::sun::star::beans::PropertyVetoException; +using rtl::OUString; +using rtl::OUStringBuffer; SvXMLImportPropertyMapper::SvXMLImportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, @@ -341,20 +344,10 @@ void SvXMLImportPropertyMapper::importXML( } finished( rProperties, nStartIdx, nEndIdx ); - - // Have to do if we change from a vector to a list or something like that - /*std::vector <XMLPropertyState>::iterator aItr = rProperties.begin(); - while (aItr != rProperties.end()) - { - if (aItr->mnIndex == -1) - aItr = rProperties.erase(aItr); - else - aItr++; - }*/ } /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_IMPORT flag set */ -sal_Bool SvXMLImportPropertyMapper::handleSpecialItem( +bool SvXMLImportPropertyMapper::handleSpecialItem( XMLPropertyState& rProperty, vector< XMLPropertyState >& rProperties, const OUString& rValue, @@ -592,7 +585,7 @@ typedef pair<const OUString*, const Any* > PropertyPair; typedef vector<PropertyPair> PropertyPairs; struct PropertyPairLessFunctor : - public binary_function<PropertyPair, PropertyPair, bool> + public std::binary_function<PropertyPair, PropertyPair, bool> { bool operator()( const PropertyPair& a, const PropertyPair& b ) const { @@ -782,3 +775,5 @@ void SvXMLImportPropertyMapper::finished( if( mxNextMapper.is() ) mxNextMapper->finished( rProperties, nStartIndex, nEndIndex ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx index 59849df1a20e..6ff60f002d39 100644 --- a/xmloff/source/style/xmlnume.cxx +++ b/xmloff/source/style/xmlnume.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,10 +39,8 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> #include <com/sun/star/text/XChapterNumberingSupplier.hpp> -// --> OD 2008-01-16 #newlistlevelattrs# #include <com/sun/star/text/PositionAndSpaceMode.hpp> #include <com/sun/star/text/LabelFollow.hpp> -// <-- #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -71,32 +70,30 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; using namespace ::xmloff::token; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE[] = "SymbolTextDistance"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_PARENT_NUMBERING[] = "ParentNumbering"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_CHAR_STYLE_NAME[] = "CharStyleName"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_CHAR[] = "BulletChar"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_RELSIZE[] = "BulletRelSize"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_COLOR[] = "BulletColor"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_GRAPHIC_BITMAP[] = "GraphicBitmap"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_GRAPHIC_SIZE[] = "GraphicSize"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_VERT_ORIENT[] = "VertOrient"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_NUMBERINGTYPE[] = "NumberingType"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_HEADING_STYLE_NAME[] = "HeadingStyleName"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_PREFIX[] = "Prefix"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_SUFFIX[] = "Suffix"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_ADJUST[] = "Adjust"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_LEFT_MARGIN[] = "LeftMargin"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET[] = "FirstLineOffset"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_FONT[] = "BulletFont"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_GRAPHICURL[] = "GraphicURL"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_START_WITH[] = "StartWith"; -// --> OD 2008-01-15 #newlistlevelattrs# -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_POSITION_AND_SPACE_MODE[] = "PositionAndSpaceMode"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_LABEL_FOLLOWED_BY[] = "LabelFollowedBy"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_LISTTAB_STOP_POSITION[] = "ListtabStopPosition"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_FIRST_LINE_INDENT[] = "FirstLineIndent"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_INDENT_AT[] = "IndentAt"; -// <-- +static sal_Char const XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE[] = "SymbolTextDistance"; +static sal_Char const XML_UNO_NAME_NRULE_PARENT_NUMBERING[] = "ParentNumbering"; +static sal_Char const XML_UNO_NAME_NRULE_CHAR_STYLE_NAME[] = "CharStyleName"; +static sal_Char const XML_UNO_NAME_NRULE_BULLET_CHAR[] = "BulletChar"; +static sal_Char const XML_UNO_NAME_NRULE_BULLET_RELSIZE[] = "BulletRelSize"; +static sal_Char const XML_UNO_NAME_NRULE_BULLET_COLOR[] = "BulletColor"; +static sal_Char const XML_UNO_NAME_NRULE_GRAPHIC_BITMAP[] = "GraphicBitmap"; +static sal_Char const XML_UNO_NAME_NRULE_GRAPHIC_SIZE[] = "GraphicSize"; +static sal_Char const XML_UNO_NAME_NRULE_VERT_ORIENT[] = "VertOrient"; +static sal_Char const XML_UNO_NAME_NRULE_NUMBERINGTYPE[] = "NumberingType"; +static sal_Char const XML_UNO_NAME_NRULE_HEADING_STYLE_NAME[] = "HeadingStyleName"; +static sal_Char const XML_UNO_NAME_NRULE_PREFIX[] = "Prefix"; +static sal_Char const XML_UNO_NAME_NRULE_SUFFIX[] = "Suffix"; +static sal_Char const XML_UNO_NAME_NRULE_ADJUST[] = "Adjust"; +static sal_Char const XML_UNO_NAME_NRULE_LEFT_MARGIN[] = "LeftMargin"; +static sal_Char const XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET[] = "FirstLineOffset"; +static sal_Char const XML_UNO_NAME_NRULE_BULLET_FONT[] = "BulletFont"; +static sal_Char const XML_UNO_NAME_NRULE_GRAPHICURL[] = "GraphicURL"; +static sal_Char const XML_UNO_NAME_NRULE_START_WITH[] = "StartWith"; +static sal_Char const XML_UNO_NAME_NRULE_POSITION_AND_SPACE_MODE[] = "PositionAndSpaceMode"; +static sal_Char const XML_UNO_NAME_NRULE_LABEL_FOLLOWED_BY[] = "LabelFollowedBy"; +static sal_Char const XML_UNO_NAME_NRULE_LISTTAB_STOP_POSITION[] = "ListtabStopPosition"; +static sal_Char const XML_UNO_NAME_NRULE_FIRST_LINE_INDENT[] = "FirstLineIndent"; +static sal_Char const XML_UNO_NAME_NRULE_INDENT_AT[] = "IndentAt"; void SvxXMLNumRuleExport::exportLevelStyles( const uno::Reference< ::com::sun::star::container::XIndexReplace > & xNumRule, sal_Bool bOutline ) @@ -139,13 +136,11 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, sal_Int32 nImageWidth = 0, nImageHeight = 0; sal_Int16 eImageVertOrient = VertOrientation::LINE_CENTER; - // --> OD 2008-01-15 #newlistlevelattrs# sal_Int16 ePosAndSpaceMode = PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION; sal_Int16 eLabelFollowedBy = LabelFollow::LISTTAB; sal_Int32 nListtabStopPosition( 0 ); sal_Int32 nFirstLineIndent( 0 ); sal_Int32 nIndentAt( 0 ); - // <-- const sal_Int32 nCount = rProps.getLength(); const beans::PropertyValue* pPropArray = rProps.getConstArray(); @@ -250,7 +245,6 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, rProp.Value >>= nValue; eImageVertOrient = nValue; } - // --> OD 2008-01-16 #newlistlevelattrs# else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_POSITION_AND_SPACE_MODE, sizeof(XML_UNO_NAME_NRULE_POSITION_AND_SPACE_MODE)-1 ) ) { @@ -280,7 +274,6 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, { rProp.Value >>= nIndentAt; } - // <-- } if( bOutline && (NumberingType::CHAR_SPECIAL == eType || @@ -397,19 +390,9 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, eElem, sal_True, sal_True ); - // --> OD 2008-01-16 #newlistlevelattrs# OUStringBuffer sBuffer; if ( ePosAndSpaceMode == PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION ) { - // --> OD 2008-06-05 #i89178# - // optimization of XML stream size: - // suppress export of property list-level-position-and-space-mode, - // if its value is "label-width-and-position" - its the default value -// GetExport().AddAttribute( XML_NAMESPACE_TEXT, -// XML_LIST_LEVEL_POSITION_AND_SPACE_MODE, -// XML_LABEL_WIDTH_AND_POSITION ); - // <-- - nSpaceBefore += nMinLabelWidth; nMinLabelWidth = -nMinLabelWidth; if( nSpaceBefore != 0 ) @@ -431,18 +414,16 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, sBuffer.makeStringAndClear() ); } } - // --> OD 2008-06-06 #i89178# - // check, if properties for position-and-space-mode LABEL_ALIGNMENT - // are allowed to be exported. + /* Check, if properties for position-and-space-mode LABEL_ALIGNMENT + are allowed to be exported. (#i89178#) + */ else if ( ePosAndSpaceMode == PositionAndSpaceMode::LABEL_ALIGNMENT && mbExportPositionAndSpaceModeLabelAlignment ) - // <-- { GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_LIST_LEVEL_POSITION_AND_SPACE_MODE, XML_LABEL_ALIGNMENT ); } - // <-- if( HoriOrientation::LEFT != eAdjust ) { enum XMLTokenEnum eValue = XML_TOKEN_INVALID; @@ -518,18 +499,15 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, } } - // --> OD 2008-01-16 #newlistlevelattrs# -// if( GetExport().GetAttrList().getLength() > 0 ) { SvXMLElementExport aElement( GetExport(), XML_NAMESPACE_STYLE, XML_LIST_LEVEL_PROPERTIES, sal_True, sal_True ); - // --> OD 2008-06-06 #i89178# - // check, if properties for position-and-space-mode LABEL_ALIGNMENT - // are allowed to be exported. + /* Check, if properties for position-and-space-mode LABEL_ALIGNMENT + are allowed to be exported. (#i89178#) + */ if ( ePosAndSpaceMode == PositionAndSpaceMode::LABEL_ALIGNMENT && mbExportPositionAndSpaceModeLabelAlignment ) - // <-- { enum XMLTokenEnum eValue = XML_LISTTAB; if ( eLabelFollowedBy == LabelFollow::SPACE ) @@ -573,7 +551,6 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, sal_True, sal_True ); } } - // <-- if( NumberingType::CHAR_SPECIAL == eType ) { @@ -684,9 +661,8 @@ SvxXMLNumRuleExport::SvxXMLNumRuleExport( SvXMLExport& rExp ) : sNumberingRules( RTL_CONSTASCII_USTRINGPARAM( "NumberingRules" ) ), sIsPhysical( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ) ), sIsContinuousNumbering( RTL_CONSTASCII_USTRINGPARAM( "IsContinuousNumbering" ) ), - // --> OD 2008-06-06 #i89178# + // Let list style creation depend on Load/Save option "ODF format version" (#i89178#) mbExportPositionAndSpaceModeLabelAlignment( true ) - // <-- { switch ( GetExport().getDefaultVersion() ) { @@ -707,57 +683,6 @@ SvxXMLNumRuleExport::~SvxXMLNumRuleExport() { } -// --> OD 2008-06-17 #i90780# -// refactoring: removing unused methods -//void SvxXMLNumRuleExport::Export( const OUString& rName, -// sal_Bool bContNumbering ) -//{ -// GetExport().CheckAttrList(); - -// // style:name="..." -// if( rName.getLength() ) -// { -// sal_Bool bEncoded = sal_False; -// GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NAME, -// GetExport().EncodeStyleName( rName, &bEncoded ) ); -// if( bEncoded ) -// GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_DISPLAY_NAME, -// rName); -// } - -// // text:consecutive-numbering="..." -// if( bContNumbering ) -// GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_CONSECUTIVE_NUMBERING, -// XML_TRUE ); - -// // other application specific attributes -// AddListStyleAttributes(); - -// OUString sElem = GetExport().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TEXT, -// GetXMLToken(XML_LIST_STYLE) ); -// GetExport().IgnorableWhitespace(); -// GetExport().StartElement( XML_NAMESPACE_TEXT, XML_LIST_STYLE, sal_False ); - -// uno::Reference< ::com::sun::star::container::XIndexReplace > xNumRule = GetUNONumRule(); -// if( xNumRule.is() ) -// exportLevelStyles( xNumRule ); - -// GetExport().EndElement( XML_NAMESPACE_TEXT, XML_LIST_STYLE, sal_True ); -//} - -//void SvxXMLNumRuleExport::ExportOutline() -//{ -// GetExport().IgnorableWhitespace( ); -// GetExport().StartElement( XML_NAMESPACE_TEXT, XML_OUTLINE_STYLE, sal_False ); - -// uno::Reference< ::com::sun::star::container::XIndexReplace > xNumRule = GetUNONumRule(); -// if( xNumRule.is() ) -// exportLevelStyles( xNumRule, sal_True ); - -// GetExport().EndElement( XML_NAMESPACE_TEXT, XML_OUTLINE_STYLE, sal_True ); -//} -// <-- - void SvxXMLNumRuleExport::exportNumberingRule( const OUString& rName, const Reference< XIndexReplace >& rNumRule ) @@ -842,9 +767,9 @@ void SvxXMLNumRuleExport::exportOutline() if( xNumRule.is() ) { - // --> OD 2008-06-17 #i90780# - // Outline style has property style:name since ODF 1.2 - // Thus, export this property and adjust fix for issue #i69627# + /* Outline style has property style:name since ODF 1.2 + Thus, export this property and adjust fix for issue #i69627# (#i90780#) + */ OUString sOutlineStyleName; { Reference<XPropertySet> xNumRulePropSet( @@ -978,3 +903,5 @@ sal_Bool SvxXMLNumRuleExport::GetOutlineStyles( XMLStringVector& rStyleNames, return nLevels != 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 9b22f1a39e29..6124414ffe5b 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,9 +44,6 @@ #include <com/sun/star/lang/Locale.hpp> #include <rtl/ustrbuf.hxx> -// #110680# -//#include <comphelper/processfactory.hxx> - #include <com/sun/star/i18n/NativeNumberXmlAttributes.hpp> #include <xmloff/xmlnumfe.hxx> @@ -73,8 +71,6 @@ using namespace ::svt; //------------------------------------------------------------------------- -// 4th condition for text formats doesn't work -//#define XMLNUM_MAX_PARTS 4 #define XMLNUM_MAX_PARTS 3 //------------------------------------------------------------------------- @@ -160,25 +156,25 @@ void SvXMLNumUsedList_Impl::SetUsed( sal_uInt32 nKey ) sal_Bool SvXMLNumUsedList_Impl::IsUsed( sal_uInt32 nKey ) const { - SvXMLuInt32Set::iterator aItr = aUsed.find(nKey); + SvXMLuInt32Set::const_iterator aItr = aUsed.find(nKey); return (aItr != aUsed.end()); } sal_Bool SvXMLNumUsedList_Impl::IsWasUsed( sal_uInt32 nKey ) const { - SvXMLuInt32Set::iterator aItr = aWasUsed.find(nKey); + SvXMLuInt32Set::const_iterator aItr = aWasUsed.find(nKey); return (aItr != aWasUsed.end()); } void SvXMLNumUsedList_Impl::Export() { - SvXMLuInt32Set::iterator aItr = aUsed.begin(); + SvXMLuInt32Set::const_iterator aItr = aUsed.begin(); while (aItr != aUsed.end()) { - std::pair<SvXMLuInt32Set::iterator, bool> aPair = aWasUsed.insert( *aItr ); + std::pair<SvXMLuInt32Set::const_iterator, bool> aPair = aWasUsed.insert( *aItr ); if (aPair.second) nWasUsedCount++; - aItr++; + ++aItr; } aUsed.clear(); nUsedCount = 0; @@ -202,7 +198,7 @@ sal_Bool SvXMLNumUsedList_Impl::GetNextUsed(sal_uInt32& nKey) sal_Bool bRet(sal_False); if (aCurrentUsedPos != aUsed.end()) { - aCurrentUsedPos++; + ++aCurrentUsedPos; if (aCurrentUsedPos != aUsed.end()) { nKey = *aCurrentUsedPos; @@ -218,12 +214,12 @@ void SvXMLNumUsedList_Impl::GetWasUsed(uno::Sequence<sal_Int32>& rWasUsed) sal_Int32* pWasUsed = rWasUsed.getArray(); if (pWasUsed) { - SvXMLuInt32Set::iterator aItr = aWasUsed.begin(); + SvXMLuInt32Set::const_iterator aItr = aWasUsed.begin(); while (aItr != aWasUsed.end()) { *pWasUsed = *aItr; - aItr++; - pWasUsed++; + ++aItr; + ++pWasUsed; } } } @@ -235,7 +231,7 @@ void SvXMLNumUsedList_Impl::SetWasUsed(const uno::Sequence<sal_Int32>& rWasUsed) const sal_Int32* pWasUsed = rWasUsed.getConstArray(); for (sal_uInt16 i = 0; i < nCount; i++, pWasUsed++) { - std::pair<SvXMLuInt32Set::iterator, bool> aPair = aWasUsed.insert( *pWasUsed ); + std::pair<SvXMLuInt32Set::const_iterator, bool> aPair = aWasUsed.insert( *pWasUsed ); if (aPair.second) nWasUsedCount++; } @@ -247,7 +243,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( SvXMLExport& rExp, const uno::Reference< util::XNumberFormatsSupplier >& rSupp ) : rExport( rExp ), - sPrefix( OUString::createFromAscii( "N" ) ), + sPrefix( OUString(RTL_CONSTASCII_USTRINGPARAM("N")) ), pFormatter( NULL ), pCharClass( NULL ), pLocaleData( NULL ) @@ -269,9 +265,6 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( { lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) ); - // #110680# - // pCharClass = new CharClass( ::comphelper::getProcessServiceFactory(), aLocale ); - // pLocaleData = new LocaleDataWrapper( ::comphelper::getProcessServiceFactory(), aLocale ); pCharClass = new CharClass( rExport.getServiceFactory(), aLocale ); pLocaleData = new LocaleDataWrapper( rExport.getServiceFactory(), aLocale ); } @@ -307,9 +300,6 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( { lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) ); - // #110680# - // pCharClass = new CharClass( ::comphelper::getProcessServiceFactory(), aLocale ); - // pLocaleData = new LocaleDataWrapper( ::comphelper::getProcessServiceFactory(), aLocale ); pCharClass = new CharClass( rExport.getServiceFactory(), aLocale ); pLocaleData = new LocaleDataWrapper( rExport.getServiceFactory(), aLocale ); } @@ -753,7 +743,7 @@ void SvXMLNumFmtExport::WriteMapElement_Impl( sal_Int32 nOp, double fLimit, case NUMBERFORMAT_OP_GT: aCondStr.append( (sal_Unicode) '>' ); break; case NUMBERFORMAT_OP_GE: aCondStr.appendAscii( ">=" ); break; default: - DBG_ERROR("unknown operator"); + OSL_FAIL("unknown operator"); } ::rtl::math::doubleToUStringBuffer( aCondStr, fLimit, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, @@ -814,9 +804,6 @@ sal_Bool SvXMLNumFmtExport::WriteTextWithCurrency_Impl( const OUString& rString, sal_Bool bRet = sal_False; -// pLocaleData->setLocale( rLocale ); -// String sCurString = pLocaleData->getCurrSymbol(); - LanguageType nLang = MsLangId::convertLocaleToLanguage( rLocale ); pFormatter->ChangeIntl( nLang ); String sCurString, sDummy; @@ -1745,7 +1732,7 @@ OUString SvXMLNumFmtExport::GetStyleName( sal_uInt32 nKey ) return lcl_CreateStyleName( nKey, 0, sal_True, sPrefix ); else { - DBG_ERROR("There is no written Data-Style"); + OSL_FAIL("There is no written Data-Style"); return rtl::OUString(); } } @@ -1759,7 +1746,7 @@ void SvXMLNumFmtExport::SetUsed( sal_uInt32 nKey ) if (pFormatter->GetEntry(nKey)) pUsedList->SetUsed( nKey ); else { - DBG_ERROR("no existing Numberformat found with this key"); + OSL_FAIL("no existing Numberformat found with this key"); } } @@ -1818,3 +1805,5 @@ sal_uInt32 SvXMLNumFmtExport::ForceSystemLanguage( sal_uInt32 nKey ) return nRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 492210236be6..a09c88233066 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,9 +41,6 @@ #include <tools/debug.hxx> #include <rtl/ustrbuf.hxx> -// #110680# -//#include <comphelper/processfactory.hxx> - #include <xmloff/xmlnumfi.hxx> #include <xmloff/xmltkmap.hxx> #include "xmloff/xmlnmspe.hxx" @@ -102,12 +100,9 @@ class SvXMLNumImpData LocaleDataWrapper* pLocaleData; SvXMLNumFmtEntryArr aNameEntries; - // #110680# ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory; public: - // #110680# - // SvXMLNumImpData( SvNumberFormatter* pFmt ); SvXMLNumImpData( SvNumberFormatter* pFmt, const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory ); @@ -333,14 +328,14 @@ static ColorData aNumFmtStdColors[XML_NUMF_COLORCOUNT] = // maps for SvXMLUnitConverter::convertEnum -static __FAR_DATA SvXMLEnumMapEntry aStyleValueMap[] = +static SvXMLEnumMapEntry aStyleValueMap[] = { { XML_SHORT, sal_False }, { XML_LONG, sal_True }, { XML_TOKEN_INVALID, 0 } }; -static __FAR_DATA SvXMLEnumMapEntry aFormatSourceMap[] = +static SvXMLEnumMapEntry aFormatSourceMap[] = { { XML_FIXED, sal_False }, { XML_LANGUAGE, sal_True }, @@ -362,7 +357,7 @@ struct SvXMLDefaultDateFormat sal_Bool bSystem; }; -static __FAR_DATA SvXMLDefaultDateFormat aDefaultDateFormats[] = +static SvXMLDefaultDateFormat aDefaultDateFormats[] = { // format day-of-week day month year hours minutes seconds format-source @@ -393,8 +388,6 @@ SV_IMPL_OP_PTRARR_SORT( SvXMLEmbeddedElementArr, SvXMLEmbeddedElementPtr ); // SvXMLNumImpData // -// #110680# -// SvXMLNumImpData::SvXMLNumImpData( SvNumberFormatter* pFmt ) : SvXMLNumImpData::SvXMLNumImpData( SvNumberFormatter* pFmt, const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory ) @@ -405,7 +398,6 @@ SvXMLNumImpData::SvXMLNumImpData( pStyleElemAttrTokenMap(NULL), pLocaleData(NULL), - // #110680# mxServiceFactory(xServiceFactory) { DBG_ASSERT( mxServiceFactory.is(), "got no service manager" ); @@ -503,7 +495,7 @@ const SvXMLTokenMap& SvXMLNumImpData::GetStylesElemTokenMap() { if( !pStylesElemTokenMap ) { - static __FAR_DATA SvXMLTokenMapEntry aStylesElemMap[] = + static SvXMLTokenMapEntry aStylesElemMap[] = { // style elements { XML_NAMESPACE_NUMBER, XML_NUMBER_STYLE, XML_TOK_STYLES_NUMBER_STYLE }, @@ -525,7 +517,7 @@ const SvXMLTokenMap& SvXMLNumImpData::GetStyleElemTokenMap() { if( !pStyleElemTokenMap ) { - static __FAR_DATA SvXMLTokenMapEntry aStyleElemMap[] = + static SvXMLTokenMapEntry aStyleElemMap[] = { // elements in a style { XML_NAMESPACE_NUMBER, XML_TEXT, XML_TOK_STYLE_TEXT }, @@ -560,7 +552,7 @@ const SvXMLTokenMap& SvXMLNumImpData::GetStyleAttrTokenMap() { if( !pStyleAttrTokenMap ) { - static __FAR_DATA SvXMLTokenMapEntry aStyleAttrMap[] = + static SvXMLTokenMapEntry aStyleAttrMap[] = { // attributes for a style { XML_NAMESPACE_STYLE, XML_NAME, XML_TOK_STYLE_ATTR_NAME }, @@ -587,7 +579,7 @@ const SvXMLTokenMap& SvXMLNumImpData::GetStyleElemAttrTokenMap() { if( !pStyleElemAttrTokenMap ) { - static __FAR_DATA SvXMLTokenMapEntry aStyleElemAttrMap[] = + static SvXMLTokenMapEntry aStyleElemAttrMap[] = { // attributes for an element within a style { XML_NAMESPACE_NUMBER, XML_DECIMAL_PLACES, XML_TOK_ELEM_ATTR_DECIMAL_PLACES }, @@ -614,11 +606,6 @@ const SvXMLTokenMap& SvXMLNumImpData::GetStyleElemAttrTokenMap() const LocaleDataWrapper& SvXMLNumImpData::GetLocaleData( LanguageType nLang ) { if ( !pLocaleData ) - // #110680# - //pLocaleData = new LocaleDataWrapper( - // (pFormatter ? pFormatter->GetServiceManager() : - // ::comphelper::getProcessServiceFactory()), - // MsLangId::convertLanguageToLocale( nLang ) ); pLocaleData = new LocaleDataWrapper( (pFormatter ? pFormatter->GetServiceManager() : mxServiceFactory), @@ -846,7 +833,7 @@ void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNumFormat else if ( rParent.GetType() == XML_TOK_STYLES_PERCENTAGE_STYLE && nLength > 1 ) { // the percent character in percentage styles must be left out of quoting - // (one occurence is enough even if there are several percent characters in the string) + // (one occurrence is enough even if there are several percent characters in the string) rtl::OUString aString( rContent.getStr() ); sal_Int32 nPos = aString.indexOf( (sal_Unicode) '%' ); @@ -892,7 +879,7 @@ void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNumFormat { // A quote is turned into "\"" - a quote to end quoted text, an escaped quote, // and a quote to resume quoting. - rtl::OUString aInsert( rtl::OUString::createFromAscii( "\"\\\"" ) ); + rtl::OUString aInsert( RTL_CONSTASCII_USTRINGPARAM( "\"\\\"" ) ); sal_Int32 nPos = 0; while ( nPos < rContent.getLength() ) @@ -950,7 +937,7 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport, { OUString sLanguage, sCountry; sal_Int32 nAttrVal; - sal_Bool bAttrBool; + bool bAttrBool; sal_uInt16 nAttrEnum; double fAttrDouble; @@ -1092,7 +1079,6 @@ void SvXMLNumFmtElementContext::EndElement() if ( rParent.ReplaceNfKeyword( NF_KEY_NNN, NF_KEY_NNNN ) ) { - //!aContent.setLength(0); //! doesn't work, #76293# aContent = OUStringBuffer(); } @@ -1122,25 +1108,16 @@ void SvXMLNumFmtElementContext::EndElement() case XML_TOK_STYLE_DAY: rParent.UpdateCalendar( sCalendar ); -#if 0 //! I18N doesn't provide SYSTEM or extended date information yet - if ( rParent.IsFromSystem() ) - bEffLong = SvXMLNumFmtDefaults::IsSystemLongDay( rParent.GetInternational(), bLong ); -#endif + rParent.AddNfKeyword( sal::static_int_cast< sal_uInt16 >( bEffLong ? NF_KEY_DD : NF_KEY_D ) ); break; case XML_TOK_STYLE_MONTH: rParent.UpdateCalendar( sCalendar ); -#if 0 //! I18N doesn't provide SYSTEM or extended date information yet - if ( rParent.IsFromSystem() ) - { - bEffLong = SvXMLNumFmtDefaults::IsSystemLongMonth( rParent.GetInternational(), bLong ); - bTextual = SvXMLNumFmtDefaults::IsSystemTextualMonth( rParent.GetInternational(), bLong ); - } -#endif + rParent.AddNfKeyword( sal::static_int_cast< sal_uInt16 >( bTextual @@ -1149,11 +1126,7 @@ void SvXMLNumFmtElementContext::EndElement() break; case XML_TOK_STYLE_YEAR: rParent.UpdateCalendar( sCalendar ); -#if 0 //! I18N doesn't provide SYSTEM or extended date information yet - if ( rParent.IsFromSystem() ) - bEffLong = SvXMLNumFmtDefaults::IsSystemLongYear( rParent.GetInternational(), bLong ); -#endif // Y after G (era) is replaced by E if ( rParent.HasEra() ) rParent.AddNfKeyword( @@ -1166,11 +1139,7 @@ void SvXMLNumFmtElementContext::EndElement() break; case XML_TOK_STYLE_ERA: rParent.UpdateCalendar( sCalendar ); -#if 0 //! I18N doesn't provide SYSTEM or extended date information yet - if ( rParent.IsFromSystem() ) - bEffLong = SvXMLNumFmtDefaults::IsSystemLongEra( rParent.GetInternational(), bLong ); -#endif rParent.AddNfKeyword( sal::static_int_cast< sal_uInt16 >( bEffLong ? NF_KEY_GGG : NF_KEY_G ) ); @@ -1178,11 +1147,7 @@ void SvXMLNumFmtElementContext::EndElement() break; case XML_TOK_STYLE_DAY_OF_WEEK: rParent.UpdateCalendar( sCalendar ); -#if 0 //! I18N doesn't provide SYSTEM or extended date information yet - if ( rParent.IsFromSystem() ) - bEffLong = SvXMLNumFmtDefaults::IsSystemLongDayOfWeek( rParent.GetInternational(), bLong ); -#endif rParent.AddNfKeyword( sal::static_int_cast< sal_uInt16 >( bEffLong ? NF_KEY_NNNN : NF_KEY_NN ) ); @@ -1253,87 +1218,19 @@ void SvXMLNumFmtElementContext::EndElement() { rParent.AddNumber( aNumInfo ); // simple number - rParent.AddToCode( OUString::createFromAscii( "E+" ) ); + rParent.AddToCode( OUString(RTL_CONSTASCII_USTRINGPARAM("E+")) ); for (sal_Int32 i=0; i<aNumInfo.nExpDigits; i++) rParent.AddToCode( OUString::valueOf((sal_Unicode)'0') ); } break; default: - DBG_ERROR("invalid element ID"); + OSL_FAIL("invalid element ID"); } } //------------------------------------------------------------------------- -sal_Bool SvXMLNumFmtDefaults::IsSystemLongDay( const SvtSysLocale&, sal_Bool bLong ) -{ - // TODO: merge system information and defaults into i18n locale data -#if 0 - return bLong ? rIntn.IsLongDateDayLeadingZero() : rIntn.IsDateDayLeadingZero(); -#else - return !bLong; -#endif -} - -sal_Bool SvXMLNumFmtDefaults::IsSystemLongMonth( const SvtSysLocale&, sal_Bool bLong ) -{ - // TODO: merge system information and defaults into i18n locale data -#if 0 - if (bLong) - { - MonthFormat eMonth = rIntn.GetLongDateMonthFormat(); - return ( eMonth == MONTH_ZERO || eMonth == MONTH_LONG ); - } - else - return rIntn.IsDateMonthLeadingZero(); -#else - return !bLong; -#endif -} - -sal_Bool SvXMLNumFmtDefaults::IsSystemTextualMonth( const SvtSysLocale&, sal_Bool bLong ) -{ - // TODO: merge system information and defaults into i18n locale data -#if 0 - if (bLong) - { - MonthFormat eMonth = rIntn.GetLongDateMonthFormat(); - return ( eMonth == MONTH_SHORT || eMonth == MONTH_LONG ); - } - else - return sal_False; -#else - return bLong; -#endif -} - -sal_Bool SvXMLNumFmtDefaults::IsSystemLongYear( const SvtSysLocale&, sal_Bool bLong ) -{ - // TODO: merge system information and defaults into i18n locale data -#if 0 - return bLong ? rIntn.IsLongDateCentury() : rIntn.IsDateCentury(); -#else - return bLong; -#endif -} - -sal_Bool SvXMLNumFmtDefaults::IsSystemLongEra( const SvtSysLocale& rSysLoc, sal_Bool bLong ) -{ - // TODO: merge system information and defaults into i18n locale data - return IsSystemLongYear( rSysLoc, bLong ); // no separate setting -} - -sal_Bool SvXMLNumFmtDefaults::IsSystemLongDayOfWeek( const SvtSysLocale&, sal_Bool bLong ) -{ - // TODO: merge system information and defaults into i18n locale data -#if 0 - return ( bLong && rIntn.GetLongDateDayOfWeekFormat() == DAYOFWEEK_LONG ); -#else - return bLong && true; -#endif -} - sal_uInt16 SvXMLNumFmtDefaults::GetDefaultDateFormat( SvXMLDateElementAttributes eDOW, SvXMLDateElementAttributes eDay, SvXMLDateElementAttributes eMonth, SvXMLDateElementAttributes eYear, SvXMLDateElementAttributes eHours, @@ -1399,7 +1296,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, { OUString sLanguage, sCountry; ::com::sun::star::i18n::NativeNumberXmlAttributes aNatNumAttr; - sal_Bool bAttrBool; + bool bAttrBool; sal_uInt16 nAttrEnum; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -1415,7 +1312,6 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, switch (nToken) { case XML_TOK_STYLE_ATTR_NAME: -// aName = sValue; break; case XML_TOK_STYLE_ATTR_LANGUAGE: sLanguage = sValue; @@ -1646,7 +1542,7 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter) { if (!pFormatter) { - DBG_ERROR("no number formatter"); + OSL_FAIL("no number formatter"); return -1; } @@ -1739,58 +1635,7 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter) } } -#if 0 //! I18N doesn't provide SYSTEM or extended date information yet - if ( nIndex != NUMBERFORMAT_ENTRY_NOT_FOUND && !bFromSystem ) - { - // instead of automatic date format, use fixed formats if bFromSystem is not set - //! prevent use of automatic formats in other cases, force user-defined format? - - sal_uInt32 nNewIndex = nIndex; - - NfIndexTableOffset eOffset = pFormatter->GetIndexTableOffset( nIndex ); - if ( eOffset == NF_DATE_SYSTEM_SHORT ) - { - const International& rInt = pData->GetInternational( nFormatLang ); - if ( rInt.IsDateDayLeadingZero() && rInt.IsDateMonthLeadingZero() ) - { - if ( rInt.IsDateCentury() ) - nNewIndex = pFormatter->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, nFormatLang ); - else - nNewIndex = pFormatter->GetFormatIndex( NF_DATE_SYS_DDMMYY, nFormatLang ); - } - } - else if ( eOffset == NF_DATE_SYSTEM_LONG ) - { - const International& rInt = pData->GetInternational( nFormatLang ); - if ( !rInt.IsLongDateDayLeadingZero() ) - { - sal_Bool bCentury = rInt.IsLongDateCentury(); - MonthFormat eMonth = rInt.GetLongDateMonthFormat(); - if ( eMonth == MONTH_LONG && bCentury ) - { - if ( rInt.GetLongDateDayOfWeekFormat() == DAYOFWEEK_LONG ) - nNewIndex = pFormatter->GetFormatIndex( NF_DATE_SYS_NNNNDMMMMYYYY, nFormatLang ); - else - nNewIndex = pFormatter->GetFormatIndex( NF_DATE_SYS_NNDMMMMYYYY, nFormatLang ); - } - else if ( eMonth == MONTH_SHORT && !bCentury ) - nNewIndex = pFormatter->GetFormatIndex( NF_DATE_SYS_NNDMMMYY, nFormatLang ); - } - } - - if ( nNewIndex != nIndex ) - { - // verify the fixed format really matches the format string - // (not the case with some formats from locale data) - - const SvNumberformat* pFixedFormat = pFormatter->GetEntry( nNewIndex ); - if ( pFixedFormat && pFixedFormat->GetFormatstring() == String(sFormat) ) - nIndex = nNewIndex; - } - } -#endif - if ( nIndex != NUMBERFORMAT_ENTRY_NOT_FOUND && !bAutoOrder ) { // use fixed-order formats instead of SYS... if bAutoOrder is false @@ -1827,7 +1672,7 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter) if ( nIndex == NUMBERFORMAT_ENTRY_NOT_FOUND ) { - DBG_ERROR("invalid number format"); + OSL_FAIL("invalid number format"); nIndex = pFormatter->GetStandardIndex( nFormatLang ); } @@ -1842,24 +1687,12 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter) if (!bRemoveAfterUse) GetImport().AddNumberStyle( nKey, GetName() ); -#if 0 - ByteString aByte( String(sFormatName), gsl_getSystemTextEncoding() ); - aByte.Append( " | " ); - aByte.Append(ByteString( String(sFormat), gsl_getSystemTextEncoding() )); - aByte.Append( " | " ); - aByte.Append(ByteString::CreateFromInt32( nIndex )); - -// DBG_ERROR(aByte.GetBuffer()); - int xxx=42; -#endif - return nKey; } void SvXMLNumFormatContext::Finish( sal_Bool bOverwrite ) { SvXMLStyleContext::Finish( bOverwrite ); -// AddCondition(); } const LocaleDataWrapper& SvXMLNumFormatContext::GetLocaleData() const @@ -2015,10 +1848,6 @@ void SvXMLNumFormatContext::AddCurrency( const rtl::OUString& rContent, Language OUString aSymbol = rContent; if ( aSymbol.getLength() == 0 ) { - // get currency symbol for language - - //aSymbol = pData->GetLocaleData( nFormatLang ).getCurrSymbol(); - SvNumberFormatter* pFormatter = pData->GetNumberFormatter(); if ( pFormatter ) { @@ -2186,7 +2015,7 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex ) rtl::OUString rCondition = aMyConditions[nIndex].sCondition; SvNumberFormatter* pFormatter = pData->GetNumberFormatter(); sal_uInt32 l_nKey = pData->GetKeyForName( rApplyName ); - OUString sValue = OUString::createFromAscii( "value()" ); //! define constant + OUString sValue(RTL_CONSTASCII_USTRINGPARAM("value()")); //! define constant sal_Int32 nValLen = sValue.getLength(); if ( pFormatter && l_nKey != NUMBERFORMAT_ENTRY_NOT_FOUND && @@ -2236,7 +2065,7 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex ) void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex, const rtl::OUString& rFormat, const LocaleDataWrapper& rData ) { rtl::OUString rCondition = aMyConditions[nIndex].sCondition; - OUString sValue = OUString::createFromAscii( "value()" ); //! define constant + OUString sValue(RTL_CONSTASCII_USTRINGPARAM("value()")); //! define constant sal_Int32 nValLen = sValue.getLength(); if ( rCondition.copy( 0, nValLen ) == sValue ) @@ -2335,9 +2164,6 @@ sal_Bool SvXMLNumFormatContext::IsSystemLanguage() // SvXMLNumFmtHelper // -// #110680# -//SvXMLNumFmtHelper::SvXMLNumFmtHelper( -// const uno::Reference<util::XNumberFormatsSupplier>& rSupp ) SvXMLNumFmtHelper::SvXMLNumFmtHelper( const uno::Reference<util::XNumberFormatsSupplier>& rSupp, const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory ) @@ -2351,13 +2177,9 @@ SvXMLNumFmtHelper::SvXMLNumFmtHelper( if (pObj) pFormatter = pObj->GetNumberFormatter(); - // #110680# - // pData = new SvXMLNumImpData( pFormatter ); pData = new SvXMLNumImpData( pFormatter, mxServiceFactory ); } -// #110680# -// SvXMLNumFmtHelper::SvXMLNumFmtHelper( SvNumberFormatter* pNumberFormatter ) SvXMLNumFmtHelper::SvXMLNumFmtHelper( SvNumberFormatter* pNumberFormatter, const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory ) @@ -2365,8 +2187,6 @@ SvXMLNumFmtHelper::SvXMLNumFmtHelper( { DBG_ASSERT( mxServiceFactory.is(), "got no service manager" ); - // #110680# - // pData = new SvXMLNumImpData( pNumberFormatter ); pData = new SvXMLNumImpData( pNumberFormatter, mxServiceFactory ); } @@ -2410,9 +2230,4 @@ const SvXMLTokenMap& SvXMLNumFmtHelper::GetStylesElemTokenMap() return pData->GetStylesElemTokenMap(); } -/*sal_uInt32 SvXMLNumFmtHelper::GetKeyForName( const rtl::OUString& rName ) -{ - return pData->GetKeyForName( rName ); -}*/ - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index 1417f239082a..1d6d5a518249 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,10 +35,8 @@ #include <com/sun/star/awt/FontDescriptor.hpp> #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> -// --> OD 2008-01-16 #newlistlevelattrs# #include <com/sun/star/text/PositionAndSpaceMode.hpp> #include <com/sun/star/text/LabelFollow.hpp> -// <-- #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/style/XStyle.hpp> @@ -83,36 +82,37 @@ using namespace ::com::sun::star::frame; using namespace ::xmloff::token; using namespace ::com::sun::star::io; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE[] = +using rtl::OUString; +using rtl::OUStringBuffer; + +static sal_Char const XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE[] = "SymbolTextDistance"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_PARENT_NUMBERING[] = +static sal_Char const XML_UNO_NAME_NRULE_PARENT_NUMBERING[] = "ParentNumbering"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_CHAR_STYLE_NAME[] = +static sal_Char const XML_UNO_NAME_NRULE_CHAR_STYLE_NAME[] = "CharStyleName"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_CHAR[] ="BulletChar"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_RELSIZE[] = "BulletRelSize"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_GRAPHIC_SIZE[] = +static sal_Char const XML_UNO_NAME_NRULE_BULLET_CHAR[] ="BulletChar"; +static sal_Char const XML_UNO_NAME_NRULE_BULLET_RELSIZE[] = "BulletRelSize"; +static sal_Char const XML_UNO_NAME_NRULE_GRAPHIC_SIZE[] = "GraphicSize"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_VERT_ORIENT[] ="VertOrient"; - -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_NUMBERINGTYPE[] = "NumberingType"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_PREFIX[] = "Prefix"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_SUFFIX[] = "Suffix"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_ADJUST[] = "Adjust"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_LEFT_MARGIN[] = "LeftMargin"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET[] = +static sal_Char const XML_UNO_NAME_NRULE_VERT_ORIENT[] ="VertOrient"; + +static sal_Char const XML_UNO_NAME_NRULE_NUMBERINGTYPE[] = "NumberingType"; +static sal_Char const XML_UNO_NAME_NRULE_PREFIX[] = "Prefix"; +static sal_Char const XML_UNO_NAME_NRULE_SUFFIX[] = "Suffix"; +static sal_Char const XML_UNO_NAME_NRULE_ADJUST[] = "Adjust"; +static sal_Char const XML_UNO_NAME_NRULE_LEFT_MARGIN[] = "LeftMargin"; +static sal_Char const XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET[] = "FirstLineOffset"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_FONT[] = "BulletFont"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_GRAPHICURL[] = "GraphicURL"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_START_WITH[] = "StartWith"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_COLOR[] = "BulletColor"; -// --> OD 2008-01-15 #newlistlevelattrs# -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_POSITION_AND_SPACE_MODE[] = "PositionAndSpaceMode"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_LABEL_FOLLOWED_BY[] = "LabelFollowedBy"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_LISTTAB_STOP_POSITION[] = "ListtabStopPosition"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_FIRST_LINE_INDENT[] = "FirstLineIndent"; -static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_INDENT_AT[] = "IndentAt"; -// <-- +static sal_Char const XML_UNO_NAME_NRULE_BULLET_FONT[] = "BulletFont"; +static sal_Char const XML_UNO_NAME_NRULE_GRAPHICURL[] = "GraphicURL"; +static sal_Char const XML_UNO_NAME_NRULE_START_WITH[] = "StartWith"; +static sal_Char const XML_UNO_NAME_NRULE_BULLET_COLOR[] = "BulletColor"; +static sal_Char const XML_UNO_NAME_NRULE_POSITION_AND_SPACE_MODE[] = "PositionAndSpaceMode"; +static sal_Char const XML_UNO_NAME_NRULE_LABEL_FOLLOWED_BY[] = "LabelFollowedBy"; +static sal_Char const XML_UNO_NAME_NRULE_LISTTAB_STOP_POSITION[] = "ListtabStopPosition"; +static sal_Char const XML_UNO_NAME_NRULE_FIRST_LINE_INDENT[] = "FirstLineIndent"; +static sal_Char const XML_UNO_NAME_NRULE_INDENT_AT[] = "IndentAt"; // --------------------------------------------------------------------- @@ -131,16 +131,13 @@ public: SvxXMLListLevelStyleContext_Impl& rLLevel ); virtual ~SvxXMLListLevelStyleAttrContext_Impl(); - // --> OD 2008-01-16 #newlistlevelattrs# virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ); - // <-- }; // --------------------------------------------------------------------- -// --> OD 2008-01-16 #newlistlevelattrs# class SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl : public SvXMLImportContext { SvxXMLListLevelStyleContext_Impl& rListLevel; @@ -154,7 +151,6 @@ public: SvxXMLListLevelStyleContext_Impl& rLLevel ); virtual ~SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl(); }; -// <-- // --------------------------------------------------------------------- @@ -179,7 +175,7 @@ enum SvxXMLTextListLevelStyleAttrTokens const SvXMLTokenMapEntry* lcl_getLevelAttrTokenMap() { - static __FAR_DATA SvXMLTokenMapEntry aLevelAttrTokenMap[] = + static SvXMLTokenMapEntry aLevelAttrTokenMap[] = { { XML_NAMESPACE_TEXT, XML_LEVEL, XML_TOK_TEXT_LEVEL_ATTR_LEVEL }, { XML_NAMESPACE_TEXT, XML_STYLE_NAME, XML_TOK_TEXT_LEVEL_ATTR_STYLE_NAME }, @@ -238,13 +234,11 @@ class SvxXMLListLevelStyleContext_Impl : public SvXMLImportContext sal_Int16 nRelSize; Color aColor; - // --> OD 2008-01-16 #newlistlevelattrs# sal_Int16 ePosAndSpaceMode; sal_Int16 eLabelFollowedBy; sal_Int32 nListtabStopPosition; sal_Int32 nFirstLineIndent; sal_Int32 nIndentAt; - // <-- sal_Bool bBullet : 1; sal_Bool bImage : 1; @@ -287,7 +281,6 @@ public: Sequence<beans::PropertyValue> GetProperties( const SvI18NMap *pI18NMap=0 ); - // --> OD 2008-01-16 #newlistlevelattrs# inline void SetPosAndSpaceMode( sal_Int16 eValue ) { ePosAndSpaceMode = eValue; @@ -308,7 +301,6 @@ public: { nIndentAt = nValue; } - // <-- }; SvxXMLListLevelStyleContext_Impl::SvxXMLListLevelStyleContext_Impl( @@ -319,7 +311,7 @@ SvxXMLListLevelStyleContext_Impl::SvxXMLListLevelStyleContext_Impl( : SvXMLImportContext( rImport, nPrfx, rLName ) , sStarBats( RTL_CONSTASCII_USTRINGPARAM( "StarBats" ) ) , sStarMath( RTL_CONSTASCII_USTRINGPARAM( "StarMath" ) ) -, sNumFormat( OUString::createFromAscii( "1" ) ) +, sNumFormat( OUString(RTL_CONSTASCII_USTRINGPARAM("1")) ) , nLevel( -1L ) , nSpaceBefore( 0L ) , nMinLabelWidth( 0L ) @@ -336,13 +328,11 @@ SvxXMLListLevelStyleContext_Impl::SvxXMLListLevelStyleContext_Impl( , cBullet( 0 ) , nRelSize(0) , aColor( 0 ) -// --> OD 2008-01-16 #newlistelevelattrs# , ePosAndSpaceMode( PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION ) , eLabelFollowedBy( LabelFollow::LISTTAB ) , nListtabStopPosition( 0 ) , nFirstLineIndent( 0 ) , nIndentAt( 0 ) -// <-- , bBullet( sal_False ) , bImage( sal_False ) , bNum( sal_False ) @@ -523,50 +513,48 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties( beans::PropertyValue *pProps = aPropSeq.getArray(); sal_Int32 nPos = 0; pProps[nPos].Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_NUMBERINGTYPE ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_NUMBERINGTYPE )); pProps[nPos++].Value <<= (sal_Int16)eType ; - pProps[nPos].Name = OUString::createFromAscii( XML_UNO_NAME_NRULE_PREFIX ); + pProps[nPos].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_PREFIX )); pProps[nPos++].Value <<= sPrefix; - pProps[nPos].Name = OUString::createFromAscii( XML_UNO_NAME_NRULE_SUFFIX ); + pProps[nPos].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_SUFFIX )); pProps[nPos++].Value <<= sSuffix; - pProps[nPos].Name = OUString::createFromAscii( XML_UNO_NAME_NRULE_ADJUST ); + pProps[nPos].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_ADJUST )); pProps[nPos++].Value <<= eAdjust; sal_Int32 nLeftMargin = nSpaceBefore + nMinLabelWidth; pProps[nPos].Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_LEFT_MARGIN ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_LEFT_MARGIN )); pProps[nPos++].Value <<= (sal_Int32)nLeftMargin; sal_Int32 nFirstLineOffset = -nMinLabelWidth; pProps[nPos].Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET )); pProps[nPos++].Value <<= (sal_Int32)nFirstLineOffset; pProps[nPos].Name = - OUString::createFromAscii(XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE); + OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE)); pProps[nPos++].Value <<= (sal_Int16)nMinLabelDist; - // --> OD 2008-01-16 #newlistlevelattrs# pProps[nPos].Name = - OUString::createFromAscii(XML_UNO_NAME_NRULE_POSITION_AND_SPACE_MODE); + OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_POSITION_AND_SPACE_MODE)); pProps[nPos++].Value <<= (sal_Int16)ePosAndSpaceMode; pProps[nPos].Name = - OUString::createFromAscii(XML_UNO_NAME_NRULE_LABEL_FOLLOWED_BY); + OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_LABEL_FOLLOWED_BY)); pProps[nPos++].Value <<= (sal_Int16)eLabelFollowedBy; pProps[nPos].Name = - OUString::createFromAscii(XML_UNO_NAME_NRULE_LISTTAB_STOP_POSITION); + OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_LISTTAB_STOP_POSITION)); pProps[nPos++].Value <<= (sal_Int32)nListtabStopPosition; pProps[nPos].Name = - OUString::createFromAscii(XML_UNO_NAME_NRULE_FIRST_LINE_INDENT); + OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_FIRST_LINE_INDENT)); pProps[nPos++].Value <<= (sal_Int32)nFirstLineIndent; pProps[nPos].Name = - OUString::createFromAscii(XML_UNO_NAME_NRULE_INDENT_AT); + OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_INDENT_AT)); pProps[nPos++].Value <<= (sal_Int32)nIndentAt; - // <-- OUString sDisplayTextStyleName = GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_TEXT, sTextStyleName ); @@ -574,7 +562,7 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties( if( sStyleName.getLength() && pI18NMap ) sStyleName = pI18NMap->Get( SFX_STYLE_FAMILY_CHAR, sStyleName ); pProps[nPos].Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_CHAR_STYLE_NAME ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_CHAR_STYLE_NAME )); pProps[nPos++].Value <<= sDisplayTextStyleName; if( bBullet ) @@ -588,7 +576,6 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties( aFDesc.Pitch = eBulletFontPitch; aFDesc.CharSet = eBulletFontEncoding; aFDesc.Weight = WEIGHT_DONTKNOW; - //aFDesc.Transparant = sal_True; sal_Bool bStarSymbol = sal_False; if( aFDesc.Name.equalsIgnoreAsciiCase( sStarBats ) ) { @@ -610,12 +597,12 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties( OUStringBuffer sTmp(1); sTmp.append( cBullet ); pProps[nPos].Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_BULLET_CHAR ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_CHAR )); pProps[nPos++].Value <<= sTmp.makeStringAndClear(); } pProps[nPos].Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_BULLET_FONT ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_FONT )); pProps[nPos++].Value <<= aFDesc; } @@ -631,47 +618,46 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties( else if( xBase64Stream.is() ) { sStr = GetImport().ResolveGraphicObjectURLFromBase64( xBase64Stream ); -// xBase64Stream = 0; } if( sStr.getLength() ) { pProps[nPos].Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_GRAPHICURL ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_GRAPHICURL )); pProps[nPos++].Value <<= sStr; } awt::Size aSize( nImageWidth, nImageHeight ); pProps[nPos].Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_GRAPHIC_SIZE ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_GRAPHIC_SIZE )); pProps[nPos++].Value <<= aSize; pProps[nPos].Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_VERT_ORIENT ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_VERT_ORIENT )); pProps[nPos++].Value <<= (sal_Int16)eImageVertOrient; } if( bNum ) { pProps[nPos].Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_START_WITH ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_START_WITH )); pProps[nPos++].Value <<= (sal_Int16)nNumStartValue; pProps[nPos].Name = - OUString::createFromAscii(XML_UNO_NAME_NRULE_PARENT_NUMBERING); + OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_PARENT_NUMBERING)); pProps[nPos++].Value <<= (sal_Int16)nNumDisplayLevels; } if( ( bNum || bBullet ) && nRelSize ) { pProps[nPos].Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_BULLET_RELSIZE ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_RELSIZE )); pProps[nPos++].Value <<= nRelSize; } if( !bImage && bHasColor ) { - pProps[nPos].Name = OUString::createFromAscii( XML_UNO_NAME_NRULE_BULLET_COLOR ); + pProps[nPos].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_COLOR )); pProps[nPos++].Value <<= (sal_Int32)aColor.GetColor(); } @@ -702,15 +688,12 @@ enum SvxXMLStyleAttributesAttrTokens XML_TOK_STYLE_ATTRIBUTES_ATTR_COLOR, XML_TOK_STYLE_ATTRIBUTES_ATTR_WINDOW_FONT_COLOR, XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_SIZE, - // --> OD 2008-01-16 #newlistlevelattrs# XML_TOK_STYLE_ATTRIBUTES_ATTR_POSITION_AND_SPACE_MODE, - // <-- - XML_TOK_STYLE_ATTRIBUTES_ATTR_END=XML_TOK_UNKNOWN }; const SvXMLTokenMapEntry* lcl_getStyleAttributesAttrTokenMap() { - static __FAR_DATA SvXMLTokenMapEntry aStyleAttributesAttrTokenMap[] = + static SvXMLTokenMapEntry aStyleAttributesAttrTokenMap[] = { { XML_NAMESPACE_TEXT, XML_SPACE_BEFORE, XML_TOK_STYLE_ATTRIBUTES_ATTR_SPACE_BEFORE }, @@ -746,11 +729,8 @@ const SvXMLTokenMapEntry* lcl_getStyleAttributesAttrTokenMap() XML_TOK_STYLE_ATTRIBUTES_ATTR_WINDOW_FONT_COLOR }, { XML_NAMESPACE_FO, XML_FONT_SIZE, XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_SIZE }, - // --> OD 2008-01-16 #newlistlevelattrs# { XML_NAMESPACE_TEXT, XML_LIST_LEVEL_POSITION_AND_SPACE_MODE, XML_TOK_STYLE_ATTRIBUTES_ATTR_POSITION_AND_SPACE_MODE }, - // <-- - XML_TOKEN_MAP_END }; return aStyleAttributesAttrTokenMap; @@ -855,7 +835,6 @@ SvxXMLListLevelStyleAttrContext_Impl::SvxXMLListLevelStyleAttrContext_Impl( if(SvXMLUnitConverter::convertPercent( nVal, rValue ) ) rListLevel.SetRelSize( (sal_Int16)nVal ); break; - // --> OD 2008-01-16 #newlistlevelattrs# case XML_TOK_STYLE_ATTRIBUTES_ATTR_POSITION_AND_SPACE_MODE: { sal_Int16 ePosAndSpaceMode = PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION; @@ -864,7 +843,6 @@ SvxXMLListLevelStyleAttrContext_Impl::SvxXMLListLevelStyleAttrContext_Impl( rListLevel.SetPosAndSpaceMode( ePosAndSpaceMode ); } break; - // <-- } } @@ -1002,7 +980,6 @@ SvxXMLListLevelStyleAttrContext_Impl::~SvxXMLListLevelStyleAttrContext_Impl() { } -// --> OD 2008-01-16 #newlistlevelattrs# SvXMLImportContext* SvxXMLListLevelStyleAttrContext_Impl::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) @@ -1024,11 +1001,9 @@ SvXMLImportContext* SvxXMLListLevelStyleAttrContext_Impl::CreateChildContext( return pContext; } -// <-- // --------------------------------------------------------------------- -// --> OD 2008-01-16 #newlistlevelattrs# enum SvxXMLStyleAttributesLabelAlignmentAttrTokens { XML_TOK_STYLE_ATTRIBUTES_ATTR_LABEL_FOLLOWED_BY, @@ -1040,7 +1015,7 @@ enum SvxXMLStyleAttributesLabelAlignmentAttrTokens }; const SvXMLTokenMapEntry* lcl_getStyleAlignmentAttributesAttrTokenMap() { - static __FAR_DATA SvXMLTokenMapEntry aStyleAlignmentAttributesAttrTokenMap[] = + static SvXMLTokenMapEntry aStyleAlignmentAttributesAttrTokenMap[] = { { XML_NAMESPACE_TEXT, XML_LABEL_FOLLOWED_BY, XML_TOK_STYLE_ATTRIBUTES_ATTR_LABEL_FOLLOWED_BY }, @@ -1108,7 +1083,6 @@ SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl::SvxXMLListLevelStyleLabelAli SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl::~SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl() { } -// <-- // --------------------------------------------------------------------- @@ -1240,7 +1214,7 @@ void SvxXMLListStyleContext::FillUnoNumRule( } catch( Exception& ) { - DBG_ERROR( "SvxXMLListStyleContext::FillUnoNumRule - Exception catched" ); + OSL_FAIL( "SvxXMLListStyleContext::FillUnoNumRule - Exception catched" ); } } @@ -1382,13 +1356,12 @@ void SvxXMLListStyleContext::SetDefaultStyle( beans::PropertyValue *pProps = aPropSeq.getArray(); pProps->Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_NUMBERINGTYPE ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_NUMBERINGTYPE )); (pProps++)->Value <<= (sal_Int16)(bOrdered ? NumberingType::ARABIC : NumberingType::CHAR_SPECIAL ); if( !bOrdered ) { // TODO: Bullet-Font - //aNumFmt.SetBulletFont( &SwNumRule::GetDefBulletFont() ); awt::FontDescriptor aFDesc; aFDesc.Name = OUString( #if defined UNX @@ -1401,18 +1374,17 @@ void SvxXMLListStyleContext::SetDefaultStyle( aFDesc.Pitch = PITCH_DONTKNOW ; aFDesc.CharSet = RTL_TEXTENCODING_SYMBOL ; aFDesc.Weight = WEIGHT_DONTKNOW; - //aFDesc.Transparant = sal_True; pProps->Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_BULLET_FONT ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_FONT )); (pProps++)->Value <<= aFDesc; OUStringBuffer sTmp(1); sTmp.append( (sal_Unicode)(0xF000 + 149) ); pProps->Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_BULLET_CHAR ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_CHAR )); (pProps++)->Value <<= sTmp.makeStringAndClear(); pProps->Name = - OUString::createFromAscii( XML_UNO_NAME_NRULE_CHAR_STYLE_NAME ); + OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_CHAR_STYLE_NAME )); (pProps++)->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "Numbering Symbols" ) ); } @@ -1422,3 +1394,4 @@ void SvxXMLListStyleContext::SetDefaultStyle( rNumRule->replaceByIndex( nLevel, aAny ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlprcon.cxx b/xmloff/source/style/xmlprcon.cxx index b87148958ddf..84c0cee372e3 100644 --- a/xmloff/source/style/xmlprcon.cxx +++ b/xmloff/source/style/xmlprcon.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,3 +103,4 @@ SvXMLImportContext *SvXMLPropertySetContext::CreateChildContext( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlprhdl.cxx b/xmloff/source/style/xmlprhdl.cxx index 666471a3d79d..b43377c8f70d 100644 --- a/xmloff/source/style/xmlprhdl.cxx +++ b/xmloff/source/style/xmlprhdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,3 +40,5 @@ bool XMLPropertyHandler::equals( const ::com::sun::star::uno::Any& r1, const ::c { return (r1 == r2); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx index eb4347f4d7d2..766f25bfa426 100644 --- a/xmloff/source/style/xmlprmap.cxx +++ b/xmloff/source/style/xmlprmap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -106,7 +107,7 @@ void XMLPropertySetMapper::AddMapperEntry( for( vector < UniReference < XMLPropertyHandlerFactory > >::iterator aFIter = rMapper->aHdlFactories.begin(); aFIter != rMapper->aHdlFactories.end(); - aFIter++ ) + ++aFIter ) { aHdlFactories.push_back( *aFIter ); } @@ -114,7 +115,7 @@ void XMLPropertySetMapper::AddMapperEntry( for( vector < XMLPropertySetMapperEntry_Impl >::iterator aEIter = rMapper->aMapEntries.begin(); aEIter != rMapper->aMapEntries.end(); - aEIter++ ) + ++aEIter ) { aMapEntries.push_back( *aEIter ); } @@ -247,6 +248,8 @@ void XMLPropertySetMapper::RemoveEntry( sal_Int32 nIndex ) return; vector < XMLPropertySetMapperEntry_Impl >::iterator aEIter = aMapEntries.begin(); for( sal_Int32 nN=0; nN<nIndex; nN++ ) - aEIter++; + ++aEIter; aMapEntries.erase( aEIter ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index cce7d30577f3..b3343c307193 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,30 +39,21 @@ #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/style/XAutoStylesSupplier.hpp> #include <com/sun/star/style/XAutoStyleFamily.hpp> -#ifndef _XMLOFF_PAGEMASTERPROPMAPPER_HXX #include "PageMasterPropMapper.hxx" -#endif #include <tools/debug.hxx> -#include <tools/list.hxx> #include <svl/cntnrsrt.hxx> #include <svl/itemset.hxx> #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> -#ifndef _XMLOFF_FAMILIES_HXX #include <xmloff/families.hxx> -#endif #include <xmloff/xmlimp.hxx> #include <xmloff/xmlnumi.hxx> #include <xmloff/xmlimppr.hxx> #include <xmloff/xmlstyle.hxx> -#ifndef _XMLOFF_TXTSTYLI_HXX #include <xmloff/txtstyli.hxx> -#endif -#ifndef _XMLOFF_TXTPRMAP_HXX #include <xmloff/txtprmap.hxx> -#endif #include <xmloff/xmlnumfi.hxx> #include "XMLChartStyleContext.hxx" #include "XMLChartPropertySetMapper.hxx" @@ -73,8 +65,11 @@ #include "PageMasterImportContext.hxx" #include "PageMasterImportPropMapper.hxx" +#include <vector> + using ::rtl::OUString; using ::rtl::OUStringBuffer; +using ::std::vector; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -84,7 +79,7 @@ using namespace ::xmloff::token; // --------------------------------------------------------------------- -static __FAR_DATA SvXMLTokenMapEntry aStyleStylesElemTokenMap[] = +static SvXMLTokenMapEntry aStyleStylesElemTokenMap[] = { { XML_NAMESPACE_STYLE, XML_STYLE, XML_TOK_STYLE_STYLE }, { XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT, XML_TOK_STYLE_PAGE_MASTER }, @@ -267,7 +262,7 @@ int SvXMLStyleIndexCmp_Impl( const SvXMLStyleIndex_Impl& r1, // --------------------------------------------------------------------- typedef SvXMLStyleContext *SvXMLStyleContextPtr; -DECLARE_LIST( SvXMLStyleContexts_Impl, SvXMLStyleContextPtr ) +typedef vector< SvXMLStyleContextPtr > SvXMLStyleContexts_Impl; DECLARE_CONTAINER_SORT_DEL( SvXMLStyleIndices_Impl, SvXMLStyleIndex_Impl ) IMPL_CONTAINER_SORT( SvXMLStyleIndices_Impl, SvXMLStyleIndex_Impl, @@ -290,16 +285,16 @@ public: SvXMLStylesContext_Impl( sal_Bool bAuto ); ~SvXMLStylesContext_Impl(); - sal_uInt32 GetStyleCount() const { return aStyles.Count(); } + size_t GetStyleCount() const { return aStyles.size(); } - const SvXMLStyleContext *GetStyle( sal_uInt32 i ) const + const SvXMLStyleContext *GetStyle( size_t i ) const { - return i < aStyles.Count() ? aStyles.GetObject(i) : 0; + return i < aStyles.size() ? aStyles[ i ] : 0; } - SvXMLStyleContext *GetStyle( sal_uInt32 i ) + SvXMLStyleContext *GetStyle( size_t i ) { - return i < aStyles.Count() ? aStyles.GetObject(i) : 0; + return i < aStyles.size() ? aStyles[ i ] : 0; } inline void AddStyle( SvXMLStyleContext *pStyle ); @@ -311,7 +306,6 @@ public: }; SvXMLStylesContext_Impl::SvXMLStylesContext_Impl( sal_Bool bAuto ) : - aStyles( 20, 5 ), pIndices( 0 ), bAutomaticStyle( bAuto ) #ifdef DBG_UTIL @@ -323,17 +317,17 @@ SvXMLStylesContext_Impl::~SvXMLStylesContext_Impl() { delete pIndices; - while( aStyles.Count() ) + for ( size_t i = 0, n = aStyles.size(); i < n; ++i ) { - SvXMLStyleContext *pStyle = aStyles.GetObject(0); - aStyles.Remove( 0UL ); + SvXMLStyleContext *pStyle = aStyles[ i ]; pStyle->ReleaseRef(); } + aStyles.clear(); } inline void SvXMLStylesContext_Impl::AddStyle( SvXMLStyleContext *pStyle ) { - aStyles.Insert( pStyle, aStyles.Count() ); + aStyles.push_back( pStyle ); pStyle->AddRef(); FlushIndex(); @@ -343,12 +337,12 @@ void SvXMLStylesContext_Impl::Clear() { FlushIndex(); - while( aStyles.Count() ) + for ( size_t i = 0, n = aStyles.size(); i < n; ++i ) { - SvXMLStyleContext *pStyle = aStyles.GetObject(0); - aStyles.Remove( 0UL ); + SvXMLStyleContext *pStyle = aStyles[ i ]; pStyle->ReleaseRef(); } + aStyles.clear(); } const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext( @@ -358,7 +352,7 @@ const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext( { const SvXMLStyleContext *pStyle = 0; - if( !pIndices && bCreateIndex && aStyles.Count() > 0 ) + if( !pIndices && bCreateIndex && !aStyles.empty() ) { #ifdef DBG_UTIL DBG_ASSERT( 0==nIndexCreated, @@ -366,13 +360,13 @@ const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext( #endif ((SvXMLStylesContext_Impl *)this)->pIndices = new SvXMLStyleIndices_Impl( - sal::static_int_cast< sal_uInt16 >(aStyles.Count()), 5 ); - for( sal_uInt32 i=0; i < aStyles.Count(); i++ ) + sal::static_int_cast< sal_uInt16 >( aStyles.size() ), 5 ); + for( size_t i = 0; i < aStyles.size(); i++ ) { - SvXMLStyleIndex_Impl* pStyleIndex = new SvXMLStyleIndex_Impl( aStyles.GetObject(i)); + SvXMLStyleIndex_Impl* pStyleIndex = new SvXMLStyleIndex_Impl( aStyles[ i ] ); if (!pIndices->Insert( pStyleIndex )) { - DBG_ERROR("Here is a double Style"); + OSL_FAIL("Here is a double Style"); delete pStyleIndex; } } @@ -390,9 +384,9 @@ const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext( } else { - for( sal_uInt32 i=0; !pStyle && i < aStyles.Count(); i++ ) + for( size_t i = 0; !pStyle && i < aStyles.size(); i++ ) { - const SvXMLStyleContext *pS = aStyles.GetObject( i ); + const SvXMLStyleContext *pS = aStyles[ i ]; if( pS->GetFamily() == nFamily && pS->GetName() == rName ) pStyle = pS; @@ -490,35 +484,20 @@ SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext( rLocalName, xAttrList, sal_True ); break; case XML_TOK_TEXT_NOTE_CONFIG: -#ifndef SVX_LIGHT pStyle = new XMLFootnoteConfigurationImportContext(GetImport(), p_nPrefix, rLocalName, xAttrList); -#else - // create default context to skip content - pStyle = new SvXMLStyleContext( GetImport(), nPrefix, rLocalName, xAttrList ); -#endif // #ifndef SVX_LIGHT break; case XML_TOK_TEXT_BIBLIOGRAPHY_CONFIG: -#ifndef SVX_LIGHT pStyle = new XMLIndexBibliographyConfigurationContext( GetImport(), p_nPrefix, rLocalName, xAttrList); -#else - // create default context to skip content - pStyle = new SvXMLStyleContext( GetImport(), p_nPrefix, rLocalName, xAttrList ); -#endif // #ifndef SVX_LIGHT break; case XML_TOK_TEXT_LINENUMBERING_CONFIG: -#ifndef SVX_LIGHT pStyle = new XMLLineNumberingImportContext( GetImport(), p_nPrefix, rLocalName, xAttrList); -#else - // create default context to skip content - pStyle = new SvXMLStyleContext( GetImport(), p_nPrefix, rLocalName, xAttrList ); -#endif // #ifndef SVX_LIGHT break; // @@ -720,7 +699,6 @@ UniReference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProperty } xMapper = mxShapeImpPropMapper; break; -#ifndef SVX_LIGHT case XML_STYLE_FAMILY_SCH_CHART_ID: if( ! mxChartImpPropMapper.is() ) { @@ -729,7 +707,6 @@ UniReference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProperty } xMapper = mxChartImpPropMapper; break; -#endif case XML_STYLE_FAMILY_PAGE_MASTER: if( ! mxPageImpPropMapper.is() ) { @@ -872,7 +849,6 @@ SvXMLImportContext *SvXMLStylesContext::CreateChildContext( sal_uInt16 nPrefix, SvXMLStyleContext *pStyle = CreateStyleChildContext( nPrefix, rLocalName, xAttrList ); -// DBG_ASSERT( pStyle->GetFamily(), "Style without a family" ); if( pStyle ) { if( !pStyle->IsTransient() ) @@ -974,3 +950,5 @@ const SvXMLStyleContext *SvXMLStylesContext::FindStyleChildContext( { return mpImpl->FindStyleChildContext( nFamily, rName, bCreateIndex ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmltabe.cxx b/xmloff/source/style/xmltabe.cxx index 64c294c3da2f..d967e3d30618 100644 --- a/xmloff/source/style/xmltabe.cxx +++ b/xmloff/source/style/xmltabe.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -117,17 +118,13 @@ void SvxXMLTabStopExport::Export( const uno::Any& rAny ) uno::Sequence< ::com::sun::star::style::TabStop> aSeq; if(!(rAny >>= aSeq)) { - DBG_ERROR( "SvxXMLTabStopExport needs a Sequence ::com::sun::star::style::TabStop>" ); + OSL_FAIL( "SvxXMLTabStopExport needs a Sequence ::com::sun::star::style::TabStop>" ); } else { const ::com::sun::star::style::TabStop* pTabs = aSeq.getConstArray(); const sal_Int32 nTabs = aSeq.getLength(); - // ignore default tab stop here - //if( 1 == nTabs && style::TabAlign_DEFAULT == pTabs[0].Alignment ) - // return; - SvXMLElementExport rElem( rExport, XML_NAMESPACE_STYLE, XML_TAB_STOPS, sal_True, sal_True ); @@ -140,3 +137,4 @@ void SvxXMLTabStopExport::Export( const uno::Any& rAny ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmltabi.cxx b/xmloff/source/style/xmltabi.cxx index 24402e61c240..a5c92fb5469d 100644 --- a/xmloff/source/style/xmltabi.cxx +++ b/xmloff/source/style/xmltabi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,7 +62,7 @@ enum SvXMLTokenMapAttrs XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN }; -static __FAR_DATA SvXMLTokenMapEntry aTabsAttributesAttrTokenMap[] = +static SvXMLTokenMapEntry aTabsAttributesAttrTokenMap[] = { { XML_NAMESPACE_STYLE, XML_POSITION, XML_TOK_TABSTOP_POSITION }, { XML_NAMESPACE_STYLE, XML_TYPE, XML_TOK_TABSTOP_TYPE }, @@ -291,3 +292,4 @@ void SvxXMLTabStopImportContext::EndElement( ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |