String and OUString cleaning in xmloff

Change-Id: I85d7fd7733814c60a048a7f87d43fbcbb83b0eb0
This commit is contained in:
Norbert Thiebaud
2012-11-25 00:33:44 -06:00
parent 739146b75d
commit 1a8ac8b2df
12 changed files with 372 additions and 386 deletions

View File

@@ -30,6 +30,7 @@
#define _SW_XMLBLOCKIMPORT_HXX #define _SW_XMLBLOCKIMPORT_HXX
#include <xmloff/xmlimp.hxx> #include <xmloff/xmlimp.hxx>
#include <tools/string.hxx>
class SwXMLTextBlocks; class SwXMLTextBlocks;
class SwXMLBlockListImport : public SvXMLImport class SwXMLBlockListImport : public SvXMLImport

View File

@@ -26,10 +26,10 @@
* *
************************************************************************/ ************************************************************************/
#include <tools/string.hxx>
#include <SwXMLSectionList.hxx> #include <SwXMLSectionList.hxx>
#include <xmloff/nmspmap.hxx> #include <xmloff/nmspmap.hxx>
#include <xmloff/xmlnmspe.hxx> #include <xmloff/xmlnmspe.hxx>
#include <tools/string.hxx>
#include <vector> #include <vector>
using namespace ::com::sun::star; using namespace ::com::sun::star;

View File

@@ -49,7 +49,6 @@
#include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/beans/NamedValue.hpp>
namespace rtl { class OUString; }
namespace com { namespace sun { namespace star { namespace com { namespace sun { namespace star {
namespace uno { class XComponentContext; } namespace uno { class XComponentContext; }
namespace frame { class XModel; } namespace frame { class XModel; }
@@ -68,7 +67,6 @@ class XMLFontStylesContext;
class XMLEventImportHelper; class XMLEventImportHelper;
class XMLErrors; class XMLErrors;
class StyleMap; class StyleMap;
class String;
namespace xmloff { namespace xmloff {
class RDFaImportHelper; class RDFaImportHelper;
@@ -134,7 +132,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper6<
XMLEventImportHelper *mpEventImportHelper; XMLEventImportHelper *mpEventImportHelper;
XMLErrors *mpXMLErrors; XMLErrors *mpXMLErrors;
StyleMap *mpStyleMap; StyleMap *mpStyleMap;
::rtl::OUString msPackageProtocol; OUString msPackageProtocol;
SAL_DLLPRIVATE void _InitCtor(); SAL_DLLPRIVATE void _InitCtor();
@@ -153,8 +151,8 @@ protected:
// This method is called after the namespace map has been updated, but // This method is called after the namespace map has been updated, but
// before a context for the current element has been pushed. // before a context for the current element has been pushed.
virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix, virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
const ::rtl::OUString& rLocalName, const OUString& rLocalName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual XMLTextImportHelper* CreateTextImport(); virtual XMLTextImportHelper* CreateTextImport();
virtual XMLShapeImportHelper* CreateShapeImport(); virtual XMLShapeImportHelper* CreateShapeImport();
@@ -169,7 +167,7 @@ protected:
void SetAutoStyles( SvXMLStylesContext *pAutoStyles ); void SetAutoStyles( SvXMLStylesContext *pAutoStyles );
void SetMasterStyles( SvXMLStylesContext *pMasterStyles ); void SetMasterStyles( SvXMLStylesContext *pMasterStyles );
sal_Bool IsODFVersionConsistent( const ::rtl::OUString& aODFVersion ); sal_Bool IsODFVersionConsistent( const OUString& aODFVersion );
const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; } const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; }
inline void SetEmbeddedResolver( com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver ); inline void SetEmbeddedResolver( com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver );
@@ -197,17 +195,17 @@ public:
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL endDocument(void) virtual void SAL_CALL endDocument(void)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL startElement(const ::rtl::OUString& aName, virtual void SAL_CALL startElement(const OUString& aName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs) const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL endElement(const ::rtl::OUString& aName) virtual void SAL_CALL endElement(const OUString& aName)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL characters(const ::rtl::OUString& aChars) virtual void SAL_CALL characters(const OUString& aChars)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL ignorableWhitespace(const ::rtl::OUString& aWhitespaces) virtual void SAL_CALL ignorableWhitespace(const OUString& aWhitespaces)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL processingInstruction(const ::rtl::OUString& aTarget, virtual void SAL_CALL processingInstruction(const OUString& aTarget,
const ::rtl::OUString& aData) const OUString& aData)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator) virtual void SAL_CALL setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
@@ -215,11 +213,11 @@ public:
// ::com::sun::star::xml::sax::XExtendedDocumentHandler // ::com::sun::star::xml::sax::XExtendedDocumentHandler
virtual void SAL_CALL startCDATA(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL startCDATA(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL endCDATA(void) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL endCDATA(void) throw( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL comment(const ::rtl::OUString& sComment) virtual void SAL_CALL comment(const OUString& sComment)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL allowLineBreak(void) virtual void SAL_CALL allowLineBreak(void)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL unknown(const ::rtl::OUString& sString) virtual void SAL_CALL unknown(const OUString& sString)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
// XImporter // XImporter
@@ -236,9 +234,12 @@ public:
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
// XServiceInfo // XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); virtual OUString SAL_CALL getImplementationName( )
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
throw(::com::sun::star::uno::RuntimeException);
// may be called by certain subclasses that handle document meta-data // may be called by certain subclasses that handle document meta-data
// override to provide customized handling of document statistics // override to provide customized handling of document statistics
@@ -288,36 +289,36 @@ public:
// Convert a local packe URL into either a graphic manager or a // Convert a local packe URL into either a graphic manager or a
// internal package URL. The later one happens only if bLoadURL is true // internal package URL. The later one happens only if bLoadURL is true
::rtl::OUString ResolveGraphicObjectURL( const ::rtl::OUString& rURL, sal_Bool bLoadOnDemand ); OUString ResolveGraphicObjectURL( const OUString& rURL, sal_Bool bLoadOnDemand );
::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
GetStreamForGraphicObjectURLFromBase64(); GetStreamForGraphicObjectURLFromBase64();
::rtl::OUString ResolveGraphicObjectURLFromBase64( OUString ResolveGraphicObjectURLFromBase64(
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOut ); const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOut );
sal_Bool IsPackageURL( const ::rtl::OUString& rURL ) const; sal_Bool IsPackageURL( const OUString& rURL ) const;
::rtl::OUString ResolveEmbeddedObjectURL( const ::rtl::OUString& rURL, OUString ResolveEmbeddedObjectURL( const OUString& rURL,
const ::rtl::OUString& rClassId ); const OUString& rClassId );
::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
GetStreamForEmbeddedObjectURLFromBase64(); GetStreamForEmbeddedObjectURLFromBase64();
::rtl::OUString ResolveEmbeddedObjectURLFromBase64(); OUString ResolveEmbeddedObjectURLFromBase64();
// get source storage we're importing from (if available) // get source storage we're importing from (if available)
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
GetSourceStorage(); GetSourceStorage();
void AddStyleDisplayName( sal_uInt16 nFamily, void AddStyleDisplayName( sal_uInt16 nFamily,
const ::rtl::OUString& rName, const OUString& rName,
const ::rtl::OUString& rDisplayName ); const OUString& rDisplayName );
::rtl::OUString GetStyleDisplayName( sal_uInt16 nFamily, OUString GetStyleDisplayName( sal_uInt16 nFamily,
const ::rtl::OUString& rName ) const; const OUString& rName ) const;
ProgressBarHelper* GetProgressBarHelper(); ProgressBarHelper* GetProgressBarHelper();
void AddNumberStyle(sal_Int32 nKey, const rtl::OUString& sName); void AddNumberStyle(sal_Int32 nKey, const OUString& sName);
virtual void SetViewSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aViewProps); virtual void SetViewSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aViewProps);
virtual void SetConfigurationSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aConfigProps); virtual void SetConfigurationSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aConfigProps);
virtual void SetDocumentSpecificSettings(const ::rtl::OUString& _rSettingsGroupName, virtual void SetDocumentSpecificSettings(const OUString& _rSettingsGroupName,
const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& _rSettings); const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& _rSettings);
XMLFontStylesContext *GetFontDecls(); XMLFontStylesContext *GetFontDecls();
@@ -329,14 +330,14 @@ public:
sal_uInt16 getImportFlags() const { return mnImportFlags; } sal_uInt16 getImportFlags() const { return mnImportFlags; }
sal_Bool IsFormsSupported() const { return mbIsFormsSupported; } sal_Bool IsFormsSupported() const { return mbIsFormsSupported; }
rtl::OUString GetAbsoluteReference(const rtl::OUString& rValue) const; OUString GetAbsoluteReference(const OUString& rValue) const;
sal_Unicode ConvStarBatsCharToStarSymbol( sal_Unicode c ); sal_Unicode ConvStarBatsCharToStarSymbol( sal_Unicode c );
sal_Unicode ConvStarMathCharToStarSymbol( sal_Unicode c ); sal_Unicode ConvStarMathCharToStarSymbol( sal_Unicode c );
bool IsTableShapeSupported() const { return mbIsTableShapeSupported; } bool IsTableShapeSupported() const { return mbIsTableShapeSupported; }
::rtl::OUString GetODFVersion() const; OUString GetODFVersion() const;
/** /**
* Record an error condition that occurred during import. The * Record an error condition that occurred during import. The
@@ -347,21 +348,21 @@ public:
/// error ID, may contain an error flag /// error ID, may contain an error flag
sal_Int32 nId, sal_Int32 nId,
/// string parameters for the error message /// string parameters for the error message
const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rMsgParams, const ::com::sun::star::uno::Sequence< OUString > & rMsgParams,
/// original exception message (if applicable) /// original exception message (if applicable)
const ::rtl::OUString& rExceptionMessage, const OUString& rExceptionMessage,
/// error location (if applicable) /// error location (if applicable)
const ::com::sun::star::uno::Reference< const ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XLocator> & rLocator ); ::com::sun::star::xml::sax::XLocator> & rLocator );
void SetError( void SetError(
sal_Int32 nId, sal_Int32 nId,
const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rMsgParams); const ::com::sun::star::uno::Sequence< OUString> & rMsgParams);
void SetError( sal_Int32 nId ); void SetError( sal_Int32 nId );
void SetError( sal_Int32 nId, const rtl::OUString& rMsg1 ); void SetError( sal_Int32 nId, const OUString& rMsg1 );
void SetError( sal_Int32 nId, const rtl::OUString& rMsg1, void SetError( sal_Int32 nId, const OUString& rMsg1,
const rtl::OUString& rMsg2 ); const OUString& rMsg2 );
/** return current error flags */ /** return current error flags */
sal_uInt16 GetErrorFlags() { return mnErrorFlags; } sal_uInt16 GetErrorFlags() { return mnErrorFlags; }
@@ -381,25 +382,23 @@ public:
sal_Bool IsTextDocInOOoFileFormat() const; sal_Bool IsTextDocInOOoFileFormat() const;
::rtl::OUString GetBaseURL() const; OUString GetBaseURL() const;
::rtl::OUString GetDocumentBase() const; OUString GetDocumentBase() const;
/// name of stream in package, e.g., "content.xml" /// name of stream in package, e.g., "content.xml"
::rtl::OUString GetStreamName() const; OUString GetStreamName() const;
/// set the XmlId attribute of given UNO object (for RDF metadata) /// set the XmlId attribute of given UNO object (for RDF metadata)
void SetXmlId(::com::sun::star::uno::Reference< void SetXmlId(::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface> const & i_xIfc, ::com::sun::star::uno::XInterface> const & i_xIfc,
::rtl::OUString const & i_rXmlId); OUString const & i_rXmlId);
/// Add a RDFa statement; parameters are XML attribute values /// Add a RDFa statement; parameters are XML attribute values
void AddRDFa( void AddRDFa( ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable> i_xObject,
::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable> OUString const & i_rAbout,
i_xObject, OUString const & i_rProperty,
::rtl::OUString const & i_rAbout, OUString const & i_rContent,
::rtl::OUString const & i_rProperty, OUString const & i_rDatatype);
::rtl::OUString const & i_rContent,
::rtl::OUString const & i_rDatatype);
/// do not dllexport this; only for advanced cases (bookmark-start) /// do not dllexport this; only for advanced cases (bookmark-start)
SAL_DLLPRIVATE ::xmloff::RDFaImportHelper & GetRDFaImportHelper(); SAL_DLLPRIVATE ::xmloff::RDFaImportHelper & GetRDFaImportHelper();

View File

@@ -50,7 +50,6 @@
using namespace ::xmloff::token; using namespace ::xmloff::token;
using namespace com::sun::star; using namespace com::sun::star;
using rtl::OUString;
using com::sun::star::uno::Reference; using com::sun::star::uno::Reference;
//---------------------------------------- //----------------------------------------
@@ -162,23 +161,23 @@ Reference< drawing::XShape > SchXMLAxisContext::getTitleShape()
if( !xDiaProp.is() || !xAxis.is() ) if( !xDiaProp.is() || !xAxis.is() )
return xResult; return xResult;
rtl::OUString aPropName; OUString aPropName;
switch( m_aCurrentAxis.eDimension ) switch( m_aCurrentAxis.eDimension )
{ {
case SCH_XML_AXIS_X: case SCH_XML_AXIS_X:
if( m_aCurrentAxis.nAxisIndex == 0 ) if( m_aCurrentAxis.nAxisIndex == 0 )
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM( "HasXAxisTitle" )); aPropName = "HasXAxisTitle";
else else
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM( "HasSecondaryXAxisTitle" )); aPropName = "HasSecondaryXAxisTitle";
break; break;
case SCH_XML_AXIS_Y: case SCH_XML_AXIS_Y:
if( m_aCurrentAxis.nAxisIndex == 0 ) if( m_aCurrentAxis.nAxisIndex == 0 )
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM( "HasYAxisTitle" )); aPropName = "HasYAxisTitle";
else else
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM( "HasSecondaryYAxisTitle" )); aPropName = "HasSecondaryYAxisTitle";
break; break;
case SCH_XML_AXIS_Z: case SCH_XML_AXIS_Z:
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM( "HasZAxisTitle" )); aPropName = "HasZAxisTitle";
break; break;
case SCH_XML_AXIS_UNDEF: case SCH_XML_AXIS_UNDEF:
OSL_TRACE( "Invalid axis" ); OSL_TRACE( "Invalid axis" );
@@ -196,26 +195,26 @@ void SchXMLAxisContext::CreateGrid( OUString sAutoStyleName, bool bIsMajor )
if( !xDiaProp.is() || !xAxis.is() ) if( !xDiaProp.is() || !xAxis.is() )
return; return;
rtl::OUString aPropName; OUString aPropName;
switch( m_aCurrentAxis.eDimension ) switch( m_aCurrentAxis.eDimension )
{ {
case SCH_XML_AXIS_X: case SCH_XML_AXIS_X:
if( bIsMajor ) if( bIsMajor )
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxisGrid")); aPropName = "HasXAxisGrid";
else else
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxisHelpGrid")); aPropName = "HasXAxisHelpGrid";
break; break;
case SCH_XML_AXIS_Y: case SCH_XML_AXIS_Y:
if( bIsMajor ) if( bIsMajor )
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasYAxisGrid")); aPropName = "HasYAxisGrid";
else else
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasYAxisHelpGrid")); aPropName = "HasYAxisHelpGrid";
break; break;
case SCH_XML_AXIS_Z: case SCH_XML_AXIS_Z:
if( bIsMajor ) if( bIsMajor )
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasZAxisGrid")); aPropName = "HasZAxisGrid";
else else
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasZAxisHelpGrid")); aPropName = "HasZAxisHelpGrid";
break; break;
case SCH_XML_AXIS_UNDEF: case SCH_XML_AXIS_UNDEF:
OSL_TRACE( "Invalid axis" ); OSL_TRACE( "Invalid axis" );
@@ -233,7 +232,7 @@ void SchXMLAxisContext::CreateGrid( OUString sAutoStyleName, bool bIsMajor )
if( xGridProp.is()) if( xGridProp.is())
{ {
// the line color is black as default, in the model it is a light gray // the line color is black as default, in the model it is a light gray
xGridProp->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )), xGridProp->setPropertyValue( OUString( "LineColor" ),
uno::makeAny( COL_BLACK )); uno::makeAny( COL_BLACK ));
if( !sAutoStyleName.isEmpty()) if( !sAutoStyleName.isEmpty())
{ {
@@ -402,26 +401,26 @@ void SchXMLAxisContext::CreateAxis()
Reference< beans::XPropertySet > xDiaProp( m_rImportHelper.GetChartDocument()->getDiagram(), uno::UNO_QUERY ); Reference< beans::XPropertySet > xDiaProp( m_rImportHelper.GetChartDocument()->getDiagram(), uno::UNO_QUERY );
if( !xDiaProp.is() ) if( !xDiaProp.is() )
return; return;
rtl::OUString aPropName; OUString aPropName;
switch( m_aCurrentAxis.eDimension ) switch( m_aCurrentAxis.eDimension )
{ {
case SCH_XML_AXIS_X: case SCH_XML_AXIS_X:
if( m_aCurrentAxis.nAxisIndex == 0 ) if( m_aCurrentAxis.nAxisIndex == 0 )
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxis")); aPropName = "HasXAxis";
else else
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryXAxis")); aPropName = "HasSecondaryXAxis";
break; break;
case SCH_XML_AXIS_Y: case SCH_XML_AXIS_Y:
if( m_aCurrentAxis.nAxisIndex == 0 ) if( m_aCurrentAxis.nAxisIndex == 0 )
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasYAxis")); aPropName = "HasYAxis";
else else
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryYAxis")); aPropName = "HasSecondaryYAxis";
break; break;
case SCH_XML_AXIS_Z: case SCH_XML_AXIS_Z:
if( m_aCurrentAxis.nAxisIndex == 0 ) if( m_aCurrentAxis.nAxisIndex == 0 )
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxis")); aPropName = "HasXAxis";
else else
aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryXAxis")); aPropName = "HasSecondaryXAxis";
break; break;
case SCH_XML_AXIS_UNDEF: case SCH_XML_AXIS_UNDEF:
OSL_TRACE( "Invalid axis" ); OSL_TRACE( "Invalid axis" );
@@ -457,7 +456,7 @@ void SchXMLAxisContext::CreateAxis()
{ {
try try
{ {
xDiaProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "HasXAxis" )), uno::makeAny(sal_True) ); xDiaProp->setPropertyValue( OUString( "HasXAxis" ), uno::makeAny(sal_True) );
} }
catch( beans::UnknownPropertyException & ) catch( beans::UnknownPropertyException & )
{ {
@@ -472,16 +471,16 @@ void SchXMLAxisContext::CreateAxis()
uno::Any aFalseBool( uno::makeAny( sal_False )); uno::Any aFalseBool( uno::makeAny( sal_False ));
// #i109879# the line color is black as default, in the model it is a light gray // #i109879# the line color is black as default, in the model it is a light gray
m_xAxisProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )), m_xAxisProps->setPropertyValue( OUString( "LineColor" ),
uno::makeAny( COL_BLACK )); uno::makeAny( COL_BLACK ));
m_xAxisProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "DisplayLabels" )), aFalseBool ); m_xAxisProps->setPropertyValue( OUString( "DisplayLabels" ), aFalseBool );
// #88077# AutoOrigin 'on' is default // #88077# AutoOrigin 'on' is default
m_xAxisProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "AutoOrigin" )), aTrueBool ); m_xAxisProps->setPropertyValue( OUString( "AutoOrigin" ), aTrueBool );
if( m_bAxisTypeImported ) if( m_bAxisTypeImported )
m_xAxisProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "AxisType" )), uno::makeAny(m_nAxisType) ); m_xAxisProps->setPropertyValue( OUString( "AxisType" ), uno::makeAny(m_nAxisType) );
if( !m_aAutoStyleName.isEmpty()) if( !m_aAutoStyleName.isEmpty())
{ {
@@ -537,7 +536,7 @@ void SchXMLAxisContext::CreateAxis()
Reference< beans::XPropertySet > xNewAxisProp( xAxis, uno::UNO_QUERY ); Reference< beans::XPropertySet > xNewAxisProp( xAxis, uno::UNO_QUERY );
if( xNewAxisProp.is() ) if( xNewAxisProp.is() )
{ {
xNewAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")) xNewAxisProp->setPropertyValue( OUString("LineStyle")
, uno::makeAny(drawing::LineStyle_NONE)); , uno::makeAny(drawing::LineStyle_NONE));
} }
} }
@@ -545,7 +544,7 @@ void SchXMLAxisContext::CreateAxis()
if( m_bAdaptXAxisOrientationForOld2DBarCharts && m_aCurrentAxis.eDimension == SCH_XML_AXIS_X ) if( m_bAdaptXAxisOrientationForOld2DBarCharts && m_aCurrentAxis.eDimension == SCH_XML_AXIS_X )
{ {
bool bIs3DChart = false; bool bIs3DChart = false;
if( xDiaProp.is() && ( xDiaProp->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Dim3D"))) >>= bIs3DChart ) if( xDiaProp.is() && ( xDiaProp->getPropertyValue(OUString("Dim3D")) >>= bIs3DChart )
&& !bIs3DChart ) && !bIs3DChart )
{ {
Reference< chart2::XChartDocument > xChart2Document( GetImport().GetModel(), uno::UNO_QUERY ); Reference< chart2::XChartDocument > xChart2Document( GetImport().GetModel(), uno::UNO_QUERY );
@@ -560,7 +559,7 @@ void SchXMLAxisContext::CreateAxis()
bool bSwapXandYAxis = false; bool bSwapXandYAxis = false;
Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] );
Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY ); Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY );
if( xCooSysProp.is() && ( xCooSysProp->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("SwapXAndYAxis"))) >>= bSwapXandYAxis ) if( xCooSysProp.is() && ( xCooSysProp->getPropertyValue( OUString("SwapXAndYAxis")) >>= bSwapXandYAxis )
&& bSwapXandYAxis ) && bSwapXandYAxis )
{ {
Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension( 0, m_aCurrentAxis.nAxisIndex ); Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension( 0, m_aCurrentAxis.nAxisIndex );
@@ -578,7 +577,7 @@ void SchXMLAxisContext::CreateAxis()
} }
m_rbAxisPositionAttributeImported = m_rbAxisPositionAttributeImported || SchXMLTools::getPropertyFromContext( m_rbAxisPositionAttributeImported = m_rbAxisPositionAttributeImported || SchXMLTools::getPropertyFromContext(
OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")), pPropStyleContext, pStylesCtxt ).hasValue(); OUString("CrossoverPosition"), pPropStyleContext, pStylesCtxt ).hasValue();
} }
} }
} }
@@ -599,7 +598,7 @@ void SchXMLAxisContext::SetAxisTitle()
{ {
try try
{ {
xTitleProp->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), uno::makeAny(m_aCurrentAxis.aTitle) ); xTitleProp->setPropertyValue( OUString( "String" ), uno::makeAny(m_aCurrentAxis.aTitle) );
} }
catch( beans::UnknownPropertyException & ) catch( beans::UnknownPropertyException & )
{ {
@@ -782,31 +781,31 @@ void SchXMLAxisContext::CorrectAxisPositions( const Reference< chart2::XChartDoc
chart2::ScaleData aMainXScale = xMainXAxis->getScaleData(); chart2::ScaleData aMainXScale = xMainXAxis->getScaleData();
if( 0 == rChartTypeServiceName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.ScatterChartType" ) ) ) if( 0 == rChartTypeServiceName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.ScatterChartType" ) ) )
{ {
xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) xMainYAxisProp->setPropertyValue( OUString("CrossoverPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) );
double fCrossoverValue = 0.0; double fCrossoverValue = 0.0;
aMainXScale.Origin >>= fCrossoverValue; aMainXScale.Origin >>= fCrossoverValue;
xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverValue")) xMainYAxisProp->setPropertyValue( OUString("CrossoverValue")
, uno::makeAny( fCrossoverValue ) ); , uno::makeAny( fCrossoverValue ) );
if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE ) if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE )
{ {
xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LabelPosition")) xMainYAxisProp->setPropertyValue( OUString("LabelPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) );
xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("MarkPosition")) xMainYAxisProp->setPropertyValue( OUString("MarkPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) );
if( xSecondaryYAxisProp.is() ) if( xSecondaryYAxisProp.is() )
xSecondaryYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) xSecondaryYAxisProp->setPropertyValue( OUString("CrossoverPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) );
} }
else else
{ {
xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LabelPosition")) xMainYAxisProp->setPropertyValue( OUString("LabelPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) );
xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("MarkPosition")) xMainYAxisProp->setPropertyValue( OUString("MarkPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) );
if( xSecondaryYAxisProp.is() ) if( xSecondaryYAxisProp.is() )
xSecondaryYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) xSecondaryYAxisProp->setPropertyValue( OUString("CrossoverPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) );
} }
} }
@@ -814,48 +813,48 @@ void SchXMLAxisContext::CorrectAxisPositions( const Reference< chart2::XChartDoc
{ {
if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE ) if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE )
{ {
xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) xMainYAxisProp->setPropertyValue( OUString("CrossoverPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) );
if( xSecondaryYAxisProp.is() ) if( xSecondaryYAxisProp.is() )
xSecondaryYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) xSecondaryYAxisProp->setPropertyValue( OUString("CrossoverPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) );
} }
else else
{ {
xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) xMainYAxisProp->setPropertyValue( OUString("CrossoverPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) );
if( xSecondaryYAxisProp.is() ) if( xSecondaryYAxisProp.is() )
xSecondaryYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) xSecondaryYAxisProp->setPropertyValue( OUString("CrossoverPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) );
} }
} }
chart2::ScaleData aMainYScale = xMainYAxis->getScaleData(); chart2::ScaleData aMainYScale = xMainYAxis->getScaleData();
xMainXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) xMainXAxisProp->setPropertyValue( OUString("CrossoverPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) );
double fCrossoverValue = 0.0; double fCrossoverValue = 0.0;
aMainYScale.Origin >>= fCrossoverValue; aMainYScale.Origin >>= fCrossoverValue;
xMainXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverValue")) xMainXAxisProp->setPropertyValue( OUString("CrossoverValue")
, uno::makeAny( fCrossoverValue ) ); , uno::makeAny( fCrossoverValue ) );
if( aMainYScale.Orientation == chart2::AxisOrientation_REVERSE ) if( aMainYScale.Orientation == chart2::AxisOrientation_REVERSE )
{ {
xMainXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LabelPosition")) xMainXAxisProp->setPropertyValue( OUString("LabelPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) );
xMainXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("MarkPosition")) xMainXAxisProp->setPropertyValue( OUString("MarkPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) );
if( xSecondaryXAxisProp.is() ) if( xSecondaryXAxisProp.is() )
xSecondaryXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) xSecondaryXAxisProp->setPropertyValue( OUString("CrossoverPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) );
} }
else else
{ {
xMainXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LabelPosition")) xMainXAxisProp->setPropertyValue( OUString("LabelPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) );
xMainXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("MarkPosition")) xMainXAxisProp->setPropertyValue( OUString("MarkPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) );
if( xSecondaryXAxisProp.is() ) if( xSecondaryXAxisProp.is() )
xSecondaryXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) xSecondaryXAxisProp->setPropertyValue( OUString("CrossoverPosition")
, uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) );
} }
} }
@@ -974,7 +973,7 @@ void DateScaleContext::StartElement( const Reference< xml::sax::XAttributeList >
bool bSetNewIncrement=false; bool bSetNewIncrement=false;
chart::TimeIncrement aIncrement; chart::TimeIncrement aIncrement;
m_xAxisProps->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "TimeIncrement" ))) >>= aIncrement; m_xAxisProps->getPropertyValue( OUString( "TimeIncrement" )) >>= aIncrement;
for( sal_Int16 i = 0; i < nAttrCount; i++ ) for( sal_Int16 i = 0; i < nAttrCount; i++ )
{ {
@@ -1031,7 +1030,7 @@ void DateScaleContext::StartElement( const Reference< xml::sax::XAttributeList >
} }
if( bSetNewIncrement ) if( bSetNewIncrement )
m_xAxisProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "TimeIncrement" )), uno::makeAny( aIncrement ) ); m_xAxisProps->setPropertyValue( OUString( "TimeIncrement" ), uno::makeAny( aIncrement ) );
} }
// ======================================== // ========================================

View File

@@ -54,9 +54,6 @@
#include "xmloff/xmlnmspe.hxx" #include "xmloff/xmlnmspe.hxx"
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::xmloff::token; using namespace ::xmloff::token;
@@ -140,17 +137,18 @@ uno::Reference< drawing::XShape > XMLShapeExport::checkForCustomShapeReplacement
if( ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 ) if( ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 )
{ {
String aType( (OUString)xShape->getShapeType() ); OUString aType( xShape->getShapeType() );
if( aType.EqualsAscii( (const sal_Char*)"com.sun.star.drawing.CustomShape" ) ) if( aType.equalsAscii( "com.sun.star.drawing.CustomShape" ) )
{ {
uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY ); uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY );
if( xSet.is() ) if( xSet.is() )
{ {
rtl::OUString aEngine; OUString aEngine;
xSet->getPropertyValue( OUString( "CustomShapeEngine" ) ) >>= aEngine; xSet->getPropertyValue( OUString( "CustomShapeEngine" ) ) >>= aEngine;
if ( aEngine.isEmpty() ) if ( aEngine.isEmpty() )
aEngine = OUString( "com.sun.star.drawing.EnhancedCustomShapeEngine" ); {
aEngine = "com.sun.star.drawing.EnhancedCustomShapeEngine";
}
uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
if ( !aEngine.isEmpty() && xFactory.is() ) if ( !aEngine.isEmpty() && xFactory.is() )
@@ -1032,43 +1030,43 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x
uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xShape, uno::UNO_QUERY); uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xShape, uno::UNO_QUERY);
if(xShapeDescriptor.is()) if(xShapeDescriptor.is())
{ {
String aType((OUString)xShapeDescriptor->getShapeType()); OUString aType(xShapeDescriptor->getShapeType());
if(aType.EqualsAscii((const sal_Char*)"com.sun.star.", 0, 13)) if(aType.match("com.sun.star."))
{ {
if(aType.EqualsAscii("drawing.", 13, 8)) if(aType.match("drawing.", 13))
{ {
// drawing shapes // drawing shapes
if (aType.EqualsAscii("Rectangle", 21, 9)) { eShapeType = XmlShapeTypeDrawRectangleShape; } if (aType.match("Rectangle", 21)) { eShapeType = XmlShapeTypeDrawRectangleShape; }
// #i72177# Note: Correcting CustomShape, CustomShape->Custom, len from 9 (was wrong anyways) to 6. // #i72177# Note: Correcting CustomShape, CustomShape->Custom, len from 9 (was wrong anyways) to 6.
// As can be seen at the other compares, the appendix "Shape" is left out of the comparison. // As can be seen at the other compares, the appendix "Shape" is left out of the comparison.
else if(aType.EqualsAscii("Custom", 21, 6)) { eShapeType = XmlShapeTypeDrawCustomShape; } else if(aType.match("Custom", 21)) { eShapeType = XmlShapeTypeDrawCustomShape; }
else if(aType.EqualsAscii("Ellipse", 21, 7)) { eShapeType = XmlShapeTypeDrawEllipseShape; } else if(aType.match("Ellipse", 21)) { eShapeType = XmlShapeTypeDrawEllipseShape; }
else if(aType.EqualsAscii("Control", 21, 7)) { eShapeType = XmlShapeTypeDrawControlShape; } else if(aType.match("Control", 21)) { eShapeType = XmlShapeTypeDrawControlShape; }
else if(aType.EqualsAscii("Connector", 21, 9)) { eShapeType = XmlShapeTypeDrawConnectorShape; } else if(aType.match("Connector", 21)) { eShapeType = XmlShapeTypeDrawConnectorShape; }
else if(aType.EqualsAscii("Measure", 21, 7)) { eShapeType = XmlShapeTypeDrawMeasureShape; } else if(aType.match("Measure", 21)) { eShapeType = XmlShapeTypeDrawMeasureShape; }
else if(aType.EqualsAscii("Line", 21, 4)) { eShapeType = XmlShapeTypeDrawLineShape; } else if(aType.match("Line", 21)) { eShapeType = XmlShapeTypeDrawLineShape; }
// #i72177# Note: This covers two types by purpose, PolyPolygonShape and PolyPolygonPathShape // #i72177# Note: This covers two types by purpose, PolyPolygonShape and PolyPolygonPathShape
else if(aType.EqualsAscii("PolyPolygon", 21, 11)) { eShapeType = XmlShapeTypeDrawPolyPolygonShape; } else if(aType.match("PolyPolygon", 21)) { eShapeType = XmlShapeTypeDrawPolyPolygonShape; }
// #i72177# Note: This covers two types by purpose, PolyLineShape and PolyLinePathShape // #i72177# Note: This covers two types by purpose, PolyLineShape and PolyLinePathShape
else if(aType.EqualsAscii("PolyLine", 21, 8)) { eShapeType = XmlShapeTypeDrawPolyLineShape; } else if(aType.match("PolyLine", 21)) { eShapeType = XmlShapeTypeDrawPolyLineShape; }
else if(aType.EqualsAscii("OpenBezier", 21, 10)) { eShapeType = XmlShapeTypeDrawOpenBezierShape; } else if(aType.match("OpenBezier", 21)) { eShapeType = XmlShapeTypeDrawOpenBezierShape; }
else if(aType.EqualsAscii("ClosedBezier", 21, 12)) { eShapeType = XmlShapeTypeDrawClosedBezierShape; } else if(aType.match("ClosedBezier", 21)) { eShapeType = XmlShapeTypeDrawClosedBezierShape; }
// #i72177# FreeHand (opened and closed) now supports the types OpenFreeHandShape and // #i72177# FreeHand (opened and closed) now supports the types OpenFreeHandShape and
// ClosedFreeHandShape respectively. Represent them as bezier shapes // ClosedFreeHandShape respectively. Represent them as bezier shapes
else if(aType.EqualsAscii("OpenFreeHand", 21, 12)) { eShapeType = XmlShapeTypeDrawOpenBezierShape; } else if(aType.match("OpenFreeHand", 21)) { eShapeType = XmlShapeTypeDrawOpenBezierShape; }
else if(aType.EqualsAscii("ClosedFreeHand", 21, 14)) { eShapeType = XmlShapeTypeDrawClosedBezierShape; } else if(aType.match("ClosedFreeHand", 21)) { eShapeType = XmlShapeTypeDrawClosedBezierShape; }
else if(aType.EqualsAscii("GraphicObject", 21, 13)) { eShapeType = XmlShapeTypeDrawGraphicObjectShape; } else if(aType.match("GraphicObject", 21)) { eShapeType = XmlShapeTypeDrawGraphicObjectShape; }
else if(aType.EqualsAscii("Group", 21, 5)) { eShapeType = XmlShapeTypeDrawGroupShape; } else if(aType.match("Group", 21)) { eShapeType = XmlShapeTypeDrawGroupShape; }
else if(aType.EqualsAscii("Text", 21, 4)) { eShapeType = XmlShapeTypeDrawTextShape; } else if(aType.match("Text", 21)) { eShapeType = XmlShapeTypeDrawTextShape; }
else if(aType.EqualsAscii("OLE2", 21, 4)) else if(aType.match("OLE2", 21))
{ {
eShapeType = XmlShapeTypeDrawOLE2Shape; eShapeType = XmlShapeTypeDrawOLE2Shape;
@@ -1100,30 +1098,30 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x
} }
} }
} }
else if(aType.EqualsAscii("Page", 21, 4)) { eShapeType = XmlShapeTypeDrawPageShape; } else if(aType.match("Page", 21)) { eShapeType = XmlShapeTypeDrawPageShape; }
else if(aType.EqualsAscii("Frame", 21, 5)) { eShapeType = XmlShapeTypeDrawFrameShape; } else if(aType.match("Frame", 21)) { eShapeType = XmlShapeTypeDrawFrameShape; }
else if(aType.EqualsAscii("Caption", 21, 7)) { eShapeType = XmlShapeTypeDrawCaptionShape; } else if(aType.match("Caption", 21)) { eShapeType = XmlShapeTypeDrawCaptionShape; }
else if(aType.EqualsAscii("Plugin", 21, 6)) { eShapeType = XmlShapeTypeDrawPluginShape; } else if(aType.match("Plugin", 21)) { eShapeType = XmlShapeTypeDrawPluginShape; }
else if(aType.EqualsAscii("Applet", 21, 6)) { eShapeType = XmlShapeTypeDrawAppletShape; } else if(aType.match("Applet", 21)) { eShapeType = XmlShapeTypeDrawAppletShape; }
else if(aType.EqualsAscii("MediaShape", 21, 10)) { eShapeType = XmlShapeTypeDrawMediaShape; } else if(aType.match("MediaShape", 21)) { eShapeType = XmlShapeTypeDrawMediaShape; }
else if(aType.EqualsAscii("TableShape", 21, 10)) { eShapeType = XmlShapeTypeDrawTableShape; } else if(aType.match("TableShape", 21)) { eShapeType = XmlShapeTypeDrawTableShape; }
// 3D shapes // 3D shapes
else if(aType.EqualsAscii("Scene", 21 + 7, 5)) { eShapeType = XmlShapeTypeDraw3DSceneObject; } else if(aType.match("Scene", 21 + 7)) { eShapeType = XmlShapeTypeDraw3DSceneObject; }
else if(aType.EqualsAscii("Cube", 21 + 7, 4)) { eShapeType = XmlShapeTypeDraw3DCubeObject; } else if(aType.match("Cube", 21 + 7)) { eShapeType = XmlShapeTypeDraw3DCubeObject; }
else if(aType.EqualsAscii("Sphere", 21 + 7, 6)) { eShapeType = XmlShapeTypeDraw3DSphereObject; } else if(aType.match("Sphere", 21 + 7)) { eShapeType = XmlShapeTypeDraw3DSphereObject; }
else if(aType.EqualsAscii("Lathe", 21 + 7, 5)) { eShapeType = XmlShapeTypeDraw3DLatheObject; } else if(aType.match("Lathe", 21 + 7)) { eShapeType = XmlShapeTypeDraw3DLatheObject; }
else if(aType.EqualsAscii("Extrude", 21 + 7, 7)) { eShapeType = XmlShapeTypeDraw3DExtrudeObject; } else if(aType.match("Extrude", 21 + 7)) { eShapeType = XmlShapeTypeDraw3DExtrudeObject; }
} }
else if(aType.EqualsAscii("presentation.", 13, 13)) else if(aType.match("presentation.", 13))
{ {
// presentation shapes // presentation shapes
if (aType.EqualsAscii("TitleText", 26, 9)) { eShapeType = XmlShapeTypePresTitleTextShape; } if (aType.match("TitleText", 26)) { eShapeType = XmlShapeTypePresTitleTextShape; }
else if(aType.EqualsAscii("Outliner", 26, 8)) { eShapeType = XmlShapeTypePresOutlinerShape; } else if(aType.match("Outliner", 26)) { eShapeType = XmlShapeTypePresOutlinerShape; }
else if(aType.EqualsAscii("Subtitle", 26, 8)) { eShapeType = XmlShapeTypePresSubtitleShape; } else if(aType.match("Subtitle", 26)) { eShapeType = XmlShapeTypePresSubtitleShape; }
else if(aType.EqualsAscii("GraphicObject", 26, 13)) { eShapeType = XmlShapeTypePresGraphicObjectShape; } else if(aType.match("GraphicObject", 26)) { eShapeType = XmlShapeTypePresGraphicObjectShape; }
else if(aType.EqualsAscii("Page", 26, 4)) { eShapeType = XmlShapeTypePresPageShape; } else if(aType.match("Page", 26)) { eShapeType = XmlShapeTypePresPageShape; }
else if(aType.EqualsAscii("OLE2", 26, 4)) else if(aType.match("OLE2", 26))
{ {
eShapeType = XmlShapeTypePresOLE2Shape; eShapeType = XmlShapeTypePresOLE2Shape;
@@ -1135,8 +1133,8 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x
rtl::OUString sCLSID; rtl::OUString sCLSID;
if(xPropSet->getPropertyValue(OUString("CLSID")) >>= sCLSID) if(xPropSet->getPropertyValue(OUString("CLSID")) >>= sCLSID)
{ {
if( sCLSID.equals(rtl::OUString( SvGlobalName( SO3_SC_CLASSID ).GetHexName())) || if( sCLSID.equals(OUString( SvGlobalName( SO3_SC_CLASSID ).GetHexName())) ||
sCLSID.equals(rtl::OUString( SvGlobalName( BF_SO3_SC_CLASSID ).GetHexName())) ) sCLSID.equals(OUString( SvGlobalName( BF_SO3_SC_CLASSID ).GetHexName())) )
{ {
eShapeType = XmlShapeTypePresSheetShape; eShapeType = XmlShapeTypePresSheetShape;
} }
@@ -1147,17 +1145,17 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x
OSL_FAIL( "XMLShapeExport::ImpCalcShapeType(), expected ole shape to have the CLSID property?" ); OSL_FAIL( "XMLShapeExport::ImpCalcShapeType(), expected ole shape to have the CLSID property?" );
} }
} }
else if(aType.EqualsAscii("Chart", 26, 5)) { eShapeType = XmlShapeTypePresChartShape; } else if(aType.match("Chart", 26)) { eShapeType = XmlShapeTypePresChartShape; }
else if(aType.EqualsAscii("OrgChart", 26, 8)) { eShapeType = XmlShapeTypePresOrgChartShape; } else if(aType.match("OrgChart", 26)) { eShapeType = XmlShapeTypePresOrgChartShape; }
else if(aType.EqualsAscii("CalcShape", 26, 9)) { eShapeType = XmlShapeTypePresSheetShape; } else if(aType.match("CalcShape", 26)) { eShapeType = XmlShapeTypePresSheetShape; }
else if(aType.EqualsAscii("TableShape", 26, 10)) { eShapeType = XmlShapeTypePresTableShape; } else if(aType.match("TableShape", 26)) { eShapeType = XmlShapeTypePresTableShape; }
else if(aType.EqualsAscii("Notes", 26, 5)) { eShapeType = XmlShapeTypePresNotesShape; } else if(aType.match("Notes", 26)) { eShapeType = XmlShapeTypePresNotesShape; }
else if(aType.EqualsAscii("HandoutShape", 26, 12)) { eShapeType = XmlShapeTypeHandoutShape; } else if(aType.match("HandoutShape", 26)) { eShapeType = XmlShapeTypeHandoutShape; }
else if(aType.EqualsAscii("HeaderShape", 26, 11)) { eShapeType = XmlShapeTypePresHeaderShape; } else if(aType.match("HeaderShape", 26)) { eShapeType = XmlShapeTypePresHeaderShape; }
else if(aType.EqualsAscii("FooterShape", 26, 11)) { eShapeType = XmlShapeTypePresFooterShape; } else if(aType.match("FooterShape", 26)) { eShapeType = XmlShapeTypePresFooterShape; }
else if(aType.EqualsAscii("SlideNumberShape", 26, 16)) { eShapeType = XmlShapeTypePresSlideNumberShape; } else if(aType.match("SlideNumberShape", 26)) { eShapeType = XmlShapeTypePresSlideNumberShape; }
else if(aType.EqualsAscii("DateTimeShape", 26, 13)) { eShapeType = XmlShapeTypePresDateTimeShape; } else if(aType.match("DateTimeShape", 26)) { eShapeType = XmlShapeTypePresDateTimeShape; }
else if(aType.EqualsAscii("MediaShape", 26, 10)) { eShapeType = XmlShapeTypePresMediaShape; } else if(aType.match("MediaShape", 26)) { eShapeType = XmlShapeTypePresMediaShape; }
} }
} }
} }

View File

@@ -63,9 +63,6 @@
#include "XMLBase64Export.hxx" #include "XMLBase64Export.hxx"
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::io; using namespace ::com::sun::star::io;
using namespace ::xmloff::token; using namespace ::xmloff::token;
@@ -79,7 +76,7 @@ using ::com::sun::star::uno::Sequence;
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
void ExportParameter( rtl::OUStringBuffer& rStrBuffer, const com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter ) void ExportParameter( OUStringBuffer& rStrBuffer, const com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter )
{ {
if ( rStrBuffer.getLength() ) if ( rStrBuffer.getLength() )
rStrBuffer.append( (sal_Unicode)' ' ); rStrBuffer.append( (sal_Unicode)' ' );
@@ -100,14 +97,14 @@ void ExportParameter( rtl::OUStringBuffer& rStrBuffer, const com::sun::star::dra
{ {
rStrBuffer.append( (sal_Unicode)'?' ); rStrBuffer.append( (sal_Unicode)'?' );
rStrBuffer.append( (sal_Unicode)'f' ); rStrBuffer.append( (sal_Unicode)'f' );
rStrBuffer.append( rtl::OUString::valueOf( nValue ) ); rStrBuffer.append( OUString::valueOf( nValue ) );
} }
break; break;
case com::sun::star::drawing::EnhancedCustomShapeParameterType::ADJUSTMENT : case com::sun::star::drawing::EnhancedCustomShapeParameterType::ADJUSTMENT :
{ {
rStrBuffer.append( (sal_Unicode)'$' ); rStrBuffer.append( (sal_Unicode)'$' );
rStrBuffer.append( rtl::OUString::valueOf( nValue ) ); rStrBuffer.append( OUString::valueOf( nValue ) );
} }
break; break;
@@ -136,18 +133,18 @@ void ExportParameter( rtl::OUStringBuffer& rStrBuffer, const com::sun::star::dra
case com::sun::star::drawing::EnhancedCustomShapeParameterType::LOGHEIGHT : case com::sun::star::drawing::EnhancedCustomShapeParameterType::LOGHEIGHT :
rStrBuffer.append( GetXMLToken( XML_LOGHEIGHT ) ); break; rStrBuffer.append( GetXMLToken( XML_LOGHEIGHT ) ); break;
default : default :
rStrBuffer.append( rtl::OUString::valueOf( nValue ) ); rStrBuffer.append( OUString::valueOf( nValue ) );
} }
} }
} }
void ImpExportEquations( SvXMLExport& rExport, const uno::Sequence< rtl::OUString >& rEquations ) void ImpExportEquations( SvXMLExport& rExport, const uno::Sequence< OUString >& rEquations )
{ {
sal_Int32 i; sal_Int32 i;
for ( i = 0; i < rEquations.getLength(); i++ ) for ( i = 0; i < rEquations.getLength(); i++ )
{ {
rtl::OUString aStr(static_cast<sal_Unicode>('f')); OUString aStr(static_cast<sal_Unicode>('f'));
aStr += rtl::OUString::valueOf( i ); aStr += OUString::valueOf( i );
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, aStr ); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, aStr );
aStr = rEquations[ i ]; aStr = rEquations[ i ];
@@ -157,8 +154,8 @@ void ImpExportEquations( SvXMLExport& rExport, const uno::Sequence< rtl::OUStrin
nIndex = aStr.indexOf( (sal_Unicode)'?', nIndex ); nIndex = aStr.indexOf( (sal_Unicode)'?', nIndex );
if ( nIndex != -1 ) if ( nIndex != -1 )
{ {
rtl::OUString aNew( aStr.copy( 0, nIndex + 1 ) ); OUString aNew( aStr.copy( 0, nIndex + 1 ) );
aNew += rtl::OUString(static_cast<sal_Unicode>('f')); aNew += OUString(static_cast<sal_Unicode>('f'));
aNew += aStr.copy( nIndex + 1, ( aStr.getLength() - nIndex ) - 1 ); aNew += aStr.copy( nIndex + 1, ( aStr.getLength() - nIndex ) - 1 );
aStr = aNew; aStr = aNew;
nIndex++; nIndex++;
@@ -174,8 +171,8 @@ void ImpExportHandles( SvXMLExport& rExport, const uno::Sequence< beans::Propert
sal_uInt32 i, j, nElements = rHandles.getLength(); sal_uInt32 i, j, nElements = rHandles.getLength();
if ( nElements ) if ( nElements )
{ {
rtl::OUString aStr; OUString aStr;
rtl::OUStringBuffer aStrBuffer; OUStringBuffer aStrBuffer;
for ( i = 0; i < nElements; i++ ) for ( i = 0; i < nElements; i++ )
{ {
@@ -319,8 +316,8 @@ void ImpExportEnhancedPath( SvXMLExport& rExport,
bool bExtended = false ) bool bExtended = false )
{ {
rtl::OUString aStr; OUString aStr;
rtl::OUStringBuffer aStrBuffer; OUStringBuffer aStrBuffer;
bool bNeedExtended = false; bool bNeedExtended = false;
sal_Int32 i, j, k, l; sal_Int32 i, j, k, l;
@@ -452,7 +449,7 @@ void ImpExportEnhancedPath( SvXMLExport& rExport,
void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< beans::XPropertySet >& xPropSet ) void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< beans::XPropertySet >& xPropSet )
{ {
sal_Bool bEquations = sal_False; sal_Bool bEquations = sal_False;
uno::Sequence< rtl::OUString > aEquations; uno::Sequence< OUString > aEquations;
sal_Bool bHandles = sal_False; sal_Bool bHandles = sal_False;
uno::Sequence< beans::PropertyValues > aHandles; uno::Sequence< beans::PropertyValues > aHandles;
@@ -463,14 +460,14 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean
uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentValues; uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentValues;
rtl::OUString aStr; OUString aStr;
rtl::OUStringBuffer aStrBuffer; OUStringBuffer aStrBuffer;
SvXMLUnitConverter& rUnitConverter = rExport.GetMM100UnitConverter(); SvXMLUnitConverter& rUnitConverter = rExport.GetMM100UnitConverter();
uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() ); uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
// geometry // geometry
const rtl::OUString sCustomShapeGeometry( RTL_CONSTASCII_USTRINGPARAM( "CustomShapeGeometry" ) ); const OUString sCustomShapeGeometry( "CustomShapeGeometry" );
if ( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName( sCustomShapeGeometry ) ) if ( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName( sCustomShapeGeometry ) )
{ {
uno::Any aGeoPropSet( xPropSet->getPropertyValue( sCustomShapeGeometry ) ); uno::Any aGeoPropSet( xPropSet->getPropertyValue( sCustomShapeGeometry ) );
@@ -478,8 +475,8 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean
if ( aGeoPropSet >>= aGeoPropSeq ) if ( aGeoPropSet >>= aGeoPropSeq )
{ {
const rtl::OUString sCustomShapeType( RTL_CONSTASCII_USTRINGPARAM( "NonPrimitive" ) ); const OUString sCustomShapeType( "NonPrimitive" );
rtl::OUString aCustomShapeType( sCustomShapeType ); OUString aCustomShapeType( sCustomShapeType );
sal_Int32 j, nGeoPropCount = aGeoPropSeq.getLength(); sal_Int32 j, nGeoPropCount = aGeoPropSeq.getLength();
for ( j = 0; j < nGeoPropCount; j++ ) for ( j = 0; j < nGeoPropCount; j++ )
@@ -603,7 +600,7 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean
{ {
sal_Int32 nExtrusionNumberOfLineSegments = 0; sal_Int32 nExtrusionNumberOfLineSegments = 0;
if ( rProp.Value >>= nExtrusionNumberOfLineSegments ) if ( rProp.Value >>= nExtrusionNumberOfLineSegments )
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_NUMBER_OF_LINE_SEGMENTS, rtl::OUString::valueOf( nExtrusionNumberOfLineSegments ) ); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_NUMBER_OF_LINE_SEGMENTS, OUString::valueOf( nExtrusionNumberOfLineSegments ) );
} }
break; break;
case EAS_LightFace : case EAS_LightFace :
@@ -986,14 +983,14 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean
{ {
sal_Int32 nStretchPoint = 0; sal_Int32 nStretchPoint = 0;
if ( rProp.Value >>= nStretchPoint ) if ( rProp.Value >>= nStretchPoint )
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_PATH_STRETCHPOINT_X, rtl::OUString::valueOf( nStretchPoint ) ); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_PATH_STRETCHPOINT_X, OUString::valueOf( nStretchPoint ) );
} }
break; break;
case EAS_StretchY : case EAS_StretchY :
{ {
sal_Int32 nStretchPoint = 0; sal_Int32 nStretchPoint = 0;
if ( rProp.Value >>= nStretchPoint ) if ( rProp.Value >>= nStretchPoint )
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_PATH_STRETCHPOINT_Y, rtl::OUString::valueOf( nStretchPoint ) ); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_PATH_STRETCHPOINT_Y, OUString::valueOf( nStretchPoint ) );
} }
break; break;
case EAS_TextFrames : case EAS_TextFrames :
@@ -1097,7 +1094,7 @@ void XMLShapeExport::ImpExportCustomShape(
const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY); const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
if ( xPropSet.is() ) if ( xPropSet.is() )
{ {
rtl::OUString aStr; OUString aStr;
uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() ); uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
// Transformation // Transformation
@@ -1105,14 +1102,14 @@ void XMLShapeExport::ImpExportCustomShape(
if ( xPropSetInfo.is() ) if ( xPropSetInfo.is() )
{ {
const rtl::OUString sCustomShapeEngine( RTL_CONSTASCII_USTRINGPARAM( "CustomShapeEngine" ) ); const OUString sCustomShapeEngine( "CustomShapeEngine" );
if ( xPropSetInfo->hasPropertyByName( sCustomShapeEngine ) ) if ( xPropSetInfo->hasPropertyByName( sCustomShapeEngine ) )
{ {
uno::Any aEngine( xPropSet->getPropertyValue( sCustomShapeEngine ) ); uno::Any aEngine( xPropSet->getPropertyValue( sCustomShapeEngine ) );
if ( ( aEngine >>= aStr ) && !aStr.isEmpty() ) if ( ( aEngine >>= aStr ) && !aStr.isEmpty() )
mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ENGINE, aStr ); mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ENGINE, aStr );
} }
const rtl::OUString sCustomShapeData( RTL_CONSTASCII_USTRINGPARAM( "CustomShapeData" ) ); const OUString sCustomShapeData( "CustomShapeData" );
if ( xPropSetInfo->hasPropertyByName( sCustomShapeData ) ) if ( xPropSetInfo->hasPropertyByName( sCustomShapeData ) )
{ {
uno::Any aData( xPropSet->getPropertyValue( sCustomShapeData ) ); uno::Any aData( xPropSet->getPropertyValue( sCustomShapeData ) );
@@ -1157,7 +1154,7 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
{ {
if( !bIsEmptyPresObj ) if( !bIsEmptyPresObj )
{ {
uno::Reference< container::XNamed > xTemplate( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TableTemplate" ) ) ), uno::UNO_QUERY ); uno::Reference< container::XNamed > xTemplate( xPropSet->getPropertyValue( OUString( "TableTemplate" ) ), uno::UNO_QUERY );
if( xTemplate.is() ) if( xTemplate.is() )
{ {
const OUString sTemplate( xTemplate->getName() ); const OUString sTemplate( xTemplate->getName() );
@@ -1192,7 +1189,7 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
if( !bIsEmptyPresObj ) if( !bIsEmptyPresObj )
{ {
uno::Reference< graphic::XGraphic > xGraphic( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReplacementGraphic" ) ) ), uno::UNO_QUERY ); uno::Reference< graphic::XGraphic > xGraphic( xPropSet->getPropertyValue( OUString( "ReplacementGraphic" ) ), uno::UNO_QUERY );
if( xGraphic.is() ) try if( xGraphic.is() ) try
{ {
Reference< lang::XMultiServiceFactory > xSM( GetExport().getServiceFactory(), UNO_QUERY_THROW ); Reference< lang::XMultiServiceFactory > xSM( GetExport().getServiceFactory(), UNO_QUERY_THROW );
@@ -1204,15 +1201,15 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
OUString sPictureName; OUString sPictureName;
if( bExportEmbedded ) if( bExportEmbedded )
{ {
xPictureStream.set( xSM->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.MemoryStream" ) ) ), UNO_QUERY_THROW ); xPictureStream.set( xSM->createInstance( OUString( "com.sun.star.comp.MemoryStream" ) ), UNO_QUERY_THROW );
} }
else else
{ {
xStorage.set( GetExport().GetTargetStorage(), UNO_QUERY_THROW ); xStorage.set( GetExport().GetTargetStorage(), UNO_QUERY_THROW );
xPictureStorage.set( xStorage->openStorageElement( OUString( RTL_CONSTASCII_USTRINGPARAM( "Pictures" ) ), ::embed::ElementModes::READWRITE ), uno::UNO_QUERY_THROW ); xPictureStorage.set( xStorage->openStorageElement( OUString( "Pictures" ), ::embed::ElementModes::READWRITE ), uno::UNO_QUERY_THROW );
const OUString sPrefix( RTL_CONSTASCII_USTRINGPARAM("TablePreview") ); const OUString sPrefix( "TablePreview" );
const OUString sSuffix( RTL_CONSTASCII_USTRINGPARAM(".svm") ); const OUString sSuffix( ".svm" );
sal_Int32 nIndex = 0; sal_Int32 nIndex = 0;
do do
@@ -1228,9 +1225,9 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
Reference< graphic::XGraphicProvider > xProvider( graphic::GraphicProvider::create(comphelper::getComponentContext(xSM)) ); Reference< graphic::XGraphicProvider > xProvider( graphic::GraphicProvider::create(comphelper::getComponentContext(xSM)) );
Sequence< beans::PropertyValue > aArgs( 2 ); Sequence< beans::PropertyValue > aArgs( 2 );
aArgs[ 0 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "MimeType" ) ); aArgs[ 0 ].Name = OUString( "MimeType" );
aArgs[ 0 ].Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "image/x-vclgraphic" ) ); aArgs[ 0 ].Value <<= OUString( "image/x-vclgraphic" );
aArgs[ 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "OutputStream" ) ); aArgs[ 1 ].Name = OUString( "OutputStream" );
aArgs[ 1 ].Value <<= xPictureStream->getOutputStream(); aArgs[ 1 ].Value <<= xPictureStream->getOutputStream();
xProvider->storeGraphic( xGraphic, aArgs ); xProvider->storeGraphic( xGraphic, aArgs );
@@ -1243,7 +1240,7 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
if( !bExportEmbedded ) if( !bExportEmbedded )
{ {
OUString sURL( RTL_CONSTASCII_USTRINGPARAM( "Pictures/" ) ); OUString sURL( "Pictures/" );
sURL += sPictureName; sURL += sPictureName;
mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sURL ); mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sURL );
mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );

View File

@@ -18,7 +18,6 @@
*/ */
#include <tools/debug.hxx> #include <tools/debug.hxx>
#include <tools/string.hxx>
#include <xmloff/nmspmap.hxx> #include <xmloff/nmspmap.hxx>
#include "xmloff/xmlnmspe.hxx" #include "xmloff/xmlnmspe.hxx"
#include <xmloff/xmltoken.hxx> #include <xmloff/xmltoken.hxx>
@@ -42,9 +41,6 @@
#include <set> #include <set>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::style; using namespace ::com::sun::star::style;
@@ -57,7 +53,7 @@ using ::com::sun::star::document::XEventsSupplier;
XMLStyleExport::XMLStyleExport( XMLStyleExport::XMLStyleExport(
SvXMLExport& rExp, SvXMLExport& rExp,
const ::rtl::OUString& rPoolStyleName, const OUString& rPoolStyleName,
SvXMLAutoStylePoolP *pAutoStyleP ) : SvXMLAutoStylePoolP *pAutoStyleP ) :
rExport( rExp ), rExport( rExp ),
sIsPhysical( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ) ), sIsPhysical( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ) ),
@@ -84,7 +80,7 @@ void XMLStyleExport::exportStyleContent( const Reference< XStyle >& )
sal_Bool XMLStyleExport::exportStyle( sal_Bool XMLStyleExport::exportStyle(
const Reference< XStyle >& rStyle, const Reference< XStyle >& rStyle,
const OUString& rXMLFamily, const OUString& rXMLFamily,
const UniReference < SvXMLExportPropertyMapper >& rPropMapper, const UniReference < SvXMLExportPropertyMapper >& rPropMapper,
const Reference< XNameAccess >& xStyles, const Reference< XNameAccess >& xStyles,
const OUString* pPrefix ) const OUString* pPrefix )
@@ -396,12 +392,12 @@ void XMLStyleExport::exportStyleFamily(
// If next styles are supported and used styles should be exported only, // If next styles are supported and used styles should be exported only,
// the next style may be unused but has to be exported, too. In this case // the next style may be unused but has to be exported, too. In this case
// the names of all exported styles are remembered. // the names of all exported styles are remembered.
boost::scoped_ptr<std::set<String> > pExportedStyles(0); boost::scoped_ptr<std::set<OUString> > pExportedStyles(0);
sal_Bool bFirstStyle = sal_True; sal_Bool bFirstStyle = sal_True;
const uno::Sequence< ::rtl::OUString> aSeq = xStyles->getElementNames(); const uno::Sequence< OUString> aSeq = xStyles->getElementNames();
const ::rtl::OUString* pIter = aSeq.getConstArray(); const OUString* pIter = aSeq.getConstArray();
const ::rtl::OUString* pEnd = pIter + aSeq.getLength(); const OUString* pEnd = pIter + aSeq.getLength();
for(;pIter != pEnd;++pIter) for(;pIter != pEnd;++pIter)
{ {
Reference< XStyle > xStyle; Reference< XStyle > xStyle;
@@ -434,7 +430,7 @@ void XMLStyleExport::exportStyleFamily(
xPropSet->getPropertySetInfo(); xPropSet->getPropertySetInfo();
if( xPropSetInfo->hasPropertyByName( sFollowStyle ) ) if( xPropSetInfo->hasPropertyByName( sFollowStyle ) )
pExportedStyles.reset(new std::set<String>()); pExportedStyles.reset(new std::set<OUString>());
bFirstStyle = sal_False; bFirstStyle = sal_False;
} }
@@ -487,7 +483,7 @@ void XMLStyleExport::exportStyleFamily(
OUString sNextName; OUString sNextName;
xPropSet->getPropertyValue( sFollowStyle ) >>= sNextName; xPropSet->getPropertyValue( sFollowStyle ) >>= sNextName;
String sTmp( sNextName ); OUString sTmp( sNextName );
// if the next style hasn't been exported by now, export it now // if the next style hasn't been exported by now, export it now
// and remember its name. // and remember its name.
if( xStyle->getName() != sNextName && if( xStyle->getName() != sNextName &&

View File

@@ -1795,7 +1795,7 @@ sal_uInt32 SvXMLNumFmtExport::ForceSystemLanguage( sal_uInt32 nKey )
{ {
DBG_ASSERT( pFormatter != NULL, "format without formatter?" ); DBG_ASSERT( pFormatter != NULL, "format without formatter?" );
xub_StrLen nErrorPos; sal_Int32 nErrorPos;
short nType = pFormat->GetType(); short nType = pFormat->GetType();
sal_uInt32 nNewKey = pFormatter->GetFormatForLanguageIfBuiltIn( sal_uInt32 nNewKey = pFormatter->GetFormatForLanguageIfBuiltIn(
@@ -1807,7 +1807,7 @@ sal_uInt32 SvXMLNumFmtExport::ForceSystemLanguage( sal_uInt32 nKey )
} }
else else
{ {
String aFormatString( pFormat->GetFormatstring() ); OUString aFormatString( pFormat->GetFormatstring() );
pFormatter->PutandConvertEntry( pFormatter->PutandConvertEntry(
aFormatString, aFormatString,
nErrorPos, nType, nNewKey, nErrorPos, nType, nNewKey,

View File

@@ -868,13 +868,12 @@ static void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNu
if ( bQuote ) if ( bQuote )
{ {
// #i55469# quotes in the string itself have to be escaped // #i55469# quotes in the string itself have to be escaped
rtl::OUString aString( rContent.getStr() ); bool bEscape = ( rContent.indexOf( (sal_Unicode) '"' ) >= 0 );
bool bEscape = ( aString.indexOf( (sal_Unicode) '"' ) >= 0 );
if ( bEscape ) if ( bEscape )
{ {
// A quote is turned into "\"" - a quote to end quoted text, an escaped quote, // A quote is turned into "\"" - a quote to end quoted text, an escaped quote,
// and a quote to resume quoting. // and a quote to resume quoting.
rtl::OUString aInsert( "\"\\\"" ); OUString aInsert( "\"\\\"" );
sal_Int32 nPos = 0; sal_Int32 nPos = 0;
while ( nPos < rContent.getLength() ) while ( nPos < rContent.getLength() )
@@ -899,8 +898,7 @@ static void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNu
rContent[0] == (sal_Unicode) '"' && rContent[0] == (sal_Unicode) '"' &&
rContent[1] == (sal_Unicode) '"' ) rContent[1] == (sal_Unicode) '"' )
{ {
String aTrimmed( rContent.makeStringAndClear().copy(2) ); rContent.remove(0, 2);
rContent = rtl::OUStringBuffer( aTrimmed );
} }
sal_Int32 nLen = rContent.getLength(); sal_Int32 nLen = rContent.getLength();
@@ -908,8 +906,7 @@ static void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNu
rContent[nLen - 1] == (sal_Unicode) '"' && rContent[nLen - 1] == (sal_Unicode) '"' &&
rContent[nLen - 2] == (sal_Unicode) '"' ) rContent[nLen - 2] == (sal_Unicode) '"' )
{ {
String aTrimmed( rContent.makeStringAndClear().copy( 0, nLen - 2 ) ); rContent.remove(nLen - 2);
rContent = rtl::OUStringBuffer( aTrimmed );
} }
} }
} }
@@ -1632,14 +1629,14 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter)
{ {
// insert by format string // insert by format string
String aFormatStr( sFormat ); OUString aFormatStr( sFormat );
nIndex = pFormatter->GetEntryKey( aFormatStr, nFormatLang ); nIndex = pFormatter->GetEntryKey( aFormatStr, nFormatLang );
if ( nIndex == NUMBERFORMAT_ENTRY_NOT_FOUND ) if ( nIndex == NUMBERFORMAT_ENTRY_NOT_FOUND )
{ {
xub_StrLen nErrPos = 0; sal_Int32 nErrPos = 0;
short l_nType = 0; short l_nType = 0;
sal_Bool bOk = pFormatter->PutEntry( aFormatStr, nErrPos, l_nType, nIndex, nFormatLang ); sal_Bool bOk = pFormatter->PutEntry( aFormatStr, nErrPos, l_nType, nIndex, nFormatLang );
if ( !bOk && nErrPos == 0 && aFormatStr != String(sFormat) ) if ( !bOk && nErrPos == 0 && aFormatStr != sFormat )
{ {
// if the string was modified by PutEntry, look for an existing format // if the string was modified by PutEntry, look for an existing format
// with the modified string // with the modified string
@@ -1682,8 +1679,7 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter)
SvNumberformat* pFormat = const_cast<SvNumberformat*>(pFormatter->GetEntry( nIndex )); SvNumberformat* pFormat = const_cast<SvNumberformat*>(pFormatter->GetEntry( nIndex ));
if (pFormat) if (pFormat)
{ {
String sTitle (sFormatTitle); pFormat->SetComment(sFormatTitle);
pFormat->SetComment(sTitle);
} }
} }
@@ -1780,15 +1776,15 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo )
bGrouping = sal_False; // grouping and embedded characters can't be used together bGrouping = sal_False; // grouping and embedded characters can't be used together
sal_uInt32 nStdIndex = pFormatter->GetStandardIndex( nFormatLang ); sal_uInt32 nStdIndex = pFormatter->GetStandardIndex( nFormatLang );
String aNumStr = pFormatter->GenerateFormat( nStdIndex, nFormatLang, OUStringBuffer aNumStr = pFormatter->GenerateFormat( nStdIndex, nFormatLang,
bGrouping, sal_False, nGenPrec, nLeading ); bGrouping, sal_False, nGenPrec, nLeading );
if ( rInfo.nExpDigits >= 0 && nLeading == 0 && !bGrouping && nEmbeddedCount == 0 ) if ( rInfo.nExpDigits >= 0 && nLeading == 0 && !bGrouping && nEmbeddedCount == 0 )
{ {
// #i43959# For scientific numbers, "#" in the integer part forces a digit, // #i43959# For scientific numbers, "#" in the integer part forces a digit,
// so it has to be removed if nLeading is 0 (".00E+0", not "#.00E+0"). // so it has to be removed if nLeading is 0 (".00E+0", not "#.00E+0").
aNumStr = comphelper::string::stripStart(aNumStr, '#'); aNumStr.stripStart((sal_Unicode)'#');
} }
if ( nEmbeddedCount ) if ( nEmbeddedCount )
@@ -1797,9 +1793,11 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo )
// only the integer part is supported // only the integer part is supported
// nZeroPos is the string position where format position 0 is inserted // nZeroPos is the string position where format position 0 is inserted
xub_StrLen nZeroPos = aNumStr.Search( pData->GetLocaleData( nFormatLang ).getNumDecimalSep() ); sal_Int32 nZeroPos = aNumStr.indexOf( pData->GetLocaleData( nFormatLang ).getNumDecimalSep() );
if ( nZeroPos == STRING_NOTFOUND ) if ( nZeroPos < 0 )
nZeroPos = aNumStr.Len(); {
nZeroPos = aNumStr.getLength();
}
// aEmbeddedElements is sorted - last entry has the largest position (leftmost) // aEmbeddedElements is sorted - last entry has the largest position (leftmost)
const SvXMLEmbeddedElement* pLastObj = &*rInfo.aEmbeddedElements.rbegin(); const SvXMLEmbeddedElement* pLastObj = &*rInfo.aEmbeddedElements.rbegin();
@@ -1809,10 +1807,11 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo )
// add '#' characters so all embedded texts are really embedded in digits // add '#' characters so all embedded texts are really embedded in digits
// (there always has to be a digit before the leftmost embedded text) // (there always has to be a digit before the leftmost embedded text)
xub_StrLen nAddCount = (xub_StrLen)nLastFormatPos + 1 - nZeroPos; sal_Int32 nAddCount = nLastFormatPos + 1 - nZeroPos;
OUStringBuffer aDigitStr; for(sal_Int32 index = 0; index < nAddCount; ++index)
comphelper::string::padToLength(aDigitStr, nAddCount, (sal_Unicode)'#'); {
aNumStr.Insert(aDigitStr.makeStringAndClear(), 0); aNumStr.insert(0, (sal_Unicode)'#');
}
nZeroPos = nZeroPos + nAddCount; nZeroPos = nZeroPos + nAddCount;
} }
@@ -1825,18 +1824,17 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo )
sal_Int32 nInsertPos = nZeroPos - nFormatPos; sal_Int32 nInsertPos = nZeroPos - nFormatPos;
if ( nFormatPos >= 0 && nInsertPos >= 0 ) if ( nFormatPos >= 0 && nInsertPos >= 0 )
{ {
rtl::OUStringBuffer aContent( pObj->aText );
// #107805# always quote embedded strings - even space would otherwise // #107805# always quote embedded strings - even space would otherwise
// be recognized as thousands separator in French. // be recognized as thousands separator in French.
aContent.insert( 0, (sal_Unicode) '"' );
aContent.append( (sal_Unicode) '"' );
aNumStr.Insert( String( aContent.makeStringAndClear() ), (xub_StrLen)nInsertPos ); aNumStr.insert(nInsertPos, '"');
aNumStr.insert(nInsertPos, pObj->aText);
aNumStr.insert(nInsertPos, '"');
} }
} }
} }
aFormatCode.append( aNumStr ); aFormatCode.append( aNumStr.makeStringAndClear() );
if ( ( rInfo.bDecReplace || rInfo.bVarDecimals ) && nPrec ) // add decimal replacement (dashes) if ( ( rInfo.bDecReplace || rInfo.bVarDecimals ) && nPrec ) // add decimal replacement (dashes)
{ {
@@ -1948,7 +1946,7 @@ void SvXMLNumFormatContext::AddNfKeyword( sal_uInt16 nIndex )
bHasLongDoW = sal_True; // to remove string constant with separator bHasLongDoW = sal_True; // to remove string constant with separator
} }
String sKeyword = pFormatter->GetKeyword( nFormatLang, nIndex ); OUString sKeyword = pFormatter->GetKeyword( nFormatLang, nIndex );
if ( nIndex == NF_KEY_H || nIndex == NF_KEY_HH || if ( nIndex == NF_KEY_H || nIndex == NF_KEY_HH ||
nIndex == NF_KEY_MI || nIndex == NF_KEY_MMI || nIndex == NF_KEY_MI || nIndex == NF_KEY_MMI ||
@@ -1957,15 +1955,20 @@ void SvXMLNumFormatContext::AddNfKeyword( sal_uInt16 nIndex )
if ( !bTruncate && !bHasDateTime ) if ( !bTruncate && !bHasDateTime )
{ {
// with truncate-on-overflow = false, add "[]" to first time part // with truncate-on-overflow = false, add "[]" to first time part
aFormatCode.append( (sal_Unicode)'[' );
sKeyword.Insert( (sal_Unicode) '[', 0 ); aFormatCode.append( sKeyword );
sKeyword.Append( (sal_Unicode) ']' ); aFormatCode.append( (sal_Unicode)']' );
}
else
{
aFormatCode.append( sKeyword );
} }
bHasDateTime = sal_True; bHasDateTime = sal_True;
} }
else
aFormatCode.append( sKeyword ); {
aFormatCode.append( sKeyword );
}
// collect the date elements that the format contains, to recognize default date formats // collect the date elements that the format contains, to recognize default date formats
switch ( nIndex ) switch ( nIndex )
{ {
@@ -1993,17 +1996,17 @@ void SvXMLNumFormatContext::AddNfKeyword( sal_uInt16 nIndex )
} }
} }
static sal_Bool lcl_IsAtEnd( rtl::OUStringBuffer& rBuffer, const String& rToken ) static sal_Bool lcl_IsAtEnd( rtl::OUStringBuffer& rBuffer, const OUString& rToken )
{ {
sal_Int32 nBufLen = rBuffer.getLength(); sal_Int32 nBufLen = rBuffer.getLength();
xub_StrLen nTokLen = rToken.Len(); sal_Int32 nTokLen = rToken.getLength();
if ( nTokLen > nBufLen ) if ( nTokLen > nBufLen )
return sal_False; return sal_False;
sal_Int32 nStartPos = nBufLen - nTokLen; sal_Int32 nStartPos = nBufLen - nTokLen;
for ( xub_StrLen nTokPos = 0; nTokPos < nTokLen; nTokPos++ ) for ( sal_Int32 nTokPos = 0; nTokPos < nTokLen; nTokPos++ )
if ( rToken.GetChar( nTokPos ) != rBuffer[nStartPos + nTokPos] ) if ( rToken[ nTokPos ] != rBuffer[nStartPos + nTokPos] )
return sal_False; return sal_False;
return sal_True; return sal_True;
@@ -2017,14 +2020,14 @@ sal_Bool SvXMLNumFormatContext::ReplaceNfKeyword( sal_uInt16 nOld, sal_uInt16 nN
if (!pFormatter) if (!pFormatter)
return sal_False; return sal_False;
String sOldStr = pFormatter->GetKeyword( nFormatLang, nOld ); OUString sOldStr = pFormatter->GetKeyword( nFormatLang, nOld );
if ( lcl_IsAtEnd( aFormatCode, sOldStr ) ) if ( lcl_IsAtEnd( aFormatCode, sOldStr ) )
{ {
// remove old keyword // remove old keyword
aFormatCode.setLength( aFormatCode.getLength() - sOldStr.Len() ); aFormatCode.setLength( aFormatCode.getLength() - sOldStr.getLength() );
// add new keyword // add new keyword
String sNewStr = pFormatter->GetKeyword( nFormatLang, nNew ); OUString sNewStr = pFormatter->GetKeyword( nFormatLang, nNew );
aFormatCode.append( sNewStr ); aFormatCode.append( sNewStr );
return sal_True; // changed return sal_True; // changed
@@ -2034,8 +2037,8 @@ sal_Bool SvXMLNumFormatContext::ReplaceNfKeyword( sal_uInt16 nOld, sal_uInt16 nN
void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex ) void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex )
{ {
rtl::OUString rApplyName = aMyConditions[nIndex].sMapName; OUString rApplyName = aMyConditions[nIndex].sMapName;
rtl::OUString rCondition = aMyConditions[nIndex].sCondition; OUString rCondition = aMyConditions[nIndex].sCondition;
SvNumberFormatter* pFormatter = pData->GetNumberFormatter(); SvNumberFormatter* pFormatter = pData->GetNumberFormatter();
sal_uInt32 l_nKey = pData->GetKeyForName( rApplyName ); sal_uInt32 l_nKey = pData->GetKeyForName( rApplyName );
OUString sValue("value()"); //! define constant OUString sValue("value()"); //! define constant
@@ -2067,10 +2070,13 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex )
{ {
sal_Int32 nPos = sRealCond.indexOf( '.' ); sal_Int32 nPos = sRealCond.indexOf( '.' );
if ( nPos >= 0 ) if ( nPos >= 0 )
{ // #i8026# #103991# localize decimal separator {
const String& rDecSep = GetLocaleData().getNumDecimalSep(); // #i8026# #103991# localize decimal separator
if ( rDecSep.Len() > 1 || rDecSep.GetChar(0) != '.' ) const OUString& rDecSep = GetLocaleData().getNumDecimalSep();
if ( rDecSep.getLength() > 1 || rDecSep[0] != '.' )
{
sRealCond = sRealCond.replaceAt( nPos, 1, rDecSep ); sRealCond = sRealCond.replaceAt( nPos, 1, rDecSep );
}
} }
aConditions.append( (sal_Unicode) '[' ); aConditions.append( (sal_Unicode) '[' );
aConditions.append( sRealCond ); aConditions.append( sRealCond );

View File

@@ -34,7 +34,6 @@
#include <tools/debug.hxx> #include <tools/debug.hxx>
#include <tools/fontenum.hxx> #include <tools/fontenum.hxx>
#include <tools/string.hxx>
#include <sax/tools/converter.hxx> #include <sax/tools/converter.hxx>
@@ -55,9 +54,6 @@
#include <xmloff/xmlnumi.hxx> #include <xmloff/xmlnumi.hxx>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::style; using namespace ::com::sun::star::style;
@@ -69,9 +65,6 @@ using namespace ::com::sun::star::frame;
using namespace ::xmloff::token; using namespace ::xmloff::token;
using namespace ::com::sun::star::io; using namespace ::com::sun::star::io;
using rtl::OUString;
using rtl::OUStringBuffer;
static sal_Char const XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE[] = static sal_Char const XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE[] =
"SymbolTextDistance"; "SymbolTextDistance";
static sal_Char const XML_UNO_NAME_NRULE_PARENT_NUMBERING[] = static sal_Char const XML_UNO_NAME_NRULE_PARENT_NUMBERING[] =
@@ -491,7 +484,7 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties(
|| ((300 == nUPD) && (nBuildId <= 9573)))) || ((300 == nUPD) && (nBuildId <= 9573))))
{ {
// #i93908# OOo < 3.4 wrote a bogus suffix for bullet chars // #i93908# OOo < 3.4 wrote a bogus suffix for bullet chars
sSuffix = ::rtl::OUString(); // clear it sSuffix = OUString(); // clear it
} }
} }

View File

@@ -56,8 +56,6 @@
#include <set> #include <set>
#include <vector> #include <vector>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using ::std::vector; using ::std::vector;
using namespace ::com::sun::star; using namespace ::com::sun::star;
@@ -101,7 +99,7 @@ const SvXMLTokenMap& SvXMLStylesContext::GetStyleStylesElemTokenMap()
void SvXMLStyleContext::SetAttribute( sal_uInt16 nPrefixKey, void SvXMLStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
const OUString& rLocalName, const OUString& rLocalName,
const OUString& rValue ) const OUString& rValue )
{ {
// TODO: use a map here // TODO: use a map here
if( XML_NAMESPACE_STYLE == nPrefixKey ) if( XML_NAMESPACE_STYLE == nPrefixKey )
@@ -164,8 +162,8 @@ SvXMLStyleContext::~SvXMLStyleContext()
} }
SvXMLImportContext *SvXMLStyleContext::CreateChildContext( sal_uInt16 nPrefix, SvXMLImportContext *SvXMLStyleContext::CreateChildContext( sal_uInt16 nPrefix,
const OUString& rLocalName, const OUString& rLocalName,
const uno::Reference< xml::sax::XAttributeList > & ) const uno::Reference< xml::sax::XAttributeList > & )
{ {
return new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
} }
@@ -290,7 +288,8 @@ public:
void Clear(); void Clear();
const SvXMLStyleContext *FindStyleChildContext( sal_uInt16 nFamily, const SvXMLStyleContext *FindStyleChildContext( sal_uInt16 nFamily,
const OUString& rName, sal_Bool bCreateIndex ) const; const OUString& rName,
sal_Bool bCreateIndex ) const;
sal_Bool IsAutomaticStyle() const { return bAutomaticStyle; } sal_Bool IsAutomaticStyle() const { return bAutomaticStyle; }
}; };
@@ -334,10 +333,9 @@ void SvXMLStylesContext_Impl::Clear()
aStyles.clear(); aStyles.clear();
} }
const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext( const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext( sal_uInt16 nFamily,
sal_uInt16 nFamily, const OUString& rName,
const OUString& rName, sal_Bool bCreateIndex ) const
sal_Bool bCreateIndex ) const
{ {
const SvXMLStyleContext *pStyle = 0; const SvXMLStyleContext *pStyle = 0;
@@ -399,10 +397,9 @@ sal_Bool SvXMLStylesContext::IsAutomaticStyle() const
return mpImpl->IsAutomaticStyle(); return mpImpl->IsAutomaticStyle();
} }
SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext( SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext( sal_uInt16 p_nPrefix,
sal_uInt16 p_nPrefix, const OUString& rLocalName,
const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList )
const uno::Reference< xml::sax::XAttributeList > & xAttrList )
{ {
SvXMLStyleContext *pStyle = NULL; SvXMLStyleContext *pStyle = NULL;
@@ -566,8 +563,7 @@ sal_Bool SvXMLStylesContext::InsertStyleFamily( sal_uInt16 ) const
return sal_True; return sal_True;
} }
sal_uInt16 SvXMLStylesContext::GetFamily( sal_uInt16 SvXMLStylesContext::GetFamily( const OUString& rValue ) const
const ::rtl::OUString& rValue ) const
{ {
sal_uInt16 nFamily = 0U; sal_uInt16 nFamily = 0U;
if( IsXMLToken( rValue, XML_PARAGRAPH ) ) if( IsXMLToken( rValue, XML_PARAGRAPH ) )
@@ -716,9 +712,7 @@ Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( sal_uInt16 nFa
xAutoStyles = mxParaAutoStyles; xAutoStyles = mxParaAutoStyles;
else else
{ {
sName = bPara ? sName = bPara ? OUString( "ParagraphStyles" ): OUString( "CharacterStyles" );
OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphStyles" ) ):
OUString( RTL_CONSTASCII_USTRINGPARAM( "CharacterStyles" ) );
Reference< XAutoStylesSupplier > xAutoStylesSupp( GetImport().GetModel(), UNO_QUERY ); Reference< XAutoStylesSupplier > xAutoStylesSupp( GetImport().GetModel(), UNO_QUERY );
Reference< XAutoStyles > xAutoStyleFamilies = xAutoStylesSupp->getAutoStyles(); Reference< XAutoStyles > xAutoStyleFamilies = xAutoStylesSupp->getAutoStyles();
if (xAutoStyleFamilies->hasByName(sName)) if (xAutoStyleFamilies->hasByName(sName))
@@ -746,16 +740,14 @@ Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer(
if( mxParaStyles.is() ) if( mxParaStyles.is() )
xStyles = mxParaStyles; xStyles = mxParaStyles;
else else
sName = sName = "ParagraphStyles";
OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphStyles" ) );
break; break;
case XML_STYLE_FAMILY_TEXT_TEXT: case XML_STYLE_FAMILY_TEXT_TEXT:
if( mxTextStyles.is() ) if( mxTextStyles.is() )
xStyles = mxTextStyles; xStyles = mxTextStyles;
else else
sName = sName = "CharacterStyles";
OUString( RTL_CONSTASCII_USTRINGPARAM( "CharacterStyles" ) );
break; break;
} }
if( !xStyles.is() && !sName.isEmpty() ) if( !xStyles.is() && !sName.isEmpty() )
@@ -788,7 +780,7 @@ Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer(
OUString SvXMLStylesContext::GetServiceName( sal_uInt16 nFamily ) const OUString SvXMLStylesContext::GetServiceName( sal_uInt16 nFamily ) const
{ {
String sServiceName; OUString sServiceName;
switch( nFamily ) switch( nFamily )
{ {
case XML_STYLE_FAMILY_TEXT_PARAGRAPH: case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
@@ -822,8 +814,8 @@ SvXMLStylesContext::~SvXMLStylesContext()
} }
SvXMLImportContext *SvXMLStylesContext::CreateChildContext( sal_uInt16 nPrefix, SvXMLImportContext *SvXMLStylesContext::CreateChildContext( sal_uInt16 nPrefix,
const OUString& rLocalName, const OUString& rLocalName,
const uno::Reference< xml::sax::XAttributeList > & xAttrList ) const uno::Reference< xml::sax::XAttributeList > & xAttrList )
{ {
SvXMLImportContext *pContext = 0; SvXMLImportContext *pContext = 0;

View File

@@ -59,10 +59,7 @@
#include <txtlists.hxx> #include <txtlists.hxx>
#include <xmloff/odffields.hxx> #include <xmloff/odffields.hxx>
#include <comphelper/stlunosequence.hxx> #include <comphelper/stlunosequence.hxx>
#include <tools/string.hxx>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using ::com::sun::star::ucb::XAnyCompare; using ::com::sun::star::ucb::XAnyCompare;
using namespace ::std; using namespace ::std;
@@ -504,8 +501,8 @@ struct SAL_DLLPRIVATE XMLTextImportHelper::Impl
::std::auto_ptr<SvXMLTokenMap> m_pTextContourAttrTokenMap; ::std::auto_ptr<SvXMLTokenMap> m_pTextContourAttrTokenMap;
::std::auto_ptr<SvXMLTokenMap> m_pTextHyperlinkAttrTokenMap; ::std::auto_ptr<SvXMLTokenMap> m_pTextHyperlinkAttrTokenMap;
::std::auto_ptr<SvXMLTokenMap> m_pTextMasterPageElemTokenMap; ::std::auto_ptr<SvXMLTokenMap> m_pTextMasterPageElemTokenMap;
::std::auto_ptr< std::vector<rtl::OUString> > m_pPrevFrmNames; ::std::auto_ptr< std::vector<OUString> > m_pPrevFrmNames;
::std::auto_ptr< std::vector<rtl::OUString> > m_pNextFrmNames; ::std::auto_ptr< std::vector<OUString> > m_pNextFrmNames;
::std::auto_ptr<XMLTextListsHelper> m_pTextListsHelper; ::std::auto_ptr<XMLTextListsHelper> m_pTextListsHelper;
SAL_WNODEPRECATED_DECLARATIONS_POP SAL_WNODEPRECATED_DECLARATIONS_POP
@@ -527,23 +524,23 @@ struct SAL_DLLPRIVATE XMLTextImportHelper::Impl
- data structure contains more than one candidate for each list level - data structure contains more than one candidate for each list level
of the outline style (#i69629#) of the outline style (#i69629#)
*/ */
::boost::scoped_array< ::std::vector< ::rtl::OUString > > ::boost::scoped_array< ::std::vector< OUString > >
m_pOutlineStylesCandidates; m_pOutlineStylesCandidates;
// start range, xml:id, RDFa stuff // start range, xml:id, RDFa stuff
typedef ::boost::tuple< typedef ::boost::tuple<
uno::Reference<text::XTextRange>, ::rtl::OUString, uno::Reference<text::XTextRange>, OUString,
::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > > ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > >
BookmarkMapEntry_t; BookmarkMapEntry_t;
/// start ranges for open bookmarks /// start ranges for open bookmarks
::std::map< ::rtl::OUString, BookmarkMapEntry_t, ::std::map< OUString, BookmarkMapEntry_t,
::comphelper::UStringLess> m_BookmarkStartRanges; ::comphelper::UStringLess> m_BookmarkStartRanges;
typedef ::std::vector< ::rtl::OUString > BookmarkVector_t; typedef ::std::vector< OUString > BookmarkVector_t;
BookmarkVector_t m_BookmarkVector; BookmarkVector_t m_BookmarkVector;
/// name of the last 'open' redline that started between paragraphs /// name of the last 'open' redline that started between paragraphs
::rtl::OUString m_sOpenRedlineIdentifier; OUString m_sOpenRedlineIdentifier;
uno::Reference<text::XText> m_xText; uno::Reference<text::XText> m_xText;
uno::Reference<text::XTextCursor> m_xCursor; uno::Reference<text::XTextCursor> m_xCursor;
@@ -572,15 +569,15 @@ struct SAL_DLLPRIVATE XMLTextImportHelper::Impl
// One more flag to remember if we are inside a deleted redline section // One more flag to remember if we are inside a deleted redline section
bool m_bInsideDeleteContext : 1; bool m_bInsideDeleteContext : 1;
typedef ::std::pair< ::rtl::OUString, ::rtl::OUString> field_name_type_t; typedef ::std::pair< OUString, OUString> field_name_type_t;
typedef ::std::pair< ::rtl::OUString, ::rtl::OUString > field_param_t; typedef ::std::pair< OUString, OUString > field_param_t;
typedef ::std::vector< field_param_t > field_params_t; typedef ::std::vector< field_param_t > field_params_t;
typedef ::std::pair< field_name_type_t, field_params_t > field_stack_item_t; typedef ::std::pair< field_name_type_t, field_params_t > field_stack_item_t;
typedef ::std::stack< field_stack_item_t > field_stack_t; typedef ::std::stack< field_stack_item_t > field_stack_t;
field_stack_t m_FieldStack; field_stack_t m_FieldStack;
::rtl::OUString m_sCellParaStyleDefault; OUString m_sCellParaStyleDefault;
Impl( uno::Reference<frame::XModel> const& rModel, Impl( uno::Reference<frame::XModel> const& rModel,
SvXMLImport & rImport, SvXMLImport & rImport,
@@ -623,7 +620,7 @@ struct SAL_DLLPRIVATE XMLTextImportHelper::Impl
{ {
size_t const size(m_xChapterNumbering->getCount()); size_t const size(m_xChapterNumbering->getCount());
m_pOutlineStylesCandidates.reset( m_pOutlineStylesCandidates.reset(
new ::std::vector< ::rtl::OUString >[size] ); new ::std::vector< OUString >[size] );
} }
} }
@@ -906,8 +903,7 @@ XMLTextImportHelper::XMLTextImportHelper(
bProgress, bBlockMode, bOrganizerMode) ) bProgress, bBlockMode, bOrganizerMode) )
, m_pBackpatcherImpl( MakeBackpatcherImpl() ) , m_pBackpatcherImpl( MakeBackpatcherImpl() )
{ {
static ::rtl::OUString s_PropNameDefaultListId( static OUString s_PropNameDefaultListId( "DefaultListId");
"DefaultListId");
Reference< XChapterNumberingSupplier > xCNSupplier( rModel, UNO_QUERY ); Reference< XChapterNumberingSupplier > xCNSupplier( rModel, UNO_QUERY );
@@ -926,7 +922,7 @@ XMLTextImportHelper::XMLTextImportHelper(
xNumRulePropSetInfo->hasPropertyByName( xNumRulePropSetInfo->hasPropertyByName(
s_PropNameDefaultListId)) s_PropNameDefaultListId))
{ {
::rtl::OUString sListId; OUString sListId;
xNumRuleProps->getPropertyValue(s_PropNameDefaultListId) xNumRuleProps->getPropertyValue(s_PropNameDefaultListId)
>>= sListId; >>= sListId;
DBG_ASSERT( !sListId.isEmpty(), DBG_ASSERT( !sListId.isEmpty(),
@@ -940,7 +936,7 @@ XMLTextImportHelper::XMLTextImportHelper(
m_pImpl->m_pTextListsHelper->KeepListAsProcessed( m_pImpl->m_pTextListsHelper->KeepListAsProcessed(
sListId, sListId,
xChapterNumNamed->getName(), xChapterNumNamed->getName(),
::rtl::OUString() ); OUString() );
} }
} }
} }
@@ -1125,7 +1121,7 @@ void XMLTextImportHelper::InsertString( const OUString& rChars )
} }
void XMLTextImportHelper::InsertString( const OUString& rChars, void XMLTextImportHelper::InsertString( const OUString& rChars,
sal_Bool& rIgnoreLeadingSpace ) sal_Bool& rIgnoreLeadingSpace )
{ {
DBG_ASSERT(m_pImpl->m_xText.is(), "no text"); DBG_ASSERT(m_pImpl->m_xText.is(), "no text");
DBG_ASSERT(m_pImpl->m_xCursorAsRange.is(), "no range"); DBG_ASSERT(m_pImpl->m_xCursorAsRange.is(), "no range");
@@ -1154,7 +1150,7 @@ void XMLTextImportHelper::InsertString( const OUString& rChars,
} }
} }
m_pImpl->m_xText->insertString(m_pImpl->m_xCursorAsRange, m_pImpl->m_xText->insertString(m_pImpl->m_xCursorAsRange,
sChars.makeStringAndClear(), sal_False); sChars.makeStringAndClear(), sal_False);
} }
} }
@@ -1211,7 +1207,7 @@ void XMLTextImportHelper::DeleteParagraph()
{ {
OUString sEmpty; OUString sEmpty;
m_pImpl->m_xText->insertString(m_pImpl->m_xCursorAsRange, m_pImpl->m_xText->insertString(m_pImpl->m_xCursorAsRange,
sEmpty, sal_True); sEmpty, sal_True);
} }
} }
} }
@@ -1219,7 +1215,7 @@ void XMLTextImportHelper::DeleteParagraph()
OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars, OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
const OUString& rStyleName, const OUString& rStyleName,
sal_uInt8& rFlags, sal_uInt8& rFlags,
sal_Bool bPara, sal_Bool bPara,
SvXMLImport& rImport ) const SvXMLImport& rImport ) const
{ {
OUStringBuffer sChars( rChars ); OUStringBuffer sChars( rChars );
@@ -1304,10 +1300,10 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
to the found list styles of the parent styles. (#i73973#) to the found list styles of the parent styles. (#i73973#)
*/ */
static sal_Bool lcl_HasListStyle( OUString sStyleName, static sal_Bool lcl_HasListStyle( OUString sStyleName,
const Reference < XNameContainer >& xParaStyles, const Reference < XNameContainer >& xParaStyles,
SvXMLImport& rImport, SvXMLImport& rImport,
const OUString& sNumberingStyleName, const OUString& sNumberingStyleName,
const OUString& sOutlineStyleName ) const OUString& sOutlineStyleName )
{ {
sal_Bool bRet( sal_False ); sal_Bool bRet( sal_False );
@@ -1426,19 +1422,19 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
// Numberings/Bullets in table not visible aftzer save/reload (#i80724#) // Numberings/Bullets in table not visible aftzer save/reload (#i80724#)
sal_Bool bSetListAttrs ) sal_Bool bSetListAttrs )
{ {
static ::rtl::OUString s_ParaStyleName( "ParaStyleName"); static OUString s_ParaStyleName( "ParaStyleName");
static ::rtl::OUString s_CharStyleName( "CharStyleName"); static OUString s_CharStyleName( "CharStyleName");
static ::rtl::OUString s_NumberingRules( "NumberingRules"); static OUString s_NumberingRules( "NumberingRules");
static ::rtl::OUString s_NumberingIsNumber( "NumberingIsNumber"); static OUString s_NumberingIsNumber( "NumberingIsNumber");
static ::rtl::OUString s_NumberingLevel( "NumberingLevel"); static OUString s_NumberingLevel( "NumberingLevel");
static ::rtl::OUString s_ParaIsNumberingRestart( "ParaIsNumberingRestart"); static OUString s_ParaIsNumberingRestart( "ParaIsNumberingRestart");
static ::rtl::OUString s_NumberingStartValue( "NumberingStartValue"); static OUString s_NumberingStartValue( "NumberingStartValue");
static ::rtl::OUString s_PropNameListId( "ListId"); static OUString s_PropNameListId( "ListId");
static ::rtl::OUString s_PageDescName( "PageDescName"); static OUString s_PageDescName( "PageDescName");
static ::rtl::OUString s_ServiceCombinedCharacters( "com.sun.star.text.TextField.CombinedCharacters"); static OUString s_ServiceCombinedCharacters( "com.sun.star.text.TextField.CombinedCharacters");
static ::rtl::OUString s_Content("Content"); static OUString s_Content("Content");
static ::rtl::OUString s_OutlineLevel( "OutlineLevel"); static OUString s_OutlineLevel( "OutlineLevel");
static ::rtl::OUString s_NumberingStyleName( "NumberingStyleName"); static OUString s_NumberingStyleName( "NumberingStyleName");
const sal_uInt16 nFamily = bPara ? XML_STYLE_FAMILY_TEXT_PARAGRAPH const sal_uInt16 nFamily = bPara ? XML_STYLE_FAMILY_TEXT_PARAGRAPH
: XML_STYLE_FAMILY_TEXT_TEXT; : XML_STYLE_FAMILY_TEXT_TEXT;
@@ -1462,7 +1458,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
if( !sStyleName.isEmpty() ) if( !sStyleName.isEmpty() )
{ {
sStyleName = rImport.GetStyleDisplayName( nFamily, sStyleName ); sStyleName = rImport.GetStyleDisplayName( nFamily, sStyleName );
const String& rPropName = (bPara) ? s_ParaStyleName : s_CharStyleName; const OUString& rPropName = (bPara) ? s_ParaStyleName : s_CharStyleName;
const Reference < XNameContainer > & rStyles = (bPara) const Reference < XNameContainer > & rStyles = (bPara)
? m_pImpl->m_xParaStyles ? m_pImpl->m_xParaStyles
: m_pImpl->m_xTextStyles; : m_pImpl->m_xTextStyles;
@@ -1499,7 +1495,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
Reference < XIndexReplace > xNewNumRules; Reference < XIndexReplace > xNewNumRules;
sal_Int8 nLevel(-1); sal_Int8 nLevel(-1);
::rtl::OUString sListId; OUString sListId;
sal_Int16 nStartValue(-1); sal_Int16 nStartValue(-1);
bool bNumberingIsNumber(true); bool bNumberingIsNumber(true);
@@ -1740,7 +1736,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
pStyle->FillPropertySet( xCrsrProperties ); pStyle->FillPropertySet( xCrsrProperties );
xCrsr->collapseToEnd(); xCrsr->collapseToEnd();
xCrsr->gotoRange( xRange->getEnd(), true ); xCrsr->gotoRange( xRange->getEnd(), true );
xCrsr->setString( ::rtl::OUString() ); xCrsr->setString( OUString() );
} }
catch(const uno::Exception&) catch(const uno::Exception&)
{ {
@@ -1865,11 +1861,10 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
return sStyleName; return sStyleName;
} }
void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName, void XMLTextImportHelper::FindOutlineStyleName( OUString& rStyleName,
sal_Int8 nOutlineLevel ) sal_Int8 nOutlineLevel )
{ {
static ::rtl::OUString s_HeadingStyleName( static OUString s_HeadingStyleName( "HeadingStyleName");
"HeadingStyleName");
// style name empty? // style name empty?
if( rStyleName.isEmpty() ) if( rStyleName.isEmpty() )
@@ -1897,7 +1892,7 @@ void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName,
{ {
if (aProperties[i].Name == s_HeadingStyleName) if (aProperties[i].Name == s_HeadingStyleName)
{ {
rtl::OUString aOutlineStyle; OUString aOutlineStyle;
aProperties[i].Value >>= aOutlineStyle; aProperties[i].Value >>= aOutlineStyle;
m_pImpl->m_pOutlineStylesCandidates[nOutlineLevel] m_pImpl->m_pOutlineStylesCandidates[nOutlineLevel]
.push_back( aOutlineStyle ); .push_back( aOutlineStyle );
@@ -1933,8 +1928,8 @@ void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel
void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels ) void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
{ {
static ::rtl::OUString s_NumberingStyleName( "NumberingStyleName"); static OUString s_NumberingStyleName( "NumberingStyleName");
static ::rtl::OUString s_HeadingStyleName( "HeadingStyleName"); static OUString s_HeadingStyleName( "HeadingStyleName");
if ((m_pImpl->m_pOutlineStylesCandidates != NULL || bSetEmptyLevels) && if ((m_pImpl->m_pOutlineStylesCandidates != NULL || bSetEmptyLevels) &&
m_pImpl->m_xChapterNumbering.is() && m_pImpl->m_xChapterNumbering.is() &&
@@ -2039,12 +2034,12 @@ void XMLTextImportHelper::SetHyperlink(
const OUString& rVisitedStyleName, const OUString& rVisitedStyleName,
XMLEventsImportContext* pEvents) XMLEventsImportContext* pEvents)
{ {
static ::rtl::OUString s_HyperLinkURL( "HyperLinkURL"); static OUString s_HyperLinkURL( "HyperLinkURL");
static ::rtl::OUString s_HyperLinkName( "HyperLinkName"); static OUString s_HyperLinkName( "HyperLinkName");
static ::rtl::OUString s_HyperLinkTarget( "HyperLinkTarget"); static OUString s_HyperLinkTarget( "HyperLinkTarget");
static ::rtl::OUString s_UnvisitedCharStyleName( "UnvisitedCharStyleName"); static OUString s_UnvisitedCharStyleName( "UnvisitedCharStyleName");
static ::rtl::OUString s_VisitedCharStyleName( "VisitedCharStyleName"); static OUString s_VisitedCharStyleName( "VisitedCharStyleName");
static ::rtl::OUString s_HyperLinkEvents( "HyperLinkEvents"); static OUString s_HyperLinkEvents( "HyperLinkEvents");
Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY ); Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY );
Reference < XPropertySetInfo > xPropSetInfo( Reference < XPropertySetInfo > xPropSetInfo(
@@ -2557,7 +2552,8 @@ sal_Bool XMLTextImportHelper::FindAndRemoveBookmarkStartRange(
{ {
++it; ++it;
} }
if (it!=m_pImpl->m_BookmarkVector.end()) { if (it!=m_pImpl->m_BookmarkVector.end())
{
m_pImpl->m_BookmarkVector.erase(it); m_pImpl->m_BookmarkVector.erase(it);
} }
return sal_True; return sal_True;
@@ -2568,14 +2564,19 @@ sal_Bool XMLTextImportHelper::FindAndRemoveBookmarkStartRange(
} }
} }
::rtl::OUString XMLTextImportHelper::FindActiveBookmarkName() OUString XMLTextImportHelper::FindActiveBookmarkName()
{ {
if (!m_pImpl->m_BookmarkVector.empty()) { if (!m_pImpl->m_BookmarkVector.empty())
{
return m_pImpl->m_BookmarkVector.back(); return m_pImpl->m_BookmarkVector.back();
} else return ::rtl::OUString(); // return the empty string on error... }
else
{
return OUString(); // return the empty string on error...
}
} }
void XMLTextImportHelper::pushFieldCtx( ::rtl::OUString name, ::rtl::OUString type ) void XMLTextImportHelper::pushFieldCtx( OUString name, OUString type )
{ {
m_pImpl->m_FieldStack.push(Impl::field_stack_item_t( m_pImpl->m_FieldStack.push(Impl::field_stack_item_t(
Impl::field_name_type_t(name, type), Impl::field_params_t())); Impl::field_name_type_t(name, type), Impl::field_params_t()));
@@ -2587,7 +2588,7 @@ void XMLTextImportHelper::popFieldCtx()
m_pImpl->m_FieldStack.pop(); m_pImpl->m_FieldStack.pop();
} }
void XMLTextImportHelper::addFieldParam( ::rtl::OUString name, ::rtl::OUString value ) void XMLTextImportHelper::addFieldParam( OUString name, OUString value )
{ {
DBG_ASSERT(!m_pImpl->m_FieldStack.empty(), DBG_ASSERT(!m_pImpl->m_FieldStack.empty(),
"stack is empty: not good! Do a pushFieldCtx before..."); "stack is empty: not good! Do a pushFieldCtx before...");
@@ -2597,13 +2598,18 @@ void XMLTextImportHelper::addFieldParam( ::rtl::OUString name, ::rtl::OUString v
} }
} }
::rtl::OUString XMLTextImportHelper::getCurrentFieldType() OUString XMLTextImportHelper::getCurrentFieldType()
{ {
DBG_ASSERT(!m_pImpl->m_FieldStack.empty(), DBG_ASSERT(!m_pImpl->m_FieldStack.empty(),
"stack is empty: not good! Do a pushFieldCtx before..."); "stack is empty: not good! Do a pushFieldCtx before...");
if (!m_pImpl->m_FieldStack.empty()) { if (!m_pImpl->m_FieldStack.empty())
{
return m_pImpl->m_FieldStack.top().first.second; return m_pImpl->m_FieldStack.top().first.second;
} else return ::rtl::OUString(); }
else
{
return OUString();
}
} }
bool XMLTextImportHelper::hasCurrentFieldCtx() bool XMLTextImportHelper::hasCurrentFieldCtx()
@@ -2628,8 +2634,8 @@ void XMLTextImportHelper::ConnectFrameChains(
const OUString& rNextFrmName, const OUString& rNextFrmName,
const Reference < XPropertySet >& rFrmPropSet ) const Reference < XPropertySet >& rFrmPropSet )
{ {
static ::rtl::OUString s_ChainNextName( "ChainNextName"); static OUString s_ChainNextName( "ChainNextName");
static ::rtl::OUString s_ChainPrevName( "ChainPrevName"); static OUString s_ChainPrevName( "ChainPrevName");
if( rFrmName.isEmpty() ) if( rFrmName.isEmpty() )
return; return;
@@ -2648,8 +2654,8 @@ void XMLTextImportHelper::ConnectFrameChains(
{ {
if (!m_pImpl->m_pPrevFrmNames.get()) if (!m_pImpl->m_pPrevFrmNames.get())
{ {
m_pImpl->m_pPrevFrmNames.reset( new std::vector<rtl::OUString> ); m_pImpl->m_pPrevFrmNames.reset( new std::vector<OUString> );
m_pImpl->m_pNextFrmNames.reset( new std::vector<rtl::OUString> ); m_pImpl->m_pNextFrmNames.reset( new std::vector<OUString> );
} }
m_pImpl->m_pPrevFrmNames->push_back(rFrmName); m_pImpl->m_pPrevFrmNames->push_back(rFrmName);
m_pImpl->m_pNextFrmNames->push_back(sNextFrmName); m_pImpl->m_pNextFrmNames->push_back(sNextFrmName);
@@ -2657,7 +2663,7 @@ void XMLTextImportHelper::ConnectFrameChains(
} }
if (m_pImpl->m_pPrevFrmNames.get() && !m_pImpl->m_pPrevFrmNames->empty()) if (m_pImpl->m_pPrevFrmNames.get() && !m_pImpl->m_pPrevFrmNames->empty())
{ {
for(std::vector<rtl::OUString>::iterator i = m_pImpl->m_pPrevFrmNames->begin(), j = m_pImpl->m_pNextFrmNames->begin(); i != m_pImpl->m_pPrevFrmNames->end() && j != m_pImpl->m_pNextFrmNames->end(); ++i, ++j) for(std::vector<OUString>::iterator i = m_pImpl->m_pPrevFrmNames->begin(), j = m_pImpl->m_pNextFrmNames->begin(); i != m_pImpl->m_pPrevFrmNames->end() && j != m_pImpl->m_pNextFrmNames->end(); ++i, ++j)
{ {
if((*j).equals(rFrmName)) if((*j).equals(rFrmName))
{ {
@@ -2677,7 +2683,7 @@ void XMLTextImportHelper::ConnectFrameChains(
sal_Bool XMLTextImportHelper::IsInFrame() const sal_Bool XMLTextImportHelper::IsInFrame() const
{ {
static ::rtl::OUString s_TextFrame( "TextFrame"); static OUString s_TextFrame( "TextFrame");
sal_Bool bIsInFrame = sal_False; sal_Bool bIsInFrame = sal_False;
@@ -2730,26 +2736,26 @@ Reference< XPropertySet> XMLTextImportHelper::createAndInsertOOoLink(
Reference< XPropertySet> XMLTextImportHelper::createAndInsertApplet( Reference< XPropertySet> XMLTextImportHelper::createAndInsertApplet(
const OUString& /*rCode*/, const OUString& /*rCode*/,
const OUString& /*rName*/, const OUString& /*rName*/,
sal_Bool /*bMayScript*/, sal_Bool /*bMayScript*/,
const OUString& /*rHRef*/, const OUString& /*rHRef*/,
sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ ) sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ )
{ {
Reference< XPropertySet> xPropSet; Reference< XPropertySet> xPropSet;
return xPropSet; return xPropSet;
} }
Reference< XPropertySet> XMLTextImportHelper::createAndInsertPlugin( Reference< XPropertySet> XMLTextImportHelper::createAndInsertPlugin(
const OUString& /*rMimeType*/, const OUString& /*rMimeType*/,
const OUString& /*rHRef*/, const OUString& /*rHRef*/,
sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ ) sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ )
{ {
Reference< XPropertySet> xPropSet; Reference< XPropertySet> xPropSet;
return xPropSet; return xPropSet;
} }
Reference< XPropertySet> XMLTextImportHelper::createAndInsertFloatingFrame( Reference< XPropertySet> XMLTextImportHelper::createAndInsertFloatingFrame(
const OUString& /*rName*/, const OUString& /*rName*/,
const OUString& /*rHRef*/, const OUString& /*rHRef*/,
const OUString& /*rStyleName*/, const OUString& /*rStyleName*/,
sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ ) sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ )
{ {
Reference< XPropertySet> xPropSet; Reference< XPropertySet> xPropSet;
@@ -2758,17 +2764,16 @@ Reference< XPropertySet> XMLTextImportHelper::createAndInsertFloatingFrame(
void XMLTextImportHelper::endAppletOrPlugin( void XMLTextImportHelper::endAppletOrPlugin(
const Reference < XPropertySet> &, const Reference < XPropertySet> &,
std::map < const rtl::OUString, rtl::OUString, UStringLess > &) std::map < const OUString, OUString, UStringLess > &)
{ {
} }
// redline helper: dummy implementation to be overridden in sw/filter/xml // redline helper: dummy implementation to be overridden in sw/filter/xml
void XMLTextImportHelper::RedlineAdd( void XMLTextImportHelper::RedlineAdd( const OUString& /*rType*/,
const OUString& /*rType*/, const OUString& /*rId*/,
const OUString& /*rId*/, const OUString& /*rAuthor*/,
const OUString& /*rAuthor*/, const OUString& /*rComment*/,
const OUString& /*rComment*/, const DateTime& /*rDateTime*/,
const DateTime& /*rDateTime*/, sal_Bool /*bMergeLastPara*/)
sal_Bool /*bMergeLastPara*/)
{ {
// dummy implementation: do nothing // dummy implementation: do nothing
} }
@@ -2815,7 +2820,7 @@ OUString XMLTextImportHelper::GetOpenRedlineId()
return m_pImpl->m_sOpenRedlineIdentifier; return m_pImpl->m_sOpenRedlineIdentifier;
} }
void XMLTextImportHelper::SetOpenRedlineId( ::rtl::OUString& rId) void XMLTextImportHelper::SetOpenRedlineId( OUString& rId)
{ {
m_pImpl->m_sOpenRedlineIdentifier = rId; m_pImpl->m_sOpenRedlineIdentifier = rId;
} }
@@ -2827,12 +2832,12 @@ void XMLTextImportHelper::ResetOpenRedlineId()
} }
void void
XMLTextImportHelper::SetCellParaStyleDefault(::rtl::OUString const& rNewValue) XMLTextImportHelper::SetCellParaStyleDefault(OUString const& rNewValue)
{ {
m_pImpl->m_sCellParaStyleDefault = rNewValue; m_pImpl->m_sCellParaStyleDefault = rNewValue;
} }
::rtl::OUString const& XMLTextImportHelper::GetCellParaStyleDefault() OUString const& XMLTextImportHelper::GetCellParaStyleDefault()
{ {
return m_pImpl->m_sCellParaStyleDefault; return m_pImpl->m_sCellParaStyleDefault;
} }