Kaydet (Commit) 7e1bb64f authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:mergeclasses OOXMLPropertyImpl into OOXMLProperty

Change-Id: I1447cfc76c529332450c90a21b6525d3103fe852
üst 9f0f30fa
...@@ -394,7 +394,6 @@ merge writerfilter::Table with writerfilter::LoggedTable ...@@ -394,7 +394,6 @@ merge writerfilter::Table with writerfilter::LoggedTable
merge writerfilter::dmapper::TableManager with writerfilter::dmapper::DomainMapperTableManager merge writerfilter::dmapper::TableManager with writerfilter::dmapper::DomainMapperTableManager
merge writerfilter::ooxml::OOXMLDocument with writerfilter::ooxml::OOXMLDocumentImpl merge writerfilter::ooxml::OOXMLDocument with writerfilter::ooxml::OOXMLDocumentImpl
merge writerfilter::ooxml::OOXMLFastContextHandlerLinear with writerfilter::ooxml::OOXMLFastContextHandlerMath merge writerfilter::ooxml::OOXMLFastContextHandlerLinear with writerfilter::ooxml::OOXMLFastContextHandlerMath
merge writerfilter::ooxml::OOXMLProperty with writerfilter::ooxml::OOXMLPropertyImpl
merge writerfilter::ooxml::OOXMLStream with writerfilter::ooxml::OOXMLStreamImpl merge writerfilter::ooxml::OOXMLStream with writerfilter::ooxml::OOXMLStreamImpl
merge writerfilter::rtftok::RTFDocument with writerfilter::rtftok::RTFDocumentImpl merge writerfilter::rtftok::RTFDocument with writerfilter::rtftok::RTFDocumentImpl
merge ww8::WW8Struct with ww8::WW8Sttb merge ww8::WW8Struct with ww8::WW8Sttb
......
...@@ -24,7 +24,7 @@ class OOXMLPropertySetPrinter(object): ...@@ -24,7 +24,7 @@ class OOXMLPropertySetPrinter(object):
return children.__iter__() return children.__iter__()
class OOXMLPropertyPrinter(object): class OOXMLPropertyPrinter(object):
'''Prints writerfilter::ooxml::OOXMLPropertyImpl''' '''Prints writerfilter::ooxml::OOXMLProperty'''
def __init__(self, typename, value): def __init__(self, typename, value):
self.typename = typename self.typename = typename
...@@ -73,7 +73,7 @@ def build_pretty_printers(): ...@@ -73,7 +73,7 @@ def build_pretty_printers():
global printer global printer
printer = printing.Printer("libreoffice/writerfilter") printer = printing.Printer("libreoffice/writerfilter")
printer.add('writerfilter::ooxml::OOXMLPropertyImpl', OOXMLPropertyPrinter) printer.add('writerfilter::ooxml::OOXMLProperty', OOXMLPropertyPrinter)
printer.add('writerfilter::ooxml::OOXMLPropertySet', OOXMLPropertySetPrinter) printer.add('writerfilter::ooxml::OOXMLPropertySet', OOXMLPropertySetPrinter)
printer.add('writerfilter::ooxml::OOXMLPropertySetValue', OOXMLPropertySetValuePrinter) printer.add('writerfilter::ooxml::OOXMLPropertySetValue', OOXMLPropertySetValuePrinter)
printer.add('writerfilter::ooxml::OOXMLStringValue', OOXMLStringValuePrinter) printer.add('writerfilter::ooxml::OOXMLStringValue', OOXMLStringValuePrinter)
......
...@@ -353,8 +353,8 @@ OOXMLPropertySet * OOXMLDocumentImpl::getPicturePropSet ...@@ -353,8 +353,8 @@ OOXMLPropertySet * OOXMLDocumentImpl::getPicturePropSet
OOXMLValue::Pointer_t pPayloadValue(new OOXMLBinaryValue(pPicture)); OOXMLValue::Pointer_t pPayloadValue(new OOXMLBinaryValue(pPicture));
OOXMLProperty::Pointer_t pPayloadProperty OOXMLProperty::Pointer_t pPayloadProperty
(new OOXMLPropertyImpl(NS_ooxml::LN_payload, pPayloadValue, (new OOXMLProperty(NS_ooxml::LN_payload, pPayloadValue,
OOXMLPropertyImpl::ATTRIBUTE)); OOXMLProperty::ATTRIBUTE));
OOXMLPropertySet::Pointer_t pBlipSet(new OOXMLPropertySet); OOXMLPropertySet::Pointer_t pBlipSet(new OOXMLPropertySet);
...@@ -363,8 +363,8 @@ OOXMLPropertySet * OOXMLDocumentImpl::getPicturePropSet ...@@ -363,8 +363,8 @@ OOXMLPropertySet * OOXMLDocumentImpl::getPicturePropSet
OOXMLValue::Pointer_t pBlipValue(new OOXMLPropertySetValue(pBlipSet)); OOXMLValue::Pointer_t pBlipValue(new OOXMLPropertySetValue(pBlipSet));
OOXMLProperty::Pointer_t pBlipProperty OOXMLProperty::Pointer_t pBlipProperty
(new OOXMLPropertyImpl(NS_ooxml::LN_blip, pBlipValue, (new OOXMLProperty(NS_ooxml::LN_blip, pBlipValue,
OOXMLPropertyImpl::ATTRIBUTE)); OOXMLProperty::ATTRIBUTE));
OOXMLPropertySet * pProps = new OOXMLPropertySet; OOXMLPropertySet * pProps = new OOXMLPropertySet;
......
...@@ -30,31 +30,27 @@ namespace ooxml ...@@ -30,31 +30,27 @@ namespace ooxml
using namespace ::std; using namespace ::std;
using namespace com::sun::star; using namespace com::sun::star;
OOXMLProperty::~OOXMLProperty() OOXMLProperty::OOXMLProperty(Id id, OOXMLValue::Pointer_t pValue,
{ OOXMLProperty::Type_t eType)
}
OOXMLPropertyImpl::OOXMLPropertyImpl(Id id, OOXMLValue::Pointer_t pValue,
OOXMLPropertyImpl::Type_t eType)
: mId(id), mpValue(pValue), meType(eType) : mId(id), mpValue(pValue), meType(eType)
{ {
} }
OOXMLPropertyImpl::OOXMLPropertyImpl(const OOXMLPropertyImpl & rSprm) OOXMLProperty::OOXMLProperty(const OOXMLProperty & rSprm)
: OOXMLProperty(), mId(rSprm.mId), mpValue(rSprm.mpValue), meType(rSprm.meType) : mId(rSprm.mId), mpValue(rSprm.mpValue), meType(rSprm.meType)
{ {
} }
OOXMLPropertyImpl::~OOXMLPropertyImpl() OOXMLProperty::~OOXMLProperty()
{ {
} }
sal_uInt32 OOXMLPropertyImpl::getId() const sal_uInt32 OOXMLProperty::getId() const
{ {
return mId; return mId;
} }
Value::Pointer_t OOXMLPropertyImpl::getValue() Value::Pointer_t OOXMLProperty::getValue()
{ {
Value::Pointer_t pResult; Value::Pointer_t pResult;
...@@ -66,7 +62,7 @@ Value::Pointer_t OOXMLPropertyImpl::getValue() ...@@ -66,7 +62,7 @@ Value::Pointer_t OOXMLPropertyImpl::getValue()
return pResult; return pResult;
} }
writerfilter::Reference<Properties>::Pointer_t OOXMLPropertyImpl::getProps() writerfilter::Reference<Properties>::Pointer_t OOXMLProperty::getProps()
{ {
writerfilter::Reference<Properties>::Pointer_t pResult; writerfilter::Reference<Properties>::Pointer_t pResult;
...@@ -77,7 +73,7 @@ writerfilter::Reference<Properties>::Pointer_t OOXMLPropertyImpl::getProps() ...@@ -77,7 +73,7 @@ writerfilter::Reference<Properties>::Pointer_t OOXMLPropertyImpl::getProps()
} }
#ifdef DEBUG_WRITERFILTER #ifdef DEBUG_WRITERFILTER
string OOXMLPropertyImpl::getName() const string OOXMLProperty::getName() const
{ {
string sResult; string sResult;
...@@ -99,7 +95,7 @@ string OOXMLPropertyImpl::getName() const ...@@ -99,7 +95,7 @@ string OOXMLPropertyImpl::getName() const
#endif #endif
#ifdef DEBUG_WRITERFILTER #ifdef DEBUG_WRITERFILTER
string OOXMLPropertyImpl::toString() const string OOXMLProperty::toString() const
{ {
string sResult = "("; string sResult = "(";
...@@ -115,7 +111,7 @@ string OOXMLPropertyImpl::toString() const ...@@ -115,7 +111,7 @@ string OOXMLPropertyImpl::toString() const
} }
#endif #endif
void OOXMLPropertyImpl::resolve(writerfilter::Properties & rProperties) void OOXMLProperty::resolve(writerfilter::Properties & rProperties)
{ {
writerfilter::Properties * pProperties = nullptr; writerfilter::Properties * pProperties = nullptr;
pProperties = &rProperties; pProperties = &rProperties;
......
...@@ -28,23 +28,6 @@ namespace writerfilter { ...@@ -28,23 +28,6 @@ namespace writerfilter {
namespace ooxml namespace ooxml
{ {
class OOXMLProperty : public Sprm
{
public:
typedef std::shared_ptr<OOXMLProperty> Pointer_t;
virtual ~OOXMLProperty();
virtual sal_uInt32 getId() const override = 0;
virtual Value::Pointer_t getValue() override = 0;
virtual writerfilter::Reference<Properties>::Pointer_t getProps() override = 0;
#ifdef DEBUG_WRITERFILTER
virtual std::string getName() const override = 0;
virtual std::string toString() const override = 0;
#endif
virtual void resolve(Properties & rProperties) = 0;
};
class OOXMLValue : public Value class OOXMLValue : public Value
{ {
public: public:
...@@ -64,9 +47,10 @@ public: ...@@ -64,9 +47,10 @@ public:
virtual OOXMLValue * clone() const; virtual OOXMLValue * clone() const;
}; };
class OOXMLPropertyImpl : public OOXMLProperty class OOXMLProperty : public Sprm
{ {
public: public:
typedef std::shared_ptr<OOXMLProperty> Pointer_t;
enum Type_t { SPRM, ATTRIBUTE }; enum Type_t { SPRM, ATTRIBUTE };
private: private:
Id mId; Id mId;
...@@ -74,20 +58,18 @@ private: ...@@ -74,20 +58,18 @@ private:
Type_t meType; Type_t meType;
public: public:
typedef std::shared_ptr<OOXMLProperty> Pointer_t; OOXMLProperty(Id id, OOXMLValue::Pointer_t pValue, Type_t eType);
OOXMLProperty(const OOXMLProperty & rSprm);
OOXMLPropertyImpl(Id id, OOXMLValue::Pointer_t pValue, Type_t eType); virtual ~OOXMLProperty();
OOXMLPropertyImpl(const OOXMLPropertyImpl & rSprm);
virtual ~OOXMLPropertyImpl();
virtual sal_uInt32 getId() const override; sal_uInt32 getId() const;
virtual Value::Pointer_t getValue() override; Value::Pointer_t getValue();
virtual writerfilter::Reference<Properties>::Pointer_t getProps() override; writerfilter::Reference<Properties>::Pointer_t getProps();
#ifdef DEBUG_WRITERFILTER #ifdef DEBUG_WRITERFILTER
virtual std::string getName() const override; std::string getName() const;
virtual std::string toString() const override; std::string toString() const;
#endif #endif
virtual void resolve(Properties & rProperties) override; void resolve(Properties & rProperties);
}; };
class OOXMLBinaryValue : public OOXMLValue class OOXMLBinaryValue : public OOXMLValue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment