diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-01-08 12:52:04 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-01-14 14:45:01 +0100 |
commit | 640a7c791b4665c16be7ad8f5f7dda30dcc88eda (patch) | |
tree | 31f6dfe2de9a1620d8e1e99f3e899628930db1a0 /xmloff | |
parent | 61618210f87f57ae21cc39530c9f777d76002a12 (diff) |
xmloff: XmlImageStyle class is pointless as the methods are static
When used, we instantiate the XmlImageStyle class but all its
methods are static, so instantioation is completely pointless.
So change XmlImageStyle to a namespace and static method to
functions.
Change-Id: I6385bd7eeb08c627cb8e48b79a6820372cf94a65
Reviewed-on: https://gerrit.libreoffice.org/47851
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/FillStyleContext.cxx | 1 | ||||
-rw-r--r-- | xmloff/source/style/ImageStyle.cxx | 36 |
3 files changed, 7 insertions, 32 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 2a0ecb11f25a..796390f2b1e1 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1609,8 +1609,6 @@ void SvXMLExport::ExportStyles_( bool ) uno::Reference< container::XNameAccess > xBitmap( xFact->createInstance("com.sun.star.drawing.BitmapTable"), uno::UNO_QUERY ); if( xBitmap.is() ) { - XMLImageStyle aImageStyle; - if( xBitmap->hasElements() ) { uno::Sequence< OUString > aNamesSeq ( xBitmap->getElementNames() ); diff --git a/xmloff/source/style/FillStyleContext.cxx b/xmloff/source/style/FillStyleContext.cxx index 15bf47a5d6b8..89c73965749f 100644 --- a/xmloff/source/style/FillStyleContext.cxx +++ b/xmloff/source/style/FillStyleContext.cxx @@ -125,7 +125,6 @@ XMLBitmapStyleContext::XMLBitmapStyleContext( SvXMLImport& rImport, sal_uInt16 n : SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList) { // start import - XMLImageStyle aBitmapStyle; XMLImageStyle::importXML( xAttrList, maAny, maStrName, rImport ); } diff --git a/xmloff/source/style/ImageStyle.cxx b/xmloff/source/style/ImageStyle.cxx index 2a648f3084d9..d4be8a0a2a1f 100644 --- a/xmloff/source/style/ImageStyle.cxx +++ b/xmloff/source/style/ImageStyle.cxx @@ -22,7 +22,7 @@ #include <xmloff/attrlist.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmluconv.hxx> -#include<xmloff/xmlnmspe.hxx> +#include <xmloff/xmlnmspe.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmlexp.hxx> #include <xmloff/xmlimp.hxx> @@ -30,9 +30,8 @@ #include <rtl/ustring.hxx> #include <xmloff/xmltkmap.hxx> -using namespace ::com::sun::star; - -using namespace ::xmloff::token; +using namespace css; +using namespace xmloff::token; enum SvXMLTokenMapAttrs { @@ -44,21 +43,7 @@ enum SvXMLTokenMapAttrs XML_TOK_IMAGE_ACTUATE }; - -XMLImageStyle::XMLImageStyle() -{ -} - -XMLImageStyle::~XMLImageStyle() -{ -} - -void XMLImageStyle::exportXML( const OUString& rStrName, const css::uno::Any& rValue, SvXMLExport& rExport ) -{ - ImpExportXML( rStrName, rValue, rExport ); -} - -void XMLImageStyle::ImpExportXML( const OUString& rStrName, const uno::Any& rValue, SvXMLExport& rExport ) +void XMLImageStyle::exportXML(OUString const & rStrName, uno::Any const & rValue, SvXMLExport& rExport) { OUString sImageURL; @@ -97,16 +82,10 @@ void XMLImageStyle::ImpExportXML( const OUString& rStrName, const uno::Any& rVal } } -void XMLImageStyle::importXML( const uno::Reference< xml::sax::XAttributeList >& xAttrList, uno::Any& rValue, OUString& rStrName, SvXMLImport& rImport ) +bool XMLImageStyle::importXML(uno::Reference<xml::sax::XAttributeList> const & xAttrList, + uno::Any& rValue, OUString& rStrName, SvXMLImport& rImport) { - ImpImportXML( xAttrList, rValue, rStrName, rImport ); -} - -bool XMLImageStyle::ImpImportXML( const uno::Reference< xml::sax::XAttributeList >& xAttrList, - uno::Any& rValue, OUString& rStrName, - SvXMLImport& rImport ) -{ - static const SvXMLTokenMapEntry aHatchAttrTokenMap[] = + static const SvXMLTokenMapEntry aHatchAttrTokenMap[] = { { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_IMAGE_NAME }, { XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, XML_TOK_IMAGE_DISPLAY_NAME }, @@ -175,7 +154,6 @@ bool XMLImageStyle::ImpImportXML( const uno::Reference< xml::sax::XAttributeList } bool bRet = bHasName && bHasHRef; - return bRet; } |